3D Cellular Automata

3D cellular automata with multi-state rules: cells that fade through dying states before they die, growing into diamonds, lava, shells and crystals.

This is a free online 3D cellular automata simulator for multi-state rules, also called Generations rules. Like in the 3D Game of Life, every cell of a cubic grid counts its live neighbors in all three dimensions to decide whether it is born or survives. But here a cell that doesn't survive does not disappear at once: it goes through dying states, one per generation, before it is dead. Those fading cells shape the growth into bands, spirals, crusts and crystals that two-state rules can't make. Type any rule like 4/4/5/M, start from a random soup or a single cell, rotate, zoom and fly inside the grid, and download what you see as a PNG image, an animated GIF or a WebM video.

The simulation and the drawing both run on your own graphics card, with WebGL, so even grids of 256 x 256 x 256 cells (16 million cells) run smoothly on a good computer. Nothing is uploaded to a server, and nothing needs to be installed.

Simulation options

Rule
Survival / birth / states / neighborhood: 4/4/5/M survives with 4 neighbors, is born with 4, has 5 states and 26 neighbors (M, or N for 6). B4/S4/C5 and B5/S4,5 (2 states) also work.
A dead cell comes to life with 1-3 live neighbors, and a live cell survives with 5,6 live neighbors. A live cell that doesn't survive goes through 5 dying states before it is dead.
Dead, alive, and the dying states that a cell goes through when it doesn't survive. 2 is the Game of Life.
Starting cells
24 cells on each side, in the middle of the grid.
A mirrored soup stays symmetric forever, and often grows into regular, crystal-like shapes.
The same seed always creates the same soup.
Camera
The speed of the W, A, S, D, R and F keys.
Visible part of the grid
Hide a part of the grid to see inside the structures. The hidden cells keep living.
Colors and light
Darkens the corners and the holes between the cells.
Fades the farther cells, which helps to see the depth.
When nothing moves, every pixel is calculated again this many times, to smooth the edges.
Image size
Simulation details:
generation: 0
live cells: ...
dying cells: ...
grid: 96 x 96 x 96 cells
image: 1280 x 720 px
pixels calculated while moving: 50% of the width
last frame drawn in: 0 ms
samples per pixel: 0 / 9
Animation
0 keeps the cells still, to record only the rotation of the camera.
The animation starts from the current generation, with the current camera. Turn on "Rotate the camera around the grid" to turn around the grid during the animation.
Generation 0 · ... live cells · ... dying

Drag the image to rotate the grid, use the mouse wheel to zoom where the pointer is, right-drag or shift-drag to move sideways, and double-click a cell to center it. Click the image and use W, A, S, D to fly, R and F to go up and down, the arrows to turn, Q and E to roll, and hold Shift to go faster. Space pauses, and the period key calculates one generation. On a phone, use one finger to rotate and two fingers to zoom.

How to use the 3D cellular automata simulator?

  1. Pick a preset - The buttons above the image start a ready-made rule: a diamond whose faces get covered in stripes, a pyroclastic cloud cut open to show its layers of cooling cells, spirals turning on growing shells, a crystal that grows from a single cell, an amoeba, a chaotic builder, spiky structures, and the flickering rule 445.
  2. Rotate and zoom - Drag the image to turn the grid in any direction, and turn the mouse wheel over a cell to move toward it. Click the image and fly with the W, A, S and D keys, go up and down with R and F, and turn with the arrows.
  3. Look inside - Use "Visible part of the grid" to cut the structure open: most multi-state rules hide their most interesting layers inside. Turn off "Show the dying cells" to see only the live cells.
  4. Change the rule - Type a rule like 4/4/5/M: the numbers of live neighbors that keep a cell alive, the numbers that give birth to a dead cell, the number of states, and the neighborhood (M for 26 neighbors, N for 6). Or change only the number of states, to see how longer or shorter dying times change the same rule.
  5. Choose the colors - "State" gives the live cells the first color of the palette and spreads the dying states over the rest of it, so you see how long ago each cell stopped living.
  6. Download the result - Save the current view as a PNG image, or record the next generations as an animated GIF or a WebM video, optionally while the camera turns around the grid.

Settings

Below are the parameters you can configure to run the 3D cellular automata.

FieldDescription
PresetA ready-made combination of a rule, a grid, the starting cells and the colors. The rules and their names come from the list of 3D rules collected by Jason Rampe for the Visions of Chaos software.
RuleWritten survival / birth / states / neighborhood. For example, 4/4/5/M means that a live cell with exactly 4 live neighbors survives, a dead cell with exactly 4 live neighbors comes to life, there are 5 states (dead, alive and 3 dying states), and every cell has 26 neighbors (M for Moore; N for von Neumann, 6 neighbors). Ranges like 13-26 are accepted, and an empty part means "never", like in /2/10/M. The tool also reads the S/B/C notation (4/4/5, without the neighborhood), the B/S/C notation (B4/S4/C5), and the two-state rules of the Game of Life (B5/S4,5).
Number of statesDead, alive, and the dying states: with C states, a cell that doesn't survive spends C - 2 generations dying. With 2 states, there is no dying state, and the rule is a 3D Game of Life. Up to 100 states.
NeighborhoodWhich cells count as neighbors. Moore: the 26 cells of the 3 x 3 x 3 cube around the cell, which touch it by a face, an edge or a corner. von Neumann: only the 6 cells that share a face with it, which gives growth with flat faces and sharp corners.
Edges of the gridDead: the cells outside the grid count as dead, so the structures that reach the edge are cut. Wrap around: each face of the grid touches the opposite face.
Size of the gridThe number of cells on each side of the cube, from 32 (32 thousand cells) to 512 (134 million cells). The larger grids need a graphics card with enough memory and speed.
SpeedHow many generations are calculated per second. If the graphics card can't keep up, the simulation slows down instead of skipping images.
Start withA random soup of live cells in the middle of the grid, or a pattern: a single cell, a 3D cross or a small cube.
Size, shape and density of the soupThe size of the region filled with random cells, in percent of the side of the grid, its shape (a cube or a sphere), and the percentage of its cells that start alive. Some rules only survive with dense soups, others only with sparse ones.
SymmetryMirrors the soup on the three middle planes of the grid. The rules keep the symmetry, so the structures stay symmetric forever.
SeedThe number that creates the random soup. The same seed always gives the same soup. The dice button picks a new one.
Dragging the image, field of view, flying speedHow the camera moves: rotating freely, around the vertical axis, or turning on the spot like in a video game, the angle seen by the camera, and the speed of the keyboard movements.
Rotate the camera around the gridTurns the camera slowly around the vertical axis of the grid, also in the downloaded animations.
Visible part of the gridShows only the cells between two values on each axis, to cut the grid open and see the layers of dying cells inside the structures. The hidden cells are still simulated.
Show the dying cellsWhen it is off, only the live cells are drawn. The dying cells are still simulated.
Color byWhat chooses the color of each cell: its state (alive, or how far it is in its dying), its position in the grid, its age (how many generations it has been alive), its height, its distance from the center of the grid, or one color for every cell.
PaletteThe gradient used to color the cells: Aurora, Fire, Ice, Sunset, Forest, Rainbow or Grayscale. With "State", the first color is for the live cells and the last one for the cells that are about to die.
Shadows, ambient occlusion, outlines, fogThe lighting of the cells: the shadows they cast on each other, the darkening of the corners and holes, dark lines on the edges of each cell, and the fading of the farther cells into the background.
Samples per pixelWhen nothing moves, each pixel is calculated again several times, at slightly different positions inside the pixel, which smooths the edges of the cubes.
Resolution / Width / HeightThe size of the image in pixels, also used for the PNG download.
AnimationThe format (animated GIF or WebM video), the number of frames, how many generations are calculated between two frames, the number of frames per second and the width of the animation.

What are multi-state cellular automata?

In the Game of Life and its 3D version, a cell has two states: alive or dead. At each generation, a dead cell is born when it has the right number of live neighbors, a live cell survives when it has the right number, and every other cell is dead at the next generation. Multi-state rules, also called Generations rules, add a third possibility: a live cell that doesn't survive starts dying. It goes through one dying state per generation, and only then is it dead. A dying cell doesn't count as a live neighbor, and it can't be born again until it is dead.

The best-known multi-state rule is Brian's Brain, a 2D rule invented by Brian Silverman, where every live cell dies immediately (it has 3 states: alive, dying, dead) and a dead cell is born with exactly 2 live neighbors. Because the cells just behind a moving front are dying and can't be born, the fronts can only move forward, and the grid fills with fast moving waves and spaceships. The name "Generations" comes from MCell, the cellular automata program of Mirek Wójtowicz, which gathered many of these rules.

In 3D, the same idea gives shapes that don't exist with two states. The dying cells form layers behind the live ones, which show the history of the growth: concentric bands on the faces of the "Diamond growth" crystal, a crust of live cells over cooling layers in "Pyroclastic", spirals on the surface of "Shells". The number of states sets how thick those layers are, so changing only that number turns the same rule into a completely different structure. The rules of the presets come from the list collected by Jason Rampe for Visions of Chaos, written survival / birth / states / neighborhood: 4/4/5/M is the rule "445", in which a cell survives and is born with 4 live neighbors, with 5 states and 26 neighbors.

To run in real time, this tool does all the work on the graphics card. The grid is stored in a 3D texture with one byte per cell, holding its age while it is alive and its dying state after that, and every generation is calculated in parallel for all the cells. To draw it, a ray leaves the camera through every pixel and steps through the grid cell by cell until it meets a cell that is not dead, jumping over the large empty regions in blocks of 64 or 512 cells.

Frequently Asked Questions (FAQ)

Is this 3D cellular automata simulator free to use?

Yes, this tool is 100% free and works directly in your browser, with no installation and no sign-up required.

Are my simulations uploaded to a server?

No. The simulation and the images are calculated by the graphics card of your own computer or phone, and nothing leaves your device.

What is the difference with the 3D Game of Life?

The 3D Game of Life only has two states, so a cell that doesn't survive is dead at once. This tool also simulates rules with dying states, which take several generations to die. A rule with 2 states, like 4-5/5/2/M, works in both tools and gives the same result.

How do I read a rule like 9-26/5-7,12-13,15/5/M?

The first part is survival: a live cell with 9 to 26 live neighbors stays alive. The second part is birth: a dead cell with 5, 6, 7, 12, 13 or 15 live neighbors comes to life. The third part is the number of states: 5, so a cell that doesn't survive spends 3 generations dying. The last part is the neighborhood: M for the 26 neighbors of the Moore neighborhood, N for the 6 of the von Neumann neighborhood. This is the "Amoeba" rule.

Why do I only see the outside of the structure?

Many rules grow into a solid ball whose most interesting part is hidden inside. Use "Visible part of the grid" to hide half of the grid, as in the "Pyroclastic" preset, or fly inside the structure with the keyboard.

Why did all the cells die?

Some rules are hard to sustain from a random soup. For example, 445 usually dies from a small or dense soup, but keeps going from a large and sparse one. Try another density, a new seed or a larger soup. When the last live cell dies, the simulation stops after the dying cells have finished dying.

How large can the grid be?

Up to 512 x 512 x 512 cells, which is 134 million cells, if your graphics card has enough memory. The dying states don't make the simulation slower: a grid of 256 x 256 x 256 cells takes about 2 milliseconds per generation on a recent graphics card. On phones and laptops with integrated graphics, 128 x 128 x 128 is a good size.

Can I save an animation of the simulation?

Yes. In the "Animation" section, choose an animated GIF or a WebM video, the number of frames and the number of generations per frame, and click the download button. The animation starts from the current generation and the current camera, and can also turn around the grid.

Related tools

3D Game of Life

3D Game of Life

Run Conway's Game of Life in a 3D grid of cubes, and rotate, zoom and fly through it in real time.
Game of Life

Game of Life

Create Conway's Game of Life simulations and animations.
Generations Cellular Automaton

Generations Cellular Automaton

Simulate Brian's Brain, Star Wars and the other multi-state cellular automata, where cells fade through dying states.
Cyclic Cellular Automaton

Cyclic Cellular Automaton

Create the spiral waves of the cyclic cellular automaton, as images and videos.
Lenia

Lenia

Simulate Lenia, the continuous cellular automaton with creatures that look alive, and download images and videos.
Elementary Cellular Automaton

Elementary Cellular Automaton

Draw the 256 elementary cellular automata, like Rule 30, Rule 90 and Rule 110.
Mandelbulb 3D Fractal

Mandelbulb 3D Fractal

Explore the Mandelbulb, the 3D version of the Mandelbrot set: rotate it, zoom in and fly through it in real time.
4D Object Viewer

4D Object Viewer

Explore 4D shapes like the tesseract and the hypersphere: see their 3D slices and shadows, and rotate them through the fourth dimension.

Wave Function Collapse

Create new maps, levels and textures from a small sample image with the Wave Function Collapse algorithm.