Makinom - Game Toolkit for Unity
  • Features
  • Showcase
  • Guide
    • Documentation
    • Tutorials
    • Extensions
    • API
  • Makinom 1
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get Makinom

Guide

Getting Started

  • Introduction
  • First Steps
  • Game Starters
  • Components Overview
  • Upgrading a Makinom 1 Project

Editor

  • Makinom Editor Overview
  • Node Editor
  • Asset Sources
  • Editor Section
  • Base/Control Section
  • Game Section
  • UI Section
  • Templates Section

Features

  • Schematics
  • Dialogue Importer
  • Schematic Nodes
  • Formula Nodes
  • Languages
  • Input Keys
  • Audio and Music
  • Game States
  • Pooling
  • Saving Game Objects
  • Scene Objects
  • Save Games
  • Variables
  • Selected Data

Machines

  • Machine Components Overview
  • Animation Machine
  • Animation State Machine
  • Application Machine
  • Auto Machine
  • Collision Machine
  • Global Machine
  • Interaction Machine
  • Render Machine
  • Tagged Machine
  • Template Machine
  • Tick Machine
  • Trigger Machine

UI System

  • UI System Overview
  • UI Layers
  • UI Layouts
  • UI Boxes
  • HUDs
  • Flying Texts
  • Text Codes
  • Unity UI Module
  • HUDs: Content Providers
  • HUDs: Conditions
  • HUDs: Click Actions

Scripting

  • Scripting Overview
  • Code Extensions
  • Custom Save Data
  • Custom Component Save Data
  • Custom Nodes
  • Starting a Schematic

Advanced Topics

  • Build Troubleshooting
  • Performance Optimizations
  • Home
  • Guide
  • Documentation
  • Features
  • Game States

Game States

Table of Contents
  • Changing Game States
    • Auto Activate/Inactivate
      • Examples
    • Changing by other Game States
  • Game State Conditions
    • Checking Conditions
      • Schematics
      • Machines
      • HUDs
      • Example
    • Templates

Learn more about game states and what you can use them for.

Game states are an easy way to keep track of what’s currently happening in your game. A game state is either Active or Inactive, the game can have multiple active states at the same time.

Game states are mostly used as conditions for starting machines or displaying HUDs, and can be checked in schematics to decide the next nodes that will be executed.

Game states are set up in Game > Game States.

Changing Game States #

Game states can be changed by schematics (using a Change Game State node) or automatically through certain events or other game states being activated or inactivated.

Auto Activate/Inactivate #

A game state can be automatically activated or inactivated by the following events:

  • Start Game
    When the game is started (using a Start Game node).
  • Stop Game
    When the game is stopped (using a Stop Game node).
  • Pause Game
    When the game is paused (e.g. using a Pause Game node).
  • Unpause Game
    When the game is unpaused (e.g. using a Pause Game node).
  • Start Scene Change
    When starting a scene change (before fading out).
  • End Scene Change
    When ending a scene change (after fading in).
  • Start Blocking Machine
    When starting a Blocking execution type machine.
  • End Blocking Machine
    When ending a Blocking execution type machine.
  • Block Player Control
    When the player control is blocked (e.g. using a Block Player Control node).
  • Unblock Player Control
    When the player control is unblocked (e.g. using a Block Player Control node).
  • Block Camera Control
    When the camera control is blocked (e.g. using a Block Camera Control node).
  • Unblock Camera Control
    When the camera control is unblocked (e.g. using a Block Camera Control node).

The events can be added in the game state’s settings in the Makinom editor.

You can also create custom events by deriving your class from the BaseGameStateChangeType class. Check the classes for the available events for examples.

Examples #

The game state Game Running is auto activated by the event Start Game and auto inactivated by the event Stop Game.

While the player is playing the game (e.g. started through a main menu), the Game Running state will be active and can be used to display HUDs.

The game state In Control is auto activated by the event Unblock Player Control and auto inactivated by the event Block Player Control.

The machine handling player control (e.g. a tick machine) and all interaction machines will only start if the In Control state is active. The game can only be controlled while the player controls aren’t blocked.

Changing by other Game States #

You can add game states that will be changed when a game state is activated and inactivated in the game state’s settings in the Makinom editor.

Game State Conditions #

The current state of game states can be checked by Game State Conditions.

Checking Conditions #

Game state conditions can check multiple conditions. Either all or only one of the check conditions must be valid for the game state condition to be valid.

A single condition can check:

  • Game State
    Checks if a single game state is active or inactive.
  • Conditions
    Checks multiple game states, either all or only one of the game state checks must be valid.
    This can be used to create complex game state conditions.
  • Template
    Checks a game state condition template.

Schematics #

Schematics can check game state conditions using a Check Game State node. The next node that will be executed is determined by the conditions being valid or not.

Machines #

Machine components and global machines can use game state conditions to determine if the machine can start.

You can also check the start conditions of a machine in it’s running schematic using a Check Start Conditions node.

HUDs #

HUDs can use game state conditions to determine if they’ll be displayed.

Example #

A game state condition has 2 conditions, one of them must be valid:

  • Condition 1 (Game State)
    Checks if the single game state A is active.
  • Condition 2 (Conditions)
    Checks if the game states B and C are active (i.e. all checks must be valid).

Game states A and C are inactive, game state B is active – the whole condition is invalid.

Game state A is active – the whole condition is valid, game states B and C don’t matter.

Game state A is inactive, B and C are active – the whole condition is valid.

Templates #

Usually, you’ll keep checking the same game state conditions very often in a game. To prevent setting up a condition each time you need it, you can create a Game State Condition Template, that can be used by game state conditions.

You can create templates in Templates > Game State Condition Templates.

Share This Article :
  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
Updated on December 16, 2020
Table of Contents
  • Changing Game States
    • Auto Activate/Inactivate
      • Examples
    • Changing by other Game States
  • Game State Conditions
    • Checking Conditions
      • Schematics
      • Machines
      • HUDs
      • Example
    • Templates
Sitemap
  • Features
  • Showcase
  • Guide
    • Documentation
    • Tutorials
    • Extensions
    • API
  • Makinom 1 Hub
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get Makinom
  • Contact
  • Blog
  • ORK Framework
  • gamingislove.com
Categories
  • Makinom 1 (97)
    • Tutorial (97)
      • 2D Platformer (14)
      • 2D Roguelike (8)
      • Breakout (6)
      • How-to (34)
      • Match 3 (6)
      • Schematic (4)
      • Scripting (6)
      • Space Shooter (11)
      • Survival Shooter (8)
  • News (11)
  • Release (68)
Search

© 2015 Gaming is Love e.U.

Disclosure: This site may contain affiliate links, which means I may receive a commission if you click a link and purchase something that I have recommended. While clicking these links won’t cost you any money, they will help me fund my development projects while recommending great assets!