CPA Prototype

Yeah I’ve been thinking something similar, I like what you’re saying.

Re having a constant + polynomial cost function my concern is that is too heavy handed. Like we want microbes which are like grass, right, which have just chloroplasts and plant cell walls and are able to breed like crazy fast. And we also want the big complicated predators which have loads of organelles and win every fight.

I was thinking that maybe we should think more deeply about what we are trying to model (in the hopes the results will fit nature more closely). Like why do you need mitochondria? Because you want to be able to produce a lot of energy. So maybe I should turn the energy cost of flagella up a lot so that you need to have mitochondria in order to power them (maybe we should have other cells which cost energy, like bioluminescant or water pumps).

Same with lysosomes, why do you want to break down protein (rather than just immediately use it for growth?). Maybe it’s worth having like “self protein” and “other protein” and you can’t turn “other protein” or “other DNA” into more cells of yours you have to break it down and built it up again. That would make lysosomes useful, as you suggested a while ago. Right now protein is much more valuable to you than it’s components so it’s never worth breaking it down.

1 Like

I think both of those are good ideas – and each would have it’s own ATP costs, which would make for a more natural way to scale maintenance costs with the size and composition and behaviour of an organism. I was only suggesting a very simple maintenance cost function so we can test the basic result (of changing what size they’ll optimize towards).

1 Like

I think that’s a good idea.

I think we’ll have to choose how much control we want over the system, do we want to force it to look how we think it should look or are we happy if it often comes out wildly different?

That’s a bit of an ill-defined question :stuck_out_tongue:

There are some behaviours/properties that we want the system to always display (for example, trophic levels and energy pyramids) even if we don’t code them in explicitly; but there are a lot of other things where we want the system to be more innovative. I don’t think I can give a more specific answer without enumerating all possible behaviours we might like the system to have.

Hi hello I was talking with some guys in the Thrive skype group and this might be a bit late to mention this but would it make sense to allow the player to go extinct at this stage? In the real world isn’t it borderline impossible for microbes to go extinct as they reproduce way too fast and the populations are up in the billions?

We have a skype group?

And yes, I think it’s been part of the plan (for longer than I can exactly pinpoint) to allow the player’s species to go extinct.

While a species might have a huge population, there’s always the chance that it would simply be outcompeted in all patches, and thus drop in population, and quite possibly go entirely extinct. Or, indeed, it can be a victim of circumstance, much like how the rich world of anaerobic prokaryotes faced massive losses thanks to the rise of cyanobacteria and the oxygenation of the oceans and atmosphere.

2 Likes

So I’ve been playing around with this a bit (I went and looked at all the processes running and found they had gone haywire, I think the step length was too short) and this is quite hopeful. In a patch with no predation and no scavenging (you have to make everything from scratch) the following result is nice. It trialed removing the last chloroplast and the population crashed, which is very hopeful that it’s working better.

Mutation will be applied to species 2
Patch 0 will be the control.
In patch 1 removing Agent Gland
In patch 2 adding Mitochondria
In patch 3 adding Flagella
In patch 4 removing Chloroplast
Percentage Completed : 0.0 10.0 20.0 30.0 40.0 50.0 60.0 70.0 80.0 90.0 done
The resulting populations are :
0 : 28.1572134292 1 : 29.4552372482 2 : 28.0231015215 3 : 27.4647290579 4 : 14.8121745563 .
The best version was in patch 1 with average population 29.4552372482
Current State: F = Flagella, A = Agents, P = Pilli, C = Chloroplast, Y = Cytoplasm, L = Lysosomes, M = Mitochondria, T = Total number of organelles, O = Population:
F : 1 A : 1 P : 3 C : 3 Y : 2 L : 1 M : 4 T : 20 O : 7.95552900387 .
F : 0 A : 0 P : 0 C : 2 Y : 2 L : 0 M : 2 T : 15 O : 9.85783058708 .
F : 2 A : 0 P : 0 C : 1 Y : 1 L : 0 M : 2 T : 7 O : 29.4552372482 .
F : 1 A : 0 P : 2 C : 1 Y : 1 L : 0 M : 3 T : 9 O : 27.7953742456 .
F : 0 A : 0 P : 0 C : 2 Y : 1 L : 0 M : 2 T : 9 O : 41.918679826 .

However they may well all be heading for organelle counts of 2, not sure. After running for a long time it ended up with this

Current State: F = Flagella, A = Agents, P = Pilli, C = Chloroplast, Y = Cytoplasm, L = Lysosomes, M = Mitochondria, T = Total number of organelles, O = Population:
F : 0 A : 0 P : 0 C : 1 Y : 1 L : 0 M : 2 T : 5 O : 32.927965766 .
F : 0 A : 0 P : 0 C : 1 Y : 4 L : 0 M : 0 T : 9 O : 81.2634684396 .
F : 0 A : 0 P : 0 C : 1 Y : 1 L : 0 M : 2 T : 5 O : 34.4976761388 .
F : 0 A : 0 P : 0 C : 1 Y : 1 L : 0 M : 2 T : 5 O : 34.0063172659 .
F : 0 A : 0 P : 0 C : 1 Y : 1 L : 0 M : 2 T : 7 O : 61.9414309715 .

Which I guess is ok for a non-predation patch. It’s weird the one with 4 cytoplasm does so much better.

1 Like

This is quite interesting. So I’ve been running the system with ocean mixing set to 1 (which means that anything the microbes put into the patch gets instantly washed away, the water in the patch is the same as that in the ocean as a whole). The reason for this is there was a protein cycle before, so species A would make protein and then, when it died, that protein would go into the patch and another species could absorb it and immediately put it into their locked bin (make new members out of it). This meant it was a bit easy to be a scavenger.

Anyway here’s a result after 108 auto-evos (which isn’t very many, each species only gets like 21 changes on average).

Current State: F = Flagella, A = Agents, P = Pilli, C = Chloroplast, Y = Cytoplasm, L = Lysosomes, M = Mitochondria, T = Total number of organelles, O = Population:
F : 0 A : 4 P : 2 C : 0 Y : 1 L : 0 M : 0 T : 8 O : 4.46654783014e-58 .
F : 0 A : 3 P : 0 C : 0 Y : 1 L : 0 M : 0 T : 5 O : 1.23767072247e-11 .
F : 1 A : 4 P : 2 C : 3 Y : 3 L : 2 M : 3 T : 19 O : 1.52591081771e-13 .
F : 1 A : 1 P : 1 C : 3 Y : 2 L : 0 M : 0 T : 9 O : 1.17022791251e-13 .
F : 0 A : 0 P : 0 C : 3 Y : 1 L : 0 M : 1 T : 7 O : 72.6981404907 .

The top species has 10^59 times more biomass than the bottom one! Crazy. The top one is a pure photosynthesizer (3 chloroplasts no weapons) and the bottom one is a pure predator (4 agents + 2 pilli and no chloroplasts) so that does fit with the idea of trophic levels. (But is probably a fluke :smirk_cat:)

1 Like

Wait, aren’t those exponents negative? It looks to me like the predator species vastly outnumbers the others; which makes sense in the case of zero maintenance costs, since the top predator will slowly hoard all produced material.

Try adding a basic ATP cost, and see what happens.

Edit: Can I push my changes to the simulation? There’s the basic maintenance cost I tested out a few weeks ago, and I’m also going to try making each species have the separate lysosome pool for ingested compounds like you suggested. Or, even easier, make protein and DNA break into their respective monomers when a predation event happens – since anything that eats them would have to break it down anyway.

1 Like

Oh I see when I said “top species” I meant “the one with the highest population”. Yeah the exponents are negative. I should have said:

The species with the highest population has 10^59 times more biomass than the one with the least. The dominant species is a pure photosynthesizer (3 chloroplasts no weapons) and the least successful is a pure predator (4 agents + 2 pilli and no chloroplasts) so that does fit with the idea of trophic levels.

Sure I’d be really interested to see what you’ve done with it! I added a process called “Use Energy” but it doesn’t work because it never gets activated (well it will but only when the cell is low on energy).

I think if you auto breakdown the protein that gets ingested the lysosomes will really do nothing. As it is they are usually auto-evod away because they slow the species down for nothing.

This is quite interesting, I turned predation way down and started each species with nuclues + cytoplasm + chloroplast and that’s it. After 130 auto-evos they are like this

Current State: F = Flagella, A = Agents, P = Pilli, C = Chloroplast, Y = Cytoplasm, L = Lysosomes, M = Mitochondria, T = Total number of organelles, O = Population:
F : 0 A : 2 P : 0 C : 1 Y : 1 L : 0 M : 2 T : 7 O : 30.0437273745 .
F : 0 A : 1 P : 1 C : 1 Y : 1 L : 0 M : 2 T : 7 O : 28.2405138447 .
F : 0 A : 2 P : 0 C : 1 Y : 1 L : 0 M : 2 T : 7 O : 30.8079513635 .
F : 0 A : 0 P : 0 C : 1 Y : 1 L : 0 M : 3 T : 6 O : 28.6296721381 .
F : 0 A : 3 P : 0 C : 1 Y : 1 L : 0 M : 3 T : 9 O : 31.5956902582 .

I have no idea why so many mitochondria and why no flagella but it’s interesting to see an arms race develop with them getting agents and pilli.

Oh I see, I got it backwards.

What I did was add a function which removes a proportion of the ATP in the species bin, scaling that up based on number of flagella. It had the expected effect of reducing use of flagella, and increasing use of chloroplasts, but it’s a rather clunky solution.

Now that I know you’re cool with me fiddling with your sim, though, I’m working on a better maintenance cost calculation (a flat cost for each organelle), and a separated bin for ingested compounds, with lysosomes putting their outputs into the free bin.

1 Like

So I made a bunch of changes and here’s what it looks like after 100(?) auto-evos:

Current State: F = Flagella, A = Agents, P = Pilli, C = Chloroplast, Y = Cytoplasm, L = Lysosomes, M = Mitochondria, T = Total number of organelles, O = Population:
F : 0 A : 1 P : 0 C : 4 Y : 4 L : 0 M : 4 T : 18 O : 30.5777779 .
F : 2 A : 0 P : 2 C : 1 Y : 4 L : 2 M : 1 T : 15 O : 31.3338460799 .
F : 2 A : 0 P : 2 C : 2 Y : 2 L : 2 M : 3 T : 17 O : 30.85882375 .
F : 2 A : 0 P : 2 C : 2 Y : 4 L : 1 M : 2 T : 15 O : 32.4795656831 .
F : 3 A : 1 P : 0 C : 2 Y : 2 L : 0 M : 1 T : 15 O : 32.373332637 .

Good news is that lysosomes are now valuable to all the predators – we can always tweak how useful they are by changing the lysosome processing rate or compound cost or maintenance cost.

1 Like

That’s great. I like that. Something I’ve been doing is running it with initial conditions “each microbe gets a chloroplast, nucleus and cytoplasm and nothing else”. I think that’s an interesting way to start. See what you find.

Also I’m starting to think there is a relationship between the number of timesteps between auto-evos and the ocean mixing. So if the amount of mixing with the ocean is low then the protein which is coming out from the dying species can be instantly taken up by others and used to make more of them. So scavenging becomes really successful. I think this means you want a long time between auto-evos so that the effect on the patch as a whole can be really clear (like you getting rid of your chloroplast reduces the amount of sugar in the patch as a whole enough to make it not worth it for you, even if it increases the percentage of the patch’s sugar you have).

Whereas if the mixing with the ocean is high then the number of steps needed is less because each species is more of an island. They have to make everything for themselves so the effect of giving up the chloroplast becomes evident quicker.

Like I just ran a sim where all the microbes gave up their chloroplasts, which makes sense if the patch has sugar but they just haven’t detected that over time the amount will decay to 0 (though I guess if they can get their chloroplasts back at that point then that’s cool).

I guess in general life in a sealed bottle would be weird, because they could just make some protein and then live off that forever, passing it round between them. They would just need a simple cycle to get some atp and that would be enough. So the dynamics will be weird.

Here’s a run I did today with 1 mixing with the ocean and starting with 3 organelles per species, it’s pretty interesting how it turned out.

F : 0 A : 4 P : 4 C : 4 Y : 6 L : 0 M : 3 T : 22 O : 0.0352048791827 .
F : 0 A : 3 P : 5 C : 3 Y : 5 L : 0 M : 2 T : 20 O : 0.035887939545 .
F : 0 A : 9 P : 0 C : 1 Y : 3 L : 0 M : 3 T : 17 O : 0.496922279518 .
F : 0 A : 4 P : 8 C : 2 Y : 3 L : 0 M : 2 T : 20 O : 0.23115696353 .
F : 2 A : 4 P : 6 C : 4 Y : 4 L : 0 M : 1 T : 23 O : 0.195507877075 .

1 Like

Hmm, well, the ocean mixing rate technically also represents the spontaneous decomposition of compounds – however, a better way to model this might be to have compounds have a ‘stability’ parameter, that dictates what proportion decomposes (via a specified process, so for example ATP decomposes to nothing (because we don’t represent ADP in the model), and protein decomposes to amino acids and a bit of CO2 and nitrates).

It might even be a good idea to add these sorts of constant turnover processes to all compounds, whether locked, free, or environmental; though in that case we’d need different processes for their degradation (for example, protein turnover in living cells is more rapid than it would be from abiotic processes breaking it down alone; and it’s degraded into amino acids via controlled processes, rather than uncontrolled oxidation).

Anyway, that aside, I think the result looks pretty good; apart from the near-total lack of flagella?

Yeah well with flagella it’s important how strong the “speed discount” is. So if it’s high then you outrun most of your predators and it’s really great to be fast leading to a speed arms race. However if it’s low then it’s much better to have weapons so I guess we need to find the right intermediate level where it balances.

I wondered about putting in bacteria to do the degradation. So the rate of degradation is proportional to the population of bacteria (which grows as they degrade stuff, which to them is eating). But I didn’t really want to put in another non-linearity when the model has been so unstable thus far.

One thing I was wondering about is how often Auto Evo will run. So it depends how frequently it will run but in a 5 species patch each cell only gets modified 1 in every 5 times auto-evo runs. So if auto evo runs each time the player goes to the editor, and you go to the editor every 5 minutes, that’s only 12 AE’s per hour and that’s 2 and change for each cell. So yeah it’s going to take hours and hours of gameplay to go from, say 3 organelles to 20 (in fact approximately 8 hours).

Now maybe you can run AE more frequently but then what if we have 20 species per patch? then you’d be lucky to get 1 adaptation per hour.

I guess we could make a system where each person can upload the current setup of their species to a central database where others can download it and keep playing with it. But that’s a whole nother level.

C++ is generally 2-3 orders of magnitude (base 10) faster than Python, so I think we have a lot of leeway to do both deeper and more numerous simulations; especially since the plan is to run all of these computations over a few minutes while you swim around and edit rather than within a single frame. So while right now it might look like we only have time to evolve one species per gameplay round, that shouldn’t have to be the case. In fact, if we’re willing to parallelize the algorithms (which I don’t think is too smart while prototyping, but better as we move to implementation) and use numpy then we can probably get a speedup of an order of magnitude or more in python.

We might also be able to get the simulation to converge faster, in which case we can reduce the number of timesteps. I suspect that most of the instability at the beginning of each simulation is due to the abrupt change in the species state (the mutation); so if we do the averaging thing, smoothly transitioning from original species to mutated species, we would remove that major driver of instability, and hopefully see it converge in a fraction of the number of steps.

Yeah I think it’s two issues, one is the time it takes to run the calculation. Some of the speed increase will be taken up with more species per patch and more patches but yeah I’m hoping c++ will give us enough power so it doesn’t take a long time to run. If it can run while the player is in the editor that’s great.

The second issue is how fast other species should evolve compared to yours from a gameplay perspective. I guess it’s ok if every other species in the patch evolved every time you do. However even at that rate the rate of change is going to be slow. I guess no slower than the players cell, but going from 3 organelles to 20 will take a long time (though that’s probably the biggest change that could ever take place).

Ok so I merged our work together, and in the sim I’m running right now, nobody is predating (in fact the only species with either a pilus or agent is the extinct one, which evolved an agent vacuole after going extinct…), and I’ve realized that the maintenance system I’ve made has one major flaw, in that it can’t cause a species that’s run out of food to actually decline in population due to starvation. So now I’m going to work on making a maintenance system as i recently suggested, where a steady (but small) proportion of locked (and perhaps free) protein (and perhaps also fat and DNA) gets recycled into its monomers. This way, a species would get the monomers back and could just spend a bit of ATP, but if it runs out of ATP, then the degrading will destroy the population.

1 Like

I turned down the predation strength, it’s one of the constants at the top, it’s probably worth turning it up again and seeing if that makes a difference.

Interesting. I think the way things are set up a species population will never go to 0.

The locked bins lose ~1% of their contents per time step so your population is the level at which you can balance this with compounds coming into these bins. It’s hard to see how you would ever lose all your population because you are banned from removing your nucleus and the last of your cytoplasm so you always have the ability to make protein, fat and DNA out of glucose. I guess if you were completely out of glucose and could get no more (no chloroplast, no agents/pilli and no scavenging) then your pop would slowly decay to 0 but otherwise it won’t.

If you do have an income of glucose then you can burn it for energy and so asking for 20% of the glucose to be diverted to making energy rather than being turned into compounds is only going to reduce your population to a lower level, not to 0, because you’re still putting in 80% of what you were before.