Nick's Auto-Evo Algorithm Discussion

For anyone following the dev forums, we’ve been working on a possible auto-evo algorithm here:

It’s planned to be around 3 episodes, and we’re still on the first episode, but we’ve made a decent amount of progress so far.

I figured it would be good to give a chance for people not on the dev forum to have a place to discuss it and ask any questions they wanted. I can’t guarantee I’ll always be available to answer questions so feel free to answer others if you’ve already read the part in question.

Just to start things off, here are a few questions:

  1. What do you guys think of the series so far? Do you have any feedback on how it’s written? Is it easy or difficult to follow?
  2. What do you think of how perception was implemented?
  3. What features do you think should be added to the model?
1 Like

This is a good idea for a thread. I have wanted to comment, but I have not had a place to do it. What do I think of the model? I think it’s great! Seeing the complexities of ecology being quantized and simulated is interesting. I find it easy to follow, but then I already am familiar with many of the concepts it references.

I am impressed with your implementation of perception. The idea to use that chemical equation for calculating particle interactions was very clever. I think your idea of spheres and averages makes sense, given that the simulation is meant to portray millions of years. Even if you could use cones, how would you know where to place them? Not all organisms have eyes on their fronts. I also like that you use general terms of perception instead of ones confined to aquatic organisms. I was never comfortable with the inclusion of swim speed, as that is a specifically aquatic statistic that would be meaningless for terrestrial creatures. My only criticism of the perception section is that gustation is a pointless inclusion, as it is so short-range as to be meaningless. A creature must touch something to taste it, which makes gustation indistinguishable from tactition. Besides, if the prey is close enough to be tasted, then the prey is almost certainly already caught anyway.

I think rarer types of perception could be implemented, such as electroreception. That would only be relevant in some circumstances, but in those circumstances it could be a great advantage. Furthermore, it could be evolved into a defensive or even offensive tool, like with electric eels. I find electricity-utilizing animals fascinating. I think adding radiotrophy is a great idea, and adding the ability to manipulate electricity in the multicellular stage would be very cool.

2 Likes

It doesn’t matter. Since the equation doesn’t track the positions of organisms, we’ll just use averages in all scenarios.

Oh yeah, that’s just because swim speed is specifically for organisms that can swim. Once I get to introducing aerial, and terrestrial organisms, I’ll introduce flying speed and walking speed as well. This is important for when you have organisms with multiple modes of transport like amphibians with swimming and walking, and birds with walking and flying.

Yeah gustation is a unique one. I’ve included it for now but I’m thinking it might be irrelevant in the hunting function of sensation and only be relevant in functions like communication or examining food. Like for example, in the case of examining food, gustation is very clearly different from tactition. A human could touch a fruit he finds on the ground to see if it is rotten, but taste usually gives the best indication of whether the fruit is rotten or it is good to eat.

Yeah electricity could be really interesting. Once we do a part on combat I’ll discuss different types of combat/damage such as blunt, pierce, slash, electrical, etc. However, Episode 1 is pretty limited in how much it can discuss the different available mutations for an organism since it’s mostly about calculating a population number from the numerical traits of the organism. In Episode 2 though, we’ll fully dive into the Organism Editor side, where we talk about how changes in the OE translate into changes in the numerical traits of the organism used in the algorithm.

1 Like

If you track different kinds of movement, I worry that there will be superfluous calculations. If swim speed is calculated for every organism, then there will be many organisms for which the number is zero (i.e. terrestrial organisms). The simulation would waste time calculating irrelevant factors. I don’t know whether this would decelerate the simulation, though, so my concern may be moot.

How will the simulation handle different media? It will need to differentiate organisms moving through air from those moving through water, as those environments favor different adaptations. Perhaps this could be tested by trying to replace the water of the current simulation with something else (e.g. gelatin) just to see how it affects the simulation, even though the game will not feature marmalade oceans.

I can see how simple attacks could be calculated (organism 1 attacks for 4 piercing damage but fails because the hide of organism 2 has a piercing armor value of 5), but I’m uncertain how more unusual attacks like venom or electricity could be simulated, as those affect many parts of organisms instead of only the point of physical contact between fang and hide.

1 Like

The extra calculations wouldn’t result in that much additional computing power, but just to be safe the algorithm will do a check on every species before it calculates speed for a certain type of locomotion. If it sees that that species is incapable of, say, underwater locomotion (swimming) then it’ll automatically assign it a speed of 0.

I’m not sure yet, the plan is currently that each medium is split into its own patches. So if a tidepool neighbours a beach, the tidepool is one patch (that is aquatic) and the beach is another patch (that is terrestrial). Then the sky above the two would be a third patch (that is aerial). I’ll discuss terrestrial and aerial patches more in a future part. However, the simulation currently does allow for different liquids to be comprising the planet’s oceans. If water was replaced by marmalade, for example, the higher density would reduce the movement speed of all organisms. This would currently penalize carnivores more than herbivores, since the glucose clouds prey of Propagatus and Minimus don’t run away.

Yeah I’m not sure yet how to implement that either. It’ll be interesting to see how we can try to add it in. It might be a similar approach of offence vs defence as sensation had with perception vs camouflage.

1 Like

But should it be a value of zero? Zero would mean that the organism cannot move at all in water. Perhaps it should instead be a relatively low value. Humans are terrestrial organisms, but they can swim (albeit slowly in comparison to fish). Hippos can be relatively speedy in water. This low value would be irrelevant most of the time, but this way a terrestrial species could evolve into an aquatic one, like the ancestors of whales did.

I’m glad the current simulation can handle different liquids. How will this patch concept be transferred to the multicellular stage? In Spore’s creature stage, the player could move anywhere on the continent with no loading screens, but that game did not simulate environments like Thrive is meant to. Would Thrive have instanced areas separated by load walls? If not, how would the game handle the player moving between patches during gameplay?

Futhermore, the simulation must be able to produce organisms that can succeed not only in the algorithm, but also in gameplay against the player. I worry that a species might be successful as a mathematical abstraction but flounder uselessly when put into the game world, like an AI uploaded to a body it is not able to control.

You could add some stat like “electrical defense” in the simulation, but I worry that that would be too gamey and arbitrary. Then again, the simulation should not become distracted be overly minute details.

2 Likes

Depending on the creature, yes or no. I know what you mean, like for example dogs are a terrestrial species but can swim if they need to. And maybe a future climatic event will kill all dogs who can’t swim and evolve them into an aquatic species. Different locomotion speeds will likely still be calculated for those species. But for some species that physically can’t (like a fish that physically can’t fly) it’s not worth calculating.

That’s more related to gameplay than the auto-evo algorithm, but there’s not intended to be any loading screens between patches. We only divide the planet into patches for the purposes of the algorithm and other such calculations. In gameplay though, it’ll all be one continuous environment.

That is a good problem to consider while building the algorithm. I can’t really answer it at the moment because it’s something I’ll come back to in Episode 2 once I’ve built the entire algorithm for Episode 1. Ideally though, the traits that are selected for in the algorithm should represent the traits that are most important and competitive for the environment/ecosystem the species is in.

1 Like

Hey, @NickTheNick ! I have chosen your auto-evo proposal as a topic for my presentation during my AI lesson covering the topic (can you guess?) evolutionary algorithms. I’d like to ask you a few questions for the sake of my presentation, if you don’t mind.

  1. Is the algorithm somewhat capable of picking organelles already? I would like to give the class some visuals of the evolution performed by the algorithm itself. I have no problem making them in the free-build editor myself, but I would like to do so based on the algorithm’s decisions.
  2. What is the current equation for population? I am assuming it’s not a short one.
  3. Any interesting info you think I should mention?

Thank you so much for helping me out and of course, for writing this beautiful piece of auto-evo! If I come up with any more questions, I will make an edit/addendum, but currently this is all I can think of so far. Thank you one more time.

2 Likes

I’m not Nick but I feel like I want to address a few things.

All of the finished parts of the algorithm are explained here: https://forum.revolutionarygamesstudio.com/t/nicks-auto-evo-algorithm-episode-1/629
Unless Nick has some super secret stuff he’s done since the last episode, that’s all there is to it.
So there is nothing to convert given species list of organelles to the properties of the species that are used in that algorithm. Also no actual mutation or anything like that is included in the algorithm. I’m a bit worried that currently it just does not count as any kind of AI algorithm and might be unsuitable material for any serious AI course (university level course).

That’s something I haven’t really considered. Perhaps I can present the goal of the project Nick is working on. And maybe if I assign the organelles currently available some values, such as osmoregulation cost, how they affect speed and such, which could be then varying the input of the algorithm in the equation for population, I might be able to mash together a very basic and simplified beta for at least some sort of a showcase. Since the population numbers are what determines the success of the mutation, there might be one of the fancy showcases common to evolutionary algorithms that show each generation and their population numbers. (I would make their visual representation in the free-build editor).

Hey @Zahyyy I appreciate the support! Unfortunately, as @hhyyrylainen pointed out, the algorithm’s design is only in Episode 1 right now, which means that I’m still just working on an algorithm to solve for the final population using all the inputs (traits) from the species and environment. Episode 2 is going to be all about how changes in the OE (like adding or removing organelles) can change those inputs, and how to “smartly select” those changes (evolutions) for AI species. So to answer your questions:

  1. Currently, no. However, as you pointed out, you could make your own list of organelles/evolutions and pick trait changes that you think could represent those. Basically equal to doing an early draft of Episode 2. The full list of traits that input into the equation are in the Original Post of the thread I post all the updates on.

  2. Unfortunately, VERY long. It’s also reached the point where it’s not just a single equation anymore because there are certain variables in the equation that have conditionals as to what their input/formula is. Like for example, body volume has a certain formula if you are a sphere, but a different formula if you are tear-drop shaped. The overall general equation for population growth though is below. Everything in the algorithm just contributes towards calculating one of the below terms.

    Final Population = Initial Population + Births - Old Age Deaths - Starvation Deaths - Predation Deaths

  3. If you read through the thread, there should be a lot of visuals, diagrams, graphs, and charts available representing how the algorithm works and example simulations using the algorithm that you’re free to use. For example after the part on predation (part 7) I did a sub-part on explaining the changes that had been made (part 7.1) and that post contains a lot of diagrams and visuals if you want.

3 Likes

Thank you so much! I will try to put together a very simplified version of what will come in the episode 2, just so that I can give the class some kind of a demonstration of the algorithm in practice. Also, I will try to put all the pieces of the equation together (as in I will try to write in in a form where every variable is DIRECTLY affected by the mutations), just so I can directly see what has what effect. Also, I love the visual in the 7.1. of all the traits that affect the final population. Thank you for giving me the permission to use it, I sure will! Also, the “bottom row” of the visual is what I will try to write the equation as. Thank you one more time, if I run into any issues, I might have another question or two, but for now, it’s time to get started. Thank you!

2 Likes

Hello, @NickTheNick, I have started dissecting the equation and I think I am going absolutely crazy. How could you have put this all together and remain sane? On one hand I don’t want to bother you, as I guess you are busy working on the algorithm, on the other hand, I have a lot of questions. So if you don’t mind, here they are.

  1. In part 7.1 you have the table to calculate the Base time per hunt and Success rate. Is the Success rate represented in the graph in the same part by “Completed hunts” or “Chase success”?
  2. Is Available hunts = Prey population/Prey energy yield? Where does the Required hunts step in?
  3. In my first question I mentioned the Base time per hunt. What is the difference between that and Time spent hunting and Time per hunt?
  4. Is Required hunts simply Base metabolism*Population?
  5. The thing I struggled with the most was calculating Time spent hunting. Honestly I don’t even have idea where to start. I cannot figure out anything between Chase success, Competetivness and Time per hunt and Time spent hunting including those mentioned and I feel really stupid, but I’m genuinely lost.

I am sorry one more time. I’ve scribbled over several papers and I’m still not sure how to continue. I admire your dedication and your talent of not going crazy from this project. I will highly appreciate any help. Thank you so much.

Edit:
Does the average distance from predator to pray in the table in 7.1 equal to distance per hunt? (which is (0.66patch length)1-(4pd population densitypy population density*(1-avg clustering))-pd body radius - py body radius)?

Also, my current dissection of the equation looks like this:

Final Population = Initial Population + Births - Old Age Deaths - Starvation Deaths - Predation Deaths

Final population = Initial population + (Initial population * Litter * Reproductive Fraction * Mating frequency) - (Initial population * 1/Lifespan) - (Initial population * (1 - (Calories consumed / Base metabolism * Initial population))) - Predation deaths

The things in bold are the things I have trouble dissecting. The things in italics are the “base elements” of the equation that cannot be dissected anymore. There are some other things I have dissected, such as spatial density, distance per hunt, and so on, but I have trouble “getting to them” in the equation because of these three things in bold. I assume that Mating frequency is Free time - Time spent hunting, but that would be immediately in bold as well. Also, one more question - what exactly is reproductive fraction?

Thank you! I appreciate the support, and it definitely is a challenging project.

Before I answer your questions I’ll stress that this algorithm will be obscenely long if you turn it into a single mathematical equation. It’s also actually not possible to do so, because as I said there are a lot of conditionals in the algorithm (like “if A, then do B, but if X, then do Y”), so to turn it into a single equation you’d have to assume a lot of things, like a scenario where A and X and several other conditionals are true. A good example of this is the Endurance vs Speed Hunter from part 7. If you know this and still want to do it though, then don’t let me stop you all power to you.

Additionally, I would recommend to read the relevant posts for the topics you have questions on before you ask the questions, because they really explain each concept pretty thoroughly. I can also provide you with the script if you want, but I don’t know how familiar you are with code and reading it.

With those two things in mind, I’ll do my best to answer your questions:

  1. Chase success
  2. Required hunts is the total number of hunts required by the species to feed all their members. Available hunts is how many prey there actually are that they can hunt. Required hunts is thus limited by the available prey to produce available hunts.
  3. Base Time per Hunt is the average time it takes for a predator to catch the prey. This is then modified by competition modifiers which can increase the total value to produce the actual, final, Time per Hunt. Time Spent Hunting is a proportion of the entire month, aka how much of the month is spent hunting instead of reproducing.
  4. No. Base Metabolism * Population / Prey Energy Yield.
  5. Time Spent Hunting is the time out of the month that is spent hunting. You just find the total number of hunts that the species performed, and multiply it by how long each hunt took. Then you divide that by the total time in a month.

Yes.

Mating Frequency is how often the species reproduces. It’s a trait, so it doesn’t change. You then multiply it by the time in the month which is spent reproducing, as well as the other factors you have listed, to get monthly births. The time spent reproducing is as you put it, the free time minus the time spent hunting.

Reproductive fraction is how much of the population can reproduce. In humans it’s 50% because only females can reproduce. In my example I use a species that uses asexual reproduction so I’ve used 100% so far.

2 Likes

Hello again, @NickTheNick! I have somewhat finished dissecting the algorithm. I have a hunch that the solution I came up with differs a bit from yours and is a bit simplified, but it should more-or-less work. So my next task is assigning mutations with the variables in the equation.

That would be amazing. I am no expert when it comes to programming, but I’m at least somewhat familiar with it, so I think that might be a great help as well. Thank you for all the help, I really appreciate it!