The following is a list of patterns that are related or alternatives to the State pattern:
- Blackboard/Behavior Trees: If you are planning to implement complex AI behaviors for NPC characters, I would recommend considering patterns such as the Blackboard or concepts such as Behavior Trees (BT). For example, if you need to implement AI with dynamic decision-making behaviors, then BT is a more appropriate approach because it permits you to implement behavior using a tree of actions.
- FSM: A question that often arises when discussing the State pattern is the core difference between an FSM and the State pattern. The quick answer is that the State pattern is concerned with encapsulating an object's state-dependent behaviors. However, FSM is more deeply involved with transitioning between finite states based on specific input triggers. And so, FSM is often considered more suited for the implementation of automaton-like systems.
- Memento...