RimWorld

RimWorld

Time Kills
 This topic has been pinned, so it's probably important
Silencer59  [developer] 14 Aug, 2022 @ 6:11pm
Making Changes to the Mod
This will be a brief overview of the values you can edit with the mod (there's not many). This assumes you know how to use an editor like Notepad++ and have some experience working with a .xml file.

We'll start with this file inside the mod:
/Patches/HediffGiverSetDef.xml

This file contains the aging curve which determines the chances for a pawn to get Old Age. It looks like this:

<ageFractionChanceCurve> <points> <li>(0.95, 0.0)</li> <li>(1.0, 1.0)</li> <li>(1.05, 0.0)</li> </points> </ageFractionChanceCurve>

This sort of works like a line graph. The first value in each point is the life expectancy % and the second value is the % at which the hediff can occur. With this example, pawns at 95% of their life expectancy will start with a 0% chance to get Old Age which begins to scale up towards 100% by the time they reach 100% of their life expectancy (80 for humans). It then falls back to 0% by 105% life expectancy. These points can be changed and new points can be added if more of a curve is wanted.


The second file to edit would be this one:
/Defs/HediffDefs/Hediffs_Local_Chronic.xml

This file contains the progression and effects of Old Age and Degradation. To change how quickly either of these progress you'd want to look at this section (this example is from Old Age):

<comps> <li Class="HediffCompProperties_Immunizable"> <severityPerDayNotImmune>0.18</severityPerDayNotImmune> </li> <li Class="HediffCompProperties_TendDuration"> <baseTendDurationHours>24</baseTendDurationHours> <severityPerDayTended>-0.18</severityPerDayTended> </li> </comps>

In the above example, the severityPerDayNotImmune value determines how quickly the hediff progresses, in this case it increases by 18% per day. The severityPerDayTended value uses a negative value to lower the severity. The value used assumes a 100% tend quality. If you were using herbal medicine to treat this (70% tend quality max) it would essentially be -18% x 0.7 to get -12% change. Match that with the 18% change from the severityPerDayNotImmune value and you'd get 6% progression per day, which means the condition will get to the extreme stages in ~16 days.

Another section of the Old Age hediff is the section that causes Degradation under it's stages section. As an example, here's the first stage that can give Degradation:
<li> <label>minor</label> <minSeverity>0.2</minSeverity> <hediffGivers> <li Class="HediffGiver_Random"> <hediff>TK_Degradation</hediff> <mtbDays>60</mtbDays> <canAffectAnyLivePart>true</canAffectAnyLivePart> </li> </hediffGivers> </li>

The only part you'd need to edit here is the mtbDays section. This value is the average amount of days it should take to get Degradation. If you're using faster aging rates you'd likely want to reduce these since Degradation is what should kill the pawn. If you're using pretty high aging rates, I'd recommend setting mtbDays for the very last stage to 1 and then setting the previous stages to slightly higher values as you work your way back up in the file. As an example:

Severity 0.2 - mtbDays 16
Severity 0.4 - mtbDays 8
Severity 0.6 - mtbDays 4
Severity 0.8 - mtbDays 2
Severity 0.9 - mtbDays 1

This covers everything that comes to mind but let me know in the comments if there's something that could be expanded upon.
Last edited by Silencer59; 7 Apr, 2024 @ 8:00pm