Communicating behavior with state diagrams
State diagrams are helpful when you want to communicate how specific parts of your system transition from one status to another. This can be helpful in modeling complex concepts such as the life cycle of a support ticket at your organization. I’ve also found state diagrams very helpful in defining how AI systems function because state diagrams pair well with the traditional AI concept of Finite State Machines (FSMs), which seek to define systems in terms of states and transitions to and from those states.
FSMs are particularly popular in game development, so let’s illustrate this with an example from my own experience.
A few years ago, I built a small game prototype with a more complicated “boss” monster at the end of the level. This monster would wait for the player to enter the room, then descend, roar, and begin attacking the player.
If the player hurt the boss enough, it would retreat. Additionally...