Multiplayer tutorial 1: concepts



Features on these Courses


53,132 visits, 254,176 views


The chaos of the Internet

Suppose now that some peers have joined the same room, successfully connected to a host, and a multiplayer game has begun. We can now ignore the signalling server: it is no longer involved from this point.

As described earlier, the multiplayer game itself runs with the host acting as the server. Peers only send data to the host, whereas the host can send data to anyone. This means if two peers want to communicate, it must be relayed through the host.

Multiplayer games would be a lot simpler if all transmission over the Internet was near-instant. This is generally the case on local area networks (LAN), such as your home or office network. However the Internet is phenomenally complex. Between any two players on the Internet, there could be 10-20 network devices (such as routers). The devices along this route will be different for each pair of players. For every single message sent, each device along the route must receive an incoming packet of information, read and understand its destination, determine where to forward it on to, and then re-transmit it. On top of that if you connect to a player overseas, your data will most likely be travelling through undersea cables, which deal with extraordinary amounts of traffic over large distances.

Amazingly, each device on the route can often forward on an incoming packet within milliseconds. However with lots of devices along a route, this adds up. If any device along the way is experiencing high load, it could slow down resulting in longer transmission delays. These devices, like any computers, can also crash, run out of memory, shut down for maintenance, lose power, run in to bugs that affect service, and so on. Due to much impressive engineering, routers can often re-route data around devices that have gone offline, or even re-route data down faster alternative paths. All of this can add temporary or permanent changes to the time it takes a message to travel from A to B.

The laws of physics must also be taken in to account. If a player from London in the UK connects to Sydney in Australia, the data must travel approximately 17,000km. Travelling in a straight line at the speed of light, this would take around 57ms. It is physically impossible to get data there faster than that. Then the cables along the way probably aren't perfectly straight, and over such a long distance there are likely to be many more routing devices.


  • Order by
Want to leave a comment? Login or Register an account!
  • Hello! I managed to make the multiplayer connection, but I'm having a problem with the peer, on the screen of his monitor the player's jump is not well synchronized, you know how to fix? Sorry for my english, I'm Brazilian and translated by google translator!

  • I need help with everything in multiplayer

  • help me

  • So 8 bits can store "10000001" for up to eight controls. But it can also store up to




    for each bit, yes?

    Since "0" & "1" are single digits per bit, are not "2-9" also as efficient to utilize, also being single digits? And "10-99" would have to also be more efficient than "100-255". Even if the efficiency of fewer digits per bit in a byte is rather negligible...?

    Edit: Right. 1s & 0s in combo * 8 digits = 255.

    8 slots to indicate 8 controls in-/active in one packet, or all 8 slots used to indicate just one piece of info.

  • can the chat room template run just on its own if i publish it?