Creating the many levels of a state machine
A state machine allows us to separate behavior based on the idea of a state – a simple concept, but it has wide-reaching applications from animation state machines to AI logic and contextual player actions.
The simplest of state machines feature two elements: states and transitions. A state machine, at any moment, will either be in a single state or transitioning between two different states, which is why they are a significant part of animation systems, where blending improves the visual quality and feel of characters when receiving input from the player. Let’s look at this in more detail:
- A state defines a specific output and/or value of variables. In an animation state machine, the state defines which animation asset should be playing.
- A transition contains the logic that defines when a state machine can transition between two states. Transitions can be adjusted to control the duration as well as utilize curves...