Finite State Machine & Game Prog Gems
Hi
I''m trying to implement a Finite state machine using the example given in Game Programming Gems 1. Only problem is I get a syntax error regarding the STL
there is only one way
Did you use the "using namespace std;" ?
Else you''ll have to
typedef std::map< int, FSMstate*, less > State_Map;
You also need to
#include <map>
Hope this helps
Eric
Else you''ll have to
typedef std::map< int, FSMstate*, less > State_Map;
You also need to
#include <map>
Hope this helps
Eric
that probably should read
notice the space between the two > >
the less parameter specifies the criteria by which the elements in the map are to be sorted. std::map uses less by default so you could write the typedef as
don''t forget to
#include <map>
typedef std::map< int, FSMstate*, std::less<int> > State_Map;
notice the space between the two > >
the less
typedef std::map<int, FSMstate*> State_Map;
don''t forget to
#include <map>
My Website: ai-junkie.com | My Books: 'Programming Game AI by Example' & 'AI Techniques for Game Programming'
lol. Eric, you got there just before me...
My Website: ai-junkie.com | My Books: 'Programming Game AI by Example' & 'AI Techniques for Game Programming'
You may also want to look at Steve Rabin''s Finite State Machine Language that is in that book as well as "AI Wisdom". That''s slicker than... uh... graphite.
Dave Mark - President and Lead Designer
Intrinsic Algorithm - "Reducing the world to mathematical equations!"
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!"
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement