Build Singleplayer & Multiplayer Logic
Use this one page guide to learn about Game Maker's logic systems and how they work together for single or multiplayer gameplay. Follow links as needed for more details in our documentation.
Game Maker's Logic Systems




Rules are gameplay mechanics that can be triggered and completed repeatedly and use variables for all players or individual players.
Example: Points, Timers, Shops, and more
OBJECTIVES (QUESTS)
Quests are an individual player's progress in a singleplayer or multiplayer Experience's flow, which can be completed only one time.
Example: A quest to collect coins
OBJECT LOGIC
Behaviours & components are logic applied to voxel objects placed in the game world.
Example (image above):
Light, NFT Sensor, NFT Image Display, Play Sound & Trigger Volume This includes Spawn Point behavior, which includes unique settings per spawn point such as custom avatar, team assignment, equipment, tags, etc.
Gameplay Parameters
Global settings to customize basic interactions.
Example:
The player's avatar may be allowed to swim, breathe oxygen, receive fall damage, use abilitities, etc.
Object Logic
[SP] & [MP] Behaviours and Components
A split between [SP] and [MP] logic was introduced with Game Maker 0.8.
This made it possible for players to experience some logic independently and other logic simultaneously with all other players. Synchronised logic includes position and state of objects, environment, global mechanics, etc.
An object may have one of the following logic setups:
No logic applied
Only [SP] logic "Client Only" - for each player to experience at different times Example: A player explores gameplay at their own pace and reads Quest dialogue when ready
Only [MP] logic "Networked" - for all players to experience at the same time Example: A door opening or a platform moving is synchronised for all players
Selecting [SP] or [MP]
Select an object and click on the behaviour or component field in the Properties panel.
When the pop-up window opens, use the dropdown at the top right to select a logic Type: All, [SP] Client Only, or [MP] Synchronised.
Click on the desired logic for your needs, and it will be added to the selected object.


Triggering Logic Across Systems
Messages are sent between and within systems to trigger gameplay logic.
Logic can be a simple or complex chains of events, and it can be linear or branching with options.
There are many simple ways to send a message and trigger something to happen. Messages can also be directed more specifically using filters and tags.
Broadcast
Send a message on start of the Experience or when triggered, once or repeatedly.
Example:
Add a Message Broadcaster behaviour to a logic actor or object and set desired parameters.
Use a message broadcaster as a middle step if two logic elements will not send or receive messages as quickly, consistently, or specifically as you want.
Object/Player Avatar Detection
An object can send a message when an expected tag is detected. It can also be set to play one of its animations. Detection is triggered when:
player avatars are in range
specific tags are in range
specific objects are in range
Examples:
Add a Speaker component and choose what to detect and detection range (avatars, tags, or a specific actor).
To trigger an asset's animation and send a message when an avatar is detected or a message is received, use Animated Decoration behaviour.
The Trigger Volume component can also detect and trigger a message when any tag enters or exits its volume.
Object Destruction
Send a message or drop (spawn) a new object (e.g. loot, smaller enemies, etc) when an object is destroyed from an attack or an instant kill message.
Example (direct):
Send Message - Add a Health component to the object that will be destroyed. Set a Message sent on death. You can trigger this with an Instant death message.
Example (indirect):
Drop (spawn) object - Add a Drop component to the object that will be destroyed. Choose Behavior (default asset settings) or Preset (custom settings for one or more objects to spawn). Select the asset or preset to spawn.
Other objects nearby with a Speaker component can detect a tag that is included in your spawned object.
A spawned object, such as a Message Broadcaster, could instantly send a message.
Object Collection
Can be set as collectible by one player or every player, send a message, and/or play a sound.
Example:
Add a Collectable component to an object and set a message to send.
Object Interaction (E)
Press E to send the “Interact” Message. This can trigger a wide variety of events depending on logic setup.
Examples:
Open a door to access a new area
Toggle on/off logic
Talk to NPCs for a quest
Collect or pick up an item
View NFT info (The Sandbox & external NFTs)
More complex logic sequences
Objectives/Quests
Send a message after receiving confirmation that a quest condition is met and/or after the quest is complete.
Example:
Create an Objective/Quest. In the Action After Completion dropdown, choose Send Message. Use the dropdown below this to select an existing message or create a new one. Any object in your Experience will be able to receive this message.
Game Rules
Most rules can optionally send a message when their logical flow is complete. Some may also be stopped or paused with a message.
Example:
Add a rule to the gridboard, set the Message In, apply any custom settings you like, and set the Message Out. Trigger the Message In and the Message Out will quickly be sent.

Creating Experiences
👤 Singleplayer
Why use [MP] objects in a singleplayer game?
Some logic would cause conflicts between what is visible and what has collisions in a multiplayer Experience, so in some cases there is only a [MP] version available. [MP] logic works like [SP] logic in a singleplayer Experience.
Performance
[MP] logic DOES NOT reduce gameplay performance in singleplayer games compared to multiplayer games.
Variables (Game Rules)
Variables can track numbers, time, t/f states, etc. They can be applied to affect data for a player (P), team (T), or global (G) and change depending on player interactions. Global variables may perform slightly better in singleplayer Experiences.
Objective 1: Find the key and unlock the break room in 30 seconds
Game Ruleset: Countdown timer (triggered with Objective 1)

[MP] Objects: Pickable key, Door
Logic:
The player picks up the key and takes it to the door.
When the door detects the key nearby, it opens.
Objective 2: Get Seb a drink from the vending machine room
Ruleset: Shop (global or local variable for money)

[SP] Objects: Vending machine, Seb NPC, coin
Logic:
Interact with Seb to trigger the quest and turn on quest markers.
Collect enough coin objects (money variable in the Shop Ruleset) to buy a drink.
Interact with the machine to get a drink.
Return to Seb to give him the drink, which triggers the quest as complete.
👥 Multiplayer
There are two layers of logic that do not communicate with each other, but must be designed to feel seamlessly integrated for players.
Multiplayer Simulator
Toggle the Multiplayer Simulator at the top right in the Editor to test how the Experience will behave if published as singleplayer or multiplayer.
Use Objectives for individual player goals. Use Crowd Events for collective goals.
Behaviours and components without [SP] or [MP] in the name are not compatible with multiplayer Experiences yet. They will be ported in the future.
Why use [SP] logic in a multiplayer game?
[SP] logic is necessary in the game world to trigger quests, which track each player's individual progression in your game. Some logic may also only be available as [SP].
Performance
[MP] logic should be used minimally in multiplayer games to add more gameplay potential without reducing the fun. Start by using as much [SP] logic as possible and then add the [MP] layer. You can build the same player experience that performs more efficiently!
Consistency
1️⃣ Consistent Type
An object with [MP] logic may only have other [MP] logic added. An object with [SP] logic may only have other [SP] logic added.
2️⃣ Consistent Messages
An object with [MP] logic may only send messages to objects with [MP] logic. An object with [SP] logic may only send messages to objects with [SP] logic.
3️⃣ Consistent Hierarchy
An object with [MP] logic may only be a parent or child of an object with [MP] logic. An object with [SP] logic may only be a parent or child of an object with [SP] logic.
4️⃣ Consistent Spawn
An object with [MP] logic may only spawn an object or preset with [MP] logic. An object with [SP] logic may only spawn an object or preset with [SP] logic.
Variables (Game Rules)
Use global (G), player (P), and team (T) variables depending on how you want number, text, and t/f values to be tracked and affected in your Experience. Learn more about How Variables are Applied.
See Multiplayer Logic below for more details on additional design considerations.
Objective 1 (auto trigger at start): Race to unlock the break room
Gameplay:
All players see the single player objective and rush to find the key
Ruleset: Countdown timer (triggered with Objective 1)

[MP] Objects: Pickable key, Door
Logic:
One player picks up the key and takes it to the door.
When the door detects the key nearby, it open for all players.
Objective 2: Get Seb a drink from the machine
Gameplay:
All players explore and find Seb on their own time, triggering logic only they can see.
Ruleset: Shop (Local variable - track each player's money)

[SP] Objects: Vending machine, Seb NPC; [MP] Object: Coin
Logic:
Each player interacts with Seb to trigger dialogue, quest, and quest markers.
Each player collects enough coin objects (money variable in the Shop Ruleset) to buy a drink (all coins must be [MP] and collectable by each player).
Each player interacts with the machine to get a drink.
Each player returns to interact with Seb to "give him the drink." A message is sent to Objectives to complete the quest.
Notes on Variable Types in Multiplayer
Using a player variable (P) The Shop Preset gives coins to only the players who trigger the rule to earn coins. It tracks this value as it changes (earning or spending) for every player individually. Using a global variable (G) The Shop Preset gives coins to all players even if only one player triggers earning them. It tracks this value as it changes (earning or spending).
Using a team variable (T) The Shop Preset gives coins to a team a player who triggers earning them is assigned to. It tracks this value as it changes (earning or spending) for the whole team.
Resources
Last updated
Was this helpful?

