I've been trying to make my own HFSM as a tool to organize my playercontrollers and any future enemy ai systems. I'm having trouble figuring out how I should manage my state entry/exiting, and when and where I should have/reuse instances of states.
My current code wipes the current state (exits it) and enters anew whatever new state is provided, even if its the same as the previous state. However I dont really know how to preserve states or if I even should, and how I would reenter a current state if I wanted to seperately from entering a different child.
A lot of this trouble is arising from the fact that for parent states, I by default enter their default children unless a path is otherwise defined. However, in order to follow this path down, I exit all children at every step so children get frequently reentered
My ChangeState method is also a bit confusing because I cant comfortably reconsile it with my ChangeDeepState method
Im sorry if Im a bit all over the place, Im sort of asking for structure advice and code review simultaneously because honestly Im a bit lost as to how I should be thinking about and implementing this...