Re:Fixed Timestep Without Interpolation
by aappleby on Monday October 21, 2024 @04:14PM
(#41908060)
There's another another way to do this, which I have used successfully for years -
The fixed time step simulation is the ground truth "goal", and the "render simulation" is "pulled" towards the goal using an exponential moving average interpolation.
I find that moving the render simulation 90% of the way to the goal every 80 milliseconds feels good for UI interactions. That means that the rendered version is 99% of the way to the goal after 160 msec, 99.9% after 240 msec, etcetera.
This also has the nice property that the render sim is always smooth regardless of tick rate and it never overshoots the goal sim.
The fixed time step simulation is the ground truth "goal", and the "render simulation" is "pulled" towards the goal using an exponential moving average interpolation.
I find that moving the render simulation 90% of the way to the goal every 80 milliseconds feels good for UI interactions. That means that the rendered version is 99% of the way to the goal after 160 msec, 99.9% after 240 msec, etcetera.
This also has the nice property that the render sim is always smooth regardless of tick rate and it never overshoots the goal sim.