Reproduction and Health System Development Progress


#1

With 0.3.2 out of the way, it is prime time to start working on new features for the 0.3.3 New Year release. As promised, I will be completely redoing the reproduction and health systems to make them much more realistic and intuitive, and also to pave the way for agents and other features that rely on this working properly. Now, you might be wondering why I put the reproduction and health systems in one post; I’ll get to this later, but in short, they are one and the same. The reproduction bar is basically a continuation of the health bar—after you reach 100% health (assuming you were damaged), the exact same processes will continue to “prepare you for reproduction”.

Below I will be describing the system that I will be implementing. Feel free to comment and critique, but keep in mind that everything below was already discussed and agreed upon. We don’t want this turning into the AI thread.

Reproduction

G1 phase

  1. All organelles (including the membrane) will be assigned a growthIndex that is constricted to [0.0,2.0].
  2. This growthIndex will be initialized to 1.0 when starting a new game or when you exit the editor.
  3. All organelles will also be assigned a cost that is dependent on the type of the organelle and the level it is at (e.g. 3 fatty acids, 2 glucose, 6 protein)
  4. The cell nucleus will be assigned processes that can synthesize the necessary compounds to satisfy the cost.
  5. Every single time a compound used in reproduction is synthesized, it is “consumed” and the organelle that consumed it increases its growth index (so in the example organelle above, consuming one fatty acid will increase your growth index from 1.0 to 1.09 and then consuming another protein will increase it to 1.18)
  6. Organelles are scaled in the y-direction based on their growthIndex, so a mitochondrion with an index of 1.5 will be 50% longer than the normal model.
  7. Once an organelle reaches 2.0, it is split into 2 separate organelles, making the cell actually bigger (so absorption rate and engulfment size are increased).
  8. Both split organelles are assigned an index of 1.0 and can no longer grow, so resources go to growing other organelles.
  9. Once all organelles split in half (excluding the nucleus, ER, and golgi) the cell finishes the G1 phaze.

S phase

  1. After you enter the S phase, you cannot go back, even if you are damaged (read below how agents affect growthIndex). However, until you are fully healed, you are unable to finish the S phase.
  2. The S phase is basically identical to the G1 phase except you will be “duplicating” your nucleus.
  3. The nucleus will require protein and nucleic acids and will grow in all directions until its growthIndex reaches 2.0.
  4. The nucleus will not split, but will remain at the enlargened size.

G2 phase

  1. Same as for S phase, once you reach this you cannot go back, but you need to be at full health to proceed.
  2. This stage requires a lot of protein, fatty acids, and other elements to manufacture microtubules and the like.
  3. Unlike before, there will be no visual changes to the cell (although it might be a good idea to spawn a pair of centrioles)
  4. All you need to pass this stage is to have above a set level compound.
  5. While you have above the set level, the reproduction button becomes green, but if you dip below it becomes grey’d out until you increase your compound stores.
  6. Pressing the button enters you into M phase and takes away this threshold of compounds.

M phase

  1. Once you click the reproduce button, a timer will start to count to 5 seconds. After the 5 seconds have passed, your cell has succesfully reproduced and you enter the editor.

Graphically, this will be very easy to show. You will have one bar that will be divided into 3 chunks of different colors (say green, yellow, and red). Each bar represents one of the 3 interphase stages and will be filled up or down as you reach reproduction or stray away from it. Once a bar is filled up, it cannot go down.

Health

Health directly ties into the growthIndex (which I know think will be better named as the compoundBin), and is really just a representation of how full these bins are. The health is equal to the sum of the (compoundBins for each organelle divided by the number of organelles. So if you have 1.0 for each organelle, you have 100% health, but if you are damaged and two of your mitochondria will go down to 0.2, your health will be (0.2 + 0.2 + 1.0 + 1.0 + 1.0) / (1.0 + 1.0 + 1.0 + 1.0 + 1.0). Attacking an organelle will decrease the compoundBin, shrink it, and change its color to black (blinking red while the damage is in place). Once an organelle grows big enough, it splits in half and your max health is increased since you now have two 1.0 bins for that organelle instead of just one.

The damaged organelles work less efficiently (max efficiency multiplied by compoundBin), while larger organelles work better. This means that an agent that targets vacuoles (and brings them all down to 0.0) will leave you with no storage space except cytoplasm. Damaged organelles will consume compounds (fatty acids, glucose, and protein) in the same way they grow to split in half, except now they will be aiming to get back to 1.0, which is maximum health. As before, the lower an organelles compoundBin, the greater priority it uses for compounds (so you will heal a 0.0 organelle first, before healing a 0.5 organelle, before growing a 1.5 organelle).

An organelle that split in half will be destroyed if its bin reaches zero, while the original organelle will simply stop working if it reaches zero. This means that if your mitochondria split into two organelles with 1.0, and was then attacked by an agent, the first organelle to drop to 0.0 will vanish, while the second one will shrink, turn black, and will stop working.

Okay, that’s basically it for the reproduction and health system revamps. Simple on paper, hard in code.


Microbe GUI
Microbe GUI
#2

This is really cool!

How long do you imagine it will take from starting a new cell to being able to reproduce? Presumably it depends on how many compounds and how many predators there are around but ballpark? 10s, 30s, 1m, 5m, 20m, 2hr?


#3

That’s the best part. Obviously, it depends on the costs and the amount of necessary compound clouds around you, but I’m going to try tuning it to 5 minutes per cycle. However, small predator cells with 1 nucleus, toxin, and flagella will likely be able to reproduce every 30-60 seconds, while larger ones will spend 10+ minutes on reproduction.


#4

+1

As a small sidenote, it might work better to use a nonlinear function to scale organelle health against organelle efficiency (to simulate compensation mechanisms, and reduce the compounding effect of one tiny injury on your future likelihood to get new injuries; or alternatively, to make those effects stronger if it’s good for gameplay). But we’ll tackle that when we get there.

I like how this entire system is essentially a one-microbe analogue to the CPA’s growth and damage systems.


#5

I think I’ll try to implement the reproduction and health systems this week. Since we don’t have a GUI yet, I’ll just duplicate the health bar. Is the master branch up to date?


#6

This seems a wee complicated. We should keep in mind this is a game and people have already brought up qualms about Thrive’s steep learning curve. I like the idea, but we need to make it very clear to the player what is happening and what they should do to progress


#7

The thing is I see why you’d think it’s complex, and I’d agree it is technically a complex system, but a lot of it is what I’d call “passive complexity” in that it’s complexity that the player does not have to think about or plan around, it is simply there in the background to provide for realistic emergent gameplay.

Basically, all the player needs to know about reproduction is:

  • Damage to the cell stops the reproductive process until it’s healed
  • Collect fatty acids, amino acids, and nucleic acids to build all of the components for replicating

#8
  • Each organelle slowly grows bigger and finally splits in half.

#9

Everything up to G2 has been finished. Once enough compounds are consumed, the cell will first enlargen organelles, then split them in half, pushing out bordering organelles in the process. After all of this is done, the nucleus will start to get darker and darker (as DNA is duplicated and chromatin condenses into chromosomes). Finally, once all of this has been done, the organelle button becomes green. Clicking it will enter you in the editor (where the duplicated organelles are no longer visible). You can place stuff down as usual. Once you click finish, the compounds your cell previously had will be split into two between you and the newly split off daughter cell (the cell no longer splits once you can reproduce, the split happens after you exit the editor).


#10

Hey! Not my field but quick question: When you finally divide will one cell (the player cell) be mutated and the other cell be a copy of the original cell?

Because if that’s the case should we accomodate and have extra compounds required for the extra organelles?

For example say you’re a cell with one mitochondria and you get enough compounds to multiply them so now you have two. You press the division button and go into the editor and add an extra mitochondria to the base cell so now the base cell has two. But then there’d need to be 4 mitochondria… am I making sense?


#11

Yeah, you’re making a valid point. This was definitely discussed in depth somewhere a long time ago, though I cannot seem to find where. Basically, the CPA system accounts for it, since your species isn’t defined by the number of cells there are, but rather by the total amount of locked compounds. So if you add a bunch of new organelles in the editor, your species number will temporarily dip, but the amount of compounds making them up will stay the same, which gives us conservation of matter that we need in the world. I’m sure tjwhale or moopli could give a better answer if what I said doesn’t make sense.


#12

Makes perfect sense thanks!