My Old Friend, Cholera

Hey Folks! The long process of porting NEO Scavenger's medical simulation over to Ostranauts continues today, as I add the first dozen or so conditions and their logic.

One of the things NEO Scavenger did pretty well was to model complex health issues, so I want to salvage as much of that as possible. Quite a lot of it will still apply to Ostranauts, as crew will still need to grapple with trauma, disease, and drugs. And while some diseases might be more uncommon in space than on post-apocalyptic Earth (Cholera), it's still useful for me to carry them over. I can verify the new system handles the range of effects I might need, and quite often, I can slightly alter certain effects to model other, newer ones.

So far, I have the list you see in today's image. And this means chain progression, stat effects, recovery effects, side effects, and everything else that's involved. And so far, it's mostly going smoothly. I have a few things that need adjusting to new scales in Ostranauts, but I can map pretty much one-to-one.

One particular shortcoming, though, I just noticed while finishing up cholera: my immune system recovery rate cannot go into negative values. I missed it while doing hepatitis, but the effects of those diseases were to invert the immune system recovery rate so the patient progressively got worse.

But my immune recovery rate just has a multiplier >=0. I can halt recovery, but not simulate degrading health.

It's possible I might need to have a few stats with negative counterparts, since nothing can go below 0 in the game. E.g. immune recovery rate might be 1.0, and immune degrade rate starts at 0, but can superceded recovery by becoming something like 2. And as long as the payload for degradation is a negative amount, 2x a negative will outpace 1x a positive, resulting in a net health degradation. (This also solves the problem of "lost" bonuses when a value crosses 0. E.g. if you have 3 and subtract 5 during a disease, and it cannot go below 0, the disease will restore 5 when done, leaving the patient with 5, or a net gain of +2.)

A lot of these subtleties were hidden in the NEO Scavenger codebase and data. Some real minefields to navigate!

Anyway, that's food for thought over the weekend. I have to check-out early tonight for a school function. And also, Monday is a holiday. So I'll see you all on Tuesday. Have a good one!

Tags: Ostranauts

Comments

olsonjeffery's picture
olsonjeffery

Have you considered a more "entropic" system where the human body/environments naturally degrade over time and the "stats", ranging from something arbitrary like 0..1 are responsible for keeping them "in good shape"?

This is really something you can generalize across the board. Not sure how computationally intensive it is at scale, although there are obvious shortcuts for differing levels of simulation (ie you can have "random degradation" on a ship with a single, overall condition stat by applying perlin noise over maps of components/walls/etc with the current health/condition value used as the multiplier on the noise value).

This is all quite involved and random, but it only popped into my head because of the signed integer math that you had avoided in previous approaches, based on how the stat values were modeled? This is something I've observed over several of your posts, but it's your world and I'm psyched to see it when its ready, in any case. I'm mostly thinking out loud, as well, because modelling systems like this is interesting. Cheers!

dcfedor's picture
dcfedor

This is actually pretty close to how humans work right now. Various stats degrade over time, and actions/items can be used to restore them. Usually with side-effects.

For things like walls, floors, and other equipment, I expect something similar eventually. Components will wear out, equipment will fail, damage will accumulate on walls and floors. There's a ton of stuff that could cause these to wear and break over time, providing a good reason to have crew skilled in repair, and the tools/materials to do it.

As for performance, I've recently overhauled the stat degradation stuff to be less cpu intense per-frame. Instead, the whole object has a single timer representing the next thing that needs updating. And when the time comes, everything in the object's timer list gets adjusted by the time passed since last update.

This way, a ship with thousands of time-sensitive objects is just updating one double value each, which is pretty manageable on most any PC.

Dan Fedor - Founder, Blue Bottle Games