RimWorld

RimWorld

553 betyg
Better GC: Mothballed and World Pawns
17
5
4
3
4
4
2
4
4
4
2
2
   
Utmärkelse
Favorit
Favoritmarkerad
Avfavoritmarkerad
Mod, 1.4, 1.5
Filstorlek
Lades upp
Uppdaterades
73.938 KB
28 maj, 2023 @ 14:46
14 maj @ 19:20
13 ändringsnotiser ( visa )

Abonnera för att ladda ner
Better GC: Mothballed and World Pawns

Beskrivning
The mod is meant to improve game performance.

The BGC mod does the following:
  • better pawn mothballing (XML patch)
  • reduces the number of world pawns that the game keeps forever through garbage collection (C# patch)
  • pawn garbage collection is customizable

For the improved mothballing, it patches some of the core/biotech hediffs, as well as the following:
  • Expanded Prosthetics and Organ Engineering
  • Diseases Overhauled
Let me know about other mods that may need a patch.

It makes little to no impact on new games (since the world's not bloated yet), but rather intended for the games that ran for a while.

Reported possible incompatibilities/special cases:
  • RIMMSqol - some pawns were reportedly removed from the cities introduced by the RIMMSqol mod. Version 1.4.0.6 of the BGC mod added "more gentle pawn cleanup" option, and when the option is on, the pawns are reportedly kept. So please use that option when playing with RIMMSqol or other mods creating long-term non-vanilla map objects storing pawns.
  • Performance Fish - PF mod description claims incompatibility, but I had reports from players claiming the two mods work just fine. The possible incompatibility seems to be related to the fact that the PF has its own Garbage Collection tweaks and settings which will be ignored by this mod. Of course, the best way to proceed is to make a backup before trying.


FAQ:
1. What's the difference between this mod and No Reasons To Avoid Mothballing?
  • This mod patches hediffs by adding allowMothballIfLowPriorityWorldPawn property, while the other mod adds alwaysAllowMothball property. The latter method is more aggressive, so you will end up with fewer ticking pawns, but with a higher risk of mothballing an important pawn that was not supposed to be mothballed.
  • On top of the 2 different properties that were added, the list of patched mods is different.
  • Most importantly, this mod removes old references to non-existing pawns


Please read before installing the mod for the details, technical or otherwise.

TLDR:
1. More pawns mothballed due to allowMothballIfLowPriorityWorldPawn tag (xml patch)
2. Better pawn cleanup by GC for those pawns that were not seen for over 1 year (runs on save load).

I've been running a colony for 7 years, and my performance eroded from 600-700 TPS to 100-120 TPS, while the savefile expanded from 25M to 80M.
I started debugging and discovered that my save file had almost 2000 pawns that were not processed by the garbage collector, and, on top of it, 200+ of those pawns were "active", so each of them "ticked".

The reason for the 200+ active pawns that were not mothballed was diseases.
The game code prevents pawn mothballing if the pawn has hediffs unless the hediff has allowMothballIfLowPriorityWorldPawn tag.
The main culprit (for my case) was the DiseasesOverhauled mod (that added a bunch of hediffs without the tag), and GeneticDrugNeed hediff added by Biotech expansion.
So the mod does just that: it patches some hediff by adding allowMothballIfLowPriorityWorldPawn tag to them.
As a result my number of ticking pawns went down from 200+ to 80+.

The second thing was bloated world pawns storage.
Pawns never get discarded if they have relations to other pawns or appear in logs somewhere.
So after you've got a bunch of big raids, you're bound to get some pawns with relations. They will be kept, probably forever.
To remedy that I added a patch that runs when the world is loaded from the save.
The patch checks if the pawn could be garbage collected (meaning, it's not an "important" pawn, e.g. not a faction leader, kidnapped, caravan member, reserved for a quest, has a corpse present on the map, etc),
then it checks that the pawn was a "WorldPawn" (meaning it was not seen by a player) for over a year (5 years if the pawn belongs to your faction), and then the patch clears pawn relations and the log entries the pawn appears in.
Then, the mod triggers a pawn mothballing and garbage collection process, so you don't have to wait until the game runs it on its own (toggleable).

In my case, it brought down the number of world pawns from 2000 to under 1000.

All in all, my savefile size went down from 80M to 58M, and my TPS went up from 100-120 to 250-270 TPS.
YMMV, depending on how many pawns you've got in your save file and whether you use Diseases Overhauled mod.

It's still in beta, though I have 150+ mods and it seems to run fine.
Please let me know if there are other common diseases that have to be patched.

Since some mods may handle pawns in unexpected ways, please make sure to make a backup copy of your save file before trying this mod.

[ko-fi.com]
Populära diskussioner Visa alla (1)
9
17 aug, 2023 @ 9:06
Rocketman
CrusaderRO
274 kommentarer
GwinnBleidd  [skapare] 10 maj @ 21:21 
@Hattsworth "totally disable report letter"? (at the bottom of the settings; you may need to scroll a bit, depending on your screen size)
Hattsworth 3 maj @ 11:50 
Okay it's complete inconsequential but is there no way to stop it from giving me a letter every time I load my save? It really annoys me OCD and I don't need any of this information. I turned off auto-run and the generate report.
Hyndis 3 maj @ 10:51 
This mod is a godsend. For a long running colony is reduced my file size by about 70% and greatly increased TPS from nearly unplayable to mostly smooth.
Sencho 20 apr @ 2:45 
Thanks for this mod, I play Rimworld on my laptop and this is a must have when you play for some time.
Torrixx 11 apr @ 0:52 
Goated mod. Installed this on my heavily modded world I have been playing a while on. went from max 150TPS with drops to 15 TPS occasionally to a consistent 400-500 TPS. Commenting for the other mod doom scrollers that get the eventual lag problem
Sky Icewind 6 mar @ 2:05 
I was getting some random slowdowns like, three times an in game day after having an active colony for a few years, couldn't figure out why, all I knew is that according to performance analyzer, it was something involving a world tick update, and it would happen usually like clockwork, at the exact times.

This fixed it all and now a heavily VFE and such modded game runs pretty damn smoothly again, great mod.
batatspamavert 26 feb @ 10:23 
Another, unintended but highly appreciated effect: I'm going with archonexus quest, on the third map right now. With random pawns mothballed, I get a lot of my old colonists visiting through Hospitality mod now. Very cool.

Also it seems to work perfectly fine with Performance Fish so far.
Errant_Gunner 22 feb @ 23:52 
11 years in and it just cleaned up almost 3000 world pawns. This mod is a lifesaver
batatspamavert 17 feb @ 16:10 
I'm more than impressed. It just fixed the game. 10/10.
Captain Frost20 10 feb @ 9:04 
I don't understand what makes this incompatible with performance fish. I'm utterly convinced PF doesn't mothball as I installed this mid-play through and my TPS went from 120/180 on 3x speed back up to 290/340 on 3x speed. Literally a play through saver. Ive had no issues using this with PF so far, and if anything its mothballing is better then PF's.