I've tried a few times to understand the physics stepping code, but haven't completely wrapped my head around it yet, it's pretty convoluted. However, it's not true that the physics simulation runs at a fixed frequency: from what I understand so far, the PhysicsSimulateCycle() gets a dtime parameter which is usually 1/100 s, but may be smaller if the game wants to simulate a shorter step to make the physics catch up to the current frame time. Something may be not quite right in that logic. At least it means if you run at >100 fps, you consistently have smaller physics steps than if you ran at, say, 60 fps.
Something simple to try would be to force the physics to actually run at a fixed 100 Hz and see if it changes anything for better or worse.
The part where dtime is not 1/100 (first exit from while loop) is only there to search for collisions and move the ball forward up to that point in time, so that the ball (in theory and actually also in practice, as it stutters even more when disabling this part) is always animated as smooth as possible. But the displacement is also synched to that dtime and the velocities update is synched to the 100hz.
So i don't know where this difference in simulation could actually happen, as to my understanding the simulation cycles should always be the same (unless one counts floating point precision issues), but just chopped into more parts optionally.
But apparently there must be some quirk somewhere in the code and, as you say, its not exactly easy to understand.. :/




Top


















are all trademarks of VPFORUMS.