Ludeon Forums

RimWorld => Bugs => Topic started by: koisama on May 07, 2016, 12:58:29 PM

Title: [A13] Pathfinding and equipment racks
Post by: koisama on May 07, 2016, 12:58:29 PM
Today I found my colonists strangely attracted to walking over equipment racks, which slows their movement.

Here are the screenshots:
http://i.imgur.com/glIPQvc.png
http://i.imgur.com/lYLa9HE.png
http://i.imgur.com/NZWgy2m.png
Title: Re: [A13] Pathfinding and equipment racks
Post by: ison on May 26, 2016, 03:52:47 AM
@koisama and pestilenz, could you please upload the savefile? I couldn't reproduce the bug.
Title: Re: [A13] Pathfinding and equipment racks
Post by: Tynan on May 26, 2016, 07:51:14 PM
bumpo
Title: Re: [A13] Pathfinding and equipment racks
Post by: Amariithynar on May 26, 2016, 09:07:27 PM
I've noticed in arctic conditions I can clear a path along a wall of snow and concrete it for 100% movespeed and they'll still cross snowed on soil diagonally instead of walking over to the path that leads right to the door, which would be much faster; Maybe this is related?
Title: Re: [A13] Pathfinding and equipment racks
Post by: milon on May 27, 2016, 09:15:24 AM
I reproduced it:

(https://ludeon.com/forums/index.php?action=dlattach;topic=19958.0;attach=13277;image)

You can tell by the foot steps that Kazuki just walked over the southwest equipment rack, and Tail is about to walk over the northeast equipment rack.  See attached .zip with world & colony save.

At a guess, I'd say the pathing algorithm isn't considering everything on a tile that affects movement speed (or else isn't calculating the costs properly).  Tail is going to avoid the artwork, the silver, and the rock chunk, but she's not going to avoid the equipment rack.

[attachment deleted by admin - too old]
Title: Re: [A13] Pathfinding and equipment racks
Post by: hwfanatic on May 28, 2016, 09:39:20 AM
I think it may be a more general problem. Look at these guys intentionally avoiding a concrete pathway I have setup for them: http://i.imgur.com/XQW4aZv.png
Both drafted (Gallagher) and undrafted (Earl).

EDIT: This other screenshot may be an even better example, because of the unfinished section: http://i.imgur.com/odRxAwN.png

EDIT 2: At first glance, doesn't seem to affect paved tiles: http://i.imgur.com/G1M6eOU.png
Title: Re: [A13] Pathfinding and equipment racks
Post by: matthiaskrgr on May 28, 2016, 09:50:34 AM
I had similar issues where colonists would walk through crops although I had a paved way directly next to it.

EDIT: added screenshot

EDIT2:
It also seems a bit odd that the path from A to B often differs from the paths from B to A,

[attachment deleted by admin - too old]
Title: Re: [A13] Pathfinding and equipment racks
Post by: hwfanatic on May 30, 2016, 12:28:03 AM
They also seem to ignore cleared snow: http://i.imgur.com/JIZm6FJ.png
Am I supposed to clear where they walk, or are they supposed to walk where it is clear? https://imgflip.com/memegenerator/Futurama-Fry
Title: Re: [A13] Pathfinding and equipment racks
Post by: ison on June 09, 2016, 01:53:32 PM
There was a bug with path costs on cells with snow. Fixed.

@milon I think that it's legitimately possible for it to be the best path available. Tail is about to walk over the equipment rack because otherwise she would have to take a longer path, so it's possible that it was the best choice even considering the fact that equipment rack slows movement a bit. Perhaps we could make equipment rack slow movement even more, so pawns would avoid walking over them.

So the only pathing weirdness (except for the issue with snow) I see here is this:
Quote from: matthiaskrgr on May 28, 2016, 09:50:34 AM
I had similar issues where colonists would walk through crops although I had a paved way directly next to it.

EDIT: added screenshot

EDIT2:
It also seems a bit odd that the path from A to B often differs from the paths from B to A,

Is it possible that there was a snow at these cells since loading the game? If not, then could you please attach the savefile?
Title: Re: [A13] Pathfinding and equipment racks
Post by: matthiaskrgr on June 09, 2016, 03:39:08 PM
Nope, no snow.
In the attached savefile you only need to select all the pawns, I already sent them on their paths.
It is odd that a lot of them get different paths although they all walk through the same bottlenecks (1x1 squares) which *should* narrow down the optimal path.

[attachment deleted by admin - too old]
Title: Re: [A13] Pathfinding and equipment racks
Post by: ison on June 13, 2016, 05:32:14 AM
I see, these paths are not optimal.

Tynan, should pawns always choose the best path available?
Title: Re: [A13] Pathfinding and equipment racks
Post by: Tynan on June 13, 2016, 03:36:30 PM
No, our pathing algorithm by design does not attempt to find a perfect optimal path - just a good-enough one. That's how A* works. Finding perfect paths is too CPU-heavy.

I think this is working okay; it's not a serious issue or even a bug by the basic definition.