Cellular Automata

AaronOfTomorrow's icon
By AaronOfTomorrow on 04/09/2008 09:23 AM

After seeing this talk by Will Wright and Brian Eno on generative systems, I started playing around with Cellular Automata. I remembered this post on using flash's bitmap filters to do all the calculations for Cellular Automata, so I wrote my own version, just for the hell of it.

Adobe Flash Player must be installed to view this content.

Get Adobe Flash player

A couple of gotcha's that held me up:

  • When setting pixel values in a BitmapData object with transparency enabled, the color will be set to 0x000000 when the alpha is 0, no matter what color you actually passed in.
  • On the other hand, with transparency disabled, the alpha value of pixels will always be set to 0xFF.
ComcastSUX's icon

ComcastSUX

04/10/2008 12:37 AM
Okay, so while it's obvious to me what's going on here and what the controls do, could you please explain it for the idiots out there?
AaronOfTomorrow's icon

AaronOfTomorrow

04/10/2008 07:35 AM
No problem. What you're going to want to do is click on the address bar in your browser and type in "wikipedia.org", then search for "Cellular Automata". All smartassery aside, cellular automata basically creating a bunch of things (in this case pixels) which follow some very simple rules on how they interact. This can lead to very complex behavior and the outcome can change drastically based on the rules and initial conditions. So in the flash thing above, each pixel has 2 kinds of rules. First, if it is black and x number of its neighbors are white, it becomes white (this is the "born" row of checkboxes). Secondly, if it is white and x number of its neighbors are white, it stays white. Otherwise, it becomes black (this is the "survives" row). The default conditions (2 and 3 survives, 3 is born) is a setup called "The Game of Life".
Knight's icon

Knight

05/24/2008 07:20 PM
I will appreciate that if you set your flash program to pause by default. Since every time when I load the pages have this flash, my CPU usage goes on to 95%!
Knight's icon

Knight

05/24/2008 07:27 PM
Maybe it is the time to upgrade my PC with Intel Core2 Quad processors plus a dual processor motherboard.