Looking for a FSM tutorial

Started by
7 comments, last by rtw1701 19 years, 3 months ago
Hi I have been reading a lot about finite state machines and decided to implement a simple one in C++. I stared at my drawings of state diagrams and transitions and tough there must bee an efficient way to write this code, but I can’t figure it out. So please help, is there some helpful tutorials out there?
Advertisement
Either a State pattern (for preprogrammed state machines) or an adjacency list where each element is annotated with the element of the alphabet the FSM accepts that follows the annotated edge (for arbitrary state machines).
---New infokeeps brain running;must gas up!
Have a look at Algorithmic Forays in the article section.
Found one!
http://www.ai-junkie.com/architecture/state_driven/tut_state1.html
Don't if it’s any good, but I will take a look at it.
Magnus242,
I found it very good for the stucture to follow with an FSM. The book, IMO, is excellent as well.
Quote:Original post by tonyg
Magnus242,
I found it very good for the stucture to follow with an FSM. The book, IMO, is excellent as well.


I'll second that, the book is great!
________________________________pro.gram.mer - an organism that turns caffeine into code
Thanks for your replies!
I will try to use the structure from that tutorial.
Seems like a good start for my AI.
Funny this came up...

I was currently thinking about writing a little FSM tutorial myself. I have a gui that lets you create fsms very quickly, not too much set up. They use extensive use of function pointers and whatnot, but you never have to set them up if you use the tool. If there is an intrest I could post the tool with some example files, and if there is a stronger intrest I could go ahead and do the tutorial. I think it's a good state machine overall.

I'd be interested in a FSM tool/article. I've just done a simple FSM for controlling my program, but will want more complex FSM for the AI of the space ships in my game.

This topic is closed to new replies.

Advertisement