New in GM 0.9. GM 0.10: evolved math rule, new "Float" variable, share/reuse rulesets (copy/paste), new inputs & events, etc. GM 0.11: new "Team" variable, connectors, etc.
The Game Rules system empowers builders to:
Build new gameplays
Design more complex and compelling mechanics
Enhance the functionality of object logic (behaviours and components)
The Game Rules system defines, tracks, and relays an Experience's global mechanics.
DEFINE
Create Rulesets made of one or more Rules
A Rule carries out actions, which may use variables you define and values you enter
TRACK
Changes to variables caused by Rule actions are stored for reuse
Player variables(P) - track individual players
Global variables (G) - track all players
Team variables (T) - track teams (set in Spawn Point behavior)
RELAY
Rules are trigged by messages In and send messages Out to communicate with:
other rules
behaviours and components
(object logic)
quests (Objectives)
MULTIPLAYER GAMES
Use a combination of player variables (P),global variables (G), and team variables (T) depending on how you want Rulesets to be triggered, variables to be tracked, and information to be displayed in your game mechanics.
The Game Rules Window
1ī¸âŖBoards button - opens a menu to select a gridboard or add a new one to organize rulesets.
2ī¸âŖRules Guide button - links to this documentation in the Creator Portal.
3ī¸âŖRule Connectors toggle - see chains of logic with messages sent/received in a gridboard.
4ī¸âŖIsland Menu - contains Presets, Rules, and Variables to build mechanics
5ī¸âŖGridboard - a space to add rules from the Island Menu and organise them into Rulesets.
6ī¸âŖRules Hierarchy dropdown (applies to the selected gridboard):
view and duplicate rules
focus on (go to) a rule or ruleset
enable/disable debugging for one or more rules or rulesets
Controls
Click the magnify lenses (top right)
CTRL+WASD keys
CTRL+Z - Undo
CTRL+Y - Redo
CTRL + C
CTRL + V
Tip: Paste into a notepad to save/share (JSON format).
Pasting into an Experience generates included variables and messages.
Using Multiple Gridboards
Game Maker 0.11 introduces multiple gridboards to organize rulesets.
Add gridboard or category - Add button
Select a gridboard - double click its name
Rename/move - right click
Delete - trash icon (press CTRL+Z to undo)
deleting a gridboard removes all of its rules
deleting a category removes all of its gridboards and rules
Close Boards panel - click the X in the top right
Connectors and Rules Hierarchy are unique to the selected gridboard. Rules on different gridboards communicate.
Rules
Rules are a sequence of steps carried out from top to bottom that can be reused in your game.
They offer new possibilities, mechanics, and shortcuts to solve complex problems.
Game Rules will only receive a message from objects if the Broadcast Type is All or Rules.
To decrease a variable, use a negative number in the value change logic box.
Rule types currently include: Math, Time, Comparisons, Replace Variable Values, Game Screen, Triggers, and Events.
Click a rule type to expand the list of options. Click on a rule in the list to add it to a gridboard.
Logic boxes highlighted in red require more information to make the rule active.
A Rule's Logical Flow
Logic boxes break down Rules into simple steps executed from top to bottom:
Trigger
A rule is triggered by a message In.
If a message with arguments is received, the argument value may be used in a rule's action.
Variable(s)
A rule may use zero, one, or multiple stored values defined by name and type.
Action(s)
An action to carry out (e.g., change a variable, compare values, display on the HUD, etc).
Message to Stop the Rule
Some rules allow another message In to stop its actions.
Output
An optional message Out may trigger another rule, object logic, or quest.
A message with arguments may be sent for more complex logic or fewer rules.
EXAMPLE
Timer Rule
Player Perspective
Enter an area. A timer appears as a door opens, indicating limited time to enter.
Re-enter the area to start a timer again.
Logic Flow of the Timer Rule
Trigger - When the player enters an area and is detected, a message is sent to the Rule.
Variable - A time variable will be used to store the timer.
Actions - The timer is displayed and starts to count down.
Output - When the timer reaches 0, a message is sent to close the door.
The timer can be reused if triggered.
Trigger a Rule
A rule is triggered by a message received. This can be done in many ways. Here are just a few ideas (see more):
Use Timed Events to send a message in a sequence a sequence of events
Use an outgoing message sent from a rule to trigger a different rule
More Rule Info
Visit Rule Types for the same information in our documentation.
Right click a Rule and use đŧđŊ arrows to view details about each logic box.
Variables
What Are Variables?
Variables are the backbone of the Game Rules system. Almost every rule can or must work in combination with a variable.
They can be used to store information to build more complex logical systems and provide important information to players.
Create or Repurpose
Variables are automatically created when you use a Preset in Game Rules (more information below) or if you paste a ruleset into a gridboard. You can also create any type of variable you want and change the variable used in a rule.
A variable can be renamed and its value can be changed, but it can not be modified to a different type or be applied differently.
Create the type of variable needed and how it will be applied, replace the old variable in a rule, and delete the old variable.
Variable Types
Currently the following types of variables are available:
Whole numbers for counting resources, scores, etc.
Non-whole numbers for more precise calculations (currency, using division, etc).
Display short text in banners or HUD slots (status, location, player name/level, etc).
Timers and stopwatches that can be stopped, paused, and resumed.
Set a state to manage logic, with potential to createif/else structures.
How Variables are Applied
Local variables have been renamed to Player variables in GM 0.11.
A variable can be applied three ways: global, player, or team.
Global (G)
Synchronised values for all players
Example:
All players earn a resource anyone can use.
Player (P)
Store each player's values based on their individual actions
Example:
Each player earns different resources to use their own way.
Team (T)
Stores values based on the actions of members of each team
Example:
Team members work together to earn a resource to gain a competitive edge over other teams.
Player & Team Variable Data
Direct player interaction is required to trigger changes to a player or team variable.
Player Source
To modify a variable for the correct player or team during play, a direct interaction from a player must trigger a message to be sent to the rule. This automatically includes player source data with the message.
Behaviours, components, and the Send Message rule can broadcast a message to a specific team.
Variables Window
The Variables window lists all variables in the Experience. Each will have a tag of either G, P, or T to show whether they are global, player, or team variables.
In this area new variables can be added and existing ones can be removed or edited. The list shows the variables' names, whether they are global, player, or team variables, and type (number, decimal number, time, true/false and text).
Rulesets
Rulesets are a way to visually organise a group of rules used for the same game mechanic.
How Rules Act in a Ruleset
Rules may be grouped into a Ruleset, but they still act independently when triggered:
The order in which rules are placed in a ruleset does not change the flow of logic.
A rule's message Out may trigger another rule in the same ruleset or in a different one.
Some rules may not send a message Out.
a rule may trigger another rule in a different gridboard.
Example
The Collect Points ruleset (a Preset) is a gameplay mechanic that includes a chain of two rules (shown in red below) and other rules that act independently of the others.
Managing Rules and Rulesets
Add a Rule
- to a new ruleset
Click on a rule in the Rules list
-to an existing ruleset
Select a ruleset to add it to, then click on a rule in the Rules list
Select a ruleset to reveal a small menu of buttons (top center)
Move a rule to a ruleset
Drag a rule from the gridboard or another ruleset into the desired ruleset with the â ŋ grabber at the top right of a rule
Move a Ruleset to a Different Gridboard
Use CTRL+C to copy a ruleset and CTRL+V to paste a ruleset into a different gridboard. Then delete the ruleset from the old gridboard.
Presets
Presets are pre-built rulesets you add to a gridboard with a single click. This is a fast way to set up commonly used game mechanics and customise as needed.
When adding a Preset, all necessary variables and messages are automatically generated.
Add then Integrate
Presets are accessed with a button in the Island Menu on the left. Click on a Preset in the list to add it to a selected gridboard.
Customise messages sent/received, variables used, rule names, and more as needed.
Integrate the Preset to communicate with your object logic (behaviours and components) to activate the Preset's mechanics in your Experience.
Integrate a Preset with Your Experience
Check Variables Included
Review variables created with your Preset to make sure they are player (P) for individual players, global (G) for all players, or team (T) for teams, depending on how you want them to apply.
Set up Messages to Trigger the Rules Included
Modify messages sent by objects or messages required in the preset's rules to ensure they will communicate as expected.
There are multiple ways to send a message. Here are just a few ideas (see more):
Collect, destroy, spawn, or interact with objects
Use a Message Broadcaster to send messages repeatedly with a delay between
Use Timed Events to send a message in a sequence a sequence of events
Use an outgoing message in another Rule to trigger a different one
Make sure a message is being sent to rules through direct player interaction for player or team variables to be affected correctly with player source data.