For the complete documentation index, see llms.txt. This page is also available as Markdown.

Behaviours

A behaviour is a logic bundle that controls an object's actions so you can quickly build custom gameplay with no code.

Plant, Button, Light, Visual FX behaviours switched to be components in Game Maker 0.10 for more interactive use cases.

What is a Behaviour?

Each object may have ONE behaviour

A behaviour is a bundle of logic that applies action characteristics and identity tags to an object. This controls how it will function in your Experience and how it will be detected by other objects.

OBJECT LOGIC

Behaviours relate to object or Experience actions. An object may have only ONE.

Components relate to player actions. An object may have one of each type.

Behaviours allow you to quickly build dynamic interactions between objects, with many parameters that can be customised to create unique gameplay. No coding experience is needed!

Examples:

Healer chases and heals an object with a specific tag that needs health.

Melee Enemy chases and attacks a specific tag.

Predator chases and attacks Prey as food, which flees Predator and seeks Plant as food.

A Button can be set up to open a Door when players interact with it.

Timed Events can trigger Weather Switcher to change the time of day, sky colours, clouds, stars, etc. in a preset cycle or based on player actions.

General Uses for Behaviour Types

The behaviour groupings below are how they're often used. However, Farmer behaviour simply allows an object to randomly remove other objects in its path from the game. Think outside the box based on what behaviours can do, and you'll dream up amazing custom interactive play in no time!

No behaviour applied: The object can be a prop or be interactive if Components are applied.

NPCs

An NPC is usually a person, creature, etc. When this type of behaviour is applied to an object, properties are included to create interactive potential:

  • 🏷️ identity tags, which allow other objects to detect it

  • 🎯 tags to detect on nearby objects and respond to (flee, attack, heal, food, or gather)

Modify object tags and the tags their behaviours are set to detect for custom interactions.

Behaviours

Citizen: Passive walking object, flees Hostile tag by default.

Farmer: Passive walking object, harvests Plant tag and flees Hostile tag by default.

Melee Enemy: Chases and attacks Avatar tag by default. Has Hostile tag by default.

Healer: Restores health. By default it flees Hostile and seeks Friendly and Avatar tags.

Plant: Prey and Farmer seek its default Plant tag. No death visual effects when "killed."

Predator: Chases and attacks Prey and Avatar tags and has Hostile tag by default.

Prey: Passive walking object that seeks Plant tag and flees Hostile tag by default.

Soldier: Passive walking object that attacks when it is attacked or detects a Hostile tag.

CUSTOM INTERACTIONS

Examples:

⚔️Create barbarians to attack Soldiers. Apply Melee Enemy behaviour with Tags to Attack set as Soldier. Apply Soldier behaviour to objects (includes Soldier tag).

🗑️ Create volunteers to remove garbage. Apply Farmer behaviour with Gathering Tags set as Trash. Apply Plant behaviour to various objects, adding the Tag Trash.

Experience Management

Animated Decoration: Plays specified animations, each followed by a message.

Actor Property Switcher: Change physics of objects in range during play.

Message Broadcaster: Precisely control how to send a message, can repeat forever.

Timed Events: Sends messages after parent and sub-event timers; linear logic, loops.

Player Engagement

Asker: Pop up box posing a question with 4 answer options that each send a message.

Button: Sends a message upon interaction.

Crowd Event: Emotes or messages reach a collaborative goal; success or fail messages.

Experience Ambience/Feel

Post Process Effects: Visual modifier for the camera with various effects to customise.

Weather Switcher: Changes environmental ambience (sun, stars, clouds, etc).

Add or Destroy Blocks, Assets & Avatars

Asset Spawner: Spawns a specified asset (can offset).

Replace Asset: Switch an asset to a different asset.

Multi: Spawns a specified block in a defined space (3x3 or larger) around the object.

Void: Destroys specified blocks, assets, or avatars within a defined space.

Motion-Based

Bird: Flies clockwise in a circle. Randomise movement with height and width ranges.

Basic Platform: Moves back and forth in any direction, can face the direction of motion.

Door: Plays door animations, allows entry; rotates 90 degrees and back at its pivot point.

Add a Behavior to an Object

One behaviour may be applied to an object to control its actions. Many Components can be applied to an object to make it more interactive.

  1. Left click to select an object. This will open the Properties Panel on the right side of the screen.

Click any object to open the Properties Panel.
  1. Beneath Attributes, click on the Behaviour field where it says NONE or displays the currently applied behaviour.

Behaviour details are located in the Properties Panel under Attributes.
  1. A window named Select Behaviour will pop up with available options. In this example, we’ll choose the Soldier behaviour. The Select Behaviour window will close, and the chosen behaviour will now appear in the Properties Panel along with its default settings.

The behaviour you select is added to object in the Properties Panel.

In our Soldier behaviour example, default logic is automatically added, including:

  • the Patrol Zone of the entity

  • the Walk Speed, Run Speed, Attack Damage and Attack Speed

  • Tags to Attack is set as Hostile

  • a Health Component which allows the soldier to receive damage if attacked

  • tags so other objects with can detect it with their behaviours

Edit the object's behaviour, components, and tags in the Properties Panel
  1. Click the Edit Logic button to see the full Behaviour & Component Parameters for any behaviour and components applied to the object. Here you can see how the object will work in your Experience and customise parameters such as Walk Speed, Tags to Attack, Message sent on death, etc. You can also scroll to the bottom of the object's properties and change its identity tags so it will be detected specific to your game's mechanics. Test your logic frequently by presssing the TAB key to toggle on and off Play mode.

Click Edit Logic to inspect and customise the object's behaviour and components

If you need to go back to the default view of the Properties Panel, click the X next to Logic at the top. Your settings will not be lost.

Click the X at the top left to go back to the default Properties Panel view

Type
Behaviour
Performance
Max Amt
Perf in Scope

Movement

Bird

Medium

61

Movement

Door

Movement

Advanced Platform

Movement

Projectile

Movement

Basic Platform

Last updated

Was this helpful?