“Bad netcode” is the most-used excuse in online gaming, and it is partly deserved and partly a myth. The myth is that lag has one cause, your ping, and that a faster connection fixes everything. In reality, netcode is a bundle of design tricks that decide whose version of events counts when two players disagree about what just happened.
Once you see how those tricks work, odd moments like dying behind a wall start to make sense.
What Netcode Means
Netcode is the informal name for the networking code that keeps every player’s screen in sync. Because data takes time to travel, no two players ever see exactly the same moment. The game has to pick a source of truth and hide the delay from you.
The Authoritative Server
Most competitive games run on an authoritative server. As game developer Gabriel Gambetta explains in his series on client-server game architecture, the server alone manages the game state while clients just send their actions. That design prevents many forms of cheating, since your own PC cannot simply declare that you were not hit. It is the same reasoning behind the protections described in our piece on anti-cheat systems.
The catch is delay. If your character waited for the server to confirm every step, you would feel a lag of a tenth of a second or more between pressing a key and seeing a result, which makes fast games feel sluggish.
Tick Rate: How Often the Server Updates
The server does not run continuously. It updates the world in steps called ticks, and the tick rate is how many of those happen per second. A higher rate means the server samples the game more often, so positions and hits are resolved with finer detail.
That sounds like a clear win, and the myth says “higher is always better.” It is not that simple. A faster tick rate costs more server computing and bandwidth, and it only helps if your connection and the rest of the pipeline can keep up. A well-built game at a modest tick rate can feel better than a sloppy one at a high number.
Client-Side Prediction: Hiding Your Own Lag
To avoid the sluggish feeling, the game moves your character right away on your screen and checks with the server later. Gambetta’s page on client-side prediction and server reconciliation describes the idea: most inputs are valid, so the client processes them immediately instead of waiting for confirmation.
If the server disagrees, reconciliation steps in. The client tags inputs with sequence numbers, the server reports which it has processed, and the client replays the rest on top of the server’s authoritative state. When the two differ, you may see a small snap or “rubber-band” correction.
Lag Compensation: Why You Get Hit Behind Cover
Shooting creates a harder problem. By the time your shot reaches the server, the target has moved. Lag compensation fixes this by letting the server rewind. According to Gambetta’s explanation of lag compensation, the server reconstructs the world at an earlier instant and checks what was in the shooter’s sights at that moment.
It rewards the shooter, who sees a clean hit. The tradeoff lands on the target, who can be damaged a fraction of a second after reaching cover. Gambetta calls this somewhat unfair but the most agreeable solution, since missing an apparently unmissable shot would feel worse.
What You Can Control
You cannot rewrite a game’s netcode, but you can reduce the problems it has to hide:
- Use a wired connection instead of Wi-Fi where you can, because spikes in delay hurt more than a steady average.
- Pick servers near you.
- Close background downloads and streaming while playing.
- Remember that streaming services add their own delay on top, which we compare in our guide to cloud gaming services.
The same logic shapes shared lobbies across platforms, as explained in how cross-platform play works.
FAQs
What is tick rate in gaming?
Tick rate is how many times per second a game server updates the game world. Each update processes player inputs and resolves hits, so a higher rate lets the server track fast action in finer steps, at the cost of more bandwidth and server load.
Is a higher tick rate always better?
Not always. It helps precision, but the benefit depends on your connection, the game’s design, and how well prediction and lag compensation are implemented. A well-designed game at a lower tick rate can feel smoother than a poorly built one at a higher number.
What is the difference between ping and netcode?
Ping measures how long data takes to travel between you and the server. Netcode is the software that hides that delay, deciding how movement is predicted and how hits are judged. Two games with the same ping can feel very different.
Why do I get shot after I take cover?
The server often judges shots by rewinding to what the shooter saw, so your earlier position still counts for a moment. This is the main tradeoff of lag compensation, which favors the attacker’s view so that good aim is rewarded.
Does a wired connection reduce lag?
Yes, in most cases. Ethernet usually delivers steadier timing than Wi-Fi, and consistency matters because prediction systems work best when delay does not jump around.














Discussion about this post