How can servers let multiple gamers play together in real time?



Gamers can be across the globe yet if you have good enough internet connection you can play with them, see what each other see and do inside the game real-time without delays.

In: Technology

There’s a lot of very low level detail, but it basically comes down to sharing the workload between the servers and the player’s local.machine (the “client”) and having each connection to the server processed independently of the others so they don’t get mixed up.

If you’re in a game with another person, and they move to the left, the server doesn’t send the whole screen. It just sends a message that “player B moved to the left” and then your computer processes that instruction and draws the screen for you.

You basically have a server with the map and all the events on it. When you log in it sends you all the part of the map Within sight, when you move your client gives the server the coordinates you want to move to and it replies with the updated view. Your character has a clone on the map doing what you do and when you enter another players view you are just part of the map packet he or she is sent at that instance. So when they fire a bullet or spell the server just maps the trajectory and figures out what it is going to hit and if it happens tobe your clone you get sent the new info your character reacts accordingly and your clone copies you.

The only data you have to send ad receive at mp games are you and the other players’ character positions. Which are very small data packs, small enough to survive the losses of speed, or any other important thing ;when the connection goes worldwide.

MP Connections are actually small data packs, they can survive worldwide connections

Imagine 2 rooms both identical, you and your parent in room 1 and your friend and his parent in room 2, the parents are in a phone call with each other.

When you move a lamp your parent talking on the phone will tell parent 2 what moved and where two.

Parent 2 then moves the lamp.

In this way when ever anything changes the parents update the room so there always the same.

There are delays, they’re just masked. You always see slightly outdated positions of other players and same goes for you. For other players you are always few metres behind you think you are. That’s why sometimes you die behind corners, that’s why “peeker’s advantage” exist etc. It’s a massive topic, but too keep it short: what you see on your screen is not what other players see on theirs. It’s close, but it’s not the same. It matters a lot in fast paced games like Quake for example. There are even examples of players who perform better on LAN than in online matches because of these reasons.