A hexagonal cellular automaton universe simulation built with Swift and SpriteKit. Explore how simple rules create complex behaviors in a virtual universe.
Try HexGenesis Online: English Web Demo 中文网页体验
HexGenesis is a two-dimensional universe built on a hexagonal grid.
In HexGenesis, you can modify the rules and add initial elements, then observe how they evolve inside the universe and explore the sparks of emergent life that appear from simple systems.
![]()
🚧 HexGenesis is currently an experimental open-source project.
The core simulation engine is functional, and future versions will explore more complex evolution mechanisms.
git clone https://github.com/Gelly-23/HexGenesis.git
cd HexGenesis
open HexGenesis.xcodeproj
To run HexGenesis on a physical iPhone or iPad:
Many years ago, I encountered Conway’s Game of Life. What amazed me was this idea:
By defining only a few simple rules inside a fixed grid structure, something resembling life can emerge.
The universe we live in is incredibly complex and mysterious. For thousands of years, countless thinkers have tried to simplify our understanding of reality, searching for the fundamental rules behind everything.
Could the underlying structure and rules of our universe be as simple as those in Conway’s Game of Life?
Could all complexity and mystery emerge from simple structures and simple rules?
Although we do not yet know the answer, we can create a small universe based on a hexagonal grid, define its rules, and observe what happens.
We imagine a two-dimensional universe composed of hexagonal cells.
Each hexagonal cell is both the space of the universe and the fundamental element that constructs the universe.

In this universe, hexagonal space and elements share the same origin. They only differ in their current state.
When a cell has no energy, it appears as the background color.
Energy states:

The state of each hexagonal cell is affected by the total energy of its six neighboring cells.
The sum of neighboring energy values ranges from 0 to 18.
Different energy sums create different effects on the current cell.
Default rules:
Players can adjust these values freely.
Summary:
Decay
Sum ≤ limitLower → Energy decreases by 1 level.
Growth
limitLower < Sum ≤ limitUpper → Energy increases by 1 level.
Overload
Sum > limitUpper → Energy becomes zero.
Based on the HexGenesis concept above, I created an iOS demo application using Swift with the assistance of AI.
HexGenesis can run on iPhone and iPad.
I also created a browser-based demo version so that users can experience HexGenesis without installing the app.
You can experience the web version directly in your browser:
The introduction screen provides a brief explanation of HexGenesis. It can be skipped.
Because this is currently only a demo, the login system is not connected to a real account system. Simply press login to enter the homepage and start the game.
While paused, press the settings button to open the settings screen.
Settings include:
Left column: - Controls the boundary values for element growth and decay.
Right column: - Controls the boundary values for element growth and overload.
After changing the rules, return to the main screen, add elements, and observe different evolution behaviors.
The web demo provides similar settings in the upper-left corner.

The following examples use the default evolution rules.
Under these rules, elements do not grow endlessly and do not easily become completely inactive.
Certain arrangements can survive for a long time.
Examples of stable structures:

I will continue adding more observations under different rule settings.
For example, increasing the overload limit to 18 allows groups of red elements to remain stable.
They can form dense cores and consume surrounding elements.

For example, lowering the growth boundary to 4 causes elements to rapidly expand across the universe.
In some cases, the expansion process creates fractal-like patterns.

If you are interested in HexGenesis, or discover new evolution patterns, feel free to leave feedback.
Any discussion, suggestions, or ideas are welcome.
If you have explored HexGenesis, please let me know.
Thank you.