Box2D Fixed Timestep needed ?

BlitzMax Forums/Brucey's Modules/Box2D Fixed Timestep needed ?

Armitage 1982(Posted 2008) [#1]
Hi

Yesterday I try my game on a laptop friend to get some feedback.
I didn't accord too much importance to this at the beginning but the game always run at 60Hz (timeStep and refresh rate)

Animation and simulation are all based on this Flip -1 mode.

For the moment, everything work great on every machine tested (even slow-motion due to smaller box2d time step) but what if someone has opengl graphic driver that pass through the sync ?
Maybe a lower frame rate will ruin everything too ?
I try my game in a 80hz fullscreen and obviously frame animation where running too fast because cycle based.

Then I remember about fixed Timestep and this article : http://gafferongames.wordpress.com/game-physics/fix-your-timestep/

I rather prefer to stick with flip -1 if only I can be sure this will work in any situations.

Have you any informations on this or advises ?
Shall I think about a fixed timestep ?


Brucey(Posted 2008) [#2]
Since you tell Box2D in the DoStep() method what the delta for the step should be, can't you keep track of that yourself, rather than hard-coding a value.
If you know the "real" delta for the step, passing that value into DoStep should keep the physics running at the same apparent speed regardless of changes to the real display framerate.

Probably?


Armitage 1982(Posted 2008) [#3]
The physics keep running at the same Hertz frequence.
It's only the animation with loadAnim which change in regard of the display refresh rate.
Well, I'm gonna stick with flip -1 and graphic Hz object of 60 since everything looking great on most machines.
Thanks ;)