We are building a couple of Defend The Dome games in flash for the Atlanta Falcons and Ford, one is driving game where you get to drive an F150 from Flowery Branch to the GA down avoiding ladders, sofas and the things you see on i285, and you can get power ups, avoid cars, and take shortcuts if you get qualifying power ups. In that game I had a command that managed the "state" and managed the changes in state, but it was quite a bit of work and often felt a bit "hacky" where the command was really deciding things that mediators should decide for views.
For the 2nd game we are doing a sacking game, where you get to be John Abraham. This game is more like "dragons lair" where you watch video and then at strategic points you interact by entering a key sequence, or pounding your keyboard in a power meter. We have 4 progressively harder downs and lots of video cut scenes. For this I'm using the pureMVC Finite State Machine.
At first I wasn't sure it was going to help much, but after studying the stopwatch demo, and then using the FSM visualizer ( its very buggy, don't rely on it), I got a good picture of how complex the application was and how many states I'm going to need to manage. I think the FSM has easily saved me a ton of time and complexity due to it managing the state and dispatching notifications when the states change.
Here is a rough capture of the my state machine for the sacking game from the FSM visualizer, sorry its not "great" but the print function in the visualizer doesn't work and it also doesn't allow scaling or zoom of the image.
Once I'm done I'll also publish the XML so people can see what a not trivial FSM looks like in pureMVC.
Hey, just to point out that the FSM visualizer is still in a pre alpha state, so yes, its still buggy. I put it out there more as an aid for getting feedback to what people would find useful than as an actual finished app, so please don't use it on a project :~/
Unfortunately I haven't had much time to work on it lately, what with having to bring home the bacon, but hopefully before the year is out there'll be a proper release.
cheers
Posted by: neil manuell | August 26, 2009 at 05:35 PM
Hi Neil, hope I wasn't sounding ungrateful, its an awesome tool its just so buggy right now its not really usable for anything with more than a couple of states and my FMS has 27 since its a game :) I love the tool just wish I had time to help fix it :)
Posted by: Grant Davies | August 26, 2009 at 05:38 PM
Also, you may want to watch the StateMachine overview presentation on http://puremvc.tv. The StopWatch demo doesn't show off the latest features, which are explained in the preso.
-=Cliff>
Posted by: Cliff Hall | August 27, 2009 at 10:37 AM
Thanks cliff, I have actually watched those a few times, and it was a big help. The FSM is working fantastic for me, I have 2 modules and a shell and didn't use it for the shell or 1st module, and now the 2nd module is super easy compared, I'll be using the FSM on many projects from here.
Posted by: Grant Davies | August 27, 2009 at 10:40 AM
I did have some questions on conventions that I posted here :
http://forums.puremvc.org/index.php?topic=1413.0
Posted by: Grant Davies | August 27, 2009 at 10:42 AM
hey grant,
as you've been working with the state machine util, I
thought this might interest you:
http://revisual.co.uk/?p=665
and I would certainly be interested in your comments.
cheers :)
Posted by: neil manuell | October 02, 2009 at 03:56 PM
this looks awesome Neil, I'm actually in the requirements phase of a product configurator we'll be building in flex and planned on using the FSM again, I hope Dom
Posted by: Grant Davies | October 02, 2009 at 06:37 PM