Game dev
Saved & recent

Lockstep

Also called: deterministic lockstep

Related terms: input sync, desync

Instead of sending where every unit is, each machine sends only its player's commands. All machines then run the exact same simulation from the same inputs. A turn runs only once everyone's input for it has arrived.

A thousand units cost no more bandwidth than one, which is why strategy games use it. It needs perfect determinism. The smallest difference between machines grows into a desync.

Further reading
Glenn Fiedler: Deterministic Lockstep
machine A machine B A → ← B both commands ready inputs for turn 5 same stateon turn 5 advance turn advance turn
Both machines wait for the commands for turn 5. They apply the same left and right moves to the same starting state, so both reach the same result.

View in the full Game dev collection