Game State Awareness

Use multiple diagrams based on your game's state.

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.

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".

Last updated