The first tutorial covered the theory of how multiplayer games work and the way they need to be designed, using techniques like local input prediction and lag compensation. The second tutorial covered a practical example of a chat room, which dealt with practical use of signalling, connectivity and sending messages. The third covered the basics of syncing objects. This tutorial will now cover the final topics of designing real-time games, such as implementing the input prediction and lag compensation described in the first tutorial. This is an advanced subject; if you are not already comfortable with your knowledge, consider revising the prior tutorials. This tutorial also covers some of the same ground as the previous pong example again, which is worth revising.

To get going, open the Example: Multiplayer - real-time game example that comes with Construct 2. This can be found in the Select template or example dialog that opens when pressing File - New. As with the previous tutorial, the project will be described event-by-event in more detail than the comments already in the project.

Running and testing

As with the chat example, the real-time game example must also be run from the first layout (F4), since it needs a valid name entered from the Login layout.

When testing the tutorial multiplayer games, it's possible you will meet other people who happen to be running the tutorial at the same time. However users commonly go "away from keyboard" (AFK) and leave things running without attending to them, so don't be surprised if other people are present but don't respond to chat messages. If you don't happen to meet someone active, get a friend involved and do some testing with them!

It's also possible someone will already be hosting the tutorial but you won't be able to connect to them. If that happens, change either the game, instance or room name and you'll start a new game which you host yourself.

@AshleyHello AshleyI've got a little question....Would you're game run on LTE or only Local by Wifi?We tested it with our and your game and i'ts unable to connect the second Player to the Host when they aren't in the same network.