Machinations Documentation
  • What is Machinations?
  • ☉Getting Started
    • Explore
    • Interface
    • Framework Basics
    • How-To Videos
  • ▷ Simulations
    • Run Modes
    • Charts
  • ⦽ Basic Nodes
    • Pools
    • Sources
    • Drains
  • ⇢ Connections
    • Resource Connections
    • State Connections
      • Label Modifiers
      • Node Modifiers
      • Triggers
      • Activators
    • Labels
  • ⧰ Advanced Nodes
  • Converters & Traders
  • Gates
    • Sorting Gates
    • Trigger Gates
    • Mixed Gates
  • Registers
    • Math.js Functions
  • Delays & Queues
  • End Conditions
  • Artificial Player
  • ✑ Nodes Properties
    • Activation Modes
    • Pulling & Pushing Resources
    • Filter (Colour Coding)
  • ⚯ Collaboration
    • Live Collaborative Editing
    • Public Diagrams
    • Google Sheets
    • Tags
  • ♔ Accounts
    • User Profile
    • Pricing
    • Billing Policy
    • Team Management
  • ☆ Tips
    • Shortcuts
    • Best Practices
  • ⚙️Unity Plugin (UP) & API
    • Game Engine Plugin
    • Quick Start
    • Main Concepts
    • Real-Time Sync
    • Unity Integration Guide
    • Known Issues
    • Key Features
      • Game-Aware Analytics
      • Local Cache
      • Game State Awareness
      • Data Formats & Handoff
  • ≏ Evolution
    • Changelog
    • Framework Diff Log
  • 〄 Localisations
  • 🇷🇺 RU by Lev "evlko" Kobelev
Powered by GitBook
On this page
  1. Unity Plugin (UP) & API
  2. Key Features

Game State Awareness

Use multiple diagrams based on your game's state.

This feature is under heavy development and is considered unstable. We expect to have a working example set up in the coming weeks.

In the vast majority of game projects, you will have multiple diagrams describing your mechanics.

With our Game Engine Plugin, you can use multiple Machinations diagrams within the same game, and get values from them based on Game State.

Example: a game in which the Player fights Ghouls

During day-time, Ghouls do normal damage against the Player, while during twilight & night-time, they do higher damage.

With Game State Awareness, your game will be able to take Ghouls' Damage (as well as any other mechanics) from 2 different diagrams: one defined for day-time mechanics, one for night-time.

The only thing your game needs to do is to notify our Game Engine Plugin about Game State changes via the OnGameStateChanged method of the IGameLifecycleSubscriber interface.

Here's a code snippet showing a section of a Machinations Game Object's manifest, which shows how to set up this feature.

StatesAssociationsPerPropertyName = new Dictionary<string, List<StatesAssociation>>
{
  {
    M_DAMAGE, new List<StatesAssociation>
    {new StatesAssociation("LowDamage", new List<GameStates>() {GameStates.Daytime})}
  },
  {
    M_DAMAGE, new List<StatesAssociation>
    {new StatesAssociation("HighDamage", new List<GameStates>() {GameStates.Twilight, GameStates.Nighttime})}
  }
}

In the above snippet, the "Damage" of a creature will be taken from 2 different Diagrams. One Diagram will be connected to the "LowDamage" StatesAssociation while another to "HighDamage".

This feature is close to being finalized, with full architectural support already completed. We will focus on this as soon as we're done launching our UP Unity Pilot through the Machinations Early Adopter Program.

PreviousLocal CacheNextData Formats & Handoff

Last updated 4 years ago

⚙️