Fixed Rate Logic vs DT?

Monkey Forums/Monkey Programming/Fixed Rate Logic vs DT?

zoqfotpik(Posted 2012) [#1]
Is there an appreciable difference in smoothness between fixed rate logic and delta timing?

I've used delta timing with some success but I think there's more smoothness to be had than I am getting. Any thoughts?


Xaron(Posted 2012) [#2]
Well it would be nice if Monkey would have some kind of a Sleep command (or Delay).


Dima(Posted 2012) [#3]
http://gafferongames.com/game-physics/fix-your-timestep/ great read for fixed interval integration this can probably be implemented right inside the onRender method ignoring the onUpdate. Also, it's probably easy to create a sleep/delay method using Millisecs() in Monkey.

edit: delta timing is usually the smoothest. fixed interval usually runs at different frequency than rendering so you might run into situations where you do multiple updates per frame or multiple frames per update, and in either case you might notice that. What worked best for me with fixed steps was; using low frequency updates and interpolating things at render time to fill the missing steps in between render frames.


zoqfotpik(Posted 2012) [#4]
I will just keep on using delta timing then.

Tangent: This may sound idiotic but I was running into a long-term problem with smoothness in Blitzmax, where every five seconds there would be a momentary series of very short hitches, probably all told lasting about a tenth of a second. Delta timing helped but didn't solve the problem. Turned out that for some reason Google Chrome momentarily does something that kills the framerate for a fraction of a second.


MikeHart(Posted 2012) [#5]
What you see there is the GC kicking in badly. IF you have problems with that, then try to pool objects and reuse them. And on HTML5 you can see these hickups the most.


Xaron(Posted 2012) [#6]
Delay is NOT easily done with Millisecs command. What I would need would be a real sleep to free the CPU but that's not possible on all targets I guess.