How Online Multiplayer Games Stay in Sync
📑 On this page
- A concrete example: moving a character
- Authoritative server
- Inputs instead of state
- Tick rate
- State snapshots
- Packet loss
- Interpolation
- Extrapolation
- Client-side prediction
- Server reconciliation
- Latency
- Jitter
- Lag compensation
- Time synchronization
- Interest management
- Matchmaking and servers
- Disconnect and reconnect
- Anti-cheat
- Deterministic lockstep
- Knowledge check
- The one idea to remember
Players in different places never see the exact same instant at exactly the same time.
Network messages take tens or hundreds of milliseconds, arrive unevenly, and can be lost. A game still needs to feel responsive while maintaining one trusted shared outcome.
Multiplayer games hide latency locally while an authoritative server validates and distributes shared state.
The exact techniques depend on whether the game is turn-based, competitive, or physics-heavy.
A concrete example: moving a character
You press forward.
The client:
- moves your character immediately through prediction,
- sends input number 8472 to the server,
- receives an authoritative state later,
- confirms or corrects the predicted position,
- replays any inputs the server has not processed.
You avoid waiting one round trip before seeing movement.
Authoritative server
The server owns important truth:
- player position,
- health,
- score,
- inventory,
- hit validation,
- and game rules.
Clients send intentions rather than declaring outcomes such as "I won."
Authority reduces cheating and resolves conflicting views.
Inputs instead of state
A client can send:
- move direction,
- jump,
- fire,
- ability use,
- and sequence number.
The server simulates those inputs under valid rules.
Sending raw final position would let a modified client teleport.
Tick rate
The server advances simulation in discrete ticks.
A 60 Hz tick runs about sixty updates per second. Higher rate can improve precision but consumes more CPU and bandwidth.
Network send rate and rendering frame rate may differ from simulation tick rate.
State snapshots
The server periodically sends snapshots:
- entity positions,
- velocities,
- animation state,
- and events.
Snapshots may be compressed and contain differences from a known earlier state.
Reliable and unreliable channels are chosen according to the data.
Packet loss
Position updates become obsolete quickly, so retransmitting every lost snapshot may add delay.
Critical events such as inventory change need reliable ordered delivery. Games often combine transport strategies or application-level reliability.
The newest movement state can supersede an old lost one.
Interpolation
Remote players' updates arrive at intervals.
The client displays them slightly in the past and interpolates between known snapshots. This creates smooth motion despite network jitter.
The delay provides a small buffer of future-known states.
Extrapolation
If a new update is late, the client may extrapolate from current velocity.
Prediction works briefly but becomes wrong when the player changes direction. Limit extrapolation and correct smoothly.
Too much creates characters moving through walls before snapping back.
Client-side prediction
For the local player, interpolation delay feels sluggish.
The client predicts its own movement immediately using the same rules as the server.
Prediction must be deterministic enough that most server confirmations agree.
Server reconciliation
The server sends:
- authoritative state,
- last processed input sequence.
The client resets to that state and reapplies later unacknowledged inputs. Small differences can be smoothed visually; large invalid differences may snap.
Reconciliation keeps responsiveness without surrendering authority.
Latency
Round-trip time affects how quickly actions influence shared state.
Games choose:
- prediction,
- animation,
- generous local feedback,
- and game mechanics
to reduce perceived delay. No networking technique removes physical distance.
Jitter
Jitter is variation in arrival time.
Buffers, interpolation, and adaptive delay absorb some variation. Excessive buffering improves smoothness but makes displayed state older.
The game chooses a balance by genre.
Lag compensation
In a shooter, a player fires at an opponent visible on their screen.
The server may reconstruct recent historical positions at the firing time and evaluate the shot there.
This helps high-latency players but can make the target feel hit after reaching cover.
Time synchronization
Client and server clocks differ.
Protocols estimate offset and network delay. Sequence numbers and server ticks are often more reliable than trusting client wall-clock timestamps.
Clients should not choose arbitrary old timestamps for lag compensation.
Interest management
A player does not need every update from an entire huge world.
The server sends relevant entities based on:
- distance,
- visibility,
- zone,
- team,
- and gameplay importance.
Interest management controls bandwidth and client processing.
Matchmaking and servers
Before gameplay, systems choose:
- region,
- skill,
- party,
- latency,
- queue time,
- and available server.
The closest region reduces network delay, but fair skill matching and party constraints also matter.
Disconnect and reconnect
A brief disconnect may reserve a player's slot and preserve authoritative state.
The client reconnects, authenticates, receives a fresh snapshot, and resumes according to game rules.
Competitive games need policies for abuse and abandoned matches.
Anti-cheat
Server authority prevents impossible outcomes but cannot hide all information sent to the client.
Anti-cheat may use:
- server validation,
- client integrity,
- behavior analysis,
- replay review,
- and least information.
False positives require an appeal and investigation process.
Deterministic lockstep
Some strategy games send only inputs and run the same deterministic simulation on every participant.
This saves bandwidth but one slow or divergent client can affect progress. Randomness and floating-point behavior need strict coordination.
Different genres favor different network models.
Knowledge check
- Why do clients send inputs rather than final outcomes?
- How does interpolation smooth remote movement?
- What steps make server reconciliation work?
- What tradeoff does lag compensation create?
- How does interest management reduce load?
The one idea to remember
Multiplayer games maintain a trusted server state while clients use interpolation, prediction, and reconciliation to hide network delay. Sequence, authority, selective updates, and genre-specific tradeoffs create the illusion of one immediate shared world.