Something Wrong with the System

A Flash/Actionscript blog

Colour Swarm – Contest Entry

I was recently invited to participate in FXpression 09.  A flash contest on  The contest rules state that all entries must be composed entirely of circles.

I entered a modified version of my swarm code.  See it in all it’s glory after the break.

Read the rest of this entry »

January 19th, 2009 by Peter Organa

Mega Swarm + AS3 optimizations

I’m still working on the flocking code I blogged about earlier.

I wanted to get more flock objects on screen.  But my nearest neighbour detection code was VERY SLOW.  In the old version each flock object would do a closest neighbor check by for looping through EVERY OTHER ENTITY on screen.  The number of calculations would increase exponentially as the number of flock entities increased.  This set a limit of about 200 entities before things started to slow down.

So I decided to add a broad level distance detection level.  My first attempt got me up to about 700, before things started to slow down.  Which was not bad but I was sure I could do better.  At this point my friend William stepped in and essentially re-wrote my code 3 times over (William is a math major, and a super smart guy).  One of his broad hit level schemes let me get up to 2000 entites on screen at once (on my home computer). The version I posted here shows 1200.

See the mega swarm in action after the break.

Read the rest of this entry »

January 18th, 2009 by Peter Organa

Swarm (nicer)

Hey guys, I made a prettier version of the Swarm app I posted yesterday.

Check it out after the break.

Read the rest of this entry »

January 8th, 2009 by Peter Organa

The Swarm

Recently I watched a video on In the video Steven Strogatz talks about sync, in one segment he speaks about flocking behavior and lists the three simple rules that govern flocking.  Later I found that this type of artificial flocking behaviour can be referred to as ‘Boids‘.

So yeah… I decided to code it up in Flash ActionScript 3.0.

The image on the left doesn’t really do the app justice.
Click more to see the app in action.

Read the rest of this entry »

January 7th, 2009 by Peter Organa