Advertisement

AI Game Engine Programming, FSM

Started by April 19, 2011 10:09 PM
2 comments, last by IADaveMark 13 years, 7 months ago
Hi,

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
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.

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!"

Advertisement
Okay. That makes total sense. (Almost a 'DUH' moment). Thanks. By the way, I am reading your book, "Behavioral Mathematics for Game AI", and I am really getting a lot out of it. So far, I have really enjoyed it.


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.
Thank you for the compliment. (When you're done, please go put a review on Amazon so other people can better judge!)

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!"

This topic is closed to new replies.

Advertisement