4D Game of Life
Conway's Game of Life on a four-dimensional grid: what changes, how you can see a world you cannot picture, and what lives in it. All of it runs in your browser.
Open the 4D Game of Life → Take the 4D tour →
4D is a Labs mode of the 3D Game of Life: it works, and it is still changing.
What the 4D Game of Life is
In Conway's Game of Life every cell on a square grid is alive or dead, and all cells update together from how many of their neighbours are alive. The 4D Game of Life keeps that idea and changes only the grid. Cells sit on a four-dimensional grid with axes x, y, z and w, and a cell's neighbours are all the cells within one step of it along every axis: the 3×3×3×3 block around it, less the cell itself.
| Dimensions | Block around a cell | Neighbours |
|---|---|---|
| 2 (Conway's game) | 3² = 9 | 8 |
| 3 | 3³ = 27 | 26 |
| 4 | 34 = 81 | 80 |
Another way to count the 80: a cell has 26 neighbours in its own 3D slice, and 27 in each of the two slices beside it along w.
Rules are written as in 2D and 3D, in B/S notation. B lists the neighbour counts at which a dead cell is born, S the counts at
which a live cell survives, and every other cell dies or stays dead. Conway's rule is B3/S23. The 4D rule
B8/S4-7 means a cell is born with exactly 8 live neighbours and survives with 4 to 7. Counts now run from 0 to 80, so
there are far more rules to choose from, and Conway's numbers do not carry over: with 80 neighbours a count of 3 is reached almost
everywhere, and births would fill the world. From 2D to 3D shows the same problem one dimension down.
How can you see four dimensions?
Nobody can picture a 4D grid directly, so the app borrows the trick from Edwin Abbott's Flatland. Imagine a flat creature living in a plane. When a ball passes through its plane, it never sees the ball whole: it sees a point that grows into a circle, shrinks again and vanishes. Each circle is a slice of the ball.
We are in the same position with a 4D world. Cut it at one value of w and you get an ordinary 3D world, a box of cubes. The app shows the 4D world as a row of these 3D slices, one box for each value of w. Cells that are neighbours along w sit in the same place in boxes next to each other. A 4D ball, cut this way, is a row of spheres: small in the boxes at its ends, largest in the middle.
B13/S2-15 grows into a round 4D ball. Each box is one slice along w; the spheres in them are
the ball's cross-sections.
Four ways to look
- Slices. Every slice as its own box, side by side: the whole world at once.
- One slice. A single box, with the slices either side drawn faintly so you see what arrives next. A slider moves through w, and a sweep plays through the slices one after another, the way the flat creature watches the ball go by.
- X-ray. All the slices overlaid in one see-through box, coloured by slice: the overview.
- Turn. A 3D cut tilted through the fourth dimension instead of straight across it. It can spin by itself, so the shapes keep changing as the cut turns through them.
You can slice along any of the four axes, not only w. Sliced along the direction a ship travels, the ship steps from box to box.
Is there a 4D rule like Life?
Conway's rule is special because of how it behaves, not because of its numbers. In 1987 Carter Bays, looking for a Game of Life in three dimensions, asked two things of a rule worthy of the name:
- Random starts stay bounded: they settle down instead of growing without limit.
- Gliders exist, and they arise on their own from random starts.
We put 4D rules to the same test. A search of about 110,000 rules of Bays' form (a range of birth counts and a range of survival counts), with tens of millions of random starts, scored each rule by these two criteria. The honest answer is no: no natural 4D rule meets both. In almost every rule, random starts explode, die out, or freeze into still lifes and short oscillators.
The closest is a rule we call Nearly Life, B8/S0-1,4-5,7. Over 5,000 random starts, about 92% stayed bounded and 96%
stayed alive, and the half-speed ship described below still flies in it. What it lacks is the second half of the test: none of the
5,000 starts threw off a ship on its own. The best of the rules that do throw off ships manage it in about 1 random start in 300,
and their starts are much less tame: only about two in three stay bounded.
Ships in four dimensions
A ship (a spaceship, or glider) is a pattern that comes back to its own shape in a new place. When a cell only looks at its neighbours, nothing can move faster than one cell per generation; that top speed is called the speed of light, c. Life's glider moves at c/4, one cell diagonally every 4 generations.
Ships do exist in 4D. A handful are truly four-dimensional, using all four axes, and every one of them flies under a rule in which a cell is born on exactly 8 neighbours. Most move at the speed of light:
| Ship | Rule | Cells | Period | Speed |
|---|---|---|---|---|
| Lightspeed ship | B8/S9-11 |
48 | 1 | c |
| Half-speed ship | B8/S4-7 |
15 | 8 | c/2 |
| Period-6 ship | B8/S4-7 |
28–40 | 6 | c |
| Period-18 ship | B8/S4-7 |
20–42 | 18 | c |
| Period-84 ship | B8/S11-19 |
36–90 | 84 | c |
The lightspeed ship is two 3D shells with an empty slice between them. Every cell dies each generation and a copy is born one
slice further along w, so it moves at the top speed with a period of 1. The period-84 ship changes shape the whole way, between 36
and 90 cells. The same search found period-3 lightspeed ships in rules one neighbour count away from B8/S4-7.
One ship moves slower than light: a 15-cell ship with period 8 that moves 4 cells every 8 generations, half the speed of light,
under
B8/S4-7. It also works in 37 related rules, which is how the search could look for tamer rules that keep it.
Life's glider and Bays' 3D glider also work in 4D if you thicken them into slabs: copy the pattern so it is two cells thick in the
missing directions. Inside the slab an empty cell sees its old count multiplied, and a live cell the same plus its own copies, so
a matching rule plays the old game. Conway's glider, two cells thick in z and w, glides under B12/S11,15; Bays'
glider, two cells thick in w, under B10/S9-11. Both move at c/4. In those rules every 4D random start dies, though,
so the gliders never arise on their own.
Not everything moves. The longest oscillators in the rule search repeat every 60 generations, and under B13/S2-15 a
random start grows into the round 4D ball shown above.
What you can do in the app
Switch between 3D and 4D at the top of the panel, or open the 4D mode directly. It keeps the 3D app's camera, themes and controls: Run, Step, Back and the timeline work the same way.
- Worlds from 8⁴ to 32⁴ cells. 32⁴ is 1,048,576 cells. The world wraps round in all four directions (a torus), so a ship that leaves one side comes back on the other. Large worlds step on the GPU with WebGPU where the browser has it.
- Painting. Draw cells in 4D, one plane of a slice at a time, with the slices either side shown faintly.
- A guided tour. Seven short steps, from the Flatland view of a 4D ball to the ships and Nearly Life. Start it.
- A rule browser. The 65 rules the search found worth a look, with their scores, in Advanced mode; Surprise me picks one for you.
- Discovery. While the world runs, the app looks for ships and long oscillators and tells you when one turns up. You can keep what you find.
- Share links. Send a 4D world as a link, and it opens in 4D.
A little history
Conway's game appeared in 1970. Carter Bays' 1987 paper, "Candidates for the Game of Life in three dimensions", set out the two tests used on this page and found two 3D rules that pass them, Life 4555 and Life 5766. Through the late 1980s and the 1990s he went on to explore Life-like rules in other dimensions, four among them.
The search behind this page is the app's own. It uses Bays' tests and his family of rules, with a range for birth and a range for survival, stretched to 80 neighbours. Its answer is the one above: 4D has rules where random starts mostly settle, and it has a slow ship, but no rule yet where the ship arises on its own, which is what makes Life Life.
Questions
How many neighbours does a cell have in 4D? 80: 34 − 1. In 2D it has 8, in 3D 26.
Is there a glider in the 4D Game of Life? Yes, several ships, most of them moving at the speed of light and one at half of it. What no rule has yet is ships that arise from random starts while those starts stay bounded.
Does Conway's rule work in 4D? Not as it is: B3/S23 is tuned for 8 neighbours, and with 80 it fills
the world. A glider made two cells thick in the extra directions plays Conway's game under B12/S11,15.
Do I need a powerful computer? No. Small worlds run in a recent browser, phones included; large ones use the GPU where the browser supports WebGPU.
Does it cost anything? No. It runs in your browser, free, with nothing to install and no account needed.
Further reading
- Carter Bays, Candidates for the Game of Life in Three Dimensions, Complex Systems 1(3) (1987), 373–400. The two tests on this page come from it.
- Edwin A. Abbott, Flatland: A Romance of Many Dimensions (1884).
- From 2D to 3D: why Conway's rule needs changing in 3D, and which 3D rules come closest.
- 3D Game of Life rules: every 3D rule in the app, explained.