RimWorld

RimWorld

Repair in the Zone
36 Comments
Myrmatta 13 Jul @ 2:46pm 
From testing, this doesn't seem to work in 1.6 yet, probably because of the 1.6 pathfinding alterations.
Tyrant 27 Jun @ 2:58pm 
Do you plan on updating this for 1.6?
Kathanon  [author] 13 Apr, 2024 @ 2:56am 
Updated for RimWorld 1.5.
Farbott 18 Mar, 2024 @ 11:35pm 
well im gonna make the assumption that a mod that makes pawns not stand in disallowed tiles while repairing doesnt have very many connections to the mod which makes combat AI a lot more aggressive and smarter (the ones who DONT care about repairing, they are destroyers >:))
Kathanon  [author] 29 Aug, 2023 @ 6:52am 
Depends on exectly what code they replace. I only change the way the target square is chosen, but that is part of the pathfinding code.
Miguel V-DF 28 Aug, 2023 @ 6:31pm 
I presume the code doesn't interfere with mods that change pathfinding like clean pathfinding 2, or CAI, but can anyone confirm?
Kathanon  [author] 26 Jul, 2023 @ 2:42am 
It applies to any area that the pawn is set to. If they are set to unrestricted, the it does not affect them at all.
Monkey Magic 26 Jul, 2023 @ 12:33am 
Does this apply only to the "Home" zone then, or does it work on a building by building basis too? Would be nice to be able to repair a building from the inside when it's sweltering heat outside, even if it is well within the "Home" zone.
Kathanon  [author] 10 May, 2023 @ 3:15pm 
I think it would be better to make separate zones for each "island" for that.

Also, the change you are proposing would mean replacing or patching the vanilla pathfinding logic. Way to big a project for so little gain.
Nirahiel 10 May, 2023 @ 10:07am 
Or, what if you make zones that are "islands", on purpose, for these man-hunters moments, and you really don't want spawns to step out of their assigned zone. If they have to step out to reach another point within the zone, they can't do it at all. If there are man-hunters animals outside, I don't want my pawns to exit their zone to do whatever they planned on doing, even if their destination is inside the zone too. If you can't get there without getting out of your zone, consider you can't get there at all. The floor is lava.
Kathanon  [author] 15 Mar, 2023 @ 5:42pm 
With the vanilla behavior, if you make your zones such that there is always a path from any allowed square to any other allowed square (basically that it is contiguous, plus that the walkable parts must also be contiguous), then they will always stay within the zone.

The issue with the vanilla logic, that this mod fixes, is that when repairing a structure that is in the zone, it just picks a random walkable square next to it to stand on, but does not check if that square is also in the zone.

If a structure is in the zone, but no free square next to it is walkable, then they will pick one that isn't. So, to get them to always stay in the zone, you need to make it contiguous as above, and also ensure that all structures in the zone have a walkable square next to it, that is also in the zone.
Kathanon  [author] 15 Mar, 2023 @ 5:42pm 
That would add more complexity than it is worth, I think.

The vanilla mechanic is that pawns can walk to any square in the zone that is walkable and can repair any building that is in the zone. They first choose a square to walk to, and then check if they can path there without leaving the zone. If they can't, they try again with no regard to zone.

If pawns are restricted to not pathing between zones, then any "island" part of the zone becomes useless, as the pawns can't get there. To fix that you would have to make the zone contiguous, which would negate the need for that limitation.
lol 15 Mar, 2023 @ 11:28am 
@Kathanon, np. Yes, in case parts of the zone are not connected. Mostly applicable for situations when everyone's locked in during manhunters attack and pawns shouldn't come out to repair walls.
Kathanon  [author] 15 Feb, 2023 @ 7:22pm 
@vlad-lecteur
Sorry, I missed your comment. Do you mean for the case where parts of the zone are not connected?
Kathanon  [author] 15 Feb, 2023 @ 7:19pm 
No, it does not influence performance. Technically there is a penalty, but it is way too small to measure.
star 15 Feb, 2023 @ 5:55pm 
I wonder if it increases the performance.
lol 26 Nov, 2022 @ 12:11am 
Thank you for the mod! Please consider adding "Do not leave allowed area" toggle in the mod options. That's the behavior I had supposed the mod had in the first place, to be fair.
Michiko 7 Aug, 2022 @ 1:04am 
Ah that makes sense. Thanks!
Kathanon  [author] 6 Aug, 2022 @ 12:39pm 
It does not add any UI. The "zone" refers to the "allowed area" in vanilla. This mod just changes their behavior, so that they actually consider their allowed area when deciding where to stand when interacting with something.

I have updated the description to use the correct phrase. It was a mistake on my part to call it a "zone" - probably because the area tools are under "Zone" in th architect menu.
Michiko 6 Aug, 2022 @ 8:05am 
Hi, I can't seem to figure out how to use this mod. Where do I find the zone itself?
Kathanon  [author] 9 Jun, 2022 @ 7:39am 
@ LumpyArbuckle I have not specifically tested that, but I would expect so. This mod affects pathfinding, not selecting what building to work on (which is what I would expect Better Construction to do).
LumpyArbuckle 9 Jun, 2022 @ 1:31am 
Does this mod work with Smarter Construction?
Kathanon  [author] 30 Apr, 2022 @ 6:59am 
Yes, it is safe to add or remove at any point.
χø£¡Ŧ|ź <(´= w =`)> 29 Apr, 2022 @ 9:52pm 
Can I add it mid-playthrough to an existing save?
Emilie Sackenball 28 Apr, 2022 @ 5:18pm 
Sir you're a legend
Jakov 27 Apr, 2022 @ 9:31am 
Finally my pawns won't go over a wall to repair it right next to the raiders blowing it up. Thank you good sir
Kathanon  [author] 25 Apr, 2022 @ 1:20am 
@WeskerMo : I have not done any testing of performance specifically, but I do not expect there to be any measureable impact.
WeskerMo 24 Apr, 2022 @ 5:23pm 
How about the impact on performance? Is that high?
SaNSaI 24 Apr, 2022 @ 6:52am 
Thanks!
J 23 Apr, 2022 @ 3:05pm 
I see, thanks again for clearing it up. <3
Star~Verse 23 Apr, 2022 @ 12:05pm 
An example is toxic fallout, or temperatures you just don't care to deal with. Or some other weathers caused by mods. But yes, good mod, thank you.
Kathanon  [author] 23 Apr, 2022 @ 11:05am 
@J : When you have set up walls, and a "safe" zone inside it. If the zone does not include the walls, then you can not repair them. If it does include the walls, then your pawns will sometimes run outside the wall to repair them instead of doing it from the inside.
J 23 Apr, 2022 @ 9:38am 
Why is it an issue gameplay-wise? Can’t think of in-game scenarios where this behavior can be problematic, but I haven’t played the game in a year, so I probably need to have my memory refreshed. Thanks.
greyghostie 23 Apr, 2022 @ 8:32am 
The zombie mod users will love this. Thanks for your effort.
Uma Musume: Pretty Derby 23 Apr, 2022 @ 8:08am 
As with many things, surprised this isn't vanilla behaviour.
Lekoda 23 Apr, 2022 @ 7:09am 
Good Mod and Much NEEDED.