1,849 ratings
[KV] Path Avoid
Mod, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5
File Size
253.319 KB
Oct 25, 2017 @ 1:34pm
Apr 13 @ 11:10am
32 Change Notes ( view )

Subscribe to download
[KV] Path Avoid

Path Avoid allows you to "nudge" the pathfinding system for your pawns, to make them prefer and avoid different areas. Use it to make your pawns follow pathways in your base, or avoid passing through a freezer to get to the other side! Avoidance won't prevent pawns from pathing, it'll just make them take an alternate path...

Paths made with this mod only apply to colonists, (non-hostile) animals, and friendly traders/travelers/etc. Anything that wants to kill a colonist will not follow these pathing hints.

Can be added to an existing save.

Ludeon Forum Thread: https://ludeon.com/forums/index.php?topic=33027

Direct Download:

GitHub: https://github.com/KiameV/rimworld-pathavoid

Supported Mods:
- Save Our Ship 2 - Disable SOS2's pathfinding

Thanks to everyone who's helped translate this mod!
Ɲơɴɑɱɛ - German
53N4 - Spanish
Tuvka - Russian

Performance Improvement:

Like my mods? Consider supporting me!

Original Author: Vendan

Supports ModSync RW
Popular Discussions View All (1)
Oct 26, 2022 @ 1:10am
francoquesada May 20 @ 2:53am 
Love this mod. And would love an option to allow colonists to ignore restrictions while drafted =)
John Helldiver May 16 @ 2:36pm 
@missionz3r0 Would love to see it!
Neville May 15 @ 2:10pm 
So I did some rough testing. It does indeed seem the case that it does not affect the algorithm as I hoped. My hopes were that it would not check adjacent nodes of high cost until it reached similar cost on different paths. I.e. before trying a cost 100 "hated" node, it would first check 100 normal nodes. I don't think it does that. Massively "tuning" the pathfinding area actually cut the FPS from 50fps on 2X speed to 25fps. So this mod does incur a cost, although if used for it's strict purpose (avoiding path, not gaming the pathfinder) it seems neglible, i.e. I see no FPS loss for just marking some unwanting doors and the tiles next to them to avoid pathing there.

tl:dr: just use it to avoid pawns going where you don't want them to go, do NOT try to use it to give the pathfinder an easier time - he won't like it^^ Cheers
Jaggid Edje May 15 @ 1:54pm 
Ah, I see what you mean. While the pawns aren't going to path through dead ends and single-entry rooms unless they need to actually do something there, you are suggesting that marking them to be disliked removes them entirely from the algorithm.

I doubt that is the case in Rimworld. Raising the point cost doesn't remove something from an algorithm, it just makes it less desirable as part of the algorithms calculations. In the case of your dead ends and rooms with only one door, they were never desirable routes in the first place, so it would not serve a purpose, I don't believe.
Neville May 15 @ 1:24pm 
I may have expressed myself poorly. I do not just mark the the doors as high-cost, I mark the entire room, as well as hallways leading nowhere, large parts of excavated mountain, etc. What I'm asking is not so much about the end result (i.e. pawn takes the expected route, avoids the disliked/hated paths), but rather about the pathfinding algorithm. Does the pathfinding algorithm effectively behave as you'd expect from something like A* or some other dijkstra derivated pathfinding algorithm, thus will it be able to skip a lot of unnecessary nodes when finding it's path, or does it not affect the algorithm in this way?
Jaggid Edje May 15 @ 1:18pm 
I use this mod in my game and haven't noticed any performance issues. It works alongside other mods that do change the pathing algorithms without any conflicts, so I think this mod just change the pathing costs.

Also, I don't think there's really any point to setting a single room door to be disliked/hated. Pawns only enter rooms if they have a reason to. For rooms with multiple doors it's useful if you don't want people using the room as a throughway and to only enter if they need to go inside the room itself. I do that for my hospitals and freezer rooms, for example.

It does do exactly what you asked, it 'nudges' the pawns (as well as NPC allies and tamed animals) to select the desired pathways. I use the mod quite a bit to keep my pawn traffic on pathways, outside of rooms with multiple doors where I don't want, on bridges (rather than through water), etc.
Neville May 15 @ 12:42pm 
(part2)In Dwarf Fortress for instance I can gain significant FPS gains by marking zones for the pathfinding to avoid/prioritize, but that works because it's predictable A*-type pathfinding, and I'm not sure if rimworld does that as such or if it's heavily tweaked and thus might not gain a performance improvement or even cause performance degradation as a result of marking low-traffic areas as high cost.

Any idea?
Neville May 15 @ 12:42pm 
I have a question about this mod's performance implications. Is there an overhead to the pathing cost changes I make with this, or does it simply change a tile's pathing cost to X (0, 25, 50, 100 or whatever?)? I'm asking because I always struggle with FPS because I build big, so I wonder if marking all the rooms with just one door (i.e. no transit, like a bedroom, or a hospital) in HATE (very high cost) would nudge the pathfinding algorithm away from those areas, and thus help it find it's desired path faster, or is this not recommended? I'm not certain of how pathfinding is implemented exactly nor how this mod makes it's changes.
missionz3r0 May 7 @ 8:32pm 
I'm mostly done with the code changes, some small bug fixes, and refactoring.

Only thing I'm waiting a bit on is to get Vendan (one of the other OG devs for the mod) to give their blessing for an MIT license. If I don't hear back from them by this weekend I'll go ahead and publish.
Celgaming May 5 @ 12:57am 
This is a must for big colonies with farms unless you want that dirt everywhere. No vanilla option makes pawns avoid walking through a farm area, not even fences.