Cheating in online games: trusted client network model vs. server-authoritative network model
Trusted client networking model
What does this mean?
That the game is being played on the computers of the clients while the server is just updating all the players in the online game about the other players.
The server trusts that the client is sending it the right information.
2
Trusted client networking model - to illustrate
Blue and Red are playing a car-racing game. When Blue presses the ‘UP’ key, his computer moves his car forward to the cell above, and then tells the game-server that Blue’s car has moved up one cell.
3
| |
| |
| |
| |
| |
| |
| |
| |
Blue car has gone forward one cell
Okay sure!
Trusted client networking model - to illustrate
The server dutifully communicates this to Red (the other player), and he sees the blue car move up.
4
| |
| |
| |
| |
| |
| |
| |
| |
Blue car has gone forward one cell
Okay sure!
Trusted client networking model - to illustrate
So far, things are all good. Red and Blue are simply playing their racing game against each other.
The cheating happens when one of the players figures out a way to manipulate the game files on his computer so that when he presses “up”, his car moves forward two cells instead of one.
5
| |
| |
| |
| |
| |
| |
| |
| |
Blue car has moved forward two cells
WTF?!
Trusted client networking model - explanation
In this manner, when the server trusts the client, players can take advantage by manipulating the game files on their computer and changing the behavior of in-game characters.
For example, they could make cars drive faster than they were meant to be, guns do more damage, fire more bullets in a shorter timeframe, or the player runs faster than others in the game and can teleport to different parts of the map instead of running there.
6
Server-authoritative networking model
What does this mean?
Instead of being played on the computers of clients, the game is played on the server. Clients just send those instructions through which players normally control in-game characters, like pressing keyboard buttons and mouse movement.
So instead of saying�My car has moved up one cell�the client says to the server�I have pressed the UP key once
7
Server-authoritative networking model
This is what server-authoritative networking looks like.
8
| |
| |
| |
| |
I have pressed the ‘up’ key once (in my computer that moves the car up two cells).
Sorry, that’s called cheating and you can go shove it. On this computer, one ‘up’ means one cell forward.
Yup, that’s about it.
I made this presentation after reading Glenn Fiedler’s post “Never Trust Clients”.
The HackerNews discussion is at https://news.ycombinator.com/item?id=11583008
9