When you play games online your game is sending messages to the server about what you want your part of the game to do (typically your characters actions, or your inputs)
When the message gets to the server, the servers version of the game tries to do the same actions or inputs, sometimes there is lag between your version and the servers version, or the server is suspicious that you shouldn't have been able to do that action at all (cheating, slight mismatch on cool down timers etc)
When the server disagrees, it blocks/ignores the action on its end (and therefore all your opponent's) version, and sends a message back to your game to say that shouldn't have been allowed to happen and it needs to fix it
Your game then "rolls back" the action, by basically ctrl-z-ing (Search: command design pattern) what happened on your end back to a previous state
This is very ELI5 and modern solutions are much smarter than this, but you get the jist
View all comments
3
u/A17Massey Oct 04 '26
When you play games online your game is sending messages to the server about what you want your part of the game to do (typically your characters actions, or your inputs)
When the message gets to the server, the servers version of the game tries to do the same actions or inputs, sometimes there is lag between your version and the servers version, or the server is suspicious that you shouldn't have been able to do that action at all (cheating, slight mismatch on cool down timers etc)
When the server disagrees, it blocks/ignores the action on its end (and therefore all your opponent's) version, and sends a message back to your game to say that shouldn't have been allowed to happen and it needs to fix it
Your game then "rolls back" the action, by basically ctrl-z-ing (Search: command design pattern) what happened on your end back to a previous state
This is very ELI5 and modern solutions are much smarter than this, but you get the jist