Netcode is the networking layer of an online video game: the code that sends player inputs and world state between machines, reconciles different views of the same match and hides the delay of the internet so that play feels immediate. In gaming, the word is also used loosely by players to describe how responsive and consistent an online match feels, which is why netcode sits beside frame rate and input lag as a core factor of gaming performance.
Good netcode cannot remove physical latency, because a signal still needs tens of milliseconds to cross a continent. What it does is predict, interpolate and correct so that the delay is masked, and it decides who has authority when two players disagree about what happened.
How netcode synchronizes an online match
Netcode keeps every participant in a shared, consistent game state by exchanging small messages many times per second. Most competitive games use a client-server model, in which a server runs the authoritative simulation and each client sends its inputs and receives snapshots of the world. Some fighting games and older strategy titles use peer-to-peer connections, in which players exchange inputs directly.
The server advances the simulation in fixed steps called ticks. The tick rate, measured in hertz, defines how often the server processes inputs and sends updates. A shooter running at 64 or 128 Hz updates every 15.6 or 7.8 milliseconds, while large battle royale or MMO servers often run at 20-30 Hz to save bandwidth and CPU time.
The following table lists the parameters that shape how netcode behaves and what each one affects.
| Parameter | Typical range | What it affects |
|---|---|---|
| Tick rate | 20-128 Hz | Precision of hit registration and movement |
| Round-trip time | 10-150 ms | Delay before the server confirms an action |
| Interpolation delay | 1-3 snapshot intervals | Smoothness of other players’ movement |
| Packet loss | 0-2% on a healthy link | Missing updates, rubber-banding |
| Jitter | Under 5-10 ms preferred | Uneven arrival of updates, stutter in motion |
Techniques that hide latency
Modern netcode relies on a toolkit of latency compensation techniques that let the local player act without waiting for the server. Each technique trades a small amount of accuracy or consistency for responsiveness, and engines usually combine several of them.
- Client-side prediction: the client applies its own inputs immediately and simulates the result before the server answers.
- Server reconciliation: when the authoritative state arrives, the client rewinds and replays unacknowledged inputs to correct mispredictions.
- Entity interpolation: other players are drawn slightly in the past, between two received snapshots, so their motion looks smooth.
- Lag compensation: the server rewinds hitboxes to the moment the shooter saw the target, which is often called favor the shooter.
- Rollback: in peer-to-peer games, each side predicts the remote input, and on a wrong guess it rolls the simulation back and resimulates the corrected frames.
The table below compares the main approaches by where they are typically used and what side effect players notice.
| Approach | Typical genre | Visible side effect |
|---|---|---|
| Delay-based netcode | Older fighting games | Input feels sluggish as ping rises |
| Rollback netcode | Modern fighting games | Brief visual snaps on wrong predictions |
| Lag compensation | First-person shooters | Being hit after reaching cover |
| Deterministic lockstep | Real-time strategy | Whole match slows to the worst connection |
| Snapshot interpolation | Most action games | Opponents shown slightly behind reality |
Netcode versus input lag and frame time
Netcode delay is separate from local input lag, although players feel both as one sensation of sluggishness. Input lag is the time from pressing a button to seeing the result on screen on a single machine, shaped by frame time, the render queue and display processing. Netcode adds the network round trip and server processing on top, but only for actions whose outcome depends on other players.
Because client-side prediction shows local movement instantly, a well-designed game can feel crisp even at 80 ms of ping, while a game with high local input lag feels slow even on a LAN. Tools such as NVIDIA Reflex reduce the local part of the chain and have no effect on network latency.
| Delay source | Where it occurs | Typical size |
|---|---|---|
| Input and render pipeline | Local PC or console | 15-60 ms |
| Display processing | Monitor or TV | 1-30 ms |
| Network transit | Internet path to server | 5-100 ms one way |
| Server tick wait | Game server | Up to one tick interval |
| Interpolation buffer | Receiving client | 30-100 ms |
Common netcode problems and their causes
Most complaints about bad netcode trace back to a small set of recognizable symptoms. Some are caused by the player’s connection, others by server capacity or design choices, and distinguishing the two prevents wasted troubleshooting.
| Symptom | Likely cause | Typical remedy |
|---|---|---|
| Rubber-banding | Packet loss or server correction | Use a wired connection, check Wi-Fi |
| Shot not registering | Low tick rate or misprediction | Higher tick servers, closer region |
| Killed behind cover | Lag compensation for a high-ping opponent | Ping limits in matchmaking |
| Teleporting players | Jitter or lost snapshots | Reduce network congestion, use QoS |
| Desync | Nondeterministic simulation | Developer fix, resynchronization |
A frequent misconception is that a higher tick rate always fixes hit registration. It narrows the timing window, but an opponent with 150 ms of ping still creates disagreements that lag compensation must resolve. Another misconception is that netcode can be judged by ping alone, while jitter and packet loss often matter more than the average delay.
How developers design and evaluate netcode
Netcode design is a trade-off between responsiveness, fairness, bandwidth and cheat resistance. An authoritative server prevents clients from inventing results, which is essential for anti-cheat protection, but it costs hosting money. Peer-to-peer and rollback designs are cheaper and give low latency between nearby players, yet expose IP addresses and leave more trust with clients.
Developers test netcode under simulated adverse conditions, adding artificial latency, jitter and loss to verify that prediction and correction stay stable. Reviewers and players evaluate it by measuring round-trip time, update rate and correction frequency, and by comparing how matches feel at different pings. Transport usually runs over UDP, because a late packet is worth less than the next fresh one, and retransmission as in TCP would add delay.
Stripped to the essentials
Netcode is the part of an online game that keeps every player’s screen showing the same match. Messages between players take time to travel, so each screen is always slightly out of date. Netcode guesses what is happening right now, shows that guess, and quietly fixes it when the real information arrives.
Think of two people playing chess by mail who agree to assume the obvious next move to save time, and undo it only when the letter says otherwise. Good netcode makes those corrections rare and invisible, so the game feels as if everyone were in the same room.
Where it is applied
A studio preparing an online fighting game for a cross-regional tournament switches from delay-based netcode to rollback netcode. Under the old design, a match between players 60 ms apart added several frames of input delay, and players complained that combos felt heavy and unreliable. After the change, inputs execute locally on the next frame, and the game predicts the opponent’s action, usually by repeating the last input.
During testing with two frames of rollback and 1% simulated packet loss, mispredictions caused only brief visual corrections that most testers did not notice. Matches between distant players became playable, and the tournament organizers could run online qualifiers across a wider region without forcing players to travel.