Nudge Me - Melee Pathfinding Fix
Nudge Me
[b]Nudge Me[/b] is a targeted bug-fix mod for melee combat pathing. As of RimWorld 1.6, pawns can get stuck while attacking enemies. This is a RimWorld Core issue and is not related to any DLC. Pawns may idle behind other pawns even when a valid path to the target exists. This can occur even with just two pawns attacking a single enemy.
Nudge Me cannot fix the underlying issue. Ludeon needs to fix that, and I trust they eventually will. In the meantime, this mod reduces the severity of the symptoms and makes certain animal-based combat playstyles more playable.
How the mod works
The mod detects pawns that become stuck during melee engagement. When a pawn is stuck, it nudges the pawn to forget its current path. This uses the same method vanilla applies when a path ends. The game then generates a new path.
The mod runs for all pawns that are not player-faction humanlikes. Your colonists will never be nudged or have their paths reset. The biggest benefit is visible for released animals, manhunter packs, and enemy melee fighters.
Performance and technical details
The detection does not run on its own tick system. It executes only during active melee jobs, at the same time vanilla processes the relevant toil. The mod uses interval-based checks to keep overhead low. If a pawn remains unable to reach its target after being nudged, the system applies increasing grace periods before another nudge can occur.
When triggered, the mod simply clears the pawn’s current path, allowing the vanilla pathfinding system to calculate a new one. No core logic is replaced or altered. All behavior happens at runtime. Nothing is stored in your save file.
The mod does very little work. Tested with 100 simultaneous melee pawns, the performance analyzer shows no noticeable increase in pathfinding time. The Harmony patch remains well below 0.001 ms per frame on average.
You can install this mod on an existing save. Removing mods from ongoing saves is generally not recommended. If you absolutely need to remove this mod, disable the mod in the mod settings, let the game run for a few seconds, then save your game. After that, remove the mod and reload the save.
Compatibility
Anything that replaces or alters vanilla Toils_Combat.FollowAndMeleeAttack is not compatible.
But I am not aware of any single mod which does that. Combat Extended seems to be compatible. Happy to hear your reports and adjust this section.
Why this mod exists
The Odyssey DLC description promised that we can “raise a hunting pack of scimitar cats and great wolves.” And now we are going to do exactly that.
Time to hunt. Release the hounds … and the cats.
[b]Credits[/b]
Thanks to the folks at the RimWorld discord and Aelanna for nudging me towards a better solution.