Variable frame rate and large time deltas

Variable frame rate and large time deltas

Hi,
I run a physics simulation using Havok with variable frame rate.
Once in a while I have a larger deltaTime (because some delays in other parts of my program), and those larger steps create strange results in the physics simulations.
Does anybody knows a nice way to deal with such cases?
What is a reasonable step size for the physics engine to give reasonable results?
Does the variable step size is a problem for the solver?

Thanks
Yinon

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Yinon,

Variable timesteps can definitely introduce jitter into the system. The recommended way of dealing with this is by gradually changing the timestep until you reach the value you want it to be at. For example, make each frame's timestep 90% of the previous until it gets to where you want it to be.

Please keep in mind that it's much easier to work with Havok when using discrete timesteps and if you can make sure that your timestep values aren't changing it would really improve your stability.

Usually timestep values are about 30Hz (i.e., 1/30 seconds). In general, the smaller the timestep, the better the result (though it gets a bit expensive). You may notice some slightly different behavior on smaller timesteps. For example, constraints may seem a bit less 'stretchy' and if you're not using continuous simulation, it may help prevent 'bullet through paper' issues, if you're seeing those in your current setup.

Hope this helps!

Daniel

Leave a Comment

Please sign in to add a comment. Not a member? Join today