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.
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
AaronOfTomorrow
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
Knight