Discord
Login
Community
DARK THEME

Wrong FPS and update_rate indications.

code showing the effects I'm writing about : >>> https://microstudio.dev/i/Loginus/speedtest2/ ( Firefox browser, os - windows 8.1 )

I noticed that when it performs a lot of graphic operations, the system FPS counter is inflated. 'system.fps' usually drops to 30 (28-30). The 'system.update_rate' variable is always set to 60 . I created my own FPS counter and 'update' function calls.

divResX and divResY variables - modifies to change the number of drawn objects.

Here are what values I get on my laptop.

divResX = 1, divResY = 1,
system.fps = 30, system.update_rate = 60
My FPS = 1, My Update = 1
divResX = 2, divResY = 2,
system.fps = 27..36, system.update_rate = 60
My FPS = 3..4, My Update = 3..4
divResX = 3, divResY = 3,
system.fps = 15..20, system.update_rate = 60 ,<< Fewer objects less FPS !!!!!
My FPS = 6, My Update = 14
divResX = 4, divResY = 4,
system.fps = 10, system.update_rate = 60
My FPS = 10, My Update = 58..64

Try different divResX and divResY sizes.

Additionally, there is a strange tearing effect. It seems that behind the scenes the screen is refreshed in some extra thread. This refresh breaks the not fully rendered 'screen' .

update_rate is actually a writable property, allowing you to request the engine to call your update() function at a different rate. By default it is set to 60. For example if you want to do your physics pass 120 times per second, you can set it to 120. The engine will do its best to call update() at the requested rate, but when it is overloaded, it can happen that it fails to reach this rate. CPU time is only finite :-)

I've been having these issues as well. system.fps is indeed incorrect when the game slows down. I made my own fps counter, but I'm having reliability issues with it as well, but it may be some mistake I'm making (I still have to test it further).

I've also noticed that at low frame rates my screen flickers. It goes black for a moment sometimes. That stops happening if I don't clear the screen inside draw, but of course I can't do without clearing.

I'm noticing this in projects where I'm drawing the game to a buffer image, prior to drawing the image on the screen, so I don't know if that has anything to do with it.

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community