In a multiplayer game, every player is trying to interact with the same fast-changing world from different locations on the internet. A server keeps the match synchronized by collecting player inputs, simulating the official game state, and sending updates back to everyone. This matters because even a delay of a few dozen milliseconds can change who sees an enemy first, whether a shot counts, or where a player appears to be.
Competitive games rely on careful networking so the match feels fair, responsive, and consistent.
Key Facts
- Ping is the round-trip time for data to travel from client to server and back, usually measured in milliseconds.
- One-way latency is approximately latency = ping / 2 when the path is symmetric.
- Server tick interval is tick interval = 1 / tick rate, so a 64 Hz server updates every 15.625 ms.
- Authoritative servers reduce cheating by treating the server simulation as the official game state, not the client display.
- Client prediction hides input delay by letting the local client immediately guess the result of its own actions before server confirmation.
- Lag compensation can rewind server history to evaluate actions such as shots using the time stamp of the player input.
Vocabulary
- Authoritative server
- A server that decides the official game state and rejects client updates that do not match the rules.
- Client prediction
- A technique where a player’s device immediately simulates local actions before the server confirms them.
- Tick rate
- The number of times per second a server updates the game simulation and processes player inputs.
- Lag compensation
- A networking method that accounts for latency by evaluating an action using the game state from an earlier time.
- Packet loss
- The failure of some network messages to reach their destination, causing missing updates, stutter, or incorrect positions.
Common Mistakes to Avoid
- Confusing ping with frames per second is wrong because ping measures network delay while FPS measures how often your device draws images.
- Assuming a higher tick rate always fixes lag is wrong because latency, jitter, packet loss, and server load can still make updates arrive late or unevenly.
- Trusting the client for important events is wrong because a modified client could lie about position, aim, health, or hits to gain an unfair advantage.
- Ignoring time stamps on inputs is wrong because the server needs timing information to judge actions fairly when different players have different delays.
Practice Questions
- 1 A server runs at 128 Hz. What is the time between server ticks in milliseconds?
- 2 A player has a ping of 84 ms. Assuming the route is symmetric, estimate the one-way latency from the player to the server.
- 3 Two players shoot at nearly the same time, but one has 25 ms ping and the other has a sudden spike to 180 ms ping. Explain how an authoritative server with lag compensation can still judge the shots, and why the high-ping spike may still feel unfair to the player.