LogoLogo
GeneralAccountsPlayersOwnersCreatorsThe Sandbox Website
Creators
Creators
  • 🎆Welcome to the Creator Portal
  • 🟦Learn Creator Basics
    • 🟦Scale & LAND Use
    • 🟦Assets & Equipment
    • 🟦Avatars & Character
    • 🟦Look & Feel
    • 🟦Logic & Gameplay
    • ❓FAQs: Gameplay
    • ❓FAQs: Assets
    • 🧙‍♂️Begin Game Maker (Video Series)
  • The Sandbox Creators Forum
  • The Sandbox DAO
  • 🪙Monetisation
  • Game Maker
    • ✨Create Experiences
    • 🔰Beginners
      • Play/Test
      • Build with Blocks
      • Place Assets
      • Set Object Actions
      • Trigger Logic
      • Craft Quests
      • Set Up Mechanics
      • Build Multiplayer Games
    • Game Maker 0.11 Update
    • 0.11 Upgrade Guide
    • 📖Docs
      • Navigate Game Maker Home
      • Manage Experiences
      • Controls & Shortcuts
      • Build Menus
        • Top Bar
          • Gameplay
        • Side Bar
          • Hierarchy
          • Presets
        • Library & Quick Access Bar
        • Grid System & Snap Tool
        • Properties Panel
      • Using Blocks
      • Using Assets & Objects
        • Behaviour & Component Parameters
        • Tags
        • Messages
      • Behaviours
        • NPC - AI Pawns
          • 🔵Citizen
          • 🔵Farmer
          • 🔵Healer
          • 🔵Melee Enemy
          • 🔵Predator
          • 🔵Prey
          • 🔵Soldier
          • 🔴Friendly NPC
        • Movement
          • 🟡Door
          • 🟡Bird
          • 🔴Basic Platform
          • 🔴Advanced Platform
          • 🔴Projectile
          • 🔴Rotate
        • Basic Logic
          • 🔵Message Broadcaster
          • 🟢Combination Code
          • 🟢Asker
          • 🟢Timed Events
          • 🟡Crowd Event
          • 🔴Spawn Point & Avatar's Feature
        • Modifiers
          • 🔵Actor Property Switcher
          • 🔵Multi
          • 🔵Void
          • 🟢Asset Spawner
          • 🟢Replace Asset
        • Visual
          • 🟢Post Process Effects
          • 🟡Weather Switcher
          • 🟡Animated Decoration
      • Components
        • Actions
          • 🟢Climbable
          • 🟢Avatar Teleport
          • 🟢Collectable
          • 🟢Drop
          • 🟢Slide
          • 🟢Speaker
          • 🔴Pickable
        • Triggers
          • 🟢Plant
          • 🟢Switch
          • 🟢Button
          • 🟢Trigger Volume
        • Status
          • 🟢Toggle
          • 🟢Power Up
          • 🔴Avatar Checkpoint
          • 🔴Health
        • Gameplay
          • 🔵Defeat
          • 🔵Victory
          • 🔴Raycast
        • NFT
          • 🟢NFT Sensor
          • 🟢NFT Image Display
          • 🟢Image Display
          • 🔴NFT Details Display
        • Display
          • 🟢Indicator
          • 🟢Rarity VFX
          • 🟡Visual FX
          • 🟡Light
        • Audio
          • 🟡Play Sound
      • Objectives
      • Game Rules
        • Math
        • Time
        • Comparisons
        • Replace Variable Values
        • Game Screen
        • Triggers
        • Events
      • Build Singleplayer & Multiplayer Logic
      • Quality Guidelines
        • Optimisation
        • Testing
        • Playability
      • Templates
    • 📑Creative Guides
      • 📗Game Rules Guide
        • Point Race
        • Collect Points
        • Time Trial
        • Combo
        • Hunger
        • Poison
        • Shop
      • ⚙️Logic Guide
        • Abilities
        • Equipment Based Logic - On Equip / NFT Sensor
        • Doors & Chests
        • Collectibles
        • Text, Quests & Icons
        • Platforms
        • Victory & Defeat
        • Miscellaneous
        • NFT Inspect
        • Fighting
      • 🏞️Experience Guide
        • Tower Defense
        • Horror / Backrooms
        • Solo Platforming
        • Social Platforming
        • Resource Management
        • Cooking Simulator
        • Survival
        • Action / Adventure
        • Night Clubs & Concerts
        • Virtual Home & Architecture
        • NFT Gallery / In-Game Shop
        • Puzzle Games
        • Social Hubs
        • Simulation
      • 🎲Experience Design Techniques
        • Narrative Design
          • Worldbuilding
          • Storyboard
          • Dialogue
        • Art Design
          • Experience Art Concept
          • Asset Curation
          • Blockout Aesthetics
          • Detailing / Dressing
        • 3D Spatial Layout
          • Rough Base Map
          • Greyboxing / Blockout
        • Game Design
          • Ramp of Difficulty
          • Risk & Reward
          • Game Loops & Decisions
    • 🎬Game Production Guide
      • 🟥Concept
      • 🟧Blockout
      • 🟨Logic
      • 🟩Art
      • 🟦Quality Assurance
      • 🟪Polish
      • ⬜Marketing
    • 🧰Publish Experiences
      • Experience Manager
        • Experience Analytics
        • 🧰Experience Page
          • Content Guide
          • Marketing
          • Create an Experience Trailer
          • Player Engagement
        • Map Location
        • Asset Review
        • Access Restrictions
      • Collaborating With Third Parties
      • ❓FAQs: Experience Publishing
    • 🕘Version Notes & Changelogs
      • Game Maker 0.11
        • ❗0.11 Upgrade Guide
      • Game Maker 0.10
      • Game Maker 0.9
      • Game Maker 0.8
      • Game Maker 0.7
    • ❓FAQs: Game Maker
  • VoxEdit
    • ✨Create Assets
    • 🔰Beginners
    • 📖Docs
      • Navigate VoxEdit Home
      • Controls & Shortcuts
      • Panels & Custom Layouts
      • Block
      • Modeler
        • Use Modes & Tools Together
        • Set the Pivot Point
        • Create Frame Assets
      • Animator
        • Build a Rig
        • Create an Animated Asset
        • Use Inverse Kinematics
      • Templates
      • Quality Guidelines
        • Asset Types & Collisions
        • Asset Scale
        • Node Efficiency
        • Pivot Point & Alignment
        • Animation
        • Visual Quality
        • Asset Name & Description
        • Manage Files & Folders
    • 📑Creative Guides
      • 🧍Asset Guide
        • Structures & Landmarks
          • Basic Building: No Entry
          • Animated Building: No Entry
          • Unanimated Building: Player Entry
          • Landmark
          • Building Facade
          • Structure Component Parts
          • Modular Architecture
        • Humanoids & Animals
        • Vehicles
        • Equipment
        • Art: Statues, Paintings
          • Animated Art Screens
          • Statues
          • Kinetic Art Sculptures
          • Paintings
          • Performance Art
        • Furniture
        • Platforms
        • Doors, Gates, and Windows
          • Multi Design Door Asset
        • Chests & Other Animated Interactions
        • Plants, Trees
        • Objects, Machines
        • Signs & Text
        • Obstacles
        • Create Frame Assets
      • 🎨Art Techniques
        • Asset References
        • 3D Design
          • 🧹Need to Simplify?
          • ✂️Trim All Volumes
          • 🟢Optimize with Texture
          • 🟢Curved Edges: Blocky Style
          • 🟡Break Down Objects
          • 🟡Create Smooth Angled Lines
          • 🟡Circular Shapes: Cross Technique
        • Colour, Texture & Depth
          • 🪅Colour Choice & Strategy
          • 🧱Textures & Materials
    • 🧰Upload Assets to Workspaces
    • 🌟Mint & List Assets to Sell
    • 🕘Changelogs
    • 🔓Open Source Assets
    • ❓FAQs: VoxEdit
  • Creators Program
    • 🏗️Builders' Challenge
      • Rules & Eligibility
      • Earnings & Rewards
      • How to Succeed in the Builders' Challenge
      • ❓FAQs: Builders' Challenge
    • ℹ️Creator Contests
    • 🏆Game Jams
      • Rules & Guidelines
      • Judges & Voting
      • Explore Past Winners
      • ❓FAQs: Game Jams
    • 🏆VoxEdit Contests
      • Rules & Guidelines
      • Judges & Voting
      • Explore Past Winners
      • ❓FAQs: Voxel Art Contests
  • General
    • 📚The Sandbox Documentation
    • 🔄Play, Create & Earn
    • 🗺️Map
    • 🛒Marketplace
    • 🗣️Discord Community
    • 🔗Social Networks, News & Blogs
    • The Sandbox Linktree
    • ❓Help & Contact
Powered by GitBook
LogoLogo

INFO

  • Discord
  • Social, News & Blogs
  • Service Status

PLAY

  • Events
  • Map
  • Avatar

CREATE

  • VoxEdit
  • Game Maker
  • Contests

OWN

  • SAND
  • LAND
  • Staking

Copyright ©The Sandbox. All Rights Reserved.

On this page
  • Game Maker's Logic Systems
  • Object Logic
  • Triggering Logic Across Systems
  • Creating Experiences
  • Singleplayer
  • Multiplayer
  • Resources

Was this helpful?

  1. Game Maker
  2. Docs

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.

PreviousEventsNextQuality Guidelines

Last updated 8 months ago

Was this helpful?

Game Maker's Logic Systems

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:

Selecting [SP] or [MP]

  1. Select an object and click on the behaviour or component field in the Properties panel.

  2. 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.

  3. 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 the machine 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)

[SP] Objects: Vending machine, Seb NPC; [MP] Object: Coin

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

👤
✅
✅
✅
👥
❌
❌
✅
Message Broadcaster
Speaker
Animated Decoration
Trigger Volume
Health
Drop
Preset
Speaker
Message Broadcaster
Collectable
Objective/Quest
Shop
Crowd Events
Shop
Experience Guide
Quality Guidelines
Game Production Guide
Monetisation
Singleplayer Experiences
Multiplayer Experiences
Multiplayer Logic
How Variables are Applied

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

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

Example (image above):

Global settings to customize basic interactions.

Example:

The player's avatar may be allowed to swim, breathe oxygen, receive fall damage, use abilitities, etc.

Messages
tags
timer
Shop
timer
Shop

(QUESTS)

& 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.

Gameplay

GAME RULES
OBJECTIVES
Behaviours
components
Spawn Point
Variable Types
Parameters
filters
Game Rules
Objectives (Quests)
Voxel Object Logic (Behaviours & Components)
Gameplay Parameters (affects all players)