Quantcast
Channel: FlexMonkey
Viewing all articles
Browse latest Browse all 257

More Morphogenesis with Swarm Chemistry with ActionScript Workers & Feathers UI

$
0
0


I've been experimenting with Hiroki Sayama's Swarm Chemistry recently and have just wrapped up the first iteration of a Flash (using ActionScript Workers) and Feathers based application based on his work. 

Swarm Chemistry simulates heterogenous systems of particles with genomes that describe simple kinetic rules. Morphogenesis and self organisation emerge and surprising organic formations appear.

Hiroki Sayama's Java application allows users to mutate, mix, replicate and edit genomes. My first iteration doesn't offer the first three functions yet, but users can edit genomes.

The application opens with four presets 'recipes' which are selected from the drop-down in the top left. From there, I present a list of each genome within the recipe and selecting one of the genomes enables the editor on the right. Users can then edit properties that affect populations of particles (or members) such as their colour or their cohesion, separation or alignment. 

While I was developing this I took the output and tinkered with it in After Effects (as I did with a lot of my reaction diffusion work). The end results look almost alive:





I originally started coding this in Flex but there was some odd compiler memory leak that I couldn't fix. I thought it would be a great opportunity to try out Feathers UI and use the new ActionScript 2.0 compiler in a pure ActionScript project.  


Feathers is great, but it did make me realise the joy of Flex. Marking up in MXML, binding, layouts and skinning are all such a breeze in Flex and I still genuinely believe it's a viable client technology decision for enterprise applications. I still use it every day at work!

Once again, I've used ActionScript Workers to keep the user interface responsive while the heavy calculations are running. One worker does the swarm chemistry calculations and another does the rendering. They both run simultaneously - so I'm rendering a calculated frame while calculating the next. 

The application lives here (try to avoid using the debugger version of FlashPlayer) and the source code is available here.


Viewing all articles
Browse latest Browse all 257

Trending Articles