Stable FPS?

Monkey Forums/Monkey Programming/Stable FPS?

Rixarn(Posted 2011) [#1]
Hi,

I've just started to play with monkey, but what puzzles me is that no matter what the refresh rate is, 30 or 60... it doesn't stays stable, at random intervals the FPS drop a little bit for no apparent reason (i'm talking here about no rendering but the text for the FPS count, and no update routines but the FPScount) and then goes it back to an average of 30. Laptop with RADEON HD 3450.

I knew that flash was slow and that HMTL5 is just starting...but even with that old laptop i can make it run starcraft 2, at the lowest settings and it's playable.

Haven't checked the other targets... Anyways..The point is... i can live with the fact that a flash game or an HTML5 game i make will be small and modest at a steady 30 FPS rate. But having those "lag-like" spikes kills me!

Any idea how to mask them, or fix them?

:)


sknightly(Posted 2011) [#2]
In the Monk help section, look under Sample Programs, James Boyd, Delta Timing.

Delta timing will mask variations in framerate - something which is quite common on all sorts of platforms.


Midimaster(Posted 2011) [#3]
Do you refresh also the OnRender() with the 60Hz?

If you reach 100% computer performance you will "loose" some Timer-Ticks, This will result in unsteady FPS.

Already the CLS command needs 40% of the performance. So if you write a code, where the OnRender() runs only if necessary, this might be helpful.

See my APP here: ARCA-LOW which demonstrates low consumption of performance.

See the code on:

http://www.blitzforum.de/forum/viewtopic.php?t=36794

(the description is german, but the code is "international")


Rixarn(Posted 2011) [#4]
@sknightly

I'll check it out then, thanks :) The only thing that worries me about delta timing is that you need to use floating point coordinates... and because of that, there is a noticeable "spike" when coordinates are rounded... (this is just noticeable in any tile based game that uses delta timing...

@Midimaster

Well, i set the refresh rate in the onCreate method of the main app class...
and why is the CLS command taking 40% of the performance? That's overkill!

i'll check your code then... thanks!