Perfect Pathfinding

Mod, 1.2, 1.3, 1.4


~ Features ~Heuristic Patch:
When a pawn paths to a target a great enough distance away, the vanilla game utilizes an alternate heuristic to calculate the cost of a path that shortens the calculation time, but results in worse paths. This is the cause of the "zig-zag" diversions when approaching corners and doorways, and paths that ignore difficult terrain. This patch forces the algorithm to us...

Author: JisPichi

Created: 29 Dec, 2020 @ 9:13pm

Updated: 27 Nov, 2022 @ 5:45am

Subscribers: 63983


Size (unpacked) : 0.918 MB

~ Features ~
Heuristic Patch:
When a pawn paths to a target a great enough distance away, the vanilla game utilizes an alternate heuristic to calculate the cost of a path that shortens the calculation time, but results in worse paths. This is the cause of the "zig-zag" diversions when approaching corners and doorways, and paths that ignore difficult terrain. This patch forces the algorithm to use the accurate heuristic every time.

Lighting and Weather Patches:
Pawns move slower when walking in the dark or in the rain. The vanilla algorithm uses the light and weather condition at the pawn's starting position for the entire length of the path. This patch calculates the real movement cost at each cell location, incentivizing pawns to avoid dark, stormy areas like they should.

Dirt Avoidance:
This patch was more of a personal challenge to come up with a method of avoiding dirt while maintaining the most optimal path. The strength can be adjusted in the settings, which is the number of added seconds a pawn is willing to spend taking a longer, cleaner path.

~ Questions ~
Can this mod be added and removed safely from existing saves?
Yes!

Does this mod impact performance?
The worst case performance impact that I measured were in the tens of milliseconds. On a regular sized map and with a reasonable CPU the performance impact of this mod should be negligible. Anyone who still needs a lightweight alternative, look into Clean Pathfinding.

So how is this different to Clean Pathfinding?
Perfect Pathfinding removes optimizations and adds complexity to the algorithm calculations with the goal of finding optimal, perfect paths.
Clean Pathfinding adds optimizations and uses lightweight methods to find paths that keep your pawns clean.

If all you want is for your ungrateful colonists to use the roads you lovingly paved for them, Clean Pathfinding is probably what you're looking for.

¯\_(ツ)_/¯

How do I download and install mods?

Simply click the blue button above. It will open the file hosting page with the mod repacked by us from the official source.

How do I install this mod?

See the 'How to install' tab.

Is this mod safe to use?

The mods are repacked as is, without any additional software, malware, or bloatware added. To check for viruses, use a reliable antivirus or upload the archive to a website like virustotal.com. Anyway, It's always a good practice to keep backups of your saves in case of mod incompatibility .

There is a folder in the .zip archive. To install the mod, move the entire folder (not just its contents) into 'Mods' folder located under your RimWorld root isntallation folder.
So, for steam version of the game, the path would look like this: C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods
For any other distribution, firstly locate your rimworld installation path and then unpack the archive into the 'Mods' folder.
Then enable the mod in the game mods menu by double clicking on its name and restart the game