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.
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:
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.
There is no visual indicator in the viewport that an object has [SP] or [MP] logic. Select an object to view its properties.
Game Maker will automatically grey out options you cannot apply.
For example, [MP] and [SP] variants of behaviours and components cannot exist on the same object since they communicate on different layers.
Remove all logic to switch an object to the other type.
Triggering Logic Across Systems
Logic can be a simple or complex chains of events, and it can be linear or branching with options.
Broadcast
Send a message on start of the Experience or when triggered, once or repeatedly.
Example:
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:
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):
Example (indirect):
Object Collection
Can be set as collectible by one player or every player, send a message, and/or play a sound.
Example:
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:
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
One Layer of Logic
FULL DESIGN FLEXIBILITY
[SP] means Client Only, and [MP] means Synchronised to all players. Both can be used in single and multiplayer Experiences.
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.
Global, player, and team variables are unrelated to [SP] and [MP] differences. They can be used in a rule triggered by both types of logic.
Logic:
The player picks up the key and takes it to the door.
When the door detects the key nearby, it opens.
Logic:
Interact with Seb to trigger the quest and turn on quest markers.
Interact with themachine to get a drink.
Return to Seb to give him the drink, which triggers the quest as complete.
There are two layers of logic that do not communicate with each other, but must be designed to feel seamlessly integrated for players.
Toggle the Multiplayer Simulator at the top right in the Editor to test how the Experience will behave if published as singleplayer or multiplayer.
Two Layers of Logic
DESIGN RESTRICTIONS APPLY
[SP] is Client Only for individual players and [MP] is Synchronised for all players. Both can be used in single and multiplayer Experiences.
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)
Global, player, and team variables are unrelated to [SP] and [MP] differences. They can be used in a rule triggered by both types of logic.
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.
Logic:
Each player interacts with Seb to trigger dialogue, quest, and quest markers.
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.
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
In , [MP] logic works like [SP] logic. Gameplay design is more simple.
In , there are communication and bandwidth limitations to consider when designing gameplay.
Trying to select a Behaviour or Component from an alternate network will result in the message:
"BLOCKED BY Network policy incompatible with another behaviour/component assigned to the actor/s."
The message received when trying to add a [SP] Component to an actor with a [MP] Behaviour.
are sent between and within systems to trigger gameplay logic.
There are many simple ways to send a message and trigger something to happen. Messages can also be directed more specifically using and .
Add a behaviour to a logic actor or object and set desired parameters.
Add a 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 behaviour.
The component can also detect and trigger a message when any tag enters or exits its volume.
Send Message - Add a component to the object that will be destroyed. Set a Message sent on death. You can trigger this with an Instant death message.
Drop (spawn) object - Add a component to the object that will be destroyed. Choose Behavior (default asset settings) or (custom settings for one or more objects to spawn). Select the asset or preset to spawn.
Other objects nearby with a component can detect a tag that is included in your spawned object.
A spawned object, such as a , could instantly send a message.
Add a component to an object and set a message to send.
Create an . 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.
Singleplayer
[MP] and [SP] logic communicate with each other in singleplayer games.
[MP] and [SP] logic communicate with an individual player's Objectives/quests.
[MP] and [SP] logic communicate with Game Rules.
Objective 1: Find the key and unlock the break room in 30 seconds
Game Ruleset: Countdown (triggered with Objective 1)
[MP] Objects:Pickable key, Door
Objective 2: Get Seb a drink from the vending machine room
Ruleset: (global or local variable for money)
[SP] Objects: Vending machine, Seb NPC, coin
Collect enough coin objects (money variable in the Ruleset) to buy a drink.
Multiplayer
Multiplayer Simulator
[MP] and [SP] logic DO NOT communicate with each other in multiplayer games.
[MP] logic DOES NOT communicate with individual player Objectives/quests.
[MP] and [SP] logic communicate with Game Rules.
Use Objectives for individual player goals. Use for collective goals.
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 .
See 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 (triggered with Objective 1)
[MP] Objects:Pickable key, Door
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: (Local variable - track each player's money)
Each player collects enough coin objects (money variable in the Ruleset) to buy a drink (all coins must be [MP] and collectable by each player).
Notes on in Multiplayer
📖
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
& are logic applied to voxel objects placed in the game world.
Light, NFT Sensor, NFT Image Display, Play Sound & Trigger Volume
This includes behavior, which includes unique settings per spawn point such as custom avatar, team assignment, equipment, tags, etc.