Real-time collaborative Game of Life
A never ending simulation of Conway's Game of Life, real-time collaborative.
Open projectAbout This Demo
I have always been fascinated with cellular automatons, in particular with the Conway's Game of Life. I have seen many versions, but I have never seen a real-time collaborative version of it. In this small project, I bring the magic of RTC (real-time collaboration) to the Game of Life so that every single user that loads the game is interacting with the same board.
The Game of Life was created by late British mathematician John Horton Conway in his pursuit of a set of rules that could create life-like patterns. The game is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input. Conway drastically simplified an earlier automaton by John von Neumann which contained several complex rules.
The Conway's model appeared on the page 120 of the October 1970's issue of the Scientific American magazine which contributed to his widespread recognition in the fields of math.
Game of Life Rules
Let's say we have a chessboard grid and a bunch of pawns which we will call *living cells* from now on. If there is a *living cell* on the board that grid square is considered to be alive. If its empty then that square is considered to be dead. These two states are can be easily represented on a computer by using the binary system, so that the equivalence ends up being **1 for a living cell** and **0 for a dead cell**. Now image that you randomly throw 5 living pawns on the 8x8 board and you end up in the following pattern: This is called the generation 0, to compute the next generation we will follow these 4 rules:
The rules are as follows:
- Any living cell with fewer than two live neighbors dies, as if caused by under-population.
- Any living cell with two or three live neighbors lives on to the next generation.
- Any living cell with more than three live neighbors dies, as if by overcrowding.
- Any dead cell with exactly three living neighbors becomes a living cell, as if by reproduction.
These rules, albeit simple, can create "life-like" patterns that can evolve in very complex ways. For example, the following pattern is called a glider and it moves diagonally across the board. Starting with the cells,
This last pattern is the same as the first one, but it has moved one square to the right and one square down. Therefore, this pattern travels diagonally across the board. This pattern is stable and dynamic at the same time.
Not all patterns are stable and dynamic, some are simply stable and do not move. These are also interesting because they can act as the "heartbeats" of more complex patterns.
Here is another stable example that appears to be formed by the meeting of two distinct patterns. Unlike the typical outcome where two patterns collide and destabilize each other, often leading to their collapse and eventual disappearance, these two patterns defy expectations.
Here is another interesting glider that partially cancels out travel across the Y axis, making it move only in the X axis. This phenomenon occurs through the careful manipulation of the glider's trajectory, where its inherent vertical motion is counterbalanced by a temporary pattern.
In this other configuration, four stable patterns come together to form a captivating flower-like design. Each pattern, stable on its own, is positioned in such a way that they collectively create a symmetrical and visually striking arrangement. The Game of Life is full of surprises.
Further Steps
A few additional ideas about where I want to take this project are the following:
- Making an spherical topology so that there are no boundaries.
- Making a non-discrete version (i.e. like a fluid simulation).
- Adding different races of cells that interact with each other.
- Adding a reinforcement learning reward/punishment system so that the rules can evolve.