RE: [Algorithms] Game loop timings
Brought to you by:
vexxed72
From: Jon W. <hp...@mi...> - 2005-04-04 17:48:34
|
> there. It shows differences in path that are due to just framerate > differences, and those that happen when you add truncatenation. Looks like > step time doesn't make much difference. I believe that he was not using a > simple Euler integrator there, though. I guess it was implicit Euler, but > didn't bother to check thoroughly yet. With non-fixed frame rates, you also have problems with penalty methods, because object won't come to "rest" as easily. Consider a box lying on the ground, not yet disabled. Each frame, gravity pulls it down into the ground, and a penalty force based on penetration depth is added to the box. With a longer time step, a greater force will be added. If the time step jitters, then variable forces will be added to the box, leading to a jittery box. With a fixed time step, the system will work like a dampened spring, and come to stability. Other positives of fixed step size include networking consistency, and recording/replay, as well as consistent reproducibility of bugs. I really can't think of any really good reason for variable frame time except that it's sometimes the simplest to implement up-front. Cheers, / h+ |