RimWorld

RimWorld

25 ratings
Custom Infestations
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.4
File Size
Posted
Updated
78.333 KB
24 Jan, 2023 @ 9:18pm
25 Jan, 2023 @ 9:17pm
3 Change Notes ( view )

Subscribe to download
Custom Infestations

Description
Why did I make this?
I had a few separate infestation mods with different approaches installed. None of them changed much about infestations but some introduced bloat to do it. None of them gave you a lot of customization, i.e. they introduced new flooring types, a new lighting cutoff, or always forbid infestations on buildings. I wanted one mod with configurable options for infestations so I made one.

Available Options
- Forbid infestations on buildings.
- Forbid infestations on any terrain matching "NoInfestation" tag, with options to apply tag to "hardy" vanilla flooring. Easy patching for modded flooring.
- Customize the minimum distance from a colony building.
- Customize the smallest enclosed area.
- Customize the minimum "Infestation Score" considered.
- Customize the light level at which infestations are possible.
- Customize the light level at which infestations are possible but less likely.
- Customize the minimum and maximum temperature an infestation can spawn.
- Customize the temperature range at which infestations are possible but less likely.

The default options leave infestation scoring at vanilla configuration. All values except for forbidden flooring types update live so you can experiment.

Performance
Optimized the performance of the "Draw Infestation Chance" debug option. It was calculating the score for cells twice and calling inefficient rendering code.

Bugfixes
Fixed significant bugs in the "Draw Infestation Chance" debug option. It was not updating the render infestation chance for cells that no longer had any infestation chance.

Compatibility
This mod uses Harmony to replace InfestationCellFinder.GetScoreAt, InfestationCellFinder.DebugDraw, and prefix CompSpawnerHives.CanSpawnHiveAt. It may conflict with other mods that do the same. Those methods have not changed in several versions of RimWorld so I would expect this mod to continue to work through updates.

Source Code
Available on github[github.com]
Popular Discussions View All (1)
1
4 Feb @ 2:13pm
Dev mode "Draw Infestation chance" is now unreliable with your mod change.
Chris
20 Comments
Galadedrid 27 Jul @ 8:09am 
Unfortunately this throws errors with 1.6
whitespacekilla  [author] 4 Feb @ 2:15pm 
@Noxilie I don't imagine anything has changed in the 1.5 update to break it. The only infestation changes I can find in any of Ludeon's patch notes wouldn't have touched the methods patched here. Have you tried it and verified the mod is non-functional? I generally recommend everyone does that before bothering mod authors.
Noxilie 26 May, 2024 @ 5:27am 
Hi, any plans on updating this to 1.5?
whitespacekilla  [author] 26 Jan, 2024 @ 10:39am 
@jacrispy360 probably not from me. I made this mod as fixes and configurability for vanilla infestations (the hives themselves spawning). once the hives are spawned, the infestation is "over" and you're talking about much larger changes to pawn AI.
whitespacekilla  [author] 26 Jan, 2024 @ 10:37am 
@Alsinir tile count

This may not be a helpful explanation, but it's an override of the vanilla infestation algorithm, which itself has a minimum tile count that is literally tile count, not side-length of a room.
Alsinir 28 Dec, 2023 @ 5:17am 
is smallest enclosed area total tile count or is it so that if you say put it as 2 it'll be 2x2, with 3 it'd be 3x3 etc?
jacrispy360 12 Jul, 2023 @ 5:39pm 
Can I pleeeease get a setting that stops the insects from digging? I try to leave an infestation alone and they just destroy the whole mountain.
kongkim 31 May, 2023 @ 12:43pm 
@whitespacekilla Ok that a bit sad, but thx for getting back to me on it :)
whitespacekilla  [author] 31 May, 2023 @ 11:04am 
@kongkim I would recommend installing an event configuration mod to disable VFEI's giant infestation event. Looking at the event code, I don't think it's worth patching. It's basically a normal infestation event that doesn't follow the rules of infestation events in ways you don't like, seems easier to just disable.

@Roger Douglas nope, you can see what the mod does in the description.
Dracula Flow 5 7 May, 2023 @ 10:55pm 
Can this limit infestations to one hive?

I would also like the ability to spawn more then one hive, but in different locations?