Build Multiplayer Games
This activity is included in an 8-part, 1 hour series to learn Game Maker. Short, focused topics with guided practice will give you practical experience building useful logic for creating games.
Begin Game Maker 8
Design Multiplayer Game Logic
🔴 COMPLEX
In this activity, you will learn the fundamentals of setting up logic layers for multiplayer games, which combines logic individual players experience and synchronized logic all player experience. This includes how variables in the Rules System and Spawn Point behaviors can be used to create teams. Finally, you will learn how to share your Experience for testing or publish it to The Sandbox Map if you own LAND.
How Does Multiplayer Work?
Two Logic Layers
Multiplayer Experiences synchronize data across all players, such as object motion.
However, not all logic needs to be Synchronized [MP] for all players. To improve gameplay performance, some logic can be managed on the individual, or Client [SP], layer.
When adding logic to an object, you can see a dropdown filter for these communication layers.

Launch Game Maker
Open the Experience from the previous activity to reuse some of its logic.
Object Logic
Consistent Type
To be compatible in multiplayer games, an object may have only [SP], only [MP], or no logic.
Remove all logic from an object to change between [SP] and [MP].
Practice: Try to add a [SP] Toggle component to the logic asset with [MP] Weather Switcher behaviour added in an earlier activity. You can only add the [MP] version of Toggle.
Consistent Communications
In singleplayer Experiences, [SP] and [MP] logic can communicate because all data is managed locally.
In multiplayer games, [SP] and [MP] logic only "interacts" with its own layer (send/receive messages, detect, collide, spawn, replace, have a parent/child relationship, etc).
Practice: Try to send a message to trigger the [MP] Weather Switcher with a [SP] Message Broadcaster. In
singleplayer mode it will work, but in
multiplayer mode it will not.
Gameplay Recommendations
In Game Maker 0.10, the Objectives system only communicates with [SP] logic. This limitation will be removed in 0.11, allowing compatibility with [MP] logic.
Practice: Use the recommendations below to build one or two logic examples in your practice experience based on the gameplay you're interested in exploring.
To make a multiplayer Experience feel seamless for players and perform better, use as much [SP] logic in place of [MP] logic as possible.
Speaker component
When information is only relevant for an individual player
"Barks" to hint all players to talk to an NPC, share general information, etc.
Dialogue (Asker behaviour)
When each player triggers dialogue at their own pace
Compatibility with quests (0.10)
When all players must see dialogue at the same time
Collectables (includes consumables & equipment)
When each player can collect an item (and you need to use less MP logic for improved performance)
SP compatibility is needed
When players compete to collect only one instance of an object (Global set to True) OR When every player can collect an instance of the object (Global set to False)
MP compatibility is needed
Any use of Game Rules (HUD, banner, key input, variables, etc)
No limitations (Set Broadcast Type to All to communicate with Game Rules)
No limitations (Set Broadcast Type to Rules or All to communicate with Game Rules)
Quests
Only SP logic can communicate with quests in Game Maker 0.10
The Quest system will be compatible with MP logic in Game Maker 0.11
Logic that controls movement, collisions, spawning/ destroying, etc.
No SP options exist to avoid physics conflicts
Minimize use to boost gameplay performance
Refer to performance recommendations in Game Maker to choose how many and which logic to use to create an outcome
Use Actor Property Switcher instead of destroying and respawning objects
Variables
The Game Rules system can communicate with [SP] or [MP] logic.
In Game Maker 0.10, global variables apply to all players and local variables apply to individual players. Both work in single player games.
Example: You can create a global currency for all players to share or local currency for each player to use on their own.
Practice: You already have a global variable to count ancient treasures collected from a previous activity. Create a local player variable (integer) named "Player Treasure" with initial value 0. Place collectable Ancient Treasure B that sends the message TreasureB.Collect to Rules. Add a Math rule to add a fixed value of 100 to the new variable.
Teams
Messaging
Game Maker 0.10 introduced a new way to send messages only to certain teams of players.
Teams are defined by placing multiple Spawn Points that assign teams randomly when players arrive in the game.
Once teams are defined, you can set the Broadcast Type on most logic to Team and select the teams you created from a dropdown list.
Practice: Select the Avatars Portal asset and set "Assign Team" to true. Create a team name. Duplicate this object, move it nearby, and create a new team name for it.
Customizations
Once teams are created via Spawn Point behavior, you can do the following within that logic:
Choose equipment the team will wear (which can be unique to the team and set them apart)
Add custom tags for various types of detection
Add some available components via Avatar's Feature to set the team apart (e.g., light, sound, etc.)
Practice: Open each Spawn Point you created and set different equipment per team. At the bottom of the behavior, click "Add Feature" under the Avatar's Feature section. Apply Visual FX and choose a different trailing visual effect for each team.
Team Variable
Resetting & Instances
Some games must be reset to replay before an instance closes. Logic triggers need to be included in your design to set things back to their original state for players (e.g., variables, respawning removed objects, etc).
This requires careful planning before building your game logic for a single playthrough, and how to do it will vary depending on the gameplay you're designing. Keep this in mind early on as you design logic to create a Experience you want to publish to LAND or share in the Gallery.
Follow Up
Multiplayer is a deep and complex topic because it opens up many more game types and specialized approaches to create gameplay. We've introduced some of the key considerations so you can begin to explore it further.
We encourage you to start building your first multiplayer Experience once you feel confident with how to use Game Maker's systems to build logic for a singleplayer Experience.
➕ Relevant Resources

Change the properties of objects, such as visibility, collisions, gravity, and UI visibility for dynamic yet optimised gameplay logic.

See how logic works differently in singleplayer and multiplayer games and how to optimise with our guidelines.

Creator Events: Game Jams Join a Game Jam to challenge yourself to grow as you practice applying your skills and explore creating new things. You do not need to own LAND to participate!

Create a free Experience Page, even if you don't own LAND! Hook players on a story, wow Game Jam judges, provide extra details for play, or announce rules for your own contests.

Launch an Experience on the map if you own LAND. Learn about the Experience Manager's tools, content upload specifications, marketing, making trailers, and player engagement.

See the workflow teams use to publish professional content and try it out for yourself. We break it down into easy actionable steps!

Use our guidelines to plan ahead, add polish, and test carefully to ensure your game is fun and functional.
Forum: Community Ideas & Support
Other "Begin Game Maker" Videos
Last updated
Was this helpful?




