Multiplayer tutorial 2: chat room

Index

Features on these Courses

Stats

18,134 visits, 89,785 views

Tools

This tutorial assumes you have already read Multiplayer tutorial 1: concepts.

The easiest introduction to the multiplayer object in Construct 2 is a simple chat room. This only has to deal with connecting and joining the room, other peers joining and leaving, and relaying simple chat messages. Some of the more complicated topics like input prediction and lag compensation are simply not necessary since there is no object the player controls. These will be covered in the next tutorial, but for now we can focus on the basics and still produce something useful.

To get going, open the Example: Multiplayer - chat room example that comes with Construct 2. This can be found in the Select template or example dialog that opens when pressing File - New. While this example is already commented, this tutorial will explain it event-by-event in more detail, since some of the features take a little more explaining than is convenient in event comments.

Running and testing

To preview the example, you must run it from the first layout (F4). If you run the Chat layout directly, it will not be able to join the chat room, 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.

  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!