Skip to content
● work [seedling]

Notes on input prediction in netcode

Sketching out how rollback differs from extrapolation, and when each fits.

planted May 20, 2025 updated May 20, 2025

The basic idea of input prediction: you fire your gun, but the server is 80ms away. So the client guesses what’s going to happen and shows it immediately, then quietly corrects itself when the server replies. Most of the time you never notice.

There are two main flavors of prediction worth distinguishing:

Extrapolation — the client projects forward based on the last known state. “You were moving at velocity V, so you’re probably here now.” Simple. Falls apart when state changes abruptly (jumps, direction reversals, death).

Rollback — the client speculatively simulates frames ahead, then rewinds and replays when the server’s authoritative state arrives. More accurate. Significantly more complex to implement. Worth it when the cost of visible corrections is high.

I’m still working out where the tradeoff line sits in practice. The conventional wisdom is rollback for fighting games, extrapolation for large-scale shooters — but that’s partly a legacy of when rollback became practical.

More to explore:

  • How does lag compensation interact with this on the server side?
  • What’s the correct UX for rendering corrections — snap vs. blend?
  • The relationship between simulation determinism and rollback correctness.

I’ll come back to this. For now it’s mostly a scratchpad.