Health and Combat Overhaul

Along with a reproduction overhaul, better health, combat and death systems are the biggest parts of the planned 0.4.x updates. Though we probably won’t see these for half a year at least, it’d be useful to get a proper understanding of how they should work before we start implementing them. It’s important to note that we need something close to what the finished mechanics will be, but not necessarily the finished mechanics themselves. We have some preliminary systems in place now, but they’re so far from what we eventually want that the game isn’t exactly fun. And of course, if it turns out preliminary mechanics are more fun than anything else planned, we can go with those for the final microbe stage.

Health is a difficult concept in the game, because we can’t just slap on a hitpoint system (as we’re using now). Microbes should run on a simulated metabolism, so their health is dependent on all the elements of that metabolism running smoothly. A poorly designed cell (e.g. one with no mitochondria) should die, just as a starved cell should.

The simplest way I see of fixing this is having a clearly defined death state and having multiple paths lead up to it. A cell bursting is a pretty obvious death state, but even this is complicated for reasons I’ll cover later. For most purposes though, let’s treat a cell bursting as the moment of death.

I think there’s unanimous agreement elsewhere that the player should see their cell’s remnants for a few seconds to see why they died, then they’re transferred to another member of their species with lower compound reserves. If all members of their species are dead, they go extinct and lose the game. When a cell dies, it spills both its stored and locked up compounds into the environment (either as clouds or in intact organelles), as well as an intact nucleus. If the player collects the nucleus, they receive 25 extra MP next editor session.

So how do you get to cell bursting? Here are a couple of ways I can think of:

  • Pili

Perhaps the most obvious, enemy cells can puncture membranes with predatory pili. How easy should this be? Should an un-upgraded pili be able to rip apart a membrane with a single touch? This sounds a bit overpowered, so I think we need to add some fudge factor here. We could add a membrane health meter which decreases as pili attack it, and more powerful pili do more damage. This system is simple and player-friendly, even if not all that realistic. We can worry about balancing damage levels later.

Cells can evolve progressively stronger cell walls, which in this system would have much larger health meters, at the expense of maneuverability. This adds some complication for other things, discussed below.

I think pili should be player-activated. It probably won’t be fun to just passively puncture everything you swim past, so I suggest having a hotkey to extend the pilus and do damage.

  • Engulfment

We have engulfment in the game now, but it’s pretty basic and not player-friendly at all. Eventually we’ll want engulfment animations to indicate what’s happening, but the mechanics need rewriting too. Engulfing edges, which can be placed on the hexes at a cell’s edge like organelles, were proposed a while ago, and I think they’re the best option. Each hex of engulfing edge allows a certain size of microbe to be ingested, so longer engulfing edges mean a cell can swallow bigger prey. This also gives a purpose for cytoplasm as a defense, since it makes a cell bigger.

When a cell is ingested, it’s attacked by “digestive juices” and bursts, fulfilling the death requirement.

As with pili, engulfment should be player (or AI) triggered, i.e. a cell with an engulfing edge which moves over a smaller cell won’t automatically start engulfing it. In the player’s case, this would be a hotkey (such as G we currently have for engulf mode) which extends part of the membrane to overlap another cell.

Engulfment can be countered by, among other things, slime. Slime is a special type of agent which is stored in a slime gland. Pressing a hotkey causes a slime gland to burst, disabling the engulfing edges of any cell nearby for a certain amount of time.

  • Agents

Agent production and resistance has kind of been worked out. It’s still a bit confusing, but the jist is that agents are randomly generated and have levels of damage against different organelles. For a cell bursting, the organelle will be the membrane. Perhaps the health meter is the same one used for pili?

  • Osmolysis

So yeah, this is the really complicated one. The idea here is that a cell which can’t process compounds properly will eventually die due to its inability to regulate the concentration gradients between its internal structure and the water outside. Whatever the exact mechanics, the end goal remains the same: any cell with a sufficiently damaged or ineffective metabolism should die.

ATP is the obvious measure of how effective a cell’s inner workings are. If a cell can produce lots of ATP, it’s an indication that everything is working correctly. At the same time though, a lack of ATP shouldn’t automatically lead to death, since it may be able to find more compounds shortly after and get everything working again. I suggest then we tie this into the organelle health system. The player (or AI) can deactivate organelles at will if they’re drawing too much ATP (all organelles, even ATP producers like mitochondria, should draw ATP if they don’t have any compound inflow), but doing so will damage said organelles gradually until they collapse completely (this can also happen if an organelle is repeatedly targeted by agents). This basically gives the player a safe mode, where they’ll draw less ATP but can’t perform certain functions until they produce more. If they do come across more compounds and start processing them, they can revive organelles one by one.

Since agents will tend to target organelles a lot, the player should also be able to spend compounds to heal themselves. I believe this was proposed in the reproduction thread: damage to organelles can be repaired by drawing from compounds locked in storage for reproduction. The amount of compounds required should scale with level of damage.

So how does all this actually lead to death? Even if a cell has every organelle turned off, it will still need to expend ATP to keep osmoregulation in check. With no compound input, cytoplasm, like every other organelle, will draw ATP. If a cell has zero ATP, the ion pumps won’t be able to function and the cell will start to expand as water flows in along the concentration gradient. If more ATP is produced, the expansion reverses and all is well. If it isn’t, the expansion continues until the cell bursts. This should take a few seconds to give the player a final chance at saving their cell.

However…there is one complication to this whole osmoregulation process. Cell walls.

  • Suicide

Slime protects against engulfment, neutralising agents protect against agents, and cell walls protect against pili and osmolysis. Obviously each of these needs to be balanced correctly relative to the attacking method, but they should create a pretty good arms race.

But cell walls do pose a problem as, while everything else mitigates damage, they can prevent death entirely. Agents and pili can damage them like a regular membrane and the cell wall can fail like a regular membrane, but when it comes to osmolysis a cell wall stops the expansion, so a cell will never burst. A cell could shut down every function, but if it has a cell wall it can continue floating along with zero ATP and no ability to move of its own accord until it reaches more compounds. While this is ok, what if they never find other compounds? Is the cell going to drift forever in a comatose state?

This is where the suicide button comes in. The suicide button would always be available anyway, and if the player clicks it they just burst there and then, whatever the health of their cell. If locked waiting to drift into higher compound concentrations thanks to a cell wall, the player can choose whether to wait it out or give up. There are two options for the AI: either the AI is actually written to deal intelligently with this situation, or after a set time with zero ATP the AI commits suicide anyway.

EDIT: Come to think of it, it might be useful to get a prototype of all this done before implementing it into the game.

Interesting. A thorny issue for sure as we all have different imaginations of how the game should play. I think negotiating all of this is going to be a challenge and also very rewarding once we can do it. My position is that I am happy with any mechanics so long as the stage is fun to play.

  1. I think your osmolysis section is a little bit too complicated. You don’t need every organelle to use ATP all the time. You could have them only use ATP if they are doing a process which requires it. Then you add a water pump which uses ATP all the time (to keep pumping water out). That way if you just drift you will go into your lowest energy use state automatically. However you’ll need the water pumps running and so you will run low on ATP which will turn on the processes to produce it which will, in the end, starve you. Then the pump will shut down and you will die. Which works fine.

This is slightly tied into how the game should play but I think being able to power all organelles on and off is going to be a huge amount of micro management which really is not particularly necessary. It would be enough to be able to turn on and off the process of locking compounds away towards reproduction. If you turn that off and sit still the only thing which will run is the water pumps (lowest energy survival mode) if you turn it on your cell will start processing all it’s compounds (high energy state when you have food). Really you only need to be able to switch between these two states. I doubt anyone will use them if we make a whole load of intermediate states.

It’s also related to how long a life is. If you swim around for 45 minutes as one cell then a lot of micromanagement is good. If it’s 45 seconds then it’s not.

Also playing a cell with a cell wall needs a lot of thought as it’s hard to see how it’s going to be fun. There’s a few ideas knocking about (speed up time, micromanagement, management of a lot of agents) but it is quite a challenge.

  1. On the issue of slime it’s just an abstract agent like all the others. So, as you quite rightly point out, what the abstract agents do is when you release them there is a chance they will slow or shutdown an enemy microbes organelles. Well slime is then just the agent which slows or shuts down the engulfing edge (not sure exactly what slow means in this case, engulfing edge could be binary (either on or off) though it could also have a time parameter (like you must be in range for x seconds to be engulfed and slime makes that 2x) but this is not important). So yeah it folds in nicely with all the other agents.
2 Likes

I don’t agree with this, because one of the design decisions of MP is that it is always 100 for everyone, no matter the circumstances. Also, why would absorbing nucleus grant extra MP?

  • Pili

How exactly are pili intended to physically tear membranes (I can’t find anything on it online)?

  • Engulfment

I don’t get the difference between a regular edge and an engulfment edge. Aren’t all membranes able to phagocytosize? I think it’s more straightforward and realistic if all membranes can engulf.

  • Osmolysis

I agree with tjwhale on this. Are we planning to actually simulate the different pumps on the membrane, or just have them be implied? Because I think all cells should start with water pumps (if lack of one means death). Also, I think it would be better if we did not simulate them, but rather allow upgrades to the membrane which allow for specific mutations in how things pump in/out of the cell.

Also, tjwhale, I really like your idea of having two modes that you can switch between, a “Growth” mode where you lock compounds away for reproduction, and a regular mode where you don’t. I will post more about it in the Reproduction thread.

I suppose the simplest way of doing the pumps is to simulate nothing. Just draw them on the membrane and say they need x ATP per second and if they aren’t getting that then you will die in 30s + some swelling.

Of course we could build a model to actually balance the rate of water flowing into the cell with the power of the pumps and allow them to get damaged etc.

As for pilli there’s this which I came across last night. There’s a spring loaded toxin injector and a tiny lasso (which I find very cute) for holding on to prey (which actually might work really well as a weapon for us). As for a purely mellee damage pilus I think that’s a bit more non-physical.

There’s a kind of pili known as Type IV Pili that is supposed to be able to produce motile forces by jerking from side to side (like a rigid flagella). Instead of having it move the microbe, we could make it slash at other membranes?

I agree with all cells being able to engulf. It could be a type of “default attack”

EDIT: Actually it turns out that the Type IV Pili is also used for predatory purposes. The microbe uses the pilus to pierce a hole in its prey. It then forcibly enters the hole it created.

Pili: I think that these should be able to do damage to anything they touch but only as long as they have enough force behind them either from ramming into other cells with it or evolving something like this:

Enulfment: okay, as long as there is a counter to the counters (ie a agent that destroys slime) it would suck to make an engulfing cell to have it get countered by everything and have no chance, though it does mean the player needs to innovate which is nice.

Agents: oh boy this is a whole other page itself, i can see this getting complex quickly, maybe we need to think of a way to make a few base Agents that can be evolved further, eg evolving a acid agent that specializes on destroying membrane.

Osmolysis: wow okay, as other people have said this is a little too complex, shutting down individual organelles yourself? no, maybe have the cell shut down organelles as you start running low on ATP (shutting down the least important ones first to the vital ones) and this order can perhaps be changed in the behavior tab that’s going to go into the editor? maybe?
I think we should just make a list of vital to not vital organelles if we where to do this but when it comes down to it i think these processes should be automated by the cell and require no player input.
but this did give me an idea, perhaps when your cell dies rather then just going back to the editor just before that a kind of ‘death report’ pops up saying/showing something along the lines of “your cell died by Osmolysis by running out of ATP caused by a lack of glucose” or perhaps it just lists everything that was wrong with your cell when it died eg. telling you your cell membrane had split or your slime gland had been blocked by agents ect.

Suicide: this is something that can be done though a hotkey (something like delete because its out of the way) and when you’ve run out of ATP a UI button should pop out for it too. note that before your cell suicides it should have a “are you sure?” prompt.

Yeah it is. We’re pretty far along with it.

In answer to your questions you can counter slime by either changing the code for your engulfing edge (depending on exactly how that works out) or by creating an agent which shuts down their agent gland. Same with destroying the membrane, it’s all modulated by codes and not by specific effects.

Whether or not to grow is a delicate question, it’s really about predicting the future. I agree it is possibly better to automate it however I think giving the player control really isn’t that complicated, especially if it is just turned on or off. So if you have a store of glucose what do you want to do with it? Burn it all for ATP or convert it all into growth or some balance? That’s a hard question to answer. It’s about how long you think it will be before you get more. Basically are you about to start a long period of starvation (in which case you should save it for energy) or are you about to get more?

Another issue with automation is how to know if you are low on something. Like maybe you just ate a cell and have loads of Protein and no glucose. Surely you want to lock that protein away as growth? It’s hard to know the state of your microbe because it depends on all compounds. You could burn down all your Protein to get energy from it. In fact almost any compound can go towards energy or growth and it’s hard to know which.

In the CPA prototype growth is locked on and it takes 10% of the available compounds per timestep. That way it takes less when you are low which kind of satisfies the control requirement. However I still think it’s a nice idea to let people control it.

Also there is the problem of how plant gameplay is going to work. Being able to control something inside your cell is pretty important (as often you won’t be able to move). That might need finer leverls of control.

Okay i understand now.
especially for plant gameplay.

I would recommend that it is a behavior you can evolve then it’s less confusing for a new player and allowing players who want to use it to, well, use it. see for plants this system makes sense because they need as much gameplay as they can get really.

but real animal cells can’t predict that “oh I’m not going to be able eat glucose for a while better lay on the fat”, heck not even humans (bodies) do this, usually as long as we eat normally we are always growing but as soon as we starve for a while then we stop growing and when we do eat it most of it gets stored (and a minimum amount getting used for energy) until we start eating normally again, or even when we are low on something we stop using that for energy and start storing it (eg. protein)

point is maybe we should have a “starving” state where the cells stop growing and starts storing until stores are at (or slightly over) normal levels (thinking about it i am left to wonder if cells digest any organelles when they are starving (like we start to use muscle when we starve))

Though as i said before having this kind of system as a option to evolve would be a cool idea as it adds a bit of strategy to the game.

the other issue is creating UI for this and how to do it, should we make it so when the player right clicks on a compound bar they can choose what to do with it? (use for energy, store or grow) or do we want to add another panel for it? and then there is individual organelles and how we could let the player control them as every cell is different…

Yeah, that might be a good compromise. Maybe somewhere we could have a more detailed view for players who want to customise their compound processing in detail, but I did think the system as a whole was too complicated.[quote=“tjwhale, post:2, topic:176”]
It’s also related to how long a life is. If you swim around for 45 minutes as one cell then a lot of micromanagement is good. If it’s 45 seconds then it’s not.
[/quote]

I’m not sure how you feel, but both of these values are too extreme for me. Somewhere around 5-10 minutes would be my estimate.[quote=“NickTheNick, post:3, topic:176”]
I don’t agree with this, because one of the design decisions of MP is that it is always 100 for everyone, no matter the circumstances. Also, why would absorbing nucleus grant extra MP?
[/quote]

It was part of the original GDD concept. I think it could work.[quote=“meandmy10, post:6, topic:176”]
I think that these should be able to do damage to anything they touch but only as long as they have enough force behind them either from ramming into other cells with it or evolving something like this:
[/quote]

That’s a great idea actually. Damage could scale with impact velocity, which is both intuitive and prevents situations where cells can easily rip others apart just by sitting nearby.[quote=“meandmy10, post:8, topic:176”]
but real animal cells can’t predict that “oh I’m not going to be able eat glucose for a while better lay on the fat”
[/quote]

Ah, but real animals can’t manually adjust how they’ll evolve next generation. Maybe the AI doesn’t need to manage this, but for the player it could be really interesting and a skill they can learn to get better at the game.[quote=“meandmy10, post:8, topic:176”]
the other issue is creating UI for this and how to do it
[/quote]
My initial thoughts were that the player could click organelles directly to turn them on and off, but the new concept seems better so we’ll scrap that. Perhaps we could have a new panel that appears when the game is paused? Assuming we’re still allowing the player to pause the game to fiddle with their cell’s processing.

as long as they’re balanced (so we don’t go giving them out like candy) it should be fine, it would just be like a random buff, as long as it’s a interesting enough mechanic to warrant putting it in.

yeah sure, the only reason I’m going against this is to be devil’s advocate to make sure its worth putting in, I’m fine with it really, though i would rather it be something that is evolved through the behavior tab or something like that as a form of progression as i am fearful of blasting the player with all the mechanics all at once (or putting them somewhere the player never sees).

I’m just going to make sure this boat sinks, the cell follows the cursor at the moment so that’s a bad idea (unless someone changed that when i was not looking)

maybe, my current thinking is that when the game pauses (when you hit escape or press the menu button) it just brings up a menu a lot like the main menu, so we can do two things:

  1. Merge this idea into the pause menu (so it shows both the pause menu and this) (might be cluttered)
  2. Add this another button to make this as its own self contained thing (great reason to make this as something you evolve rather then just have)

or not add this i guess, unless one of you are inventive enough to suggest something new.

On the subject of GUI one idea I had was that when you click on the compounds summary at the bottom (whatever that will look like) the game pauses and you the screen is filled with the CPA diagram (see here). Each compound box could show how full you were of that compound and each link could show which processes are ongoing / happening. We could have it that when you click a link it toggles that process on and off. And when you click a compound it get’s added (or subtracted) from the compounds quickbar.

I think that would be a good way of explaining how all the compounds are related and providing a control panel for them all in one go.

Anyway just an idea. I am really not a design guy.

1 Like

Since ATP is always maintained at a constant amount, with you speeding up the cellular respiration process if it starts to dip below equilibrium and slowing it down if it drops below equilibrium, I think ATP would make a good mechanic for measure cell health (this is what we had in the original concept, I believe).

Maybe, i don’t mind this idea, in fact the more i think about it the more i like it, if you’d like to go over it in more detail (like examples of use) on the GUI thread then I’m totally up for it. you could also do a sketch if your feeling adventurous.

Anyone have further thoughts on what was discussed here? Combat mechanics should be the main focus of the next update, so we need to get the concept sorted ASAP.

Personally, following up on what we were talking about on Slack, I think it would be really great to have a basic pilus in the game and try to make some fun combat of swimming around and stabbing the other cells. I think if we kept the focus really tight it could just be a fun arcade style experience (something like asteroids) which would make the game fun to play (e.g. you have a pilus and a flagella, loads of big slow cells come at you and you have to avoid their pilli and stab them with yours or something like that).

I think starting with some fun and building it out could be a very satisfying way to make a game. I feel at the moment we are waiting for the fun.