Ludeon Forums

RimWorld => Mods => Unfinished => Topic started by: sumghai on June 14, 2020, 07:14:04 AM

Title: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: sumghai on June 14, 2020, 07:14:04 AM
Here's another sci-fi themed mod I've been developing, which is mostly ready for public playtesting.

Overview

(https://i.imgur.com/w7cwBYA.png) (https://i.imgur.com/igxlrJD.gif)

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 (https://en.wikipedia.org/wiki/Elysium_(film)).

Usage
Features
Compatibility
(https://raw.githubusercontent.com/CombatExtended-Continued/CombatExtended/master/Media/Badge_CE_compatible.png)

Known Issues
Download
Download Playable WIP (https://github.com/sumghai/MedPod/archive/master.zip)
Source on GitHub repository (https://github.com/sumghai/MedPod)

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) (http://www.creativecommons.org/licenses/by-sa/4.0/), which in layman's terms means:
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: 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
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: Canute on June 14, 2020, 09:37:20 AM
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.
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: sumghai on June 15, 2020, 08:06:17 AM
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.
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: sumghai on June 15, 2020, 09:02:59 AM
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.
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: Canute on June 15, 2020, 09:28:51 AM
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.

Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: sumghai on June 16, 2020, 07:16:59 AM
Canute, after reading your latest response, I have decided to disregard your suggestions.
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: Canute on June 16, 2020, 09:03:31 AM
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.
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: Zaki on June 18, 2020, 07:26:02 AM
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.
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: sumghai on June 18, 2020, 10:17:44 AM
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)

Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: 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.
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: Canute on June 18, 2020, 03:18:20 PM
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.
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: Zaki on June 19, 2020, 02:28:46 AM
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.
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: sumghai on June 19, 2020, 07:40:46 AM
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:

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 (https://steamcommunity.com/sharedfiles/filedetails/?id=1541064015), or Android Tiers by Atlas & co. (https://steamcommunity.com/sharedfiles/filedetails/?id=1386412863)?

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?
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: Zaki on June 20, 2020, 05:02:45 AM
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.
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: sumghai on June 20, 2020, 06:41:52 AM
Quote from: Zaki on June 20, 2020, 05:02:45 AM
https://steamcommunity.com/sharedfiles/filedetails/?id=1541064015
Sorry for not confirming the mod, but this one is in question.
So it was the Androids mod, then.

Quote from: Zaki on June 20, 2020, 05:02:45 AMHow 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.
I took a look at all the Hediffs associated with the upgrade modules - none of them or the abstract classes they are based on have the <isBad> parameter specified. As such, RimWorld internally considers them to be <isBad>true</isBad> by default. So in theory, ChJees could fix this by to specifying <isBad>false</isBad> for the HediffDefs associated with the upgrades, and the MedPod will automatically ignore those Hediffs in its treatment plan.

However, taking a step back, aren't these androids artificial mechanical lifeforms? If so, I should blacklist Androids completely from using MedPods, as MedPods are only meant to treat organic lifeforms.

(I've already blacklisted all the Android Tiers androids, so that they will never use MedPods)
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: Canute on June 20, 2020, 08:42:24 AM
QuoteHowever, taking a step back, aren't these androids artificial mechanical lifeforms? If so, I should blacklist Androids completely from using MedPods, as MedPods are only meant to treat organic lifeforms.
Since you speak on this yourself, i wanted to comment that allready a few postings ahead.
Could you maybe check if that patient got blood or other liquide (Blood loose vs. Coolant loose) and only treat them when they got blood ?
I think i even saw alien races with different liquid then blood or coolant. So a race with total different metabolism couldn't be treat without further research.
Maybe a corpse analyser which consume an alien corpse and unlock the ability to treat that race by x percent.
That mean all races beside human would be at the colony blacklist and could be removed with the corpse analyser.
But that would even allow to treat androids, dang.

Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: Codexehow on June 20, 2020, 03:06:12 PM
Love the concept of the mod, and the design is awesome. But I have to agree with the others (here and on Reddit) that:

• This thing should require some kind of consumable. You seem really against that for some reason, and that's cool. But...yeah. It should consume medicine or some biological raw materials.

• Power consumption is imo too low.

• The building requirements are too cheap for what this mod does. Needs more gold, plasteel and advanced components, imo.

I might modify this for my own use, but if I do I won't upload it. (of course). But I'd make it use a ton more power at the very least :P. Probably make it require a lot of meat and medicine as consumables if I can get that to work.

BTW, I love the delta wave induced coma. But that could pose a problem if someone is using this mod with Real Ruins and naked brutality. If they find this thing and run out of power... Can remove with dev console but still.
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: sumghai on June 20, 2020, 07:01:33 PM
Quote from: Codexehow on June 20, 2020, 03:06:12 PM• This thing should require some kind of consumable. You seem really against that for some reason, and that's cool. But...yeah. It should consume medicine or some biological raw materials.
I have no plans to add any item/raw material consumable requirement to the MedPod. Please do not make such a request again.

The "some reason" is because I am aiming to replicate what was seen in Elysium - the MedPod in the film did not require any consumables other than electrical power, and it could be argued that the machine was stimulating/guiding/directing the body's natural healing process to healing major injuries or restore missing parts, rather than the misconception of pure energy-to-mass transfer that some folks here seem to believe in.

Quote from: Codexehow on June 20, 2020, 03:06:12 PM• Power consumption is imo too low.
The latest revised idle/diagnosis/treatment power consumption level is 125/500/2000 W for the MedPod, and 125/750/3000 W for the MedPod Lux.

This is comparable to the Food Terminals from my Replimat mod, which uses 125/1500 W in idle/replicating modes.

Quote from: Codexehow on June 20, 2020, 03:06:12 PM• The building requirements are too cheap for what this mod does. Needs more gold, plasteel and advanced components, imo.
The research required behind the MedPod is locked at a high level in the tech tree, and constructing each MedPod requires a rare, uncraftable Isolinear Processor item.

I have already received far too many complaints for my Replimat mod that its buildings' constructions costs were far too high compared with the vanilla spaceship parts, and that the mod's own Isolinear Computing Module was far too rare and difficult to obtain.

Quote from: Codexehow on June 20, 2020, 03:06:12 PM...delta wave induced coma. But that could pose a problem if someone is using this mod with Real Ruins and naked brutality. If they find this thing and run out of power... Can remove with dev console but still.
This shouldn't be an issue.

I coded the MedPod so that if it runs out of power halfway during treatment, it will apply an "improper" cortical stimulation to wake the patient up.
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: sumghai on June 22, 2020, 09:56:10 AM
Dev Build Update:
- MedPods now ignore missing child parts of artificial body parts and implants (e.g. hands and fingers from prosthetic arms)
  - This prevents pawns from staying in MedPods longer than necessary

Zaki, I am currently undecided as to how I want to deal with the pawns from the Android mod you're using. I'm waiting for a response from ChJees himself, and while it has been confirmed that the droids are purely mechanical, I have received conflicting information regarding the fembot androids - some players regard them as purely mechanical with superficial organic features, while others regard them as mechanical/organic hybrid (i.e. cyborgs).
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: sumghai on June 25, 2020, 05:12:25 AM
Dev Build Update:
- Added compatibility patch for Androids mod
    - Droids and Battle Droids are blacklisted from using MedPods
    - Androids are allowed to use MedPods
- Fix missing inspector pane status translations
- Add translations for the following languages:
    - Traditional Chinese
    - Simplified Chinese

Zaki, in case you're still following these updates, I discussed with ChJees the issues relating to Androids mod compatibility. The consensus is that:
- Androids should be able to use the MedPods, as they have synthetic organs/flesh (a la Hosts from Westworld)
- ChJees admitted that the problem with the upgrade module hediffs is on his end; he will update his mod to correctly flag those hediffs with <isBad>false</isBad>, so that the MedPod will not accidentally remove them during treatment
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: sumghai on June 27, 2020, 06:29:05 AM
Dev Build Update:
- Patients now always lie on their backs when using MedPods
- Patients will prioritize using MedPods over other medical beds (e.g. pawns will seek out MedPods even if a vanilla hospital bed is closer)

By the looks of things, I think we're ready for prime time.
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: theMoonwalker87 on July 11, 2020, 05:17:12 PM
Great mod, awesome work!

I've found a bug however. The pod is stuck in an endless cycle, while never healing if you put a guy in that was wounded in a social brawl. I haven't seen any other situations yet where it doesn't work but Ill post an update.
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: Canute on July 11, 2020, 05:37:15 PM
I don't think the reason will be a social brawl.
It is more you use a race/mod that add some special attack, so the medpod got problem with that kind of new damage typ.
You should try to include the hugslib logfile, press CTRL-F12 or use the green "Share log" button at the log window. The link include the modlist and log, which is prolly helpful for the mod author.
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: theMoonwalker87 on July 11, 2020, 06:29:44 PM
I will do that next time I get that bug, thanks
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: theMoonwalker87 on July 12, 2020, 09:04:14 AM
https://gist.github.com/d94a193d5589faff16f2b199a092d787

This is the CTRL-F12 link Canute suggested to post. This happened after a social brawl.
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: theMoonwalker87 on July 16, 2020, 06:23:52 PM
Might be a coincidence but I keep seeing the bug on pawns with skin glands (tough/armor skin glands)
Title: Re: [1.1] (WIP) MedPod - Regenerative Medical Beds
Post by: sumghai on July 18, 2020, 11:21:01 PM
theMoonwalker87 - thanks for the heads-up. That's a known issue for all Torso-based implants, which will be fixed in the next update along with the FPS lag issue.

General comment to no-one in particular - unlike most mod authors, please don't send me HugsLib logs, as they tend to be very long and contain a lot of cruft that does not help in narrowing down the issue. Instead, only copy the relevant error messages from the game's own debug log, describe the problem in as much detail as possible (including reproduction steps), and only perform troubleshooting in a stripped-down save game (i.e. only the bare minimum of mods required to reproduce the issue - don't send me a save that requires 300+ mods to run).