Published: March 9, 2025
Evolution is an endless fascination for me. The main reason is that it’s based on a concept I quite like: the idea that complexity is born out of massive simplicity. In the case of evolution, you have many simple, random changes taking place in a population’s DNA over time that can allow a species to adapt to an environment. One can also draw parallels to programming, as all programs ever made are just high-level abstractions over massive amounts of simple assembly language instructions (which themselves are an abstraction over binary and electrical signals).
With this in mind, I set out to create an evolutionary model of my own. Given my love for cellular automata, I wanted to see if I could evolve a group of cells on a grid. Rather than using mathematical weights or neural networks to drive their behavior, I created a system that compiles a list of actions into executable Lua code that is included with each cell. Essentially, these action lists act as the cells’ DNA. It is modified through random mutations and is under direct pressure to change in response to the cells’ environment. As you’d expect, these action lists are comprised of actions. Some actions in the list have special parameters that determine what variables and options they should use. When a cell is born, its action list will be modified randomly. Actions may be added, deleted, swapped, or replaced. Their special parameters may also be changed to other random values and the starting values of their variables may be tweaked. Finally, the mutation rates for all of these modifications may also be changed. Once the mutations have occurred, the action list will be fed into a function that will combine each action into a large string which is compiled into executable code. From there, the cell is released into the cold, harsh world with hopes that its script is good enough to help it survive and reproduce.
The earliest version of the model (Mk-1) had a bug with reproduction that made it deadly for any cells that used it. This made a stable ecosystem impossible since the cells would eventually die without any heirs. This inspired me to add a failsafe system that selected the longest-lasting cells and respawned clones of them when all the previous cells had died. The clones also received heavy mutations in hopes that it would accelerate their evolution. I should also note that food in this version was limited and non-renewable. Once a cell consumed food from the environment, it was gone forever. This created an interesting effect where species would kill off most of their population to save food for the remaining cells. This allowed them to spread their DNA more effectively since it helped them survive the longest. Despite these limitations, I saw several unique and interesting species that used several different strategies to gather energy.
The next version of the model (Mk-1A) managed to create a stable ecosystem and produce the first multicellular colonies. The biggest change in Mk-1A was to the energy system. Cells in this version track all the energy they’ve consumed over their lifetimes and drop all of it on the ground when they die. Although crude, this method allows the cells to recycle energy as long as they can survive. The second big change was fixing the reproduction system, which finally allowed the cells to have children. Finally, I added a maximum lifespan to the cells so they would evolve faster. Many cell species in this version adopted a “spore and factory” lifecycle. In the spore stage, the cells would roam the world looking for large sources of energy to harvest. Once they found one, they’d glue themselves in place and continuously produce more spores to spread their genes throughout the map.
The idea of using evolution to create optimal scripts is nothing new. However, I would like to take this idea to the next level. My end goal is to turn the environment into input data (such as an image) and encourage the cells to evolve so they can read the data and predict an output. Correct predictions will be rewarded with food and incorrect predictions will be punished with damage. In essence, I want to evolve a brain made of these cells that I can use similar to something like a neural network. I doubt that this will be any better or faster than a neural network, but the idea is fascinating to me and I want to see it happen. After all, not many people can say they’ve evolved digital brains.
Anyway, if you’d like to learn more about the Sully Model feel free to visit the project’s GitHub page. You can also find releases and detailed reports of my observations for versions Mk-1 and Mk-1A that discuss my goals and some species I generated in greater detail. Finally, I’d like to give a shoutout to Simulife Hub, Primer, and The Bibites for being the inspiration behind this project. Give them a watch if you like evolution simulations. Thanks for reading!