3D Cellular Automata

Cellular Automata (or CA as they are often abbreviated to) have insterested me for many years (at least as long as I had an interest in fractals or maybe longer). I can still remember writing my first serious code in Turbo Pascal and being amazed at the patterns that arose from John Conway’s Game Of Life. Cellular Automata are a great example of complexity and emergence arising from simple rules.

3D CA have been implemeted in Visions Of Chaos for years, but only in a 2 state version (ie each cell is either dead or alive). Here is an older low resolution example of some of the 2 state rules I found (this used to be “high resolution” on YouTube).

I revisited the 3D CA code when testing the new JPS support in Visions Of Chaos. The most obvious progression was to allow more than 2 states per cell. This leads to more interesting results (but also a much larger possible search space to try and find good rules within).

Here are a few of the multi-state 3D Cellular Automata rules I found while testing the new 3D CA code. They are all based on the surrounding Moore neighborhood 26 cells.

4 4 5
Survival 4
Birth 4
Number Of States 5
This rule can be difficult to get started and develop (as this movie shows), but once past the initial deadness it develops many gliders and other shapes.

Amoeba 3
Survival 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26
Birth 5,6,7,12,13,15
Number Of States 5
This one has slow growth using bulbous pulsating arms to grow. Rarely it will sprout a thin diagonal growing arm from the main body that will continue to spread until it hits a wall or other active cell(s).

Survival 4,5,6,7
Birth 6,7,8,20
Number Of States 4
Trying to get coral like growth. I have tweaked this one for hours and cannot seem to get a nice realistic coral result.

Jason’s Brain
Survival 4
Birth 4,8
Number Of States 5
Very similar to 4 4 5. Found when I was trying to find a 3D version of Brian’s Brain (hence the name).

Survival 4,5,6,7
Birth 6,7,8
Number Of States 10
Expanding rule. Reminded me of footage of pyroclastic flows from volcanos.

Finding good or interesting rules is not easy, so if you have any new rules let me know. Just comment on this post and give the details.

Finding ways to display 3D Cellular Automata can be difficult. The main issue faced is if the rule causes a dense cluster of particles you only get to see the outside and the inside of the structure(s) remian hidden. Some options I experimented with are only rendering state 1 (ie cells that have just been born) cells, and rendering the display with a chunk of cells cut out of it to see inside.

A quick side tip for other programmers. If you are rendering a large grid of 3D cubes in OpenGL you can work out which sides of each cube touch another cube and then skip passing these faces to OpenGL. The overhead of coding the face checks gives a huge speedup when there are a large amount of cubes on screen.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s