A More Dynamic Ecosystem
This month, I’ve been adapting the game’s simulation of evolution to closer match what happens in nature. Before, every species had a fixed population size. While living out their lives, each creature was awarded a ‘fitness score’, a number that combines swimming speed, steering, and stability. The 20% of creatures that score the highest within the species survive into the next generation and reproduce, filling in the rest of the available slots. Over time, mutation and recombination leads to a more and more fit species: one that is faster, more stable, and more accurate.
As an aside, the fitness score can actually correspond to anything, as long as you can assign a number to it. If you added a fitness bonus for having a big head, the sea would quickly fill with big-headed fish. However, for sufficiently complex scores, creatures often don’t really evolve to maximize it very well without impossibly large populations and time-frames.
Two deep-sea creatures that have evolved in total darkness
I’m now switching over to a system based around individual creatures, where ‘species’ is an emergent property rather than a fundamental one. Creatures acquire energy through feeding, and they use this energy to live and have children with other nearby, genetically-similar creatures. Limited food availability means that creatures must compete over the food supply, which can be anything from algae, to plants, to other creatures or the remains of them. As before, mutation and recombination leads to a more and more fit species over time, but now fitness is broader and encompasses anything that helps creatures thrive in their world.
I had initially implemented the energy requirements in a very direct way, where for every unit of energy a creature consumes, it gets to have one child. This produced the following graphs of population size, for creatures living in a region where there is enough food to support a population of 40:
Populations grow quickly, immediately overshoot the carrying capacity of their environment, and then go extinct. This happened every single time! Once the population grew too large, a situation would arise where, because of the intense competition, each creature ends up getting 0.7-0.9 units of energy. So all the food is eaten but nobody gets enough and everybody dies. This kind of thing does happen sometimes, but it doesn’t happen every single time, within a few generations, in environments that aren’t even changing. But how can it be fixed? It’s not like a creature that scores 0.9 can have 90% of a child!
Except actually, that is sort of possible. If 0.9 energy means a creature has a 90% chance to have a child, then from a statistical view of the whole population, that really is like having 90% of a child. Here’s what the same graphs look like when you interpret the energy ‘remainder’ of a creature as a probability to have a child:
There’s still some volatility, which is good, but it’s much more reasonable considering the environment. Most importantly, this new food system allows for a much more dynamic and interrelated ecosystem, where populations can grow and shrink based on food supply or predation, can go extinct due to environmental changes that are too fast for them to adapt to, and can split into multiple distinct species when new niches open up in an environment. As in real life, ‘species’ is more of a high-level concept based on genetic similarity, reproduction, and ecological role, built on the behaviour of many different organisms.
Thanks for reading,