Physics Updating

Started by
2 comments, last by Waterwalker 14 years, 10 months ago
I have been looking into physics, although I worked in indsutry for a year I only just overviewed the physics but I did notice it was updated more than once a frame (i believe for forza 2 the physics runs at 360fps). Can anyone here explain why this is? Accuracy? Collision? Cheers. Ash.
Advertisement
Probably a combination of stability (so things don't go flying off) and reproducibility (so a box falls exactly the same way every time the game is played).
[size=2]Darwinbots - [size=2]Artificial life simulation
1, physics simulations tend to be most stable at some timestep X. X varies based on range of inputs (floating point on a PC isn't equally accurate at all values). But X tends to have some upper and lower bound that makes the simulation look best.
2, physics simulations like fixed timesteps. That means interpolating across rendered frames what the simulation is spitting out (especially if you don't have fixed framerates). If you simulate faster than the visual output (and even take user input faster than visual output) then the game tends to feel smoother and more responsive.
This is mostly done due to accuracy. One prominent example being cloth simulation which you should easily be able to find some tutorials for explaining this issue. The less updates you have the greater the delta from frame n to frame n+1, obviously. And that's the problem, the bigger the delta the greater the loss in accuracy due to floating point precision and other algorithmic instabilities. Hence it is perfectly valid to update the physics n times with respect to one rendering update to have only a factor of delta/n in your physics calculations as opposed to delta.
------------------------------------I always enjoy being rated up by you ...

This topic is closed to new replies.

Advertisement