Finite state machine
Also called: FSM, state machine
Related terms: state, transition, behavior tree, animation state machine
A set of named states and rules for moving between them. A simple enemy can be in patrol, chase or attack. Exactly one state is active in a basic FSM; transitions happen when their conditions are met.
Each state can have entry, update and exit behavior. FSMs also suit doors, menus and character abilities. As transitions multiply, hierarchical states or a behavior tree can make the logic easier to manage.
- Further reading
- Robert Nystrom: State, Game Programming Patterns