Multiplayer tutorial 2: chat room

13

Index

Features on these Courses

Stats

25,079 visits, 111,774 views

Tools

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

The easiest introduction to the multiplayer object in Construct 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 Multiplayer chat room example that comes with Construct. 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.

You can also start multiple previews yourself either by using Remote Preview, or holding Alt and clicking the Preview button to start another local preview.

You'll need to enter your own room name for the chat. This makes it unlikely that you'll accidentally join the same room as someone else, which could interfere with your testing.

  • 6 Comments

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