Fixed timestep without interpolation

submited by
Style Pass
2024-10-18 11:30:05

Some time ago I wrote a blog post about the tick setup in my engine, why and how I use fixed timestep update loops. It also explained how to actually use it in practice when dealing with input etc.

The general idea is this: the game would keep an accumulator timer and only simulate steps with a constant delta time, which is great for stability and predictability.

This was mostly inspired by server code for multiplayer games, so I naturally also implemented game state interpolation, which multiplayer games use as well. However I have some issues with regular interpolation, it adds unnecessary latency and it’s also annoying to implement.

Turns out there are other ways to do it! It’s possible to use the game tick to “predict” the render game state without explicitly writing any interpolation code. That’s what this post is about.

Here is what the old game loop looked like. The game kept track of the game state from the previous tick, and then used this for interpolation with the time remainder.

Leave a Comment