Netcode: Difference between revisions
TeamSpecBot (talk | contribs) How online play works |
TeamSpecBot (talk | contribs) American spelling |
||
| Line 19: | Line 19: | ||
== Why you sometimes get hit behind a wall == | == Why you sometimes get hit behind a wall == | ||
Lag compensation | Lag compensation favors the shooter. If an enemy shot you on their screen just before you reached cover, the server agrees with them, and the damage arrives a moment after you are safe on yours. The higher their ping, the more noticeable it is, which is one reason for the 300 ms limit. | ||
== What ping does == | == What ping does == | ||
Revision as of 04:44, 20 October 2026
This page explains, in player terms, how TeamSpec keeps an online match fair and responsive. The approach is the same one used by today's big competitive shooters.
The server decides
Every match runs on a server that has the final say. Your game sends what you pressed; the server works out what happened and tells everyone. This is what stops one player's game from deciding a fight on its own.
Tick rate
The server simulates the world 60 times a second. Each step is a tick of about 16.7 ms. Your inputs are sent and handled tick by tick.
Prediction: your own movement feels instant
Waiting for the server before moving would make every key press lag by your ping. Instead your game predicts your own movement and shots immediately, using the same rules the server uses. When the server's answer comes back it is almost always the same. If it differs (you were knocked back, blocked or frozen by something you had not seen yet) your game quietly corrects to the server's version. A large correction looks like a small snap.
Interpolation: everyone else is smooth
Updates about other players arrive in steps, so your game shows them a tiny moment in the past and blends smoothly between the last updates it has. That way other players move smoothly instead of jittering, even when a packet arrives late.
Lag compensation: hitting what you saw
Because other players are drawn slightly in the past, the server rewinds them to where you saw them when it checks your shot. If your crosshair was on someone on your screen, the shot hits, even if they had moved a little by the time it reached the server.
Rewinding has a limit of 300 ms. With a worse connection than that, the server checks your shot against the most it can rewind and you have to lead your targets slightly; the HUD shows an indicator when this happens.
Why you sometimes get hit behind a wall
Lag compensation favors the shooter. If an enemy shot you on their screen just before you reached cover, the server agrees with them, and the damage arrives a moment after you are safe on yours. The higher their ping, the more noticeable it is, which is one reason for the 300 ms limit.
What ping does
Ping is the round trip time between you and the server.
- Your own movement feels the same at any ping, thanks to prediction.
- Higher ping means the server learns about your actions later, so you are more likely to be the one hit behind the wall, and corrections are more likely.
- Pick a nearby server in the Server browser for the best experience.