Ludeon Forums

RimWorld => Bugs => Topic started by: RommePawn on October 14, 2016, 11:32:35 PM

Title: Pawns prefering slower path
Post by: RommePawn on October 14, 2016, 11:32:35 PM
Firstly I would like to say I'm wasn't sure if I should submit this as a bug or just as a post somewhere else however I decided to post here due to observing behavior that I didn't expect/want.

I have been experiencing issues with pawns having bad pathing, pathing over slow ground or objects when a faster path is very close. In the following two screenshots the pawns aren't restricted at all.

Pathing over objects.
http://steamcommunity.com/sharedfiles/filedetails/?id=780979824

Pathing over ice instead of paved tile.
http://steamcommunity.com/sharedfiles/filedetails/?id=779711321

Notice in both that the faster path isn't even checked. When going in the reverse direction they both took the fast way. And when manually moved either way they take the fast path.

I have seen this a few times. It seems like its just pulling the path from memory. Which makes me ask, is there any way to spot fix this with dev tools? Purging some of the pathing data would be nice. I have seen a tool called flash walk path but I have no idea what it does.

The solution I have been using to fix this is to either reshape my setup to make this bad pathing fast or place a wall in the base of the path thus breaking its use.

Being able to do this with tools would be nice. Or just a purge all pathing data tool. Or alternatively, with all due respect, having better pathing might fix this.

But maybe I'm missing something, I, at first, thought that pawns pathing diagonally far away and back was a bug but I know its just how they path. I also thought that pawns fetching objects farther away before closer objects was a bug but I know now that it is a quark of having crafting stations close to region borders. So this could simply be me not catching onto some mechanic of the game.

Anyways, Thankyou.
Title: Re: Pawns prefering slower path
Post by: nccvoyager on October 15, 2016, 04:43:54 PM
While this is not directly intended behaviour, it is an intended mechanic for the game.
This imprecise path finding uses less CPU time, reducing the performance impact of the calculations.
Unfortunately, this can lead to some, shall we say, quirks, with the path finding.

The "Flash walk path" tool causes the path that a pawn is walking along to "flash" visually for you to see. (If I remember correctly.)
Title: Re: Pawns prefering slower path
Post by: RommePawn on October 15, 2016, 08:40:34 PM
Oh, I see. Having tools to force extra calculations in a spot would be nice though, to get them to remember a smarter path.
Title: Re: Pawns prefering slower path
Post by: nccvoyager on October 15, 2016, 11:35:35 PM
As a temporary work-around, I sometimes place a zone for my pawns (similar to the "hide inside" type of zone) and expand that zone in a one-tile-wide line to where I want them to work.

This forces them to path find in, and therefore follow, the one-tile-wide zone "path" instead of wherever they want.

Some micro-management, sure...
But, for long-term projects (like sowing, or hauling tons of stone chunks from across the map) this works fairly well once set up.
Title: Re: Pawns prefering slower path
Post by: RommePawn on October 16, 2016, 09:12:09 AM
I've use zoning a lot and I'm not 100% sure what you are trying to say, if you mean just zoning a path through the room then that means they cant use the rest of said room.

Do you mean this?:
http://steamcommunity.com/profiles/76561198065060434/screenshot/250339770638559818

This would work if your going around farm areas and your not a grower, or going through stockpiles and you never haul, but the pathing issues tend to come from hauling long distances so doing this seems pointless for most cases. This seems to be the only way zoning can force paths without making the area useless:
http://steamcommunity.com/profiles/76561198065060434/screenshot/250339770638581934
But this only works in specific problem areas.

I just randomly found a mod called better pathfinding
https://ludeon.com/forums/index.php?topic=26563.0
I decided to have someone haul something in the same spot as one of the screenshots in the first post and the pawn picked another closer door, after locking it this is the path it took:
http://steamcommunity.com/sharedfiles/filedetails/?id=781952349

Not sure about performance with this mod. Also it made about 6 of my pawns freeze in place with solid red path markers when deconstructing the extra roofing I accidentally made in the first screenshot of this reply. I didn't think to screenshot, I tried to reproduce the bug but didn't manage to. Maybe the mod has some issues, or maybe it was a random issue, I haven't used the mod for more than a few minutes so I'll see if it causes any lag or bugs as I play more.
Title: Re: Pawns prefering slower path
Post by: nccvoyager on October 16, 2016, 05:09:16 PM
Usually, I manually make a replacement "home zone" and have all my pawns use that area.
Then, say there's a deposit of metal on the other side of the map, I expand a single-tile-wide path of that zone from the edge of my colony out to the deposit, and then expand a small zone around the deposit.
Well, that is to say, I do this sometimes.
Right now, with 15 colonists, I'm usually just happy when they actually find any path...
22 FPS is not particularly quick. (Decades-old tri-core CPU, so, yeah.)
Title: Re: Pawns prefering slower path
Post by: Zhentar on October 17, 2016, 01:06:58 AM
I posted an updated version of the pathfinding mod this evening which fixes a few bugs; give it a try. There aren't any known bugs outstanding. As for performance, most people haven't noticed any difference, but it may depend on particular layouts. In some cases, it's even significantly faster than Vanilla.
Title: Re: Pawns prefering slower path
Post by: RommePawn on October 17, 2016, 04:49:19 PM
So you just happened to find a post that mentions your mod bugging out and you reply to it lol. I will try the update.
Title: Re: Pawns prefering slower path
Post by: Yoshida Keiji on May 17, 2017, 05:02:14 AM
Okay... I read the pinned post at this section to check for elder threads of the same nature, many pages are addressing A17 and I think another section should be created to avoid cluttering.

Anyways....why this?

(http://i.imgur.com/XhebXUi.png)
Title: Re: Pawns prefering slower path
Post by: ison on May 17, 2017, 06:30:47 AM
@Yoshida Keiji this looks very bad. Could you please upload a savefile? Thanks

Maybe there was a fire before the pawn calculated the path? Is it reproducible?
Title: Re: Pawns prefering slower path
Post by: ison on May 17, 2017, 09:47:37 AM
bump
Title: Re: Pawns prefering slower path
Post by: Tynan on May 17, 2017, 04:33:56 PM
He avoids walking adjacent to the fires. Because of the trees, he'd have to squees between them. So he ends up choosing a close-to-optimal path that looks a bit weird.

We know pathfinding is a bit janky sometimes, but there is a performance/intelligence tradeoff. So this isn't really a bug, it's more like a general thing we work on over time.

Thanks for reporting anyway.