Nick's Auto-Evo Algorithm (Episode 1)

Introduction

One of the biggest problems I see facing Thrive is the question of how to implement Auto-Evo, one of the fundamental concepts behind the game. Here are just some of the questions that come to mind when thinking about how to implement Auto-Evo:

  • How do we design a system that automatically evolves the species alongside the player?
  • How do we it in a way that stays competitive with the player’s species and other AI species?
  • How do we even design a system that can look at the design of an organism and determine its survivability?
  • How can the system calculate the change in survivability with a change to a certain trait?
  • How do we use this system to track the changes in population of the player’s and other species based off of their traits over the generations?
  • How do we make it respond effectively to changes in the environment?
  • How can we do this all without melting the first computer that tries to run it?

This is a question I’ve wondered about since I joined the project many years ago, but never had any solutions for. Recently though, I feel like I’ve had some inspiration for how we can try to solve this problem. I will admit that many others have worked on this, and maybe I’m just re-treading old ground that they’ve already covered. But anyways, here’s my attempt at tackling this game’s fundamental system.

Also before we start, I’ve actually been sitting on this idea for a while and was planning to post it a while ago, but unfortunately my computer corrupted the file and I lost everything, so I’ve had to spend a while to regain the motivation to redo my work.


Let’s start with the basic premise that we know we want the Auto-Evo system to be designed around, taken from the current concept (with some paraphrasing).

Auto-Evo is a system that automatically evolves the species around the player. Evolution is semi-random but geared towards choosing good evolutions.

Okay, sounds simple enough, but it raises three fundamental questions:

  1. How do we calculate the effect of an evolution on a species?
  2. Once we calculate an effect, how do we determine how “good” it is?
  3. How will this tie into the overall gameplay?

Episodes

Episode 1 will answer the first question and cover the concepts of traits, species, populations, biology, physiology, and ecology, and ultimately design a Population Algorithm to calculate the population change of a species based off of its traits and its environment. This will be the first component of the overarching Auto-Evo system.

Episode 2 will dive into the concepts and mechanics of evolution and try to answer “How do you choose how ‘good’ an evolution is”. Using the Population Algorithm from Episode 1, we will derive a method for choosing how species are evolved each generation and assessing how “good” those evolutions are to keep things competitive for the player and realistic for the simulation. This will be the second key component of building the overarching Auto-Evo system.

Episode 3 will close by addressing the third question and discussing how this Auto-Evo algorithm ties into the game at large. It will also address how a slightly modified version of Auto-Evo will be used for assessing the success of the player’s species based off of a combination of the player’s design of their species in the editor, as well as their performance with their species during gameplay.

Strategies

To make the construction of this algorithm easier, we will have to use several strategies in its design:

Averages . Our goal will be to measure the success of the average individual from every species. Wherever possible, we will use averages to calculate or represent the statistics of the members of the species instead of individual data points. We will tend to treat the species as a cohesive unit. We won’t care about whether one member catches a lot of food, and one member doesn’t catch enough, we’ll only look at the average food caught between them. We also don’t look at whether they specifically win on a certain hunt or lose on another certain hunt, only the average success ratio across all hunts. Of course, when there are important details that should not be simply “averaged out”, we will consider them (like for example a human could not starve all year and then eat all their calories on December 31st).

Proportional Estimations . Some qualities can be hard to describe numerically to plug into an algorithm. How do you quantify something like the aggressiveness of a species with a number? Wherever possible, we will use proportions to estimate these traits. In the case of aggression, for example, you could model it on a scale from 0 to 1.0, where 0 represents engaging in an aggressive interaction 0% of the time towards another individual, while 1.0 means engaging aggressively in 100% of interactions with others. An aggressiveness of 0.5 would mean engaging in aggression 50% of the time.

Life Activities . If you think about the life of any organism, it’s essentially just a compilation of time spent doing all the different activities of life (aka “Life Activities” as we’ll call them). These include sleeping, eating, drinking, reproducing, socializing, migrating, etc. Each of these activities pose their own challenges to species, which can lead evolution to evolve traits adapting to each one. It might be hard to imagine how a longer leg would affect the survivability of a species when looking at the effect on its entire life all at once, but if you break it down it’s much easier to imagine how a longer leg would affect its individual activities such as its hunting, its migrating, its drinking, and more. Additionally, each of these activities can be completed at differing levels of performance. As a result, if we want to look at the overall performance of a species, we can start by looking at the performance across each of the different life activities it engages in and factoring them all into an overall performance score.

Building from the Basics . This will be a complicated algorithm with many variables, and it can be overwhelming to try and design an entire algorithm like this all at once. Instead, we’ll begin by making as many assumptions as possible and creating the most simplified scenario possible with the least number of unknown variables. We will call this example species Modelus Specius . This gives us something incredibly basic to start with to help us think about how to build up the framework for our algorithm. Here are some example assumptions for the initial scenario:

  • Members of Modelus Specius can instantly detect, teleport to, catch, and consume food
  • Consumption of food always yields 100% of the energy in it
  • Members of Modelus Specius do not age. They spawn as fully capable individuals that immediately begin functioning independently.

As you might imagine, this initial scenario will be extremely unrealistic, but luckily that doesn’t matter. We will one by one introduce all the realistic elements as we work towards making the final algorithm. Notice that it doesn’t take into account perception or camouflage (they instantly detect the food), movement (they teleport to the food), or metabolism (100% of food turned into energy). This means we’ll start by essentially just creating a population growth equation, and then incrementally introduce features like perception and metabolism and socialization to flesh it out into a realistic and accurate algorithm.

By doing it step by step in this way, we hopefully make it easier for ourselves to understand, to make sure it’s realistic, and in the end gives us the Auto-Evo system that we want!

Coincidentally, the initial simplified scenario is kind of similar to the beginnings of the 3D Multicellular stage. The starting organisms in the 3D Multicellular stage are very basic and cannot engage in many advanced activities (such as mating rituals or cooperative hunting), sort of like our starting simplified model. The process of making the Auto-Evo algorithm more complex by one by one introducing the elements of evolution will be sort of similar to the progression of the player through the Multicellular and Aware stages (only sort of, some parts are obviously very different like the teleportation).

Bundles of Statistics . At the end of the day, we always need to remember that the species and organisms in Thrive are just a collection of statistics, and we can always treat them as such whenever we need to. If it might seem daunting at first to build this algorithm, such as when we want to calculate running speed or the daily metabolism or the force of a bite, we should remember that the data for all of this will be defined in the Organism Editor. Stats like mass, surface area, muscle size, density, shape, bone layout, and more will all be available to us. Our job is simply to take this data and process it in a way that produces a realistic enough outcome.

Let’s Get Started

That’s it for the introduction. In the next post we’ll start with episode 1 and take the first steps to building the algorithm!

4 Likes