Ludeon Forums

RimWorld => Mods => Unfinished => Topic started by: DoctorVanGogh on June 19, 2017, 03:00:32 AM

Title: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: DoctorVanGogh on June 19, 2017, 03:00:32 AM
I've put together a small mod prototype that extends butcher jobs to also return any installed parts from corpses. Basically what's visible in the corpse's "Health" tab and is artificial comes out when the corpse is butchered.

I've seen some remarks that this would be technically infeasible, but from the code I've seen this is almost trivially easy. I'm running this locally with EPOE, A dog said and some other mods that add parts, and am seeing zero issues.

If you want to give it a try, here (https://github.com/DoctorVanGogh/ReclaimReuseRecycle)'s the public github repository including releases (https://github.com/DoctorVanGogh/ReclaimReuseRecycle/releases).

Ideas about possibly extensions I've got so far:

If any issues crop up, post them here or on the github issue tracker.
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Buchery returns installed parts
Post by: Devon_v on June 19, 2017, 11:19:55 AM
THANK YOU. I've never understood how that valuable bionic leg is just somehow ruined forever if the person it's attached to dies, yet I can mangle said person horribly and surgically remove the leg and it's fine. I'd taken to just using the dev controls to spawn bionics as "loot" when someone so equipped died.


Doing this might have been a major issue in previous alphas, but 17 drastically changed how mods can interact with data for the better.
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Buchery returns installed parts
Post by: SpaceDorf on June 22, 2017, 09:17:00 AM
The Idea itself sounds awesome.

I think it should use the medical and crafting skill, with a chance of botching the "operation".
It should provide a debuff between butchered human and dead-mans cloth, but I have no Idea what to call it ..
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Buchery returns installed parts
Post by: lazuli42 on June 25, 2017, 10:50:37 AM
Amazing mod! So glad you were able to figure out how to do it, people have been asking for this mods for ages. You should consider hosting it on the steam workshop so more people can see it.
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Buchery returns installed parts
Post by: DoctorVanGogh on June 25, 2017, 12:38:11 PM
Quote from: lazuli42 on June 25, 2017, 10:50:37 AM
You should consider hosting it on the steam workshop so more people can see it.
That's the general idea, once I get things to a level I consider stable and at least somewhat feature complete.

As you might have noticed (or not ;)) I've pushed an update that also returns mechanoid parts on disassembly.

There are some issues with additional stuff in the background I'm working on - depending on how those turn out, I'll either release this mod with about the current feature set, or put some more work into it.

But ultimately it should be a matter of weeks (at most) until I get things polished enough - so stay tuned ;)



Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Buchery returns installed parts
Post by: Hammerskyne on June 30, 2017, 06:35:22 PM
I have no idea what scope of effects you are able to implement, as my experience with modding is limited to changing the xml files, but would it be possible to have critical failure as no part return, and regular failure as some percentage of plasteel/steel/components dropped? Or maybe pull from the assemblies for the parts involved?

The part durability not really mattering seems to be outside the scope of what you're trying to do, and I agree that the icky debuff idea is a little nonsensical but I don't know what else you'd want to do to 'balance' the functionality out. Maybe just make it really really hard? Like 20% critical failure/60% regular failure at 10/10 cooking/medicine?

Also: would you be able to/ interested in adding a disassembly task for either crafting/med or construction/med for people who don't routinely butcher corpses, but rather cremate them instead?
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Buchery returns installed parts
Post by: Dragoon on July 10, 2017, 08:02:02 AM
I think if you do try to balance the mod. You should make it optional. Honestly, you don't need to add a debuff. Usually, people who have bionics don't show up until you are able to have some of them yourself.

If you do make it skill based I suggest medicine or Butchery.
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Buchery returns installed parts
Post by: DoctorVanGogh on July 25, 2017, 12:53:26 PM
Okay - the mod is feature complete and ready for some extended tests (might add some research integration in the future).

https://github.com/DoctorVanGogh/ReclaimReuseRecycle/releases

Can be installed into any running savegame.

Quote
(https://raw.githubusercontent.com/DoctorVanGogh/ReclaimReuseRecycle/master/Textures/UI/Recycle.png)

Reclaim, Reuse, Recycle

Rimworld mod that allows extracting added parts & implants from corpses.

This mods basically adds two types of jobs/recipes:


  • A "Harvest corpse" job at the Butcher & Machining Tables which will try to extract all recoverable artificial body parts.
  • A set of "refurbish" type jobs on the Drug Lab which will transform extracted parts into fully reusable body parts again.

Basic concepts

Extracted part status

Reclaimed parts (which can be any added part or implant that could be removed from a corresponding live pawn) are either extracted in a non-sterile or mangled variant. Undamaged (or slightly damaged) parts are extracted as non-sterile, while moderately damaged parts get extracted as mangled versions. The thresholds for non-sterile/mangled/no extraction can be changed in the mod options. (Defaults are 100%-85%: non-sterile, 85%-50%: mangled, otherwise: non reclaimable).
Non-sterile parts only need the part and medicine to be usable again, while mangled parts need additional material(s) for restoration.



Non-SterileMangled
(https://raw.githubusercontent.com/DoctorVanGogh/ReclaimReuseRecycle/master/Textures/Things/Item/BodyPart/NonSterile.png)(https://raw.githubusercontent.com/DoctorVanGogh/ReclaimReuseRecycle/master/Textures/Things/Item/BodyPart/Mangled.png)

Extracted part 'Complexity'

Parts are categorized by Complexity (a visible stat on the reclaimed part). Available levels are

  • Primitive
  • Advanced
  • Glittertech

This complexity is derived from the extracted part by internal tags, techlevel or ultimately price and should account for all mod-added parts.
Each complexity level corresponds to the medicine (and possibly other materials) needed to make the part usable again. Primitive needs Herbal Medicine (plus wood/cloth), Advanced uses regular Medicine (plus steel/components) and Glittertech requires Glitterworld Medicine (plus components & plasteel).

Harvesting Jobs

Extraction is a composite job that will always try to remove all possible parts in a corpse.
The extraction can fail and that failure is calculated per part. Failures work similar to surgery and are in fact calculated from the surgery/mechanoid extraction success chance of the executing pawn. Success chance is multiplied by 1.5 compared to regular surgeries to accomodate for the composite nature of the harvesting job as well as the lack of 'supporting' medicine (Room stats still apply for biological harvests).
A minor failure will typically still allow extraction of a (mostly) undamaged part, while catastrophic failure will almost certainly destroy the part.

Changes to vanilla behavior

This mods adds two special ThingFilters to the animal, humanlike & mechanoid corpse categories: Harvested & Unharvested corpses.
Harvested corpses contain no reclaimable parts, while Unharvested corpses ultimately could have (some) parts removed.
The vanilla Butcher corpse job get's changed to only use Harvested corpses by default. If you want to make it use any corpse, make sure to activate Unharvested corpses too (but why would you?).

Compatibility

Mod load order should not matter for this mod. It also should support any and all additional parts from 3rd party mods.
While the complexity might not be 100% as expected for 'weird' extra parts it will always guess something and thus allow reclamation & reuse of the part(s).

Bugs & issues

Please report any errors or issues on the github issue tracker (https://github.com/DoctorVanGogh/ReclaimReuseRecycle/issues).
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: SpaceDorf on July 25, 2017, 01:38:57 PM
Sounds awesomer any minute.

I have a few questions to your description :

1.) The area where the parts are removed has to be clean or sterile as well to improve chances of reclaiming parts ?
2.) Are there item requirements to remove the parts ?

3.) So removing bionics and implants uses the medicine skill and removing mechanoid parts uses crafting ?

4.) Are there debuffs for extracting from human bodies ?
5.) Are there debuffs when Installing second Hands ( got it .. *snort* .. second Hands .. ²) ?


² i am sorry for this inappropriate and bad joke, but someone had to do it sooner or later.
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: DoctorVanGogh on July 25, 2017, 04:31:01 PM
Quote from: SpaceDorf on July 25, 2017, 01:38:57 PM
Sounds awesomer any minute.

I have a few questions to your description :

1.) The area where the parts are removed has to be clean or sterile as well to improve chances of reclaiming parts ?
2.) Are there item requirements to remove the parts ?

3.) So removing bionics and implants uses the medicine skill and removing mechanoid parts uses crafting ?

4.) Are there debuffs for extracting from human bodies ?
5.) Are there debuffs when Installing second Hands ( got it .. *snort* .. second Hands .. ²) ?


² i am sorry for this inappropriate and bad joke, but someone had to do it sooner or later.
1) It's the 'surgery success chance' of the room. As far as i know you can only check that with a medical bed inside the room & selected. So yeah - sterile should be your friend.
2) No - not at the current time
3) It uses a character's 'Surgery success chance' & 'Mechanoid surgery succes chance' values. Open the 'i' window for your character, select that stat and read the explanation on the right ;)
4) No at this time.
5) No - and don't worry - now can _really_ get you mother's (bionic) eyes!
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: SpaceDorf on July 25, 2017, 04:59:20 PM
Quote from: DoctorVanGogh on July 25, 2017, 04:31:01 PM

5) No - and don't worry - now can _really_ get you mother's (bionic) eyes!

Yeth, they have been in ththe family for quite a while now.
(https://www.pinterest.de/pin/503277327088501412)
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: SpaceDorf on July 28, 2017, 10:07:49 AM
I found a problem with the harvesting filters.

Since you added them to humans and animals, they still have an effect on each other :
I can't bury humans without setting the appropriate filters in the animals section
and I can't butcher animals withouth setting the filters in the human section.

I think you should make the filter general.
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: DoctorVanGogh on July 28, 2017, 11:22:42 PM
Quote from: SpaceDorf on July 28, 2017, 10:07:49 AM
I found a problem with the harvesting filters.

Since you added them to humans and animals, they still have an effect on each other :
...
DAMN - good catch. I had a similar issue before and thought I'd fixed it.

Went ahead and used your suggestion: (un)harvested filters are now simplified (and global). The issue should no longer occur.

Try the new release (https://github.com/DoctorVanGogh/ReclaimReuseRecycle/releases)
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: SpaceDorf on July 29, 2017, 12:15:22 AM
Thanks for the fix then,

Meanwhile I cleaned my first Badger-Hand Implant which is now ready to install ..
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: SpaceDorf on July 29, 2017, 01:28:35 PM
I tried the new release and RimWorld started to disco-flicker after loading a game.
Meaning the screen turned from visible to black to visible.


Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: DoctorVanGogh on July 29, 2017, 03:16:34 PM
Er.... "I can not reproduce this issue"?

Do you have a debug/error log for this? Does this happen in a new game? Or only in your existing save? If so, can you upload that existing save somwhere?
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: SpaceDorf on July 29, 2017, 04:10:16 PM
It was an existing game .. and a large modlist which I mostly blame for the behavior.

Savegame and Modlist are attached, but still with 0.5 of   your R³ - Mod

[attachment deleted by admin: too old]
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: DoctorVanGogh on July 30, 2017, 03:34:30 PM
Um yeah - I'm no gonna be able to debug that - a bit too many local custom Mod versions ;)

Try the attached savegame - if that works it was the 'renamed'/'removed' special filters


[attachment deleted by admin: too old]
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: SpaceDorf on July 30, 2017, 06:29:50 PM
I will .. could you tell me what you changed exactly in the savegame, so I can apply it to my new save ?
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: DoctorVanGogh on July 30, 2017, 07:20:46 PM
Remove all occurences of any of

<li>R3_AllowHarvestedSentient</li>
<li>R3_AllowHarvestedMechanoid</li>
<li>R3_AllowHarvestedAnimal</li>
<li>R3_AllowUnHarvestedSentient</li>
<li>R3_AllowUnHarvestedMechanoid</li>
<li>R3_AllowUnHarvestedAnimal</li>

and made sure there's only

<li>R3_AllowHarvested</li>
<li>R3_AllowUnHarvested</li>

in there instead.

Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: SpaceDorf on July 31, 2017, 02:09:53 AM
Thank you, I found it and are throwing everything out right now.
The DevMode Log told me where to look.
Although, I did wait until I was done playing :)

------ EDIT ------

I missed the replacement part .. but still,
after throwing everything "R3_A*" out of my savegame the flickering was gonne :)

Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: faltonico on August 01, 2017, 11:39:01 PM
Good job so far!
The thing that i would suggest you to do is to make it a doctoring job, it needs doctor skills anyway. Create a new job for it as well.
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: DoctorVanGogh on August 02, 2017, 03:07:53 AM
Quote from: faltonico on August 01, 2017, 11:39:01 PM
Good job so far!
The thing that i would suggest you to do is to make it a doctoring job, it needs doctor skills anyway. Create a new job for it as well.
Define "it", "it" & "it" please.
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: faltonico on August 02, 2017, 03:40:36 AM
The job of getting the parts from corpses at the butchering table.
Sorry, i have to stop thinking in Spanish ='D

Edit: Another thing, if it is not much to ask, sterilizing the recovered parts would probably need to cost the same thing regardless of where they come from, a glitterworld medicine for all instead of a tiered medicine.
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: DoctorVanGogh on August 02, 2017, 04:16:42 AM
Let's force the user to get Gliterworld meds so he can reuse his peg legs, hook hands & dentures - um, NO ;)
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: faltonico on August 02, 2017, 08:17:52 AM
Quote from: DoctorVanGogh on August 02, 2017, 04:16:42 AM
Let's force the user to get Gliterworld meds so he can reuse his peg legs, hook hands & dentures - um, NO ;)
60 wood or a glitter med, a more reasonable way to balance it imo... why would you go for the trouble to recycle a peg leg anyway? but it is you call xD

But please do change the work type, i wouldn't like to have a doctor doing cooking jobs, or worst, a cook doing doctor jobs Dx
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: tonsrd on August 05, 2017, 09:35:33 PM
just saw this mod in "release" is it the same / different than yours ?

https://ludeon.com/forums/index.php?topic=34956.0


@doctorvongogh  does yout mod conflict with any "medical" mods ?
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: SpaceDorf on August 05, 2017, 10:24:05 PM
from experience I have no conflicts with :
XeoNovaDans Surgery Tweaks, Better Surgery,Birds and Bees,  Children and Pregnancies, DESurgeries, RBSE-Hardcore, Epoe, ADogSaid, EPOE Limb Harvesting, Harvest Everything, JTFieldSurgerie, More Consumables and Mutagens, Malfunction, Mod Medicine Patch, Quality Surgeon, sd_medicaddons, fluffies medical tab and of course :

Ushanka!

what I have not tried so far is Craftable Mutants and the Extended Human Body Simulation but since it is based on epoe ..

from my understanding how the mod works it should not matter anyway ..

-----

@Doc you may quote me on that and refer all complaints to me.
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: DoctorVanGogh on August 06, 2017, 11:30:58 AM
Quote from: tonsrd on August 05, 2017, 09:35:33 PM
just saw this mod in "release" is it the same / different than yours ?

No of course not there is no equal to this wonderful recycling mod - Also that is clearly a rushed, sloppy copy of myyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy precious idea (channeling my inner Gollum here).

Nah - from a first look it seems like there are some similarities to my initial version from the end of June - you butcher people, it vomits bionics. So if that's what you're looking for, maybe that is the mod for you. There's also some weird organ vomiting on top of that.

This one will keep the 'reclamation & refurbishment' & failure logic in it. I consider it a lot more balanced. Otherwise it's really way too easy to just make tons of money from corpses. You might as well just open the dev settings and spawn in your bionics - or get 'that' mod ;)





Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: SpaceDorf on August 06, 2017, 11:36:24 AM
Yeah three people with Implants I got since I installed your mod .. one I recovered, the other two I ended up recruiting ..
( so I could have gotten the implants anyway )

Harvesting bent Scyther Claws is nice though.
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: klassekatze on August 06, 2017, 07:20:21 PM
Quote from: DoctorVanGogh on August 06, 2017, 11:30:58 AM
Quote from: tonsrd on August 05, 2017, 09:35:33 PM
just saw this mod in "release" is it the same / different than yours ?

No of course not there is no equal to this wonderful recycling mod - Also that is clearly a rushed, sloppy copy of myyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy precious idea (channeling my inner Gollum here).

Nah - from a first look it seems like there are some similarities to my initial version from the end of June - you butcher people, it vomits bionics. So if that's what you're looking for, maybe that is the mod for you. There's also some weird organ vomiting on top of that.

This one will keep the 'reclamation & refurbishment' & failure logic in it. I consider it a lot more balanced. Otherwise it's really way too easy to just make tons of money from corpses. You might as well just open the dev settings and spawn in your bionics - or get 'that' mod ;)
There really ought to be a better way to find mods, maybe by category - I didn't know this existed or I wouldn't have written that mod in the first place.

In all sincerity unless there is something incomplete or broken still in the current state of this mod, you maybe ought to update the title/initial post similar to the github and have it moved to the release forum. There are probably a fair few people who would like this and will never see it, or even if they do will read the outdated first post and think it is a lot less than it now is.

Vis a vis money from bionics, I gather from the github page that you make no distinction between the implants of friendlies and hostiles  - if you're looking for reasons to make life more difficult for the colonists who are farming raider implants rather than crafting them, that seemed to me like it came closer to the heart of the issue, and it isn't something that is mutually exclusive with the repair-required mechanic.
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: The-Eroks on August 06, 2017, 07:22:25 PM
This is a great feature! Please keep up the great work  :)
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: SpaceDorf on August 11, 2017, 10:13:39 PM
Hi Doc,

concerning the WIP Part of this, I just noticed, after a raid with actual implants, that the worktype of the harvest recipe is still set to cooking.

----- EDIT -----

I correct myself.  After trying to quickfix the perceived bug myself, I found out, that you did not forget to change the worktype. Actually I feel sorry for implying such a stupid mistake.
I now know that it is the game being stupid.
Though the Medical Skill is both used and required, the game uses the butchery workgiver to schedule the task because you inherited the priority position from it. Meaning I have to priorize cooking for my doctor to harvest parts ..  :o .. at least now I know ..
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: DoctorVanGogh on August 13, 2017, 11:35:31 AM
Okay - here's (https://github.com/DoctorVanGogh/ReclaimReuseRecycle/releases) the (hopfully final) release candidate before things get published for the masses.

New features:
- Research projects & integration. Harvesting & refurbishment for each complexity level.
- Tiered harvesting. Can only touch corpses with at most this complicated parts. Prevents cavemen from reclaiming bionic eyes. Nothing wrong with cavemen keeping the body on ice until they unlock the technology though.
- Specialized work types (some). Harvesting is now a specialized task under doctor (or crafting for mechanoids). Refurbishment is still lobbed in at 'do somethingsomething at drug lab' (because 'reasons').

(https://lh5.googleusercontent.com/ykpko8TrY6Bq3aKBdf4ccC6DvDSRWsyiUd_qARXMFER6I_hOIaxuSng00UQ0_VB8Yd33C0VVIir5oKc=w1498-h1084)
Tribal starts gets Basic Harvesting. Classic starts get Advanced Harvesting & Basic Refurbishment.

If you're upgrading from 0.5.1, you'll need to do some savefile surgery. Remove any harvesting & refurbishment jobs before upgrading. Then strip any mention of

<li>R3_AllowUnHarvested</li>

from the save file and check your storages after load. (Also add any corpse related bills as needed).

Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: SpaceDorf on August 13, 2017, 12:32:37 PM
In my savegame the line is called :

<li>R3_AllowUnHarvested</li>

---- EDIT ----
Updating the running game worked :)
I only had to rebuilt my butchers table, because I forgot to remove a harvest Bill.

Right after that I found a Typo. :
Unharvested ( dvanced )

---- EDIT ----

I have a question left depending the last version. A "Hydraulic Arm Implant" was identified as Glittertech, which seems wrong.
The part itself belongs to the Mechanite Augmentation Mod.

[attachment deleted by admin: too old]
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: DoctorVanGogh on August 13, 2017, 01:24:36 PM
Quote from: SpaceDorf on August 13, 2017, 12:32:37 PM
In my savegame the line is called :

<li>R3_AllowUnHarvested</li>
Did I not write that? My bad
Title: Re: [A17] [WIP] Reclaim Reuse Recycle - Harvest Corpse parts
Post by: DoctorVanGogh on August 26, 2017, 04:43:43 PM
Okay - this mod is now fully released (https://ludeon.com/forums/index.php?topic=35322.0), so direct any further comments there. ;)

(https://steamuserimages-a.akamaihd.net/ugc/857228336820763272/93FFA74C2BDB16508F7C7970725C29299D691D18/?interpolation=lanczos-none&output-format=jpeg&output-quality=95&fit=inside%7C637:358&composite-to%3D%2A%2C%2A%7C637%3A358&background-color=black)

"Because Recyclers do it over and over again."