[1.1] (WIP) MedPod - Regenerative Medical Beds

Started by sumghai, June 14, 2020, 07:14:04 AM

Previous topic - Next topic

sumghai

Here's another sci-fi themed mod I've been developing, which is mostly ready for public playtesting.

Overview



This mod adds a new type of medical bed called a MedPod (left), capable of automatically healing injuries, diseases, scars and missing body parts on any pawn lying on them, but consumes large amounts of power while in use.

For players with the Royalty expansion installed, an additional MedPod Lux variant (right) is also available, with faster treatment times at the cost of even higher power consumption.

Both beds were inspired by their namesakes from Neill Blomkamp's 2013 sci-fi film Elysium.

Usage

  • Complete the Atomic Cellular Regeneration research project, which unlocks the MedPod(s) in the Architect Menu's Furniture category
  • Obtain an Isolinear Processor item from orbital/caravan exotic traders, quest rewards or salvaging components from an AI Persona Core
  • Build a MedPod using one Isolinear Processor, steel, plasteel, industrial and advanced components
Features

  • Pawns will automatically use the MedPod to treat injuries and diseases
  • Pawns can be made to use the MedPod to treat scars, permanent injuries and missing body parts, using the right-click Float Menu
  • Pawns will not use MedPods that have insufficient power
  • MedPods will not remove prosthetics and bionics
  • Doctors/Wardens will rescue downed colonists/prisoners to MedPods
  • Doctors will avoid performing scheduled operations on patients currently using MedPods (the scanner/reatomizer gantry arm would smack them in the face if they tried to do so)
Compatibility

  • Safe to add to existing savegames
  • Works with most mods that add new prosthetics, implants or non-bad hediffs
  • Third-party modders can easily patch the built-in whitelist and blacklist, to always or never treat specific hediffs
  • Humanoid Alien Races - Non-human colonists should be able to use MedPods
  • Combat Extended - Will ignore the gasmask hediffs, if the colonist is wearing a gasmask
  • Replimat - Will share the same Disassemble AI persona core bill at the Machining Table, so that the same bill will produce both Isolinear chips/modules required by both Replimat and MedPod


Known Issues

  • Pawns should prioritize using (powered) MedPods, but may sometimes choose to use vanilla hospital beds if they are closer Fixed
  • Low frame rates (10~15 FPS) when running the game at 4x speed while also treating pawns with a large number of injuries/diseases/hediffs Disregarding for now, as issue only occurs sporadically
  • MedPods will heal robots and androids implemented using the Humanoid Alien Races framework (e.g. Android Tiers); a race-type blacklist is required Fixed
Download
Download Playable WIP
Source on GitHub repository

Acknowledgements
LWM, Dubwise, PeteTimesSix, Jamaican Castle, Fluffy, Drowsy Corgi, Madara Uchida, dninemfive, Garthor, Wiri - assistance with Harmony patches and other code snippets

License
This mod is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0), which in layman's terms means:

  • You are permitted to use, copy, redistribute our work as-is
  • You may remix your own derivatives (new or alternative textures, defs, plugin code), and release them under your own name
  • You must credit Robin "sumghai" Chang (author, MedPod) when publishing your derivatives in the download and forum posts

Chicken Plucker

Hey sumghai! VERY AWESOME, with the animation and everything! This'll make a fine addition to my collection

Canute

Very impressiv work.
But energy is cheap, i didn't test it yet, but 125W don't sound much for "but consumes large amounts of power while in use" or is that just the idle consum ?
Since it even can replace lost part's it would be an energy to matter process, then 10kW is the min. requirement for the treatment ! :-)
Even 10kW isn't that much, if that pawn get healed that fast. I just would build some battery banks so i could run it awhile.

So i suggest to add a fuel source, a medigel/medfuel that you create from organic matter (meat or human meat) together with herbal med.
That get used 1 each treatment, 2+ each scar, and depend on the missing part.
What do you think.

sumghai

Quote from: Chicken Plucker on June 14, 2020, 07:18:22 AM
Hey sumghai! VERY AWESOME, with the animation and everything! This'll make a fine addition to my collection
Much appreciated! By the way, best of luck with Basic Training!

Quote from: Canute on June 14, 2020, 09:37:20 AM
But energy is cheap, i didn't test it yet, but 125W don't sound much for "but consumes large amounts of power while in use" or is that just the idle consum ?
125W is indeed just the idle power consumption - much more power is consumed when the MedPod is actually running.

Quote from: Canute on June 14, 2020, 09:37:20 AM
Since it even can replace lost part's it would be an energy to matter process,
The reatomization process is not an energy-to-matter conversion. Rather, it rearranges any remaining damaged tissue and accelerates the body's natural healing process to make up for the short fall.

Although the MedPod is late-Glittertech tier technology, it still observes conservation of mass.

Quote from: Canute on June 14, 2020, 09:37:20 AM
then 10kW is the min. requirement for the treatment !
10kW is too high, even as a scaled difficulty setting set to max in a hypothetical Mod Settings dialog.

Quote from: Canute on June 14, 2020, 09:37:20 AM
:-)
>:(

Quote from: Canute on June 14, 2020, 09:37:20 AM
So i suggest to add a fuel source, a medigel/medfuel that you create from organic matter (meat or human meat) together with herbal med.
That get used 1 each treatment, 2+ each scar, and depend on the missing part.
I have no plans to add consumable requirements to the MedPod.

sumghai

Dev Build Update:
- Fixed power consumption (I forgot to flip a sign in the power consumption code, meaning that the MedPods were actually generating rather than consuming power while in use)
- Increased power usage and diagnosis/treatment times:
    - MedPod: 500/2000 W for 5/10 s during diagnosis/treatment mode
    - MedPod Lux: 750/3000 W for 3.75/7.5 s during diagnosis/treatment mode
    - Both beds still only consume 125 W while idle

I've also decided against adding further difficulty scaling options, so I'm scrapping the tentative plan to implement the Mod Settings dialog.

Canute

QuoteThe reatomization process is not an energy-to-matter conversion. Rather, it rearranges any remaining damaged tissue and accelerates the body's natural healing process to make up for the short fall.
The MedPod even restore lost limbs. A leg or two are a heavy mass compared to the whole body.
And the pawn leave the pod completly healthy and agil (not even anestetic debuff).
That is far beyond of natural healing or rearrange of bodymatter. This is like i would cast Healing on him to remove the wounds ! :-) Yeah magic is just another word of advance quantum manipulation i know :-)

The healing process is far to fast, currently the pod could heal/restore wounds nearly that faster then the pawn would get them from a combat.
The treatment cycle could be increased at last.
And it only should heal 1 point instead to cure the whole part, which would slow down the whole healing process. The lux pod could heal more or treat 2 wounds simultan.
I allready notice on lost limbs, that you don't regenate the whole limb at once, the children parts needed to regenerate too, which is allread nice.


sumghai

Canute, after reading your latest response, I have decided to disregard your suggestions.

Canute

Np, i don't want made your fantasitic work bad.
And i bet many people love it like it is, special when they doing these endgame event's when they got nonstop raids.

Zaki

Been trying your mod a good bit and enjoy it a lot, although I'm unsure if this is a conflict with EPOE and/or CE, but I find my pawns resting on the medpod much longer than needed, if they have bionics installed.

This seems to even happen if a pawn has an Death acidifier on them, causing it to be needed to turn the power off on the medpod, move the pawn to a regular bed and with dev mode, remove the hediff for the delta wave induced coma.

Could it be possible to have the delta wave induced coma dissipate after like 1 ingame hour or so, if not connected to the medpod? At least then we'd have a temporary workaround for the pawns that get stuck on the pod.

sumghai

Dev Build Update:
- Add races blacklist feature
  - This prevents pawns of certain races from ever using the MedPod
  - An example implementation can be found in the Android Tiers patch, which blocks all five tiers of Androids from using the MedPod bed

Quote from: Zaki on June 18, 2020, 07:26:02 AMI'm unsure if this is a conflict with EPOE and/or CE, but I find my pawns resting on the medpod much longer than needed, if they have bionics installed.
Firstly, can you confirm that the issue does not occur without EPOE and CE?

Secondly, can you run two separate test saves?:
- MedPod and CE only
- MedPod and EPOE only

Quote from: Zaki on June 18, 2020, 07:26:02 AMThis seems to even happen if a pawn has an Death acidifier on them, causing it to be needed to turn the power off on the medpod, move the pawn to a regular bed and with dev mode, remove the hediff for the delta wave induced coma.
That's bizarre. I'll need to test a pawn with Death Acidifier, although not with CE or EPOE yet.

Quote from: Zaki on June 18, 2020, 07:26:02 AMCould it be possible to have the delta wave induced coma dissipate after like 1 ingame hour or so, if not connected to the medpod? At least then we'd have a temporary workaround for the pawns that get stuck on the pod.
I probably should make the delta-wave induced coma fade after one hour.

FYI, the reason for the coma in the first place is because partly-healed pawns have a habit of running off during treatment, as soon as they are capable of walking (rather than waiting to be fully healed)


sumghai

Addendum for Zaki - I just installed a Death Acidifier on a pawn, downed it via dev mode, and had it healed up with a MedPod. The pawn hops right out as soon as treatment is finished, so no problems there.

Let me know when you narrow down the issue to CE or EPOE.

Canute

I used latest release with EPOE (from Ykara not the fork).
Gave a pawn Adv. bionic leg, and bionic spine, and downed him serveral times.
One time the pod scanned over a hvy damaged leg (last injured part) serveral times before it finaly got healed.
But all the other times, each scan something got healed, and the patient left once full healed.

Zaki

Quote from: sumghai on June 18, 2020, 10:24:15 AM
Addendum for Zaki - I just installed a Death Acidifier on a pawn, downed it via dev mode, and had it healed up with a MedPod. The pawn hops right out as soon as treatment is finished, so no problems there.

Let me know when you narrow down the issue to CE or EPOE.

As with confirmation from Canute as well, EPOE seems to be culprit here, the bionics from there cause an prolonged duration of the treatment.

On another note.
Androids mod, that has the module upgrades that affect whole body, they seem to get cleansed completely from the pawns if they use the medpod. And these are ones that cannot really be replaced without manually adding the hediff's back to the characters via development mode.

Does the Medpod work on cleansing the nobodypart affected hediffs? Would it be possible to instead add an filter option to the coding that would just include the diseases that can affect the whole body (Malaria, Sleeping Sickness, Mechanites and such), that would probably work as an workaround to not "curing" the beneficial hediffs that affect the pawn. At least that is with my rudimentary understanding of coding.

sumghai

Quote from: Zaki on June 19, 2020, 02:28:46 AMEPOE seems to be culprit here, the bionics from there cause an prolonged duration of the treatment.
This seems to happen with vanilla bionic arms and legs as well.

I think I have an good idea as to what's causing this problem:

  • An installed bionic arm or leg causes the corresponding child parts (e.g. hands, fingers, toes) to be marked as missing/destroyed
  • The current implementation of MedPod treats all body parts with "bad" hediffs, including missing body parts
  • So the MedPod skips the bionic arm or leg (as intended), but ends up regenerating organic fingers and toes on it

I definitely need to add some more logic to deal with this edge case.

Quote from: Zaki on June 19, 2020, 02:28:46 AM
On another note.
Androids mod, that has the module upgrades that affect whole body, they seem to get cleansed completely from the pawns if they use the medpod. And these are ones that cannot really be replaced without manually adding the hediff's back to the characters via development mode.

Is this the Androids mod by ChJees, or Android Tiers by Atlas & co.?

Quote from: Zaki on June 19, 2020, 02:28:46 AMDoes the Medpod work on cleansing the nobodypart affected hediffs?
Yes, but no-body-part hediffs (i.e. whole body hediffs) are handled last.

Quote from: Zaki on June 19, 2020, 02:28:46 AM
Would it be possible to instead add an filter option to the coding that would just include the diseases that can affect the whole body (Malaria, Sleeping Sickness, Mechanites and such), that would probably work as an workaround to not "curing" the beneficial hediffs that affect the pawn. At least that is with my rudimentary understanding of coding.
My current implementation of the MedPod mod actually has hediff whitelists (i.e. always treat, even if not bad) and blacklists (i.e. never treat, even if bad), which can be tweaked using xpath patches for XML.

The quick and dirty solution is for me to write a xpath patch to add the Android/Android Tiers (which?) hediffs from the module upgrades to the whitelist, so that the MedPod will skip those. There's no need to also whitelist the vanilla whole-body conditions, since they are usually bad and get marked for treatment anyway.

The proper solution would be to check to see if module upgrade hediffs in the actual the Android/Android Tiers (?) mod have been set as isBad = true, even if they're supposed to be beneficial module upgrades.

Clear as mud?

Zaki

https://steamcommunity.com/sharedfiles/filedetails/?id=1541064015
Sorry for not confirming the mod, but this one is in question.

How to duplicate the test: apply any kind of modifier that are native to the no body part suffix of androids (Fighter module, construction module, Agile/Hulk/perfect physique, Archotech module upgrade, techprof upgrade etc), have them get any form of injury, the injury is healed first and they still stay in the pod until all the upgrades are gone too, making the upgraded android equal to an regular pawn at that point.