Population System - Species Splitting

ive also seen some species transition into super aggressive predators from something super docile. And the evolution of toxins so that things dont eat them (because if they eat them the toxins are released) Eg, teh species wont use them at all, they will just have them. (Because its factored into wthey something tagets them, in the predator/prey calculations, and me avoiding eating them lol)

On the subject of species splitting what I’ve got in the OP is what I’m currently thinking. That if there is a single species in a patch it will split over and over until the patch is full of life, species with a very low pop will become extinct. Also if there are neighbouring patches sometimes there will be a split and some part of your species will get moved to the neighbouring patch. I think this sort of splitting is relatively close to what @Untrustedlife is already doing, though feel free to correct me if I have misunderstood.

If anyone has other ideas or contributions to species splitting feel free to post them. This stuff is slated to be implemented this patch so now is a good time to speak up if you want any changes made.

I haven’t fully thought this out but I think species splitting shouldn’t be based on the population.

Some other ideas I’ve had:

  • Species splits when a part of the population is cut-off from the rest. So if you have 1 species spread to 3 patches and the population of it goes to (near) zero in the connecting patch then both of the populations in patches 1 and 3 get converted to new subspecies.
  • A species is split when it has good amount of population, some time has passed since splitting, and auto-evo ends up creating 2 almost as viable mutations. So at that point the main species would take 1 of those and a new subspecies would be created from the other mutation.
  • And then there could be some niche detection where separate niches would bet split into different species. I think this is the most similar to just “have a large population to split” approach, but also a lot more involved.

These are much more difficult to implement and depend on a proper auto-evo implementation, which isn’t going to be in 0.4.1. So these can’t be implemented yet, but this is the direction I’d want to take species splitting.

Interesting.

I think species splitting inside a patch is realistic if we want to use it, it’s called Sympatric speciation.

I’m not sure what niches means in this context, could you explain a little more about it?

You’re not the first person to talk about having a single species spread to multiple patches. I may need to relent on this one. I think my questions about it are:

  • if every species is only in a single patch then we can run auto-evo and population calculations separately for each patch, however if there are single species which exist in multiple patches then we need a more global system

  • with auto evo what if the species is being pulled in two different directions? For example if a species is in two patches, one which has sunlight and another that doesn’t and auto-evo recommends a chloroplast that seems quite unrealistic for the part of that species that doesn’t live in the sunlit patch.

If anyone has a clear idea how to get this stuff to work I am open to it.

I think that’s what I mean. I just didn’t have the words to describe “living in the same space but managing to split the breeding population”.

This would be one of the places where auto-evo should split the species, by finding two mutations that greatly benefit different parts of the population. Thanks for finding a concrete example for how my idea could work.

My thinking is that each species doesn’t have a global population, only population per patch. So the calculations would only be different in terms of how the effectiveness of a change for a species is calculated, and the migration as I’d like that a species that has low population in some patch but high population in a nearby patch would “reinforce” its numbers from the other patch, and this would be way more common than other migration attempts. And with the effectiveness calculation it would get the overall best mutation for all the patches it inhabits or as I said before the species could split with regards to some criteria.

I think maybe there isn’t so much difference. For example if population and auto-evo are run per patch then the difference is that either you split the species when they transfer patches or you split the species when auto-evo starts diverging them, the result would be similar I think. I can see that having a species across multiple patches would be cool.

One thing is a species could spread to 6 patches and then 3 of them could break off to form new species so it means a binary tree wont work, it needs to be a non-binary tree, which makes things more complicated to implement but not hugely I guess.

I’m looking forward to handing this off for implementation so if you’ve got ideas you’d like to add then go for it. I’ve got the plan in op of this thread and the energy based auto evo here. Hopefully that is enough for a tier 1 implementation and I’m also happy to discuss stuff.

Im not sure that allows for evolutionary radiation

I think that it should be possible for single species to split off multiple subspecies in a patch that take on different niches there. EG if one creature does really well a in a patch and there are many niches available it should be able to split off into those different niches, i think it would make each patch more unique and be more realistic.

1 Like

Ok I thought about this some more, I think there is something we could do which would give more people more of what they want.

For this post I’m going to rename what is a “species” in the op as a “sub-species” and it just means a group of identical individuals that live in one patch.

I think auto-evo should be run per patch on each sub-species. I haven’t heard any suggestions of how to rewrite it and I am not keen to make it take account of multiple patches because that sounds like a computational nightmare. Each timestep the population of every sub-species is computed in each patch based on the conditions and interactions only in that patch.

One layer up we can have species. So each sub-species has an “species template” which is the organelles that the ancestor that started their species had. Then each time a sub-species is mutated by auto-evo it checks to see how different it is from it’s species template, if it is similar then it is still considered as the same species, if it is sufficiently different then it starts a new species with itself as the new species template.

For example the first sub-species is a single hex of cytoplasm and it’s “species template” will be itself. Maybe this species evolves to add a flagella, then splits into two, then one of them gets another flagella and the other gets some chemosynthesizing proteins but both are still considered the same species. Then maybe the first half gets a pilus and now that it has 2 flagella and a pilus it’s too different from the single hex to be considered the same species anymore so it gets made into a new species with itself as the template. The other half, which has just one chemosynthesizing proteins is still considered the original species.

This would mean that a species can be a larger thing, there can be some variation between sub-species, even in the same patch, however all the sub-species would be related and pretty similar. It would also allow species to spread out over many patches.

Above this we could have other layers, each sub-species could have a “genus template” in a similar way where it is allowed to be further from it before starting a new genus. We could have as many layers as we want.

I think this would give us single species across multiple patches in a pretty simple way which wouldn’t be hard to implement. It would keep all the sub-species interactions local which makes things easy.

Anyone got input? All feedback welcome.

1 Like

Thats sounds like a great, and deterministic, way to know when a new genus splits and when new species emerge.

1 Like

While @tjwhale s propoposed system will work great for now, I‘ve come up with a slightly more complex system for the midterm future that offers some advantages in my opinion. I‘d love to hear some feedback. Is it doable or is it too complicated? Do you see the advantages it may offer?

species splitting dynamics.pdf (86.5 KB)

2 Likes

I didn’t read the discussion on discord and I didn’t spend a lot of time reading that pdf, but here’s some points.

This seems very similar to what I suggested. And this doesn’t really address the most difficult calculation: how is the usefulness calculated. My idea solves that by making random mutations that can then be simulated forward in time to determine how good it is.

So I’ll reiterate the main points about my idea:

  • Species can have populations in many patches
  • Each species is simulated with 5 (roughly) random mutations and their usefulness is calculated based on how much they would gain population overall against other species.
  • Based on the usefulness of the mutations the main species will apply the most useful and then the species may split if there is a second very useful mutation.

A few amendments to my idea that I stole got inspiration / idea for from your plan:

  • Each patch’s population tries to send some population to a random connected patch. This will either reinforce the population of the species in that patch or create a new population in a patch which might succeed there and gain a foothold.
  • The chance of splitting the species increases as the global population increases.
  • It is possible for the species to split in only one patch if it has relatively hugely beneficial mutation it can take there. Otherwise the split would be in all patches at once if there isn’t a mutation that greatly benefits only a part of the species. So for example if the species is trying to establish a foothold in a hydrothermal went and it is also in a bunch of other patches then if one mutation is a chemoplast it would be almost guaranteed to split to a new species in that went.

I’m still convinced my idea (with possible tweaks) is the best one :smiley:

And while I appreciate this discussion, even if I don’t have the time to properly participate all the time, I think we just have to go with a basic implementation (my idea is good also in that regard that it doesn’t require much that other ideas wouldn’t also need, so no much wasted work) and then see concretely what these different suggestions do to it. So we could stop speculating as to what works, because we all have no experience in making an evolution simulation, so our intuition and ideas are probably not spot on.

3 Likes

I agree with this. I’ve had enough of discussing it as I think we don’t know how it’s going to feel yet. Lets just implement something simple and then iterate on it.

2 Likes

I had an idea last night which might work to keep species together a bit. If you make a species a group of groups which are in multiple patches then when auto-evo works on that species is runs 5 mutations in each patch locally to see the impact on the species.

Then, from the mutations which were beneficial, it chooses the largest subsets of the groups it can, in order to try and keep the species as blobby as possible.

So for example imagine a species is in 5 patches and the mutations tried had results

no change = control
chloroplast : +4, +3, +1, -1, -5
flagella : +1, +1, -1, +2, +2
pilus :+8, -1, -2, -1, -1

In this situation if auto-evo is run only locally, patch 1 will get pilus, 2,3 chloroplast, 4,5 flagella which would split it in to 3 species. If you just average the results the pilus wins in all patches even though it is detrimental in 4 of them, which is mad.

However the largest subsets algorithm would pick flagella for patches 1,2,4,5 and then chloroplast for patch 3. This means it only splits into two species AND every group in every patch definitely gets a beneficial mutation for it, so it is reasonable that it is adapting like that.

The drawbacks are some really beneficial mutations get missed out on, like the +8 pilus is not chosen, and it’s still a bit “spooky action at a distance” because the mutations are being chosen based on patch conditions in other patches however it might be reasonable.

This would be a way of having a species be made of identical groups in many patches, have them all adapt only to their local conditions and try to keep them together for as long as possible.

1 Like

Exactlly, the way it works right now with populations that go up and down based on successful hunts/death/reproduction etc and split at certain amounts and go extinct at certain amounts, are essentially a stopgap measure for calculating “usefulnes” and if we want to make this work for multiple patches, we need a system that can calculate usefulness and it should do so in a non-biased way (we shouldn’t assign usefulness ourselves because our ideas arent nessessarily the best ones, thats the whole point of an evolutionary algorithm). The reason being s that we cant do proper Darwinian evolution, in a way that would not kill a computer at the moment (at least in thrive, this can be explored easily in smaller simpler games)

1 Like

Here is some discussion from the discord.

OBPSGToday at 01:01

-In response to the concerns that making migrating between patches incur a Muation Point would force the player to choose between expanding to a new patch and improving their species, I propose avoiding that issue by adding a new currency related to migration, let’s call it migration points for now for simplicity. The way this currency works would be similar to as follows: Each species (including the players’) automatically generates a certain number of migration points based on its total population across all patches at each reproduction cycle/auto evo step. Then when a species wants to colonize a new patch, they pay the cost in migration points associated with the link that gives them access to that patch. This dynamic would allow more successful species to spread across patches faster. We can work out the details for calculating migration point costs of each type of link later, and add additional evolutionary restrictions if we would like.(edited)

Goro von BismarkToday at 01:13

wouldn’t it be easier if that currency was directly the species’ population?

If you migrate to another patch half of your cells go to the new one, spreading your species thin

But over more patches

crodnuToday at 02:24

Maybe we could make it so unsuccessful species get more mutation points and more successful ones more migration points?

1n48ygToday at 03:05

I agree with dividing the population when migrating to a new patch. Because at the scale of microbes, when migrating to a foreign environment, the changes that happen to your cell to adapt to the new environment are probably significant enough to label your new cell as a seperate species from the predecesor it evolved from.

TJWhaleToday at 09:23

I think species spreading between patches has been quite a controversial topic, there was a long discussion here with a lot of different ideas.

What I’d suggest is for now we do the simplest possible thing to get the system working and then we play with it, see how it feels, and iterate to make it feel better. Towards that end I’d suggest for ai species simple select some at random to split and move patches each time the player enters the editor. Let me know if that is not easy for any reason. For the player I think we should just offer them the chance to split every editor session if they want without restriction. If this turns out to be too much then we can have a currency to limit them, or limit them based on population etc. However we don’t know yet how often the player should be able to split, every 2 editor sessions, every 3, 4, 5 etc? The idea of a splitting currency is an interesting one if we need it.

Goro von BismarkToday at 09:32

There should be a risk when spliting to new patches so the player has to make sure to adapt to them first. Loosing a good chunk of your pop when traveling to a hostile patch is a good threat to adapt imo

1 Like

One of the main goals for 0.4.3 is to finish this discussion and get this stuff implemented.

Feel free to read the above if you’re interested but TL:DR:

Things which are agreed: We have a set of patches with connections between them. In each patch lives some “population groups” (I’m just calling them that to have a word for it) which are a group of genetically identical individuals. Each “turn” (each time you go to the editor is 1 turn) there will be some amount of a: population groups being split into two, b: population groups being split into two and one half moved to another patch and c: auto-evo editing the population groups.

The goal of this discussion is to finish working out the exact mechanics of how this works.

The first question is “what is a species?” One option is to have each population group be it’s own species and if a population group is split (and maybe some is moved to another patch) then it is now 2 species. This means a species can only ever be in one patch and everything is very straightforward.

Other options people brought up above include that a species is many population groups. For example if a population group is split and half is moved to another patch then those two groups are still part of the same species.

If we have a system like this there’s a bunch of questions we need to answer:

If a species is many population groups in many patches what happens when auto evo suggests different mutations in different patches? Are the auto-evo results aggregated somehow? Can a species have non-identical population groups (such as 2 thylakoid + 3 thyloakoid prokaryotes could be part of the same species) if so how different can they be? If species must be identical population groups under what conditions are they split up?

When can species move? How far can they move? Can each population group only move to neighbouring patches each turn, can it move multiple patches or possibly to the whole map?

When population groups are split inside a patch are they still the same species? When should they split, under what conditions etc?

I think personally I don’t really mind how this works. What I want is for it to be relatively simple without a huge amount of calculations and complexity and also I want to avoid “spooky action at a distance” where if a species is in both some sunlit patches and an abyss then the ones in the abyss get a choloroplast because that was the average auto-evo result or things like that. I think population groups need to adapt to the patch they are in relatively tightly.

2 Likes

I like the option that a species may be in multiple patches at once. I have coded the current system so that everything should work with a species spanning multiple patches. This also allows forcing the player back to a previous patch to work very easily. Just have a bit of code that moves the player back to a patch where they have population if their population in the current patch drops to zero.

In our model a species is uniform. If there would be members of a species with different organelles, then that is a different species.

I coded the current auto-evo to select the mutation (remember the actual population algorithm is random) that leads to the highest global population for the species.

I think there should be a population limit after which the species would have a random chance (that increases with population) to move some population to a mutated version in one of their patches. Also there could be some random chance here that the new species is put into a connected patch.

I’d say each auto-evo cycle each species that isn’t basically extinct (ie. very low population) is given three chances to try to spread with a random fraction of their population in one patch to a neighboring patch. Out of these the move that results in the greatest population gain is selected, if it is positive. ie. if a species would basically just sacrifice a bunch of their population even in their most optimal move, they wouldn’t be allowed to move that auto-evo cycle.

To one connected patch. No multiple moves per auto-evo cycle. Maybe they would be allowed to try to move from each patch they are in, but I like the simplicity of allowing to move from one patch during a single cycle, this would also mean that a widely spanning species doesn’t get a huge buff to spreading to more patches.

Code-wise it would make it unnecessarily complex if a single species is allowed to have different population groups inside a patch. Basically the code stores populations as a tuple: (patch, species, population) This change would require splitting the population variable somehow and I don’t see much benefit in a such a complication.

To me it doesn’t make sense to let AI species move with different limitations than the player.

I also don’t mind that much, but I’m suggesting solutions that are easier to implement taking into account the current code. I have so many other things to work on that I’m hoping someone else will do all the auto-evo changes for next release.

If having unnecessary organelles in the abyss was punishing enough auto-evo would not choose such a choice. Unless it makes their population bloom on the surface, but that could then quickly lead to that species extinction in the abyss.

Having huge penalties for not being optimal would quickly make species extinct that aren’t to your liking (in that patch, they could still have population elsewhere).

We’ll probably also need some emergency splitting algorithm if life is entirely in danger of going extinct (in the old version there was a minimum species threshold which triggered additional species appearing from thin air).

Oh boy, here we go.
As most of you might remember I was (at times too) exited and vocal about my opinions on this topic the last time we discussed it.
So I will try to restrain myself this time around.
Firstly, I agree with hhyyrylainen that A: all members of a species should be identical and B: a species should be able to exist in multiple patches simultaniously.

The way I see it every simulation is inherently a simplification of reality. Therefore, when creating a simulation, one has to decide where stronger simplification makes sense and where it‘s important to not simplify things too much.

A is a simplification which in my opinion makes a lot of sense.
B is the antithesis of a simplification which in my opinion is applied at the wrong place.
This is the simplification that patches are very strongly separated from each other and have very narrow bottlenecks in between them.
In reality the equivalent of „patches“ (which are a construct, not an actual well-defined entity) have very fluent borders. Over the time of one turn (that is multiple millions of years) a lot of microbes will be randomly carried around in between patches by currents. If a species inhabits two adjectant patches it doesn‘t compromise of two clearly separated populations, but rather of one more or less continuous population.

Some rambling, feel free to ignore

Therefore, if a species inhabits two patches, an epipelagic and a mesopelagic one, and 9/10 of its specimens live in the epipelagic layer, a chloroplast has a high chance of evolving in this species as a whole. The chloroplast might be useless in the mesopelagic, but it‘s so useful in the epipelagic that the chloroplast-bearing specimens might even replace the non-chloroplast-bearers in the mesopelagic through sheer numbers, even if they technically face a disadvantage in the mesopelagic. More of them might die off in the mesopelagic compared to their better-adapted brothers, but there‘s a constant supply of chloroplast-bearers from the epipelagic.

Because of this I don‘t think this is a case of “spooky action at a distance”, but rather a normal mechanism of evolution which I think we should implement.

One reason I‘m in favor of this is it helps curb another realism-problem which Thrive faces: Thrives evoltion is too inventive. Real-life evoltion is an innovation-machine, but most of the time it‘s also a pretty conservative force. Pivotal adaptions like a mitochondrion or a chloroplast, as far as I know, only happened once. Once a recepy works, evolution tends to stick with it. There are, as far as I know, no examples of a primary producer becoming a predator or a predator becoming a primary producer. This is because both extremes are effective, while intermediate forms are ineffective. You can‘t bridge the gap with one fast jump and since passing it in small steps leaves you vunerable while you‘re „in the middle“, the gap is not crossed at all.
This approach would help make evolution in Thrive more „conservative“ as it currenlty is.

What worries me about averaging auto-evo results is that it’s blunting the population groups ability to adapt to the patches they are in.

For example if a species is in the vents it might choose to get rid of all chloroplasts and use the H2S as an energy source. However if it is also in 5 sunlit patches then it will never do this because on average that would be a bad idea.

A species which is adapting to the average of a bunch of patches isn’t fully adapting to any of them. How big of a deal this is I’m not sure but in some sense the more patches you spread to the less change you have of making a meaningful adaptation to any of them.

Is it also true for the player that each editor session they are trying to choose organelles for all the patches their species is in not just the one they are swimming in?

I disagree that all patches should somehow be considered as well mixed. I think that kind of defeats the point of having seperate patches. For any neighbouring patches it’s reasonable to consider them as well mixed but as soon as you get a chain going across many patches the idea that they are all well mixed doesn’t make sense. Like an abyss is going to end up well mixed with a tidepool half way across the planet?

Below is some stuff about carnivorous plants which isn’t important.

So there’s venus fly traps etc and I’ve heard a theory that brambles are a predator for sheep (they get tangled and can’t escape). “True carnivory is thought to have evolved independently nine times in five different orders of flowering plants,and is represented by more than a dozen genera.” Link And there’s animals that photosynthesize.

Maybe that’s not so much what you mean though, you mean a tree can’t become a cheetah or something? Single celled yeasts apparently evolved from multicellular ancestors so pretty much anything can evolve into anything else I think, given enough time.

If the population penalty in a patch for not being well adapted is huge, a species will quickly go extinct in a patch in a case where an adaptation is chosen to adapt to another patch. This could probably be implemented as a single configurable variable, meaning that it’s very easy to tweak this later. Whereas if species can’t span multiple patches approach is chosen, we’ll be way more stuck with that choice.