Stacked Generations Display For 2D Cellular Automata

History Dependent Cellular Automaton

This isn’t something new, but a feature that was on my to do list for years after seeing it implemented elsewhere.

History Dependent Cellular Automaton

The idea is simple. You take a 2D CA and rather than render each step/cycle/update as a 2D image, you add the current 2D cell states as a layer of a 3D stack of cubes. Each slice of the cube is another step in the CA generation.

History Dependent Cellular Automaton

These examples are of History Dependent Cellular Automata.

History Dependent Cellular Automaton

Once again I must give a shout out to the most excellent Mitsuba Renderer. I would not be able to render these examples with such nicely shaded cubes without it.

Visions of Chaos now supports generating 2D Cellular Automata, History Dependent Cellular Automata and Indexed Totalistic Cellular Automata as stacked generations.

Jason.

History Dependent Cellular Automata

I have been exploring a variety of cellular automata lately and here is another one.

This is from another idea I had. I am not sure if this is unique, but a quick hunt found no matching CAs. If it is a duplicate of an existing named rule, let me know.

This is a totalistic CA that uses the usual 8 immediate neighbor cells as well as the last step’s current cell and 8 neighbors. This gives a total of 17 neighbor cells that can influence the birth and survival of the cells.

I call them “History Dependent Cellular Automata” because they depend on the previous cycles’ neighbor cells as well as the usual 8 immediate neighbor cells.

History Dependent Cellular Automaton

Here are a few animated GIFS showing some early results. The GIF thumbnails are messy, so click them to see the clear GIFs.

Amoebas 01

History Dependent Cellular Automaton

Amoebas 03

History Dependent Cellular Automaton

Sample 01

History Dependent Cellular Automaton

Space Ships

History Dependent Cellular Automaton

The CA is now a new mode included with Visions of Chaos if you want to have a play with it.

Jason.

Alternating Neighborhoods Cellular Automata

This was a quick experiment with an idea I had.

Alternating Neighborhoods Cellular Automaton

Update a cellular automata using different neighborhoods and rules every second step. The first step uses the 4 neighbor cells north, south, east and west. The second step uses the 4 diagonal neighbors. Then they alternate each step of the CA. Each neighborhood has its own set of rules for birth and survival.

Alternating Neighborhoods Cellular Automaton

There are a total of 2^20 or 1,048,576 possible rules using this method. 9*2^20 (9,437,184) if you take into account a maximum state value of between 2 and 10 for each cell.

Click the following to open a short GIF animation of each of the rules. The thumbnails are a mess.

Amoebas

Alternating Neighborhoods Cellular Automaton

Fireworks

Alternating Neighborhoods Cellular Automaton

Gliders

Alternating Neighborhoods Cellular Automaton

Life-ish

Alternating Neighborhoods Cellular Automaton

Traffic

Alternating Neighborhoods Cellular Automaton

Walkers and Spinners

Alternating Neighborhoods Cellular Automaton

Extending the possible maximum states of each cell up to 10 shows potential with some more interesting structures.

Expanding Ships

Alternating Neighborhoods Cellular Automaton

Fireballs

Alternating Neighborhoods Cellular Automaton

Spirals

Alternating Neighborhoods Cellular Automaton

Stick Growth

Alternating Neighborhoods Cellular Automaton

My next idea was to extend the neighborhoods as follows

Alternating Neighborhoods Cellular Automaton

The settings are extended to handle the larger neighborhood.

Alternating Neighborhoods Cellular Automaton

This gives 2^52 or 4 quadrillion (4,503,599,627,370,496 to be exact) possible rules (and that is only for 2 state rules). A maximum cell state of 10 gives 9*2^52 or 40 quadrillion (40,532,396,646,334,464) possible rules. Finding those sweet spots of interest between dying out and total chaos becomes even more daunting.

I wasn’t confident that those neighborhoods would give any interesting results beyond chaotic noise, but they are showing potential so far from random searches and mutations of rules.

Amoeba

Alternating Neighborhoods Cellular Automaton

BZ-ish

Alternating Neighborhoods Cellular Automaton

Fire Ships

Alternating Neighborhoods Cellular Automaton

Pulsating

Alternating Neighborhoods Cellular Automaton

Thick Ripples

Alternating Neighborhoods Cellular Automaton

The Alternating Neighborhood Cellular Automata are now available as part of the latest version of Visions of Chaos.

Jason.

Zhang Cellular Automata

Inspiration

Another new cellular automaton. This time inspired by this post by Xiaohan Zhang (@hellocharlien on Twitter). I messaged Xiaohan about his algorithm and he generously provided the source code to his CA processing sketch here.

I called them the “Zhang Cellular Automata” as there was no official name given to these.

How they work

Setup a 2D array of integers for the CA cells. Fill with random values between 0 and numstates-1. I allow up to 9 for the numstates which means a 0 dead state and 1-8 alive states for cells.

Create a rule table which is an array 9×9 integers in size. Fill with random values between 0 and numstates-1.

Now the steps when processing each cell.
1. Count how many of the 8 Moore Neighborhood neighbors there are in each state (between 0 and numstates-1). This gives you an array countStatesOfNeighbors[0..numstates-1].
2. Remember the current cell state value.
3. Loop through the possible state ranges from 0 to numstates-1.
4. If the rule entry matches the loop then assign the loop value to the cell, otherwise the cell remains as is.

Here is my code for updating each cell


mystate:=c[x,y];
for s:=0 to numstates-1 do
begin
     if (countStatesOfNeighbors[s]=rule[myState,s]) then
     begin
          mystate:=s;
          break;
     end;
end;
t[x,y]:=mystate;

Results

There are interesting cyclic results that tend to go through cycles of life and death. One state will fill out an area of random noise with a new pattern and that pattern allows a new pattern to fill it, before the original random state refills the area.

Zhang Cellular Automaton

Zhang Cellular Automaton

Zhang Cellular Automaton

Zhang Cellular Automaton

Zhang Cellular Automaton

If you download Visions of Chaos you can see these running.

Jason.

Two Steps Back Cellular Automata

Inspiration

This CA was inspired by this Tumblr post by Charlie Deck (@bigblueboo on Twitter).

Since there is no name given for this CA, I called it the “Two Steps Back Cellular Automata”.

How it works

This time it is a more simple 1D CA.

Each cell is updated by counting the neighbors 2 cells either side of it and itself (5 cells) and the same 5 cells in the previous generation. This gives you a possible count of active cells between 0 and 10. The count is used into a rule array for the new cell state.

For example, if your rule array is rule[1,0,0,0,0,1,0,1,1,0,1] and the cell has 5 neighbor cells that are alive, then the new cell would be alive too (the rule counts start at 0, so the 6th entry in the rule array is for 5 active neighbors and that entry is 1).

You can convert the 11 digit rule into a binary string. The above is 10000101101 which converts into the decimal number 1069 (not 1441 as in Charlie’s post – looks like he reversed the binary digits before conversion).

Results

There are 2048 possible rules. Not a big amount compared to some CAs, so it was easy to setup a loop and generate all 2048 rules. These are a few of the interesting results starting from a single centered alive cell. I have included a low res and high detail version of each rule.

Rule 313

Two Steps Back Cellular Automaton

Two Steps Back Cellular Automaton

Rule 366

Two Steps Back Cellular Automaton

Two Steps Back Cellular Automaton

Rule 384

Two Steps Back Cellular Automaton

Two Steps Back Cellular Automaton

Rule 494

Two Steps Back Cellular Automaton

Two Steps Back Cellular Automaton

Rule 798

Two Steps Back Cellular Automaton

Two Steps Back Cellular Automaton

Rule 995

Two Steps Back Cellular Automaton

Two Steps Back Cellular Automaton

Rule 1069

Two Steps Back Cellular Automaton

Two Steps Back Cellular Automaton

Rule 1072

Two Steps Back Cellular Automaton

Two Steps Back Cellular Automaton

Rule 1437

Two Steps Back Cellular Automaton

Two Steps Back Cellular Automaton

Rule 1438

Two Steps Back Cellular Automaton

Two Steps Back Cellular Automaton

Rule 1623

Two Steps Back Cellular Automaton

Two Steps Back Cellular Automaton

Rule 1822

Two Steps Back Cellular Automaton

Two Steps Back Cellular Automaton

Rule 2019

Two Steps Back Cellular Automaton

Two Steps Back Cellular Automaton

Extending the neighborhood

Once I went through those 2048 possibilities I extended the neighborhood 1 cell either side. So a total of 14 neighbor cells to check. This bumps the total possible rules up to 32768. I called these ones the “Two Steps Back Extended Cellular Automata”.

Extended Results

Again I kicked off a batch run and waited for the 32,768 results to render. Here are some of the more interesting results.

Rule 6270

Two Steps Back Extended Cellular Automaton

Two Steps Back Extended Cellular Automaton

Rule 10159

Two Steps Back Extended Cellular Automaton

Two Steps Back Extended Cellular Automaton

Rule 21627

Two Steps Back Extended Cellular Automaton

Two Steps Back Extended Cellular Automaton

Rule 28798

Two Steps Back Extended Cellular Automaton

Two Steps Back Extended Cellular Automaton

Rule 30278

Two Steps Back Extended Cellular Automaton

Two Steps Back Extended Cellular Automaton

See this flickr gallery for more samples.

Availability

Two Step Back Cellular Automata and Two Step Back Extended Cellular Automata are now new modes in Visions of Chaos.

Jason.

2D Accretor Cellular Automata

After experimenting with the 3D Accretor Cellular Automata I wanted to see how it works in 2D.

The principals in 2D are almost the same as in 3D, but in 2D you only have face and corner neighbors and no “edge” neighbors.

Here are some samples;

2 states – Solid 5×5 pixel seed

2D Accretor Cellular Automaton

2D Accretor Cellular Automaton

2D Accretor Cellular Automaton

2 states – Random 5×5 pixel seed

2D Accretor Cellular Automaton

2D Accretor Cellular Automaton

2D Accretor Cellular Automaton

3 states – Solid 5×5 pixel seed

2D Accretor Cellular Automaton

2D Accretor Cellular Automaton

2D Accretor Cellular Automaton

3 states – Random 5×5 pixel seed

2D Accretor Cellular Automaton

2D Accretor Cellular Automaton

2D Accretor Cellular Automaton

4 states – Solid 5×5 pixel seed

2D Accretor Cellular Automaton

2D Accretor Cellular Automaton

2D Accretor Cellular Automaton

4 states – Random 5×5 pixel seed

2D Accretor Cellular Automaton

2D Accretor Cellular Automaton

2D Accretor Cellular Automaton

5 states – Solid 5×5 pixel seed

2D Accretor Cellular Automaton

2D Accretor Cellular Automaton

2D Accretor Cellular Automaton

5 states – Random 5×5 pixel seed

2D Accretor Cellular Automaton

2D Accretor Cellular Automaton

2D Accretor Cellular Automaton

Jason.

Variations of Ant Automata

I had an idea to extend Langton’s Ant and the generalized Ant Automata by allowing turning of the ant in 45 degree angles rather than just 90 degree angles. I was hoping to get some new unique results.

In the usual ant automaton, when the ant turns right it makes a 90 degree turn (eg from facing west it turns 90 degrees to face north). In my experiment I turn only 45 degrees (so facing west now turns right to face north-west). Otherwise the way the ant behaves is the same for the usual Ant Automaton.

After running a few thousand automated rule numbers the results were nothing spectacular. Mostly blobs without any interesting structures.

Ant Automaton
Rule 95

A few of the rules did produce highways the same as the regular Ant Automaton in 2D and 3D does.

Ant Automaton
Rule 252

Ant Automaton
Rule 87

My next idea was to change the amount the ant turns based on its surrounding 8 neighbors (the left or right turn direction is still based on the rule binary digit as in the usual ant automaton). Each of the 8 neighbors (W,NW,N,NE,E,SE,S,SW) state values are summed and then a turnvalue is found by


turnvalue=neighborcount mod 8+1

This gives a value between 1 and 8 to turn by. 8 means do not turn and keep moving straight ahead. When a turn is made to the left or right, the turn takes that many 45 degree steps. So if the neighbor value comes out to 2, then a right turning ant now turns 90 degrees rather than the usual 45 degrees.

This method did give more interestingly shaped blobs

Ant Automaton
Rule 2327

Ant Automaton
Rule 67

and also produced some complex highways.

Ant Automaton
Rule 71

Ant Automaton
Rule 138

Ant Automaton
Rule 471

Ant Automaton
Rule 2644

The following rule created a symmetric structure before creating a straight highway.

Ant Automaton
Rule 2595

Jason.