Posted Today, 09:33 PM
State machines, including nested state machines, are an incredibly powerful tool both inside computer science generally and inside games specifically.
While you can use scenes to implement some of those things, and tools like Unity do this, there is also nothing inherently wrong with using state machines to track and flow through the system. It is not "a bad method". It is one method of many.
State machines are the correct tool to use when you flow through states. That is what they are for, that is what they do. If that is what you need part of your game to do, then it is the right tool for the job. When you need to flow from state to state to state, using transition rules along the way, you use a state machine.
For the example of having multiple pieces open at once, that is composition rather than state. Each component is engaged in states. The console is using states to indicate its drawing mode and display status. The option windows are a hierarchy defined by state and state machines. The title screen and menus are a state machine defined by state and state machines. Most of the AI in TF2 is powered by state machines. Most game objects and spawners and other parts are run by state machines.
You don't need to use state machines for everything, and there may be other tools available for various tasks, but still embrace the fact that state machines are found practically everywhere in computer programming, including concepts like the lowly switch statement and if/else trees.