Rollback netcode

Play this lesson

Waiting every frame

At lunch, Kai plays a two-player fighting game online. Each machine needs the other player's input for every frame. Waiting for it adds the network delay to every punch.

A game that waits feels heavy: every button answers late.

GGPO

GGPO, created in 2009 and now free under the MIT licence, was built to "hide network latency" and give "the illusion of a zero-latency network".

It does not wait. It predicts the other player's input, usually by assuming they keep doing what they did last frame, and plays on.

Quick check

Kai's game uses GGPO. What does it predict?

  1. The other player's input
  2. Kai's own input
  3. The network's speed
Show the answer

The other player's input

The local input is known. Only the remote player's input is still on its way.

Roll back

When the real input arrives and differs from the guess, the game rewinds to that frame and runs again from "the point of divergence" to now, all before the next frame is drawn.

The player sees a tiny correction, not a delay.

Spot the need

What must a game be able to do quickly for rollback to work?

  1. Save and load its whole state, and run several frames in one
  2. Draw at 240 frames a second
  3. Send video instead of inputs
Show the answer

Save and load its whole state, and run several frames in one

Rolling back means loading an old state and running the frames since then, all in the time of one frame.

Same inputs, same result

Both machines must reach exactly the same state from the same inputs, or their games drift apart. So the game's rules must give the same answer every time: no hidden randomness, no timing tricks.

Rollback fits small games of few players. A garden of thousands of plants is too big to rerun many times a frame.

Quick check

For rollback, the game must give the same result every time it runs the same inputs.

Show the answer

True

If one machine reached a different state from the same inputs, the two games would no longer agree.

Thousands of units

Strategy games share that rule, the same inputs give the same result, and use it to send almost nothing at all.

Bolt says: Next: lockstep.

Fact-checked 12 October 2026