Ultrashock Forums > Lounge > Showcase And Critique
FenoFSM - Finite State Machine Framework

You are currently viewing our website as a guest which gives you limited access to forums, files and other resources.

Click here to join now for free, and start interacting with our members, download files and much more!

Click here if you are looking for our Flash files and other professional assets.
 
Post Reply | View first unread Search this Thread | Thread Tools | Display Modes

#1
Bookmark and Share!
FenoFSM - Finite State Machine Framework
Old 2009-06-25

 
There are no ratings to display
 



Project homepage


I've created an ActionScript 3.0 finite state machine framework, FenoFSM.
FenoFSM supports XML, so you can define a machine's structure using XML.

It's event-based, which means entering/leaving states and transitions dispatches events;
you can work with FenoFSM just as you are working with standard EventDispatchers.

Here are tutorials on basic usage and XML:
Getting Started
Using XML

And here's the documentation.

I've also created a couple of examples.
(source files available at the download list)

Multistate Button


State Chart

http://code.google.com/p/fenofsm
postbit arrow 3 comments | 263 views postbit arrow Reply: with Quote   
Registered User
cjcat2266 is offline
seperator
Posts: 6
2009-02-07
cjcat2266 lives in Taiwan, Province of China
seperator

Ultrashock Member Comments:
Codemonkey's Avatar Codemonkey Codemonkey is offline Super Moderator Codemonkey lives in Netherlands 2009-06-26 #2 Old  
It looks great, but you might wanna start out for explaining what it's good for

I understand state machines, just not what I might use one for (in a framework as such). I suspect they might be useful in a pathfinding algorithm or something...

[edit]
Actually, this is looking very good indeed. I'm thinking defining a statemachine to define from which positions a game character is allowed to do what actions (resulting in new positions).

Also, I see you've used FlashDevelop (), although I wouldn't have included the project files in the repository (personal preference).
Reply With Quote  
cjcat2266 cjcat2266 is offline cjcat2266 lives in Taiwan, Province of China 2009-06-29 #3 Old  
Oh, I forgot to tell what the framework can be used for. Sorry about that

You can use the state machine to control an entire system's flow.

Take a Flash website for example. Different states can represent different scenes, and state transitions represent the transitions among scenes. You can listener for the State.ENTER event to set up the entering transition of a scene and State.EXIT for exiting transition. A state transition's delay can be set to be infinite. When the Transition.INIT event is dispatched, the system can load/prepare for the upcoming scene; after the preparation is done, you can call the Transition.go() method to continue the transition, making the system enter a new scene.

Also, the same can be applied to a game system. States can represent different scenes like main menu, game character selection, actual gameplay, pause menu, etc.

And as you said, this framework can be used on game characters. Say your character enters attack mode from idle mode when the player inputs the attack command through keyboard, you can create two states representing the attack and idle modes and one transition in-between, which is triggered by the "attack input".

I hope this helps you get the idea
Reply With Quote  
Codemonkey's Avatar Codemonkey Codemonkey is offline Super Moderator Codemonkey lives in Netherlands 2009-06-29 #4 Old  
Yeah, I actually love this stuff. It's perfect for handling complex state handling (like game characters, just think of the combinations in Mortal Combat et al.) It's a graceful solution for that kind of stuff. I used to go about that using multiple dimensional arrays or something.
Reply With Quote  
Showcase Tools
Display Modes