The Technology Behind Ecosystem

Published by Tom on

Hello everyone! For this update, I thought I would cover a little of how things work underneath the hood. I want to ensure that the simulation of evolution and animal life in the game has a lot of depth, and I thought this brief look might help to give a little sense of what’s possible.

Limbs

As far as the simulation is concerned, a creature’s body is a collection of simple physics primitives jointed together, each of which can have any dimensions and can be combined in any way. To render it on the screen, the game builds a procedural mesh based on this structure, looking at how it’s linked together, the size and shape of each body part, and clues about how each part may move. One of my top priorities is supporting a variety of very different creatures, so I wanted to make sure that changes to creatures’ bodies weren’t a matter of swapping premade limb models, but instead that evolution could reach in and fundamentally change how the creature looks. A creature’s face is selected from a set of premade meshes, but everything else is entirely a consequence of how the simulation plays out.

An early target-seeking creature, rendered as simple physics objects

Evolving to Cheat

Interestingly, creatures tend to be perfect cheaters. They exploit every feature of the environment, no matter how strange or unintended. For example, many modern physics engines do not conserve angular momentum for performance reasons. In the earliest versions of the game, creatures would frequently evolve to be ‘living propellers’ because the laws of physics in the universe they lived in allowed them to generate free energy by doing so. Another example is that creatures needed to be carefully coded so that their AI and the physics simulation run in lockstep with each other. Otherwise, species evolved that could only swim at the specific framerate the game was running at in their ancestral environment, as though that was as natural a feature as temperature or pressure. Species could go extinct because you installed a new graphics card and they weren’t adapted to that environment.

A later offspring of that target seeker, skinned with a procedural mesh

Symmetry

One thing that several backers have asked about is symmetry of creatures. Over 99% of animals in real life exhibit bilateral symmetry, so it’s interesting that it seems less common in the game. The view of biologists is that symmetry helps with steering and stability; for example, asymmetry would result in different amounts of drag on each side of the body, which would have to be constantly corrected for when swimming toward a target. Ecosystem does simulate drag on creatures when they swim, so why is symmetry so much more rare? I suspect it may have to do with the way the DNA is encoded. In nature, genes tell a cell what to do in-part based on their chemical environment, and bilateral symmetry largely results from a bilateral symmetry in this chemical distribution. For example, specific hormones are different at the top and bottom of a creature, distinguishing them; this doesn’t happen on the left and right sides. In this way, symmetries are ‘easier’ to evolve from mutations in nature than they are from mutations in the game. In-game, the simulation of natural selection should still favor symmetry, but since population sizes and timescales are also much smaller than in real life, it is possible that it just rarely gets hit upon. I’m looking into adjusting the way that DNA is stored and how mutations affect it to see if I can make symmetry less rare.

I hope some of that elucidated what the game is capable of. Thanks for reading!

Categories: Tech

Leave a Reply

Your email address will not be published. Required fields are marked *