Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] 3 Small Sprites & No Background - Unable to Reach 60 FPS On HTML5 On Fast Desktop?

Author
Message
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 26th Nov 2019 20:56 Edited at: 26th Nov 2019 21:05
Hi,

We are working on a new "Pong" inspired AppGameKit game now.

We have a working demo with 3 small sprites and no background.
We are unable to reach 60 Frames Per Second on HTML5 version on a very fast desktop?

Desktop is as follows:
- Kubuntu 18.04.3 LTS 64Bit Linux OS
- Gigabyte Mid-Range Motherboard
- AMD FX 3.5GHz 8-Core CPU
- 32GB DDR3 RAM Memory
- nVidia GeForce GTX 970 "Twin Turbo" 4GB GDDR5 PCIexpress GPU
(with current *ubuntu 18.04 proprietary nVidia Linux display driver)

You can play the HTML5 demo at below URL webpage:
http://fallenangelsoftware.com/stuff/files/MortalPongbat/HTML5/index.html
(Secret Code: "2777" will show Frames Per Second)

The game project is available to download at below direct URL link:
http://fallenangelsoftware.com/stuff/files/MortalPongbat/MortalPongbat.zip

Perhaps someone can see what we are doing wrong?
Considering the desktop hardware and simple demo with little resources, we should easily reach 60 FPS...

Thanks!

Jesse

JeZxLee
Fallen Angel Software
Video Game Design Studio
http://www.FallenAngelSoftware.com

Attachments

Login to view attachments

The author of this post has marked a post as an answer.

Go to answer

JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 26th Nov 2019 22:13 Edited at: 28th Nov 2019 15:48
Here is the logic code on GitHub:
https://github.com/FallenAngelSoftware/AppGameKitClassic-MortalPongbat/blob/master/logic.agc#L54

Jesse
JeZxLee
Fallen Angel Software
Video Game Design Studio
http://www.FallenAngelSoftware.com
Kevin Picone
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 28th Nov 2019 05:33
about 29 fps on my laptop


PlayBASIC To HTML5/WEB - Convert PlayBASIC To Machine Code

Attachments

Login to view attachments
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 28th Nov 2019 16:21
We added a background...

On our above desktop we get 30 Frames Per Second on HTML5 version when playing?
HTML5 Game is capped at 60 FPS when playing: "SetSyncRate( 60, 1 )".
(other screens are set to 30 FPS)

Code is below on GitHub:
https://github.com/FallenAngelSoftware/AppGameKitClassic-MortalPongbat

Any ideas?
Thanks!

Jesse
JeZxLee
Fallen Angel Software
Video Game Design Studio
http://www.FallenAngelSoftware.com
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 28th Nov 2019 17:21
Have you tested your code with SetVSync?

Extract from online help:
Note that on HTML5 the use of SetSyncRate is highly discouraged as it uses the Javascript SetTimeout function for timing, which can cause inaccurate frame rates and stuttering. On HTML5 the preferred method of frame rate control is SetVSync.


PSY


PSY LABS Games
Coders don't die, they just gosub without return
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 29th Nov 2019 01:28
This post has been marked by the post author as the answer.
Hi,

Using "SetVSync(1)" makes our game reach 60 FPS on HTML5.

Not all monitors are 60Hz though...
Is there some way to read Hz of monitor?

Thanks!

Jesse

JeZxLee
Fallen Angel Software
Video Game Design Studio
http://www.FallenAngelSoftware.com

Attachments

Login to view attachments
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 29th Nov 2019 19:53
Not without writing a plugin.

Why not try a frame independant approach ( time based movement ) ?

https://www.appgamekit.com/documentation/examples/timers/1_timer_movement.htm


PSY


PSY LABS Games
Coders don't die, they just gosub without return
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 30th Nov 2019 03:19 Edited at: 30th Nov 2019 03:21
Quote: "Is there some way to read Hz of monitor?"


not directly but you could:

...without a plugin.
i wouldn't use less than 100 iterations where, say, 10 could easily produce 59 (or worse) on a 60hz monitor.
though, i expect sampling 10 frames then rounding to the nearest "5" could be (nearly?) as accurate.

Login to post a reply

Server time is: 2024-04-24 11:50:01
Your offset time is: 2024-04-24 11:50:01