Hi everybody !
I’m currently creating a little game with the fantastic @pspeed’s Zay-ES framework. I’ve an interrogation about the implementation of an AI.
I plan to use a basic finite state machine, and I have two options : Create one component for each state, or create one componant storing the current stack of states.
First solution lead to massive attaching/detaching of components on entities. I’ve been told it could cause performance issues.
Second solution is less elegant because it demands to have a parallel and redundant componant/processor mechanism dedicated to the finite state machine.
A third solution could be to let all states attached and add sort of an “active” flag… seems heavy.
Note that in both ways, I imagine states as pure data objects.
Do you have opinions? or exemple of implementation to present me?
Thanks a lot in advance