A roadmap for implementing auto-evo

@Maxonovien and I were discussing on discord, and figured it would be good to move the discussion here:

The Problem

Since the inception of this thread, there is now a working Auto-Evo system in the game. So congrats to us on that, and specifically to the devs who made that. However, there have been a lot of new features added to the game, and the current system does not know how to take account of them in calculating its outputs.

Additionally, as far as I know the current system is energy based, which I think is limited in how well it can take into account all the different factors of evolution.

Short Term Solution

I think that currently, a lot of the new sources of confusion are in calculating competition between species for the same resources. One way we could handle this is through something I call the “Contest System”.

The Contest System

For every resource which multiple species can compete for, the game holds a contest. For example, let’s say two species (Predator 1 and Predator 2) are hunting the same prey (Prey 1). The game will run a “Hunting” contest to see how successfully the two compete in hunting Prey 1.

To hold the contest, the game assigns a “Rating” to each predator. The rating is calculated by multiplying several of the predator’s relevant stats together, alongside weights for how important each stat is. These stats will be chosen and weighted according to how important they are for hunting. For example, we could choose them to be speed at 150%, attack damage at 100%, health at 50%. The calculation for a given predator’s Hunting Rating would then be:

Hunting Rating = (Speed * 150%) * (Attack Damage * 100%) * (Health * 50%)

Let’s say Predator 1 gets a rating of 200, and Predator 2 gets a rating of 100.

The prey can then be assigned a “Hunting Defence Rating”. This can be calculated using the same variables and weights, or different ones, if we felt like the defender in such a situation should employ different tactics.

Let’s say Prey 1 gets a rating of 150.

The total contest’s pool is then just the sum of all these ratings. 200 + 100 + 150 → 450. Each species gets a share of the contest’s reward based on what percentage of the pool they comprise. So Predator 1 represents 200/450 of the total pool, so he receives 44% of the total reward. Predator 2 receives 22% of the total reward, and Prey 1 receives the remaining 33%.

The reward of the contest is the total energy/nutrients of Prey 1. Since Predator 1 was calculated to win 44% of the pool, he is given 44% of Prey 1’s energy, and this is converted into an associated number of predation deaths for Prey 1. Same is applied to Predator 2. Prey 1 receiving 33% means they get to keep 33% of their energy since that was the portion of their population that successfully evaded predators.

Such a system accomplishes:

  • Can calculate a single predator hunting a single prey, or multiple predators hunting a single prey. It will dynamically calculate a reduction in success for all associated predators if the prey evolves better defences.
  • Can easily add new variables by simply adding them to how the rating is calculated. You can also easily alter the weights of each variable to balance them.
  • Is very flexible. We could expand this in the future to hold several contests for the different stages of hunting. An initial “Chase” contest to see which predators catch the prey, a following “Combat” contest to see of the caught prey, which predators manage to kill and eat them, and a following “Scavenging” contest, where scavenging species fight over the remains. We can also calculate different ratings based on what form of hunting the predator uses, be it Ambush, Pursuit, Endurance, etc. This will then change what variables are multiplied together in calculating that rating, so for example Ambush Hunting would reward camouflage and acceleration, Pursuit Hunting would reward top speed and stamina, and Endurance hunting would reward mostly just stamina. It can be applied to other situations as well, like photosynthesizing cells competing for sunlight, cells that rely on osmosis competing for absorption rate, etc.

However I could be entirely wrong in my analysis of the shortcomings of the current system. Regardless, I did want to take the chance to mention the idea of the Contest System, as I think we could use it to get a lot more functionality out of the Auto-Evo system.

If you have any thoughts on the current shortcomings, and any potential solutions, for the current Auto-Evo system, please share!

Long Term Solution

I think long term, the Energy based system will not be able to simulate all of the aspects of evolution we will one day want it to simulate. I do predict that long-term we would be better off switching to a Population-based model. I still have my prototype in the books and could start producing a simpler, “Early Implementation” version of it down the line if it would help.