🧙♂️Beginners
Find your way in Game Maker with core tutorial videos and hands-on activities to learn about building a physical world and applying logic.
Basic Tutorial Videos
Use these videos to learn about navigating Game Maker, blocks and assets, and logic or try a hands-on activity below.
Hands-on Activities to Learn Fast
These activities are sequenced to help you learn the core functionalities of Game Maker, and will help you learn workflows to make great Experiences!
Once you've learned the basics, see other helpful Resources to create your own projects.
1. ▶️ Learn Play/Test Mode Camera & Controls
This is an EASY activity anyone can do, which will teach you how to create a new game and move the camera and your avatar in Game Maker. You will learn additional controls for the camera in Build mode and how to place blocks in the next activity.
Remember to let your mouse steer your avatar's camera, then use the W
A
S
D
keys to move relative to what you see on screen.
Now you know the basics to start playing in the metaverse or test your creations! Learn more about building in the next activity.
2. 🏗️ Learn Build Mode Camera & Block Controls
This is an EASY activity anyone can do, and will show you the controls needed to navigate while building in Game Maker and terraform with blocks. Once you know how to navigate and build with blocks, you'll be ready to place and manipulate objects in Activity 3.
Launch Game Maker
Open the Experience created in Activity 1 or start a new one
Practice Some Build Mode Camera Controls
Controls: | Keys | Mouse |
---|---|---|
Zoom in/out | Press | |
Move camera left/right | Press | |
Move camera up/down | Press | |
Turn camera left/right | ||
Turn camera up/down | ||
Orbit around a point in front of you | - | |
Modifier: Sprint a camera control | Hold | Hold |
Find Blocks
Open the Library (press L
) and add blocks to your quick access bar (above the Library):
Click the Blocks tab at the top of the library to filter options and only show blocks.
Drag and release a few blocks into slots in quick access bar. Close the library (press
L
) and click on any block in the quick access bar or use the corresponding number shown in each slot to select a block to use.
Undo/Redo if Needed as you practice the controls below
CTRL
+Z
to undoCTRL
+Y
to redo
Use the Free Brush (default) to practice basic block building controls
Basic Controls
Place
Remove
Replace
Place Layer (no modifiers)
Modifiers
Line or Rectangle Shape (on any block surface)
Hold [basic control] + drag & release
Line of Blocks (vertical)
Hold [basic control] + SHIFT
+ drag up & release
Rectangle of Blocks (vertical)
Hold [basic control] + drag to base shape + SHIFT
+ drag up & release
Test Other Block Brushes & Adjust Size
Notice when placing or removing with other brushes, the center of the shape snaps to the surface (blocks may be placed underground).
Brushes other than the Free brush will only build a vertical column in the brush shape.
Diamond - easy to climb shape
Cube - man-made structures and blocky terrain
Sphere - natural terrain
Now that you know how to build with blocks, you can block out the 3D space for your Experience, create terrain details and paths to guide players.
Learn how to add objects into your world in the next activity.
3. 📐 Place & Position Assets
This is an EASY activity anyone can do. It will introduce asset placement and movement in the Game Maker to build a scene.
Place and Remove Objects
An object is an instance of an asset placed in an Experience. You can place as many objects as you want using an asset. Objects snap to block surfaces when placed.
With an asset selected in the quick access bar,
LEFT CLICK
inside the viewport to place itPress
SHIFT
to snap to the grid when placing an assetTo remove an object:
In Select mode,
LEFT CLICK
to select an object and duplicate it withCTRL
+D
Multi-Select
Practice selecting multiple objects and try duplicating and deleting a group:
Drag the mouse to draw a rectangle (this selects all objects behind the rectangle to the edge of the Experience)
Press
SHIFT
and click one item at a time to add to your selectionPress
CTRL
to add and remove an object from your selection
View and Snap to the Grid
The grid system and snap tools allow for custom block and asset placement for any project.
Open Grid settings to hide or show the grid, adjust scale, and set opacity. Let's leave the grid on
Place an object with the grid's
OSNAP
toggle on, and notice that you can turn on and off theX
,Y
, orZ
axesSnap an object to the ground with a click
Move Objects
Click and drag a coloured arrow to move the object on one axis
Move the mouse pointer between two arrows to activate a plane to move only between those two axes
Move to the center where the arrows meet to activate a cube to move freely between all three axes
In the Properties panel, modify position coordinates to move the asset with precision
Test Movement with a Custom Grid
Rotate Objects
Press
O
to Turn offOSNAP
Click and drag a coloured curve to rotate the object on one axis
Hover over the gizmo to activate a sphere to rotate freely between all three axes
In the Properties panel, modify rotation coordinates to rotate the asset with precision
Test Rotation with a Custom Grid
Test the Hierarchy to Control Objects
Click an object in the Viewport and notice it is highlighted in the Hierarchy
In the Hierarchy, drag and drop that object onto another object to make it a child
Select the parent object and test movement and rotation to see how it controls the child object's position and rotation
Practice: Use what you've learned to build a small scene of objects. It takes time to get used to the controls with the mouse and keyboard shortcuts, but the tools are very flexible to build any project.
The next activity will introduce behaviours to drive an object's actions and tags to customize how objects can detect and respond to each other.
4. 🤺 Customize Object Behaviours with Tags
This is a MEDIUM difficulty activity using simple behaviours to create custom interactions between objects.
This activity will explore some behaviors that use AI decision making. They are programmed to detect and respond in certain ways to other objects that have specific tags, or identifiers. Tags are included when a behaviour is added to an object to make it easy to build objects that are ready to interact.
Default Settings
Prey & Predator
Place a "Stag" asset and apply Prey behavior. This includes the Prey tag.
Place a "Grey Wolf" asset nearby and apply Predator behavior. Predator tag is included.
Press
TAB
to Test:The Predator will detect the Prey and chase it.
The Prey will run when it detects the Predator up closer.
The Predator will chase any Avatar, or player, which is one of its default Tags to Attack.
Custom Targets
Plant & Prey
Select the Prey and notice that it has a Food Tag and Tags to Flee. Let's add objects with the Plant tag for it to detect.
Place a "Small Plant B" asset nearby and duplicate it. For one of them, apply the Plant component. Scroll to the bottom of the object's Properties, type the tag Plant (case sensitive), and press enter to apply it.
One plant has an identity so it can be "eaten" and the other is just a prop that won't be touched. Duplicate (
CTRL
+D
) both types and spread them in a small area.Press
TAB
to Test:Watch the Prey wander, approach objects it should eat, and make them disappear while ignoring the rest.
THINK OUTSIDE THE BOX
These behaviors are meant to be a function with flexible use.
Make an NPC collect trash using the Prey or Farmer behaviors by adding any custom tag as their food or gathering target.
Only add the custom tag to objects you want Farmer or Prey to remove.
Changing Tags During Play
Soldier & Citizen
Place an "Axeman Recruit" and apply Soldier behavior. Its default Tags to Attack includes Hostile.
Place an "Elder Caveman" with Citizen behaviour.
Press
TAB
to Test:You can't attack the Citizen because it has the built in tag Friendly.
The Soldier will ignore you until you attack, which will apply the tag Hostile to your Avatar for the rest of the game!
If you exit Play mode and re-enter it later, the game is reset, so the Hostile tag will be cleared from your Avatar.
Custom AI Interactions
Melee Enemy vs. Melee Enemy
GroupA
Place three "Maximilien" objects together. Select all of them and apply these changes in the Properties panel (which will change them all at the same time):
Apply Melee Enemy behaviour
Next to Tags to Attack, click the X to remove the Hostile tag, click
ADD+
, and type GroupB in the text box.Scroll to the bottom of the Properties panel and apply the tag GroupA (remember to press
ENTER
)
GroupB
Place three "Matthew" objects together. Select all of them and apply these changes in the Properties panel:
Apply Melee Enemy behaviour
Next to Tags to Attack, click the X to remove the Hostile tag, click
ADD+
, and type GroupA in the text box.Scroll to the bottom of the Properties panel and apply the tag GroupB (remember to press
ENTER
)
Press TAB
to Test:
GroupA and GroupB will detect each other's tags and fight. Feel free to select these groups, duplicate them a few times, and create a small army of dueling NPCs! ⚔️
Combine a variety of AI-driven behaviors and use tags to direct their decision making. Explore these ideas and your own:
Want players to join a side in a battle? Add Avatar to any enemy's Tags to Attack.
Want fighters to be revived during battle? Use the Healer behavior with Tags to Heal.
There are many other behaviors to explore, but you've learned the basics of controlling object actions by applying behaviors and custom tags.
In the next activity, you'll create functional game logic with other behaviours and add components to make objects more interactive.
5. ✉️ Create Object Cause & Effect with Messages
This is a MEDIUM difficulty activity using behaviours and components to create simple logic systems with objects.
This activity will help you learn the basics of communication in Game Maker using messages to create cause and effect.
Launch Game Maker
Open or create an Experience and move to an area with empty space.
Let's turn the grid off and focus on logic.
Some behaviors and components are only available as [MP], which means they are multiplayer synchronized. For this activity, choose [MP] only when a [SP] option isn't available.
Designing gameplay with [SP] and [MP] logic will be explored later.
Collisions & Messages
Behaviours and components are needed to make objects active and/or interactive. This logic provides a framework so messages can be sent and received to trigger gameplay events.
Tags and Broadcast Type allow for greater control over how events are triggered.
Add the following objects to the viewport:
Asset: Door (any) No behavior
Asset: Door (any) Door behaviour
Pressing E
next to an object sends the message Interact
to it.
Test (Press TAB
)
TAB
)Press
E
to interact with each door. One door is only a prop. The other animates to appear open and turns off its collisions so players can pass through.
Most objects must have collisions to prevent players from passing through them. You can control if an object has collisions, is visible, or has gravity in the Properties Panel.
Toggle Behaviours On/Off
A message sent to an object's Toggle component can turn it's behaviour on or off. Think of it as locking or unlocking a behaviour.
Add an object that sends a message:
Asset: Museum Info Panel
Button component
Message to Send:
Door.Unlocked
Broadcast Type: EveryoneInRange
Create a custom message by typing it into the message field and click to Add it.
Add two objects in range (the yellow sphere) of the first object to receive the message:
Asset: Door (any)
Door behavior
Message to Open:
Door.Unlocked
Select the existing message from the message dropdown list.
Asset: Door (any)
Door behavior
Message to Open:
Interact
Toggle component
Turn On Message:
Door.Unlocked
Initial Behaviour State: False (behavior inactive at game start)
Test (Press TAB
)
TAB
)Neither door can be opened. Interact with the panel to send its message, and then:
One door opens
The other door's behaviour is toggled on so players can open the door with
E
.
Trigger & Filter Messages
Add the following objects to the viewport:
TRIGGER: AVATAR DETECTED
Message sent to everything in the Experience (location doesn't matter)
Asset: Door (any) Name: DoorA
Door behaviour
Message to Open:
DoorA.Open
Asset: Ancient Lever
Message Broadcaster behaviour
Message to Send:
DoorA.Open
Broadcast Type: All
Wait Before Broadcast: True
Message Required: Interact
TRIGGER: OBJECT COLLECTED
Message sent to specific objects
Asset: Door (any) Name: DoorB
Door behavior
Message to Open:
DoorB.Open
Asset: Key (any)
Collectable component
Message On Collect:
DoorB.Open
Broadcast Type: SelectedActors
Broadcast Targets: DoorB
Alternative Method: Add a tag to the door, set the key to broadcast the message to SpecificTagsInRange, and adjust the key's broadcast range to include the door's location.
TRIGGER: TAG DETECTED
Message sent to self
(when the object detects a specific tag in range)
Asset: Door (any) Name: DoorC
Door behavior
Message to Open:
DoorC.Open
Speaker component
Detection Type: SpecificTagsinRange
Include Tags:
DoorC.Key
Message to Send:
DoorC.Open
Broadcast Type: Self
Asset: Key (any)
Tag: DoorC.Key
Pickable component
Test (Press TAB
)
TAB
)Trigger doors A, B, and C to open based on the logic set up. Imagine ways to use these simple trigger methods for other design needs!
There are many more ways to send messages. We'll explore more later.
One Message to Trigger Multiple Objects
Build hidden logic into your Experience with invisible and collision-free Logic Assets.
Add the following objects to the viewport:
TRIGGER: AVATAR DETECTED INSIDE A VOLUME
Asset: Logic Asset
Trigger Volume component
Detection Type: EveryAvatarInRange
Detection Shape: Box
Detection Area: x
15
y5
z15
Enter Message:
Night
Exit Message:
Day
Broadcast Type: All
Asset: Car (any)
Basic Platform behaviour
Move Offset: x
0
y0
z5
Look at Destination: True
Toggle component
Turn On Message:
Night
Initial Behaviour State: False (behavior inactive at game start)
Asset: Weather Asset Name: Night
Message Required:
Night
Profile: Night
Asset: Luxury Street Light
(prop with no logic)
Asset: Logic Light Asset Name: Street Light Position: Luxury Street Light (point down)
Light Type: Spot Light
Starting State: Off
Spot Angle: 15
Message Turn ON:
Night
Message Turn OFF:
Day
(2x) Asset: Logic Light Asset Name: Headlight Position: Car headlights (point forward)
Light Type: Spot Light
Starting State: Off
Spot Angle: 15
Message Turn ON:
Night
Message Turn OFF:
Day
Test (Press TAB
)
TAB
)The lights do not move with the car. Let's create a relationship in the hierarchy to fix that.
Modify
Set the "Headlight" assets to move with the car's platform motion. Open the hierarchy, select them, and drag them onto the Car. This makes them child objects and the car the parent object.
Test (Press TAB
)
TAB
)The location of the "Headlight" assets is now controlled by their parent object's motion.
Messages with Arguments
Some special messages appear in yellow and allow you to send information (an argument) with a message.
You can also create custom messages with arguments that will appear yellow in the message dropdown list. These will be explored in a later activity.
Continue with the previous example so weather and the streetlight will gradually change.
Add objects to communicate special messages:
Asset: Logic Asset Name: Street Light Trigger
Message Broadcaster behaviour
Message to Send:
LightColor
Time: 10
Wait Before Broadcast: True
Message Required:
Night
Asset: Logic Asset Name: Weather Trigger
Message Broadcaster behaviour
Message to Send:
WeatherFade
Time: 10
Wait Before Broadcast: True
Message Required:
Night
Modify existing objects to receive the special messages:
Asset: Logic Light Asset Name: Street Light
Message Turn ON:NightMessage Turn ON:
LightColor
Asset: Weather Asset Name: Night
Message Required:NightMessage Required:
WeatherFade
Test (Press TAB
)
TAB
)The weather and streetlight gradually change using these special messages.
Save your Experience so this logic is available for use in another activity.
This activity introduced new tools and concepts to understand objects more and how to make them communicate in custom ways.
In the next activity, you will learn to integrate quests with some of the logic from this activity so you can begin designing a flow for players with clear guidance to play through your Experience.
Ready for More Practice?
This activity leaves room for you to test out your own ideas when the player exits the Trigger Volume and the message Day
is sent. Test out custom weather profiles and light colours, too!
Remember that the special message
LightColor
sets transition timing and colour.
6. ❗ Integrate Quests with Object Logic
This is a MEDIUM difficulty activity using Quests and objects linked to them.
This activity will help you learn to guide players through your gameplay with the Objectives system UI and icons to help players find quest objects like NPCs, collectable objects, and more.
What are Quests?
Located in the Objectives system, Quests are used to guide players through your game's story, geography, game mechanics, and more with a sleek user interface. Objects in the game world can be linked to quests so they're easier to find.
A quest may be triggered and completed only one time.
Launch Game Maker
Open the Experience from the previous activity to reuse some of its logic.
To track individual player progression in single and multiplayer games, [SP] behaviors and components must be used to send messages to the Objectives system.
[MP] logic works like [SP] logic in singleplayer games.
Locked/Unlocked
Open the Objectives window and toggle on quests.
Let's add two quests to compare when they'll appear on the right side of the player screen in the Objectives UI, or user interface. Ignore other quest settings for now.
Name: Auto Quest 1. Unlock quest: Auto Unlock 2. Launch quest: Auto Launch
Name: Triggered Quest
1. Unlock quest: Requires Message
Message: DoorA.Open
2. Launch quest: Auto Launch
Note: In the last activity, an Ancient Lever object sends this message when players interact with it.
Test
Press TAB
to see the "Auto Quest" open at game start.
Interact with the Ancient Lever that sends DoorA.Open
to All, which will make the "Triggered Quest" appear in the UI because the quest is set to auto launch.
When to Launch
Modify both quests to require a message to launch:
Name: Auto Quest
1. Unlock quest: Auto Unlock
2. Launch Quest: Requires Message
Message: DoorA.Open
Name: Triggered Quest
1. Unlock quest: Requires Message
Message: DoorA.Open
2. Launch Quest: Message Required
Message: Night
Note: In the last activity, a logic asset with a Trigger Volume component sends this message when players enter the volume.
Test
Press TAB
to test. Notice that no quests appear in the UI yet.
Try entering the trigger volume (remember that your game will shift to night from the previous activity's settings). The "Triggered Quest" will not launch yet because it is still locked.
Interact with the Ancient Lever asset to send DoorA.Open
and you'll make the "Auto Quest" launch in the UI. The "Triggered Quest" is also unlocked by this message.
Now you can enter the trigger volume and launch the "Triggered Quest" in the UI.
Launch settings allow you to control how many quests may be activated at a time, while unlock settings allow you to control when players are permitted to start a quest.
Different Quest Types and Conditions
There are four types of quests: counter, asset death, timer, and wait for message.
First let's set up interactive assets for a counter quest:
Asset name: Ancient Artifact Tag: artifact Remove Predator behaviour
Health component
Health: 10
Drop component
Assets to Spawn: Ancient Treasure A
Components: [SP] Collectable
Tags: treasure
Note: Duplicate this asset (5 total)
Counter- Destroy Objects
Create a new quest (auto unlock and launch):
Name: Treasure Hunt Description: "Destroy the ancient artifacts and collect all of the treasure.”
3. Counter
Type: death
Tag: artifact
Amount: 5
Test - The quest counts the number of objects destroyed with the tag you set for it to watch.
Counter - Collect Objects
Modify the quest:
3. Counter
Type: collected objects
Tag: treasure
Amount: 5
Test
Press TAB
to test. When you attack and destroy each artifact, nothing happens. When you collect each pile of treasure dropped after each artifact is destroyed, the quest counts the number of objects collected with the tag you set for it to watch.
You can apply the same tag to collect or destroy different types of objects, such as ingredients to make a meal.
Quest States
A quest may be in three states: inactive, in progress, and finished. We can use NPC dialogue to tell players how to start or complete a quest and confirm the quest is finished.
Create an NPC and dialogue:
Asset: Adventurer Jet
Asker behaviour
Question: Can you help me find ancient treasure hidden inside the artifacts?
Answer 1: Sounds like fun! A1 Message:
Q.Treasure.Launch
Toggle behaviour
Turn OFF Message:
Q.Treasure.Launch
Asset: Logic asset
Asker behaviour
Question: Did you find the artifacts yet?
Answer 1: I'm still looking for them! A1 Message:
Q.Treasure.InProgress
Toggle behaviour
Turn ON Message:
Q.Treasure.Launch
Turn OFF Message:
Q.Treasure.InProgress
Asset: Logic asset
Asker behaviour
Question: Awesome! You found the treasure!
Answer 1: That was a piece of cake!
Toggle behaviour
Turn On Message:
Q.Treasure.Complete
Now connect the dialogue to timing of the quest:
Name: Treasure Hunt
2. Launch quest: Requires Message
Message: Q.Treasure.Launch
5. Action after completion: Requires Message
Message: Q.Treasure.Complete
Test
Press TAB
to test.
Quest inactive - Interact with the NPC to start the quest. This dialogue is then toggled off by its own message out when you answer the question.
Quest in progress - Interact after the quest is launched to see the dialogue, which can be a helpful reminder for players. No message is needed unless you want to trigger a hint for players.
Quest complete - Interact after the quest is complete to see the dialogue.
Adding Polish with Indicators
You can apply three types of icons to objects that are linked to a quest:
These icons are displayed above objects in the game world when an Indicator component is applied to the objects, a quest is linked, and quest settings match the type of icon to use.
Modify Jet and the "Treasure Hunt" quest so he can be a quest giver:
Modify Asset: Adventurer Jet
Add an Indicator component Linked quest ID: Treasure Hunt Quest cursors: True
Giver: Adventurer Jet
Create a Custom Preset to Drop
Since the tagged object that the quest counts is a dropped item (meaning it is spawned), we'll modify the ancient artifact assets to use a Preset with custom settings that link to a specific quest. You don't need to create a preset for quest items, but we've chosen an example that's a bit more fun for players.
Create an object:
Asset: Ancient Treasure A Tag: treasure
Indicator component
Linked Quest ID: Treasure Hunt
Quest cursors: True
Objective: Treasure Hunter
Collectable component
Save this object as a Preset. This allows you to spawn or place an object or group of objects with more complex custom settings during edit or play modes.
Modify all ancient artifact assets to spawn this preset.
Test
The exclamation point appears above the NPC before the quest starts because it's the quest giver.
After you interact with it, the target icons appear above each quest objective, the ancient artifacts to destroy.
Once you have collect all of the treasure, the icons and quest are no longer visible.
Save your Experience to reuse the logic in the next activity.
Quests are a great way to guide players through the flow of your Experience. They can be very simple, or they can have complex steps and hints to help players when connected with objects.
A Counter quest can be used in different ways to count what players destroy or collect.
A Timer quest can be a fun challenge to survive or defend an asset during a time period.
An Asset Death quest can be used for a special boss fight.
A Wait for Message quest is extremely flexible in use since it only requires a message to complete it.
In the next activity, we'll continue using the same Experience to learn how to make more interesting game mechanics with the Game Rules system.
7. ⚙️ Add Repeatable Game Mechanics with Rules
This is a MEDIUM difficulty activity using Game Rules with object logic.
This activity will help you learn the basics of the Game Rules system and how to apply it for more engaging game mechanics that can be used repeatedly. This unlocks more gameplay varieties and a custom player HUD.
STAY ORGANISED IN GAME MAKER
Group rules into rulesets any way you like.
Group objects in the hierarchy using folders.
Find messages sent and received with the Message Inspector in the Debug menu.
Manage messages used in your Experience in the Settings menu.
What are Rules?
The Game Rules system is a visual scripting tool located in the Gameplay menu.
It allows you to set, use, and change values such as numbers, text, time, and true/false values for your gameplay needs and control what appears on the player HUD, or heads up display.
Launch Game Maker
Open the Experience from the previous activity to reuse some of its logic.
A rule needs to be triggered by a Message In to carry out its actions. It can then trigger objects, other rules, etc. Some rules can also be interrupted with a message.
Trigger: Joining the Game
Let's begin with a simple popup window that appears when a player enters the game:
Rule: Popup Window Type: Game Screen
Required Message: Playerjoined
Title: Welcome!
Description: Explore as a player to test the logic you create.
Rule: OnPlayerJoin Type: Events
Message to Send: Playerjoined
Test
Press TAB
to test. The popup window appears as soon as the Experience starts for you.
For now, let's set the Popup Window rule's Required Message to none
so the window won't pop up every time we press TAB
to enter the game and test logic.
Use a Text Variable in a Rule
Use text variables to show status, player/location names, level up notices, and more!
Create a variable and a rule to use it:
Variable Type: Text
Apply variable: Global Name: Area Value: Banner Text
Rule: Banner Type: Game screen
Required Message:
Night
Duration: Fixed value of 5 (seconds)
Variable: Area
Name: Area
Icon: Map
Test
In a previous activity, the message Night
is sent anytime the player enters an object's trigger volume. The banner will display the words "Banner Text," which is the value saved in the variable.
Overwrite a Text Variable and Reuse It
Let's create a message with arguments to send different text to the Rules System depending on where the player is located in the game world.
Logic Asset
Trigger Volume component
Enter Message:
Message (with argument):
Area
Argument 1: Text
Argument name: Area Name
Argument value: Area 1
Broadcast type: Rules
Logic Asset
Trigger Volume component
Enter Message:
Message (with argument):
Area
Argument value: Area 2
Broadcast type: Rules
Now create a rule to overwrite the variable's text with the message argument:
Rule: Set Text Value Type: Replace Variable Values
Required Message: Area
Text variable: Area
New text: Message Argument, select argument name you created
Test
The banner rule doesn't use the text argument sent with the message, but still works. The rule to sets banner text uses the argument text included with the message.
Trigger: Keypress (to shoot projectiles)
Create a preset of the following asset. Delete the object after saving it as a preset.
[MP] Asset: Numpad Switch Invisible
Projectile behaviour
Start with Experience: True
Message Required: none
Projectile Force: 40
Projectile Trajectory: 0
Look at Direction: True
Collision Target: SpecificTags
Tags to Collide With: artifact
Message on Collision:
Health
Health: - 100
Broadcast Type: CollidedActors
Note: With these settings, the projectile will cause 100 damage if it hits an object that has the tag artifact, which was applied to objects in the previous activity.
Now create a pickable object with a child object that spawns the projectile preset:
[MP] Asset: Dragon Egg
Visual FX Component
Beverage wisp
Pickable component
Offset: x
0
y-0.5
z0
Note: This offset adjusts the object location when it is picked up.
[MP] Asset: Numpad Switch
Location: Inside the dragon egg asset Child object of the dragon egg Invisible
Asset Spawner behaviour
Message Required:
1
Use Preset: True
Preset: Select your projectile preset
Only once: False
Add a Key Input rule to trigger the projectile to spawn whenever a key is pressed:
Rule: Key Input Type: Triggers
Select Key: 1
Message to send onKeyDown: 1
Test
Press TAB
to test. Pressing the 1
key shoots the projectile from the dragon egg anytime. Pick up your magical dragon egg with E
and shoot all ancient artifact assets to collect the treasure!
Since an object that is picked up can’t send or receive messages in the current version of Game Maker, we created a child object to be the asset spawner. The projectile behavior triggers as soon as the object it’s applied to is spawned.
The Raycast component can detect objects from a distance and send messages, too!
Count Resources with a Number Variable
Place the treasure preset from the last activity. Modify its collectable component so it will send a message to the Game Rules system whenever it is collected. Save this preset over the old version. Delete the object after saving it as a preset.
Asset: Ancient Treasure A Tag: treasure
Indicator component
Linked Quest ID: Treasure Hunt
Quest cursors: True
Objective: Treasure Hunter
Collectable component
Collect Sound: Generic Coin
Message on Collect:
Treasure.Collect
Broadcast Type: All
Note: Each time this object is collected, the message is sent to all systems.
Modify all of the Ancient Artifact assets to drop the preset when destroyed:
Modify Assets: Ancient Artifact Tag: artifact
Health component
Health: 10
Drop component
Use Preset: True
Preset: Select your treasure preset
Duplicate an Ancient Artifact asset until there are at least 20 in the game. Spread them out.
Create the following variable and rules to track and display money:
Variable Type: Number
Apply variable: Local Name: Money Value: 0
Rule: Math Type: Math
Required Message:
Treasure.Collect
Operand 1: variable, Money
Operator: Add
Operand 2: Fixed value, 100
Result: Money
Note: This amount replaces the variable.
Rule: HUD Type: Game Screen
Required Message:
Playerjoined
Select slot: Top center slot
Variable: Money
Name: Treasure
Choose icon and size
Note: This displays the variable on the HUD from when a player enters the game.
Test
Press TAB
to test. Now as you destroy the ancient artifacts and collect the treasure that drops, you'll see the amount of treasure collected (100 per treasure). Each time you collect the treasure, which is a preset, you’re sending a message to a custom location.
In this case, it goes to All locations so it will reach the Rules system and increase your money when collected, which appears in the HUD slot you selected.
Make Variables Useful
Create an NPC to sell different types of items to players (equipment to wear, a consumable item, and a resource to be shown in the player HUD):
Asset: Bazaar Merchant
Asker behaviour
Question: "What would you like to buy today?"
A1: "Food" A1 message:
ShopItem1
A2: "Equipment" A2 message:
ShopItem2
A3: "Wood" A3 message:
ShopItem3
Create a preset object to spawn when purchased (delete after saving as a preset):
Asset: Any food item
Collectable component
Consumable: true Note: Press
C
in Inventory to useMessage on consume:
Speed
, Percentage 20, Duration 10 Note: This gives a 10 second boost
Create asset spawners for items to purchase and collect:
Logic Asset
Asset Spawner behaviour
Message required:
ShopItem1Purchased
Asset to spawn: any equipment asset
Component: Collectable
Logic Asset
Asset Spawner behaviour
Message required:
ShopItem2Purchased
Spawn preset (toggle): true
Preset: the food preset you created
Add variables and rules for resources that will be tracked by number and displayed in the HUD:
Variable Type: Number
Apply variable: Local Name: Wood Value: 0
Rule: Math Type: Math Name: +Wood
Required Message: ShopItem3Purchased
Operand 1: Wood variable
Operator: Add
Operand 2: Fixed value, 5
Result: Wood variable
Note: This adds 5 to the wood variable
Rule: HUD Type: Game Screen
Required Message: Playerjoined
HUD slot: any bottom slot
Add a Shop rule preset to save time on the rest of the setup:
You already set up the Add Money, HUD, and Player Join rules earlier in this activity. You can remove the ones in this premade ruleset.
The remaining rules allow you to test if you have enough money to buy two types of items and pay from your money variable if you do have enough.
You have three items in your shop, so select and duplicate a Success, Fail, and Pay rule in this Ruleset to add what's needed for your third item.
Rename Item 1 rules "Purchase Food Success," "Purchase Food Fail," and "Pay Food." Rename Item 2 rules for equipment and item 3 rules for Wood to make it easier to track what each rule does in your custom setup.
Set the price of each item in the Success and Fail rules so it will check if you have enough and send a message if you don't, and use the same value in the "operand 2" value of the Pay rules to match and subtract an item's cost from your Money. Based on the number of treasures your game has, set food to cost 1, equipment to cost 4, and wood to cost 2, for example.
The messages sent by each rule matches the rest of the logic in the activity, but you can use custom messages to keep track of things more easily.
Finally, add a text variable and rule to inform players when they don't have enough money:
Variable Type: Text
Apply variable: Local Name: Purchase Status Value: You don't have enough money
Rule: Banner Type: Game Screen
Required Message:
ShopPurchaseFailed
Duration: Fixed value of 5 (seconds)
Variable: Purchase Status
Name: Purchase Status
Test
If you destroyed some artifacts and collected treasure, you have money to spend with the merchant. You can set custom costs for each item in the Rules System and spawn any type of item you like or add resources for gameplay using variables.
Try opening your inventory to wear the equipment you purchased or consuming the food item that triggers a speed Power Up. The purpose of the items you buy are completely up to you.
Follow Up
The Game Rules System is a powerful visual scripting tool running behind the scenes to manage information and gameplay.
Other rule presets make it easy to track points, add time trials, set poison or hunger for players, and more. It's also possible to build a complex resource management system where messages with arguments trigger amounts of resources to be traded or purchased.
With rules, you can even define what variables are for all players and which ones will be tracked differently for each player. We'll explore that in the next activity.
More Information about Game Rules
🔹Game RulesRule Types8. 👥 Design Logic for Multiplayer Games
This is a ADVANCED difficulty activity to learn about setting up logic layers for multiplayer games, which combines logic individual players experience and synchronized logic all players experience.
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
Some behaviours/components only have a [MP] type to prevent conflicts with collisions, movement, etc.
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).
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.
Gameplay | When to use SP | When to use MP |
---|---|---|
Speaker component |
|
|
Dialogue (Asker behaviour) |
|
|
Collectables (includes consumables & equipment) |
|
|
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 |
|
|
Logic that controls movement, collisions, spawning/ destroying, etc. |
|
|
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.
Game Maker 0.11 will rename the local variable type to "player" and introduce a new "team" 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
A Team variable in Game Maker 0.11 will make it possible to track scores, times, etc. by teams assigned in the Spawn Point.
Resetting & Instances
Instances are different play sessions of an Experience. A new instance opens when a maximum number of players join one. An instance closes after a period of inactivity.
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.
Experiences must be marked as multiplayer to allow multiple players to enter.
Test Your Multiplayer Experience
Game Maker is great for rapid testing of singleplayer games, but will not allow multiple players to enter for testing a multiplayer game.
You can either generate a test link to open it in the Game Client or share to the public Gallery for testing and feedback.
MULTIPLAYER EXPERIENCE TESTING
Share to the Gallery
Shared Experiences are public and can be removed from the gallery when needed. They can be entered into Game Jams and used for playtesting with friends. You can also create a free Experience Page to tell players about a shared experience, but keep in mind they can not be linked to from the page or monetized.
Practice: Share your practice Experience to the Gallery (don't forget to mark it as multiplayer) and test the logic you created with a friend. Remove it from the Gallery when you're done.
Publish to the Map
You must own LAND (NFT) to publish your Experience to The Sandbox map and monetize. See our documentation to Publish Experiences.
Our Experience Manager can help you draw in players from the map, create a free Experience Page linked to your Experience, and track player analytics.
Practice: Visit The Sandbox Map to find featured UGC (User Generated Content) Experiences published by our community of creators. Explore their Experience Pages and games to see how you can publish your own.
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.
Resources
♦️Build Singleplayer & Multiplayer LogicLearn how experts at The Sandbox create a game from concept to launch with our Game Production Guide. It provides actionable steps to build a high quality singleplayer or multiplayer Experience with helpful supportive resources.
🎬Game Production GuideResources
🟦Learn Creator BasicsFind comprehensive details on Game Maker
Boost performance with best practices
Add game polish with useful logic schemas
See recommendations by Experience type
Learn how to compete to win SAND
Community
Livestreams
Follow along and ask questions during our Livestreams, available on Twitch. Subscribe to receive notifications for when we go live!
Discord
Ask for help (English) in the Game Maker Community Channel
File a ticket for a technical issue in the Game Maker Support Channel
Find channels in other languages
How to join and claim roles
Basics to navigate Discord
Resources to stay safe on Discord and report issues
Last updated