Game Info

How do multiplayer games sync their state?

Most multiplayer games keep everyone in sync with a client-server model: a server runs the "real" version of the game, players send it their inputs, and the server sends back regular updates (snapshots) of the game state. Because the internet adds delay, each player's game predicts what will happen next and smoothly corrects itself when the server's answer arrives.

The main architectures

  • Authoritative server. The server decides what really happened — who hit whom, who picked up what. Used in most shooters, MMOs and battle royales. It also makes cheating harder.
  • Peer-to-peer. Players' machines talk directly. Cheaper to run but harder to secure; common in older console games and small co-op titles.
  • Deterministic lockstep. Every machine runs the same simulation and only exchanges inputs. Classic for real-time strategy games, where sending every unit's position would be too much data.
  • Rollback netcode. Each player's game guesses the opponent's input, and if the guess was wrong it "rolls back" a few frames and replays them. Popular in fighting games because it keeps controls responsive.

Techniques that hide lag

  1. Tick rate. The server updates the world a fixed number of times per second. Higher tick rate means more accurate results but more bandwidth.
  2. Client-side prediction. Your movement happens instantly on your screen instead of waiting for the server.
  3. Server reconciliation. When the server's state disagrees with your prediction, your game corrects itself — the cause of "rubber-banding."
  4. Interpolation. Other players are shown slightly in the past and smoothly moved between snapshots.
  5. Lag compensation. The server checks a shot against where the target was on the shooter's screen, within limits.
  6. Delta compression. Only changes since the last snapshot are sent.

Why games still desync

High ping, packet loss, an overloaded server or a bug in the game logic can make players see different things. Most games fix that by trusting the server and correcting the client.

FAQ

Are multiplayer games distributed systems?

Yes. They face the same problems — latency, lost messages, consistency — and solve them with similar ideas.

How does matchmaking work?

A matchmaking service groups players by skill rating, region (ping), and sometimes party size, then assigns them to a server.

What is the architecture of a typical multiplayer game?

Clients for each player, dedicated game servers that run matches, and backend services for accounts, matchmaking, stats and stores.

What is a good ping for online games?

Under about 50 ms feels excellent; up to about 100 ms is usually playable in most games.