top | item 41879779

(no title)

dyarosla | 1 year ago

The main reason to prefer interpolation is that your fixed time step function does not need to operate on variable time ever- removing a complicated dependency.

For instance, modifying character accelerations based on a fixed time step constant is far more straightforward than the methods required to work with variable time deltas (due to floating point accumulated error). This is why any action-based deterministic game (think platformers, shooters, physics based games) will opt for this.

IMO it is much more straightforward to have a render method that pre-allocates some extra memory, interpolates a handful of values and renders them vs the nondeterminism introduced in a game logic method that has to take into account variable time (especially if also networking multiplayer state). And for this you trade off a frame of visual-only latency - a choice I’d take any day.

discuss

order

rkangel|1 year ago

> modifying character accelerations based on a fixed frame constant is far more straightforward than the methods required to work with variable time deltas

For those who don't know - the reason this is hard is because of the different amounts of maths error that can accumulate between the two approaches (usually FP precision error). Doing some maths in 10 increments a tenth of the size will likely end up with a slightly different value than doing it once in a full size increment.

This is particularly important in multiplayer games where multiple players need to be able to do the same calculations and get the identical result. It is not good if the world begins to diverge just because you've got different frame rates!