AI Game Engine Programming, FSM
I am reading AI Game Engine Programming by Brian Schwab. After reading chapter 15 on FSM, I am not sure how I would go about implementing the FSM for multiple agents. Mostly, does each agent need its own FSMMachine class? Should there be one FSMAIControl class or does each agent need there own? Can anyone suggests modifications to the structure of Mr. Schwab's code to implement it for multiple agents?
Thanks,
Doug
If the FSM class is storing the actual state that an agent is in, each agent would have to have their own. Otherwise, if one agent changed its state, they would all change right along with him. Stepping away from FSMs for the moment, if a class is only designed to help out by providing an answer to something (such as a pathfinding algorithm), then all agents can share it.
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play
"Reducing the world to mathematical equations!"
Without reaching up the 2' to pull my copy off from behind a row of GDC swag, I will give you a general way to think through this answer on your own:
If the FSM class is storing the actual state that an agent is in, each agent would have to have their own. Otherwise, if one agent changed its state, they would all change right along with him. Stepping away from FSMs for the moment, if a class is only designed to help out by providing an answer to something (such as a pathfinding algorithm), then all agents can share it.
BTW, here's a good one for you... Brian and I are good friends and just did a co-lecture on using randomness at the GDC AI Summit. So funny you should be working with both books at the same time. ;-)
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play
"Reducing the world to mathematical equations!"