
Will Fowler

Game of Life
John Conway's Game of Life is a game with no players that occurs on a two-dimensional grid. Each cell in the grid can have one of two states (on and off, or "dead" and "alive"), and for each "turn" in the game a set of rules is applied to the system. These rules determine the overall state of the grid's cells for the next generation, and the process repeats. The rules of the original Game of Life simulation are quite simple.
1. Any dead cell with exactly three neighbors becomes alive in the next generation.
2. Any live cell with two or three live neighbors lives on.
3. Otherwise, a live cell will die.
​
From these simple rules, a number of interesting behaviors that arise in the simulation. Many states eventually stabilize into unchanging patterns, while others, called "oscillators" stabilize into patterns that repeat over a number of generations. There are also patterns known as "gliders" which move across the grid forever, or until they run into another live cell.
​
It is even possible to create so-called "glider guns" and use these stable configurations to compute and store data. It is possible to create a Turing complete system within the simulation.

These simulations can be carried out in a universe of any number of dimensions, and of course, this has been done before. But to convert the system into a coherent simulation in 3D, a new set of rules must be devised. Otherwise a system may quickly dissolve into nothing, or explode into a chaotic mess with no coherency. Depending on how many cells are alive for the initial state, the classic B3/S23 rules above tend to cause the immediate death of most of the cells, and any that remain will grow into an expanding mess.
​
Because of the work of people such as Bays, some rule sets have been devised that produce more useful results for 3D simulations. Some have been shown to support gliders, and emulate the behavior of the classic game to an extent.

Modern computers can easily handle simulations like this with millions of cells without much trouble. A two dimensional grid has only eight neighbors for each cell, while a 3D grid has 26 and a 4D grid has 80. A brute force approach would be to count the number of live neighbors for each cell on every tick. Another approach would be to only iterate through the cells that are live and increase a running count of live neighbors for all of their neighbors instead. You could also keep track of what cells changed on the last tick and update only their neighbors on the next one. I use a combination of these last two methods, whichever will be faster on this tick.
​
The main bottleneck for performance is rendering. To represent each cell, a cube mesh is used. This works fine for configurations using only a few hundred or thousands of cells. However, 4D configurations can easily climb into the hundreds of thousands or millions of cells, and having the engine render millions of individual cubes at a time comes at a massive performance cost.
The project itself is very lightweight and is available on Github. A working build of the app can be downloaded from the Releases page. The entire thing was built in just under a week and uses Unity 2022.3.19. All screenshots and demos on this page were built and run in this app.
The extension of the Game of Life into 4D is less explored. It is difficult to visualize such a system. It is possible to represent a fourth dimension using a cell's color. The cells can be layered on top of each other in the same physical 3D space while using a color space to represent the fourth.
​
As with 3D automata, a new set of rules must be found to enable stable configurations for 4D as well. These rules can vary depending on the results you're looking for. As with the 2D and 3D rules there can be very little residue or quite a lot, and it can be sparse or can take the form of large stable structures. Here is an example of a ruleset that produces many small bits of residue with a few oscillators. Note that although some cells occupy the same physical space, they are still separated in color space.



