Your thoughts: Steve Rabin's Macro style FSM for AI
quote: Original post by ares32585
If I''m not mistaken, in AI Programming Wisdom, Steve Rabin lays out the system in greater detail than in Game Programming Gems.
You are correct. And I love it! I am using it in my current project on most all of my classes. I didn''t use the messaging system because it was overkill for the type of game that I have, but the FSM language makes constructing, reading, and maintaining the states a real simple task! I had the chance to tell him in person when we were at the Microsoft party at the GDC. Ask Ferretman or Geta for the amusing details.
Dave Mark - President and Lead Designer
Intrinsic Algorithm - "Reducing the world to mathematical equations!"
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!"
Do you use the version that is wrapped within a class structure?
If so, and you say most of your game objects include steve''s fsm design, so you allow multiple objects to use the same instance of a FSM, or must each object construct a new fsm for itself?
Also, seemed like his FSM was heavily coupled with the messaging. How did you change it to your needs?
- John
As for the messaging, just use the chapter BEFORE he introduces the messaging. Grab the class off the CD and just build from there.
Dave Mark - President and Lead Designer
Intrinsic Algorithm - "Reducing the world to mathematical equations!"
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!"
First, any programming design that has preprocessor macros as its fundamental level will undoubtedly generate newer, more complex and more bizarre macros as the complexity (and bizarrity) of what you want to do with them increases.
Second, that scripting system you allude to on the To Do List... you do realize that by generating your AI code via the preprocessor, the logic is frozen at compile time. The best you could hope for on-the-fly scripting is to recompile your newly edited AI state "scripts" and re-load them as a DLL, and even that would be heinous.
Personally, I''m not to this point in development yet, but I have written a nice parameter loading system (a la scott bilas) in lex & yacc that takes a script which defines an Object and generates the code for all its designer-specifiable properties and how to load it at run-time. I''d been planning on coming up with a system very similar to Rabin''s for doing NPC logic, except using lex and yacc instead of the preprocessor.
That way, I feel lex & yacc can much better handle an increased complexity in state machine grammar than the C-preproccesor, and I''ll be able to see what code the compiler ''sees'' as I''m stepping through during debugging.
But seriously, that''s good news that you''re happy with it! Please let us know the pros and cons as your project matures.
adam