anyone ever used finite state machine?

Started by Stefan Z, Mon 17/04/2006 23:58:50

Previous topic - Next topic

Stefan Z

Hey,

I was thinking about doing a detective story where there are 7 characters you can talk to and most of the game depends on how you talk to people - whether you're nice, abusive etc. Kinda like Laura Bow - Colonel's Bequest.

After looking into the Finite State Machine module my first response was 'This module seems nonsense - I can do everything this module does by using variables'.
Not being a real programmer, i wonder if I overlooked something really helpfull about this module.

So my question is this: has anyone used this? Why? And what did you use it for?

Thanks in advance for any experiences shared,
Stefan

HeirOfNorton

Having coded the module (well, copied it from the old plugin, anyway), I feel I can answer this...

The main use of an FSM is to help map out complex series of states and transitions in a way that is easy to understand and code. In particular, you do not need to know the current state to change it. You can just send the FSM a signal (like BE MEAN) and it will change the state accordingly. If you only have a couple of different states, or if all of the actions always have the same response, then a FSM is probably overkill.

HoN

P.S. To the best of my knowledge, no has ever used the module or the plugin it was based on, not even me.

The Inquisitive Stranger

Er... I learned about finite state machines in one of my first-year computer science classes about two years ago. That's about it.
Actually, I HAVE worked on a couple of finished games. They just weren't made in AGS.

ildu

I used FSMs in modding during my four-year tenure at the Max Payne modding community. Other than that, I'm lost.

Helm

I think the Flying Spaghetti Monster is cute
WINTERKILL

SMF spam blocked by CleanTalk