Eli5- How does video game de-sinc work?

82 views

I remember a while ago me and a buddy were driving around in GTA in my car. Then a weird thing happened where on his screen we slammed into a wall and on my screen we teleported up into the air. A second later everything was normal and I kept driving as if nothing happened. And yet my bumper was damaged as if I had run straight into the wall that my friend had seen for a split second. So what actually happened? How dies this stuff work?

In: 1

2 Answers

Anonymous 0 Comments

So, you’re playing a game with your buddy on the couch. For simplicity, let’s put GTA aside and imagine it’s a really simple game, like pong. You move your controller – the console updates the position of the bat and you see it move on screen. He moves his controller and the console moves his bat. It can update fast enough that as far as you can tell there’s no delay.

Now, take that same game but you’re in different locations playing over the internet, with a distant server keeping track of the bat and ball positions. Trouble is, now there’s a noticeable signal delay between between you and the server. If you have to wait for the signal to get to the server and back before you see the bat move, the game will feel very laggy – possibly unplayably so. So your and your buddy’s consoles keep their own versions of the game state, so they can update responsively. But they can disagree about what’s going on in game, because they get inputs at different times. In this case, they defer to the server as the definitive source of what’s going on. You might see on screen that you hit that ball, but if the server says you missed, then your screen has to change to agree with it.

You are viewing 1 out of 2 answers, click here to view all answers.