Or how I managed to stop worrying and reconcile two creative disciplines – coding and performing…
One of my favourite performance exercises is called Yippee. It is very simple with a myriad of ways to subvert it and take the class in different directions. It encapsulates pretty much every performance skill needed, and is a good indicator of a group’s competency and complicity. Because of all these things I often use it to start a workshop.
My last talk at Flash Brighton was (for me) a discussion about how other people used state machines in as3, basically because I was dissatisfied with the limited way that I was using mine.
It turned out they used theirs in pretty much the same way. As a backbone for simple staged processes such as bootstrapping, asset acquisition and shutdown.
And that was it.
I was a bit frustrated, my original intent for using a state machine was to completely model my controller, so I would have a map of processes through out the entire application. But I kept on hitting the same problems preventing me from doing this.
Coming out of the talk, I decided that I would set myself a challenge: to change the way I used my state machine, and map all my commands through it.
I succeeded (eventually).
In this session I shall highlight the problems involved and the very simple changes of perspective it took to overcome them.
Finally I’ve done what I should have done ages ago, instead of writing layers (and layers) of abstraction over the pureMVC statemachine utility, I have just rewritten it.
The over heads of the Domino code was ridiculous, and besides there are other frameworks out there, Robotlegs in particular.
So what I have done is to free it from any:
- framework dependencies,
- comms bus dependencies (events, signals, notifications),
- and data dependencies (for declaring the FSM).
The source is at AS3StateMachine on github, and I have registered statemachine.org for all related stuff.
My favourite is the Signal StateMachine for Robotlegs
Just seen that Joel Hooks has ported the pureMVC StateMachine utility to RobotLegs. Take a look at GitHub here.
FSMViz for pureMVC StateMachine Utility
source code here:
So this is just the visualisation and the editing of the States and Actions. I still need to implement the saving out of state, and the export of the StateConstants.as
A few points and pointers:
If you do look at the code, please consider that it is a quick prototype, it will need to be optimised and architechtured (it doesn’t even have a FSM yet ;~/).
The visualisation is done using the Flare package
I am using the flex framework RSL, so the first time you visit, the app might take a fair time to initiate. However, from then on it will be cashed on your machine, so it will be much quicker.
I have used Joel Hook’s FSM diagram from his Piping the Machine tutorial as the initial diagram
You can add states with the form on the bottom left, the package is an optional field that allows grouping of states for a prettier layout using a dot as the delimiter (eg “io.out”, “io.in” or “display”). Then fill in the name and hit ENTER to submit.
Rolling over a state will highlight outgoing actions (red) and with ctrl down, all incoming actions (green).
Clicking on a state will switch to Edit mode, and bring up forms for editing the state and outgoing actions.
Rolling over the highlighted actions will popup their names
Clicking the top right x (or hitting ESC) will close the panels with out committing changes
Clicking the red X buttons will perminently delete the state/action (hitting DEL will delete the state)
Clicking the green tick (or hitting ENTER) will commit any changes
Clicking the strange-green-plus-arrow button (or hitting F1) will create a new Action. You can then give it a name and choose its target state.
As you can see I have a new badge on my blog. Thanks to the Open Source policy of those generous people at PowerFlasher I have been given a complimentary key for FDT Enterprise for my work on the pureMVC manifold project. If you contribute to an Open Source project, why not apply here.
Sorry I’ve been neglecting my blog recently. What with a brute force attack of malware, and working on some bread-and-butter projects, I’ve been a bit diverted.
However, I have found the time to play around with the FSM Visualiser and have been working on the best way to display and interact with it, so I’ll probably stick something fresh up with in the next week or so.
Hopefully thats the end of it, tightened up my security as much as possible.
Will have to upload all my assets again in a while. I’m in quarantine at the moment my SPs changed my ftp password, and I don’t know what it is yet. Too depressed to ask.
and black listed by google!
I’ve cleaned up again, changed password, blah blah!
just uploading some of my blog assets that I removed due to an html framer infestation.