Communication

You have learned a lot by reading the functions about Multiplayer, but what’s the use you can get for them? Mostly nothing, because here starts the hot part of online games:

Communication
Communication is how you keep both games synchronized, when you’re playing an online game you have 2 different programs running, what do they do? They just keep sending info between each other to tell what’s happening. Imagine a multiplayer pong game where you see you hit with the bat but the other sees that you missed it. Well, if you don’t keep synchronization that happens.

Game Maker has two nice ways to send data, Shared data and Messages.

Shared data
Shared data is like a huge library where each book has a value; everyone can read and modify it. There are 1000000 of spaces to store data, and that data will be the same for all players. However, using too many slots will slow down the game because both games need to synchronize their slots, and that eats a lot of connection. This can be useful for some quick and not very essential data, like score for example. Nevertheless, if you want to store the x and y of an object it is advisable to use better ways.

Messages
Messages are another quick way to send data. You pack a value (a string or a real, whatever you want) and send it. But there’s a problem, sometimes the messages reach late or they never reach the player. Meaning losing some info, so, it’s advisable to have a plan B in your game to avoid havoc caused by that.