RimWorld

RimWorld

No Reasons To Avoid Mothballing
44 Comments
Rob Bobbert Jan 11 @ 2:07pm 
I'll keep it, its a good mod.
q308744928  [author] Jan 11 @ 1:10pm 
@Rob Bobbert on 1.5 it does almost to nothing, as most of the patches have already integrated into vanilla
Rob Bobbert Jan 11 @ 7:22am 
Does this help performance?
神木零子 Nov 26, 2024 @ 7:38pm 
赞美大佬
q308744928  [author] Nov 26, 2024 @ 12:28pm 
@神木零子 感谢反馈。阿尔法基因的作者已经对自己的代码进行了优化,所以不再需要本mod打补丁了,因此我已经删除了对应的补丁。
神木零子 Nov 26, 2024 @ 3:40am 
大佬,阿尔法基因的patch失效爆红了:steamsad:
q308744928  [author] Jul 11, 2024 @ 12:46pm 
@GreenJelly 兼容,但是不建议一起用
xuanxuan Jul 11, 2024 @ 11:50am 
Savegame Shrinker
Better GC: Mothballed and World Pawns
和这个可以一起使用吗?
大番薯之怒 Jun 13, 2024 @ 4:08am 
好的,感谢解答~
q308744928  [author] Jun 13, 2024 @ 2:59am 
@大番薯之怒 1.4版本在发帖之后添加了一个任务,所以有简中文本,但是贴吧里没更新说明。1.5这个任务删除了,所以没有文本需要汉化
Moonarian Jun 13, 2024 @ 2:27am 
@大番薯之怒 贴吧里写了,不需要汉化,订阅后放在core之后就行
大番薯之怒 May 16, 2024 @ 8:05pm 
好bro这个MOD怎么使用哦,还有我看文件夹1.4里有简中,但是1.5里没有,大佬是不是忘记复制过去啦。
KahirDragoon May 5, 2024 @ 12:39am 
Can confirm the errors are gone. Thank you very much.
q308744928  [author] May 4, 2024 @ 7:44pm 
@KahirDragoon

So Iv decided to change the patch in NRTAM with a new condition check,
<li Class="PatchOperationConditional"><!-- test if it exists -->
<xpath>Defs/HediffDef[defName="Malnutrition"]/allowMothballIfLowPriorityWorldPawn</xpath>

<match Class="PatchOperationReplace"><!-- replace if it does exist -->
<xpath>Defs/HediffDef[defName="Malnutrition"]/allowMothballIfLowPriorityWorldPawn</xpath>
<value>
<allowMothballIfLowPriorityWorldPawn>true</allowMothballIfLowPriorityWorldPawn>
</value>
</match>

<nomatch Class="PatchOperationAdd"><!-- add if it doesn't exist -->
<xpath>Defs/HediffDef[defName="Malnutrition"]</xpath>
<value>
<allowMothballIfLowPriorityWorldPawn>true</allowMothballIfLowPriorityWorldPawn>
</value>
</nomatch>

</li>

And add a loadsequence,
<loadAfter>
<li>Ludeon.RimWorld</li>
<li>Ludeon.RimWorld.Royalty</li>
<li>Ludeon.RimWorld.Ideology</li>
<li>Ludeon.RimWorld.Biotech</li>
<li>Ludeon.RimWorld.Anomaly</li>
<li>GwinnBleidd.MothballedAndDeadPawns</li>
</loadAfter>
q308744928  [author] May 4, 2024 @ 7:43pm 
@KahirDragoon mod updated, your may have to resort the modlist by click Tynan's button "Auto-sort mods".
Thank you for the feedback.

In details, both mods are patching the same hediff "Malnutrition",

in BetterGC the patch looks like this,
<Operation Class="PatchOperationAdd">
<xpath>Defs/HediffDef[defName="Malnutrition"]</xpath>
<value>
<allowMothballIfLowPriorityWorldPawn>true</allowMothballIfLowPriorityWorldPawn>
</value>
</Operation>

Its a patch without any condition check, means in any case the patch will add the term <allowMothballIfLowPriorityWorldPawn>true</allowMothballIfLowPriorityWorldPawn> . This would case a conflict when other mods try to patch the same term according to the rule "There should be no duplicated terms".
KahirDragoon May 4, 2024 @ 9:14am 
If used together with Better GC one of the patch operations fails and trhwos a read error.

[No Reasons To Avoid Mothballing - Start of stack trace]
Verse.PatchOperationAdd(xpath="/Defs/HediffDef[defName="Malnutrition" and not(allowMothballIfLowPriorityWorldPawn="true")]"): Failed to find a node with the given xpath
Verse.PatchOperationSequence: Error in the operation at position=1
[End of stack trace]

Probably because its already patched.
q308744928  [author] Nov 19, 2023 @ 8:51pm 
@2962342497 没测试过,不用Fish
2962342497 Nov 19, 2023 @ 5:16pm 
Is this compatible with Performance Fish?
rex6564 Jun 9, 2023 @ 6:32am 
thanks
- BusterZlista - Jun 8, 2023 @ 9:59am 
oh okay, now I sort of understand, thanks for answering all of my questions and goodbye
q308744928  [author] Jun 8, 2023 @ 9:41am 
matched one of these condition, the hediff should be patched(pawn with the hediff should be mothballed):
hediffs last more than a day
hediffs donot expired on its own
combat damages(stab, bruise, cut ... etc.)

these hediffs will not be patched:
disease
toxic buildup
pregnant
- BusterZlista - Jun 8, 2023 @ 9:14am 
I see, so now if you wanted to patch some hediffs from a mod, what kind of hediffs should you mothball and which one should you not?
q308744928  [author] Jun 8, 2023 @ 8:53am 
the pawns that had these hediffs were still being simulated, till the hediff has expired if it could be expired, if not then the pawn would be simulated forever till death
- BusterZlista - Jun 8, 2023 @ 8:20am 
oh so that's how it works, since the modded hediffs you patched didn't have this mothballing thing in them before, the pawns that had them were still being simulated, even after the hediff has expired?
q308744928  [author] Jun 8, 2023 @ 7:11am 
@- BusterZlista - say a pirate apeared on your home map, at the moment he was "alive".

your guys beated him hard and he started to flee, he was still "alive" before he walked out the map.

finally he walked out the map and you can not track him anymore, but since he had a Go-juice and the effect(hediff) was still on going, the game had to simulate him. He is now a "worldpawn" and "alive"

after some time the Go-juice effect has gone, there was no need to monitor him anymore, calculate his hunger or sleep need seemed useless. The game then decided every 1/4 day only update his age record, this is so called "mothballing a worldpawn".

from the story you may find 3 basic status when the game running a pawn simulation:
"alive" - the pawn's all parameters have to be simulated every game tick
"mothballing" - only the age will be updated every 1/4 ingame day
"dead" - somebody is dead but not sleeping

and generally 2 types of pawns:
pawn at home(map)
worldpawn(caravan or backstage)
- BusterZlista - Jun 8, 2023 @ 5:55am 
Hello, can I ask what mothballing is in Rimworld?

It's that I've never heard about it before, and so I would like to hear a general summary of it and alongside preferably an explanation too if you have the time, thank you in advance
Get Donked On May 25, 2023 @ 1:22am 
ah fair enough then if the load order isnt an issue then it doesnt really matter. it was mostly for rimpy user so they can just hit sort without having to drag it to the bottom of the list everytime but if load order doesnt matter then it all good
q308744928  [author] May 24, 2023 @ 8:52pm 
@Get Donked On the idea is good, but not necessary. Reasons:

1. say that we have mods ABCDEFG and corresponded patches A'B'C'D'E'F'G', and you only want to load mods ABC without DEFG, then only patches A'B'C' will be loaded into the game. Each patch has its own check condition. There is no point to add an extra condition check again in about.xml.

2.Iv said the word "load this mod at the bottom of the list", this happens when somebody else made another patch A'' to mod A. In this case, load this mod at the bottom of the list, only patches B'C'D' and so on will be activated if mods BCD etc have been loaded.

3. the game decided to load the Defs before patches, so it doesnt matter where i put my patches. In fact, iv tried to load the patches right after Core, even before Royalty and Biotech, still works with no red popup.
Get Donked On May 24, 2023 @ 2:29pm 
plonk this into your about xml:

<loadAfter>
<li>Ludeon.RimWorld</li>
<li>Ludeon.RimWorld.Royalty</li>
<li>Ludeon.RimWorld.Ideology</li>
<li>Ludeon.RimWorld.Biotech</li>
<li>brrainz.harmony</li>
<li>oskarpotocki.vanillafactionsexpanded.core</li>
<li>vanillaracesexpanded.saurid</li>
<li>vanillaracesexpanded.phytokin</li>
<li>vanillaracesexpanded.hussar</li>
<li>vera.bug</li>
<li>rooboid.minotaur</li>
<li>albion.sparklingworlds.addon.bluemoon</li>
<li>sarg.alphagenes</li>
</loadAfter>

Its not all of them as im not gonna downlaod mods ill never even wanna be seen in my mod list like rjw but this should help for most people
Get Donked On May 24, 2023 @ 2:22pm 
why not add a load after in the about xml that way youll know for sure people will load it after the mods you have patched
Test 05 May 23, 2023 @ 8:02pm 
虽然看过帖子,完全看不懂,不过先打一个再说,万一就不那么卡了呢 :rbrb3: (
q308744928  [author] May 23, 2023 @ 8:16am 
@Elgate the picture above has been updated

for the 2nd question, the universal solution is "load this mod at the bottom of the list"
Elgate May 23, 2023 @ 3:01am 
The mod seems to be updated, could we get a listing of what mods are helped? And assuming someone makes a mothball patch, how should we share it? I feel like the smartest solution would be to add it to this mod and make a compedium rather than having multiple mods. (I'm not doing it myself, I just know someone that made a very similar mod)
IvanovichDT May 22, 2023 @ 3:18pm 
works just fine for me,excellent!@
q308744928  [author] May 21, 2023 @ 11:53pm 
@Mute Iv actually patched "cut" "shredded" "gunshot"and "stab", these hediffs usually reasult into bleeding. Reasons:
1.I was not sure if i should patch these, but maybe regarding this mod "more patched hediffs" = "better performance"
2.assume pawns who walked out of the map could take a break and tend themselves, it sounds a bit realistic
TurtleShroom May 21, 2023 @ 5:20pm 
Shoot, that's amazing. I will try this and see if it helps with lag!
Mute May 21, 2023 @ 2:42pm 
@Holgast If a pawn leaves your map with certain health effects instead of going into "storage" (mothballing), they essentially are still updated as much as any pawn on your map.

This is good for things like bleeding, where if they go off the edge of the map 1s before death they should still be able to die instead of going into stasis. This is bad for things like genetic drug dependencies, where this has no right to leave that pawn giving you a performance impact for the next several months.

The mod fixes these silly cases.
Holgast May 21, 2023 @ 4:08am 
what does changing these things actually do?
Honey55536 May 20, 2023 @ 11:18pm 
我是20号昨天刚看玩这个帖子,今天来工坊翻翻。巧了不是
TurtleShroom May 20, 2023 @ 8:23pm 
Sarelth, that is what I am trying to figure out.
q308744928  [author] May 20, 2023 @ 7:49pm 
@TurtleShroom @Sarelth i have removed these words, sorry for the confusion
Sarelth May 20, 2023 @ 6:00pm 
So this stores Pawn data for non-colonists to read from the crypto-sleep category instead of the regular pawn list. Which makes it check data less frequently, in theory helping cause less lag from frequent checks when having played for a long time?
TurtleShroom May 20, 2023 @ 11:04am 
I don't understand what it means by putting World Pawns in the Crypto-Sleep Caskets.