Cellular Automata I

This is a great little bit of generative art, probably the best I’ve ever made. It’s based upon ‘cellular automata’. Click the wee arrow to start. Be warned though: it moves at a pretty slow pace and takes a good five minutes to get really good. i like it that way.

For some background as to what cellular automata are and an explanation of what the black & white squares along the bottom signify, read on…

I don’t know if they originated there but I first came across cellular automata in Stephen Wolfram’s book ‘A New Kind of Science‘. They are the result of set of simple rules that dictate whether a Boolean flag is either true or false. They operate in the following way:

  1. In a two-dimensional array of Boolean flags a single Boolean flag examines its three nearest neighbours in the previous row;
  2. Based on the configuration of those 3 flags the flag sets itself to either true or false by copying the value of a switch that has the same configuration as the 3 flags;

That might not be the simplest idea to follow so lets illustrate it with an example. A flag at, say, array position [6][6] looks at the flags in positions [5][5], [6][5] & [7][5] and discovers that they are set to true, false, true.  There is then a second array the flag examines, this time a three-dimensional array. That array has its own Boolean value at [1][0][1], which directly relates to [true][false][true]. This, say, is ‘false’ and therefore the flag at [6][6] sets itself to ‘false’ and we move the process along to flag [6][7].

I hope that makes sense. The black & white squares lined up along the bottom of the swf above relate to the Boolean flags stored in the three-dimensional array we just mentioned. if you look at them again you’ll see that they are a set of eight blocks with each block consisting of a unique combination of 3 static squares and an additional single dynamic square. The 3 static squares indicate the location in the array of the flag in question - with black indicating 0 and white 1 - and the dynamic square indicating the value stored at that array location, again either false (0, black) or true (1, white). This then is simply an indication of the eight possible cellular automata rules being applied at any given time.

To get a clearer indication of what that actually means in practice, have a play with the following swf. In this swf the 3-square block rules are actually buttons and pressing them will both change the value of the flag it contains and rebuild the resulting cellular automata chain from scratch. Click some of the buttons and see what happens. Some of the patterns are invisible (well, visible but fully white) most of them are very regular but some are just wild! Reading from left to right, trying setting them to 0,1,1,1,1,0,0,0.

It’s astonishing quite how much random complexity can arise from such a small selection of very simple rules. I’ll not go into that, if you’re interested in that side of the discussion I recommend you go read Stephen’s book.

So, in brief, all the first swf does is instead of starkly changing the value of a pixel from white to black, it works in gradiations of grayscale so as to make the effect much subtler and to create the effect of overlaying patterns that build into a rich tapestry of lines, shapes and angles and it sets its own eight rules at random rather than allowing the user to do so.

I think the artistic merits of this piece are quite profound but this isn’t really the time or place to discuss them, I simply wanted to explain roughly how it worked. And I’d really like to thank Peter Passaro for recommending the book to me. :)

Tags: , , , ,

3 Responses to “Cellular Automata I”

  1. zenbullets Says:

    I first encountered Cellular Automata at university, and never really got the point. Until I read Rudy Rucker’s “Lifebox, Seashell and The Soul” many years later, which derives a lot from Wolfram, and I got mightily obsessed with the idea of Universal Automatism, the theory of a fully deterministic universe that can be modelled mathematically (blogged about at length here: http://zenbullets.com/blog/?cat=15).

    I also did my own bit of CA based art: http://www.zenbullets.com/generative/CLife.php , which is a bit more of a scribble compared to the complexity of your piece.

  2. zenbullets Says:

    I first encountered Cellular Automata at university, and never really got the point. Until I read Rudy Rucker’s “Lifebox, Seashell and The Soul” many years later, which derives a lot from Wolfram, and I got mightily obsessed with the idea of Universal Automatism, the theory of a fully deterministic universe that can be modelled mathematically (blogged about at length here: http://zenbullets.com/blog/?cat=15).

    I also did my own bit of CA based art: http://www.zenbullets.com/generative/CLife.php , which is a bit more of a scribble compared to the complexity of your piece.

  3. Richard Willis » Blog Archive » Cellular Automata II: Fading Grid Says:

    [...] put the cellular automata swf up a couple of days ago I found myself in a coding frame of mind, so much so that i devoted the [...]

Leave a Reply