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.

Last updated