Game dev
Saved & recent

Rollback netcode

Related terms: GGPO, delay-based netcode, determinism

Used by fighting games, where every frame counts. Each machine runs the game immediately with its own inputs and a guess for the opponent's, usually "same as last frame". When the real input arrives and differs, the game rewinds to that frame, applies it, and re-simulates up to the present, all within one frame.

It requires a deterministic simulation: the same inputs must give exactly the same result on every machine. The older alternative, delay-based netcode, waits for both inputs and adds input lag.

Further reading
GGPO: Rollback Networking
firstrun afterreplay 1 2 3 4 5 6 4 5 6 7 8 9 restore frame 3 ← 4 5 6 5 4 3 replay frames 4–6 late input frame
Frame 4 initially uses a guessed right input. A late left input restores the saved state after frame 3, then runs frame 4 and updates the guesses for frames 5 and 6.

View in the full Game dev collection