The basic problem: one match, many screens
In a single-player game, one machine holds everything: the world, the rules, and your inputs. An online match splits that job across several computers that may be in different cities or countries. Each player sees the game on their own screen, yet everyone is supposed to be playing the same match.
Those computers cannot share a perfectly identical, instant view of the world. Information takes time to travel, and some of it is delayed or lost on the way. Almost everything in online game design is a way of coping with that fact. The code that handles it is often called netcode, a loose term for the networking part of a game.
The main parts
Most online games involve three kinds of pieces.
- Clients. Each player’s console, PC or phone runs a copy of the game. It draws the picture, plays the sound and reads your controller or keyboard.
- A host or server. One machine keeps the official version of the match. It decides what counts as having happened.
- Messages. The machines exchange small chunks of data, usually called packets, many times every second.
A client generally sends a description of what the player is doing, such as moving forward or pressing fire. The server sends back information about the state of the world, such as where other players are and what has changed. The details differ between games, but this loop of input going out and state coming back is the heart of it.
Who is in charge: authority
When two players disagree about what happened, someone has to be right. Game designers call this question authority. In many games the server has authority: clients ask to do things, and the server decides whether they worked. This makes the match harder to tamper with, which is one reason studios rely on anti-cheat software alongside it.
Some games give clients more trust for certain things, such as a player’s own movement, because it feels more responsive. That choice trades fairness against feel, and there is rarely a perfect answer.
Where the server lives
A match can be hosted in different ways. A company can run machines in data centers that exist only to run games. A player’s own console or PC can act as host, with the others connecting to it. Players can also exchange data directly with each other. Each approach has different costs, reliability and fairness, and the differences are covered in more detail in the explainer on dedicated servers and peer-to-peer connections.
Before any of that, the game has to bring players together. Matchmaking systems pick who plays with whom, sometimes by region, sometimes by estimated ability, which is the subject of skill-based matchmaking. Home networking can also get in the way at this stage, since routers decide which outside connections are allowed in, as described under NAT types.
Staying in sync: updates and ticks
The server does not send the entire world constantly. Instead it runs the game in small steps and sends updates at a regular rhythm. How often it does this is the tick rate. Between updates, your client has to guess, and it usually smooths over the gaps by drawing positions between the last two updates it received.
Your own game also feels responsive because the client often shows the result of your action immediately and checks with the server afterward. If the server disagrees, your character may be nudged to a different position. Players describe this snap as rubber banding, and it is a visible sign that the guess and the official answer drifted apart.
Why delay cannot be removed
Even on a good connection, a message has a minimum travel time because data moves through cables, switches and routers in a chain. The round trip between you and the server is usually summarized as ping time. A lower number is generally better, but it is only part of the story. If packets are dropped or arrive unevenly, the game looks worse than the number suggests, which is the topic of packet loss and jitter.
There is also delay inside your own setup. Your screen, your controller and the game’s frame rate all add to the time between an action and what you see, which is separate from network delay and is often grouped under input latency. When people say a game “lags,” they might mean any of these, and telling them apart is a useful skill.
Fairness when everyone sees a slightly different moment
Because each client sees the world slightly in the past, two players can fire at each other in what each of them sees as a clean shot. To judge these moments, many games rewind or adjust the server’s view of events to approximate what the shooter saw. The reasoning behind that is explained in the piece on hit registration. It helps the player with the higher delay, but it can look strange to the other player, who may feel they were hit after reaching cover. Neither side is lying about what they saw. They simply saw different moments.
Genres put different demands on all of this. Fast first-person shooters need frequent updates and tight timing, while a turn-based or slower game can tolerate far more delay. Large persistent worlds, such as many massively multiplayer games, spread the load over many servers and often accept less precise timing in exchange for supporting many players at once.
Other ways to deliver a match
Not every online game runs on the player’s own device. In cloud gaming, the game runs on a remote machine and your device mostly receives video and sends inputs, so the quality of the connection affects the picture as well as the match. This is a different design from the usual client and server arrangement, though the same delay issues apply.
What can go wrong, and what lasts
Online games depend on servers that someone has to keep running. When a company turns them off, the online features can stop working, which is the subject of server shutdowns. Peer-based and local options, including LAN parties, avoid some of this by keeping the match on a small private network.
The takeaway is that online multiplayer is a series of compromises between speed, fairness, cost and cheating prevention. When a match feels off, the cause may be your connection, the other player’s, the server, or the design choices in the game itself, and often a mixture of these.