[A16] Better Pathfinding (v1.5.2 update 2/22)

Started by Zhentar, October 02, 2016, 07:43:01 PM

Previous topic - Next topic

terrordrone_nl

Map is too big for screenshots, unless there's a way to zoom out even more.
It's a mountainous Boreal Forest map with size Large.
Onedrive link to save-file: https://1drv.ms/u/s!AnKrUiQqz90DgYh6Ka6Hlj-GHl_o1Q
You'll find my base on the south-west edge of the map, with the bugged alphabeaver near the north-eastern part of the map. Alphabeaver is called "Alphabeaver 2."
You can see the modlist in the debug log I posted earlier, although you shouldn't need any of those mods to load this file.

Zhentar

Bah, Boreal Forests are such troublemakers. Thanks, that should be enough to figure it out.

As an easy workaround, you could set up a new allowed area that's about half way to your base, and assign the problem beaver to it. Once the beaver is closer it should be able to path to your base successfully.

terrordrone_nl

I butchered the Beaver and went on with life already. Killing that which gives you problems seems to always work in Rimworld.

Devdisigdu

#168
So I've recently been getting some problems on my current save of about 50 hours playtime, where Pawns are trying to path towards something they can't get to. Sometimes it's been colonist trying to remove a roof that's behind a wall, which I can solve by removing the remove roof designation on the area, but the current issue is my hauling huskies. They keep trying to haul things like psychic insanity lances or luciferium that's in one of those ancient vaults hidden in a mountain. The warning seems to indicate that it's Better Pathfinding that is trying to path them towards the object which is unreachable.

Is this a Better Pathfinding problem, or is it Rimworld and it's just your code being used to try and make the path?

Husky3305881 pathing from (177, 0, 154) to Thing_Luciferium96719 ran out of cells to process.
Job:HaulToCell A=Thing_Luciferium96719 B=(182, 0, 191)
Faction: Hastur's Will

This will be the last message to avoid spam.
Verse.Log:Warning(String)
BetterPathfinding.NewPathFinder:FindPathInner(IntVec3, LocalTargetInfo, TraverseParms, PathEndMode, HeuristicMode)
BetterPathfinding.NewPathFinder:FindPath(IntVec3, LocalTargetInfo, TraverseParms, PathEndMode)
BetterPathfinding.PathFinderDetour:FindPath(PathFinder, IntVec3, LocalTargetInfo, TraverseParms, PathEndMode)
Verse.AI.PathFinder:FindPath(IntVec3, LocalTargetInfo, Pawn, PathEndMode)
Verse.AI.Pawn_PathFollower:GenerateNewPath()
Verse.AI.Pawn_PathFollower:TrySetNewPath()
Verse.AI.Pawn_PathFollower:TryEnterNextPathCell()
Verse.AI.Pawn_PathFollower:PatherTick()
Verse.Pawn:Tick()
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:Update()
Verse.Root_Play:Update()


In the meantime I can stop the errors and keep the save going by finding where the items are and making a path, but I would hope this is something that can be stopped from occurring.

Zhentar

The pathfinder is just looking for a path to where it was told to go. It does try to catch errors like that with a reachability check, but it's doing the same check hauling assignment does so they probably both get the same (wrong) answer. You'd very likely get the exact same error with the vanilla pathfinder.

That said, I enjoy investigating & reporting Vanilla bugs occasionally, so if you can share your save & mods folder, I can take a look at it.

Devdisigdu

#170
Given that a lot of my mods are from the Steam workshop, what would be the best way to go about that?

Would copying the workshop mods into the same zip as the non workshop mods and sending you the Mods Config as well work?

Edit: Here, The mods, the save and my config file.
https://www.dropbox.com/s/thtvmgx8m9isnxt/Hauling%20Problems.zip?dl=0

Degraine

#171
I have had an issue trying to remove this mod (the positioning of the menu button was driving me batty): Namely, the menu still appears when the mod has been uninstalled and I've restarted the game. On save files that I never saved with the mod enabled. How can I fix this?

Herp derp, never mind, stupid mod user doesn't know which mod is responsible for what. (It's PathAvoid)

Zhentar

Quote from: terrordrone_nl on December 30, 2016, 01:36:31 PM
Map is too big for screenshots, unless there's a way to zoom out even more.
It's a mountainous Boreal Forest map with size Large.
Onedrive link to save-file: https://1drv.ms/u/s!AnKrUiQqz90DgYh6Ka6Hlj-GHl_o1Q
You'll find my base on the south-west edge of the map, with the bugged alphabeaver near the north-eastern part of the map. Alphabeaver is called "Alphabeaver 2."
You can see the modlist in the debug log I posted earlier, although you shouldn't need any of those mods to load this file.

I had an epiphany yesterday. A tiny little one line tweak, and now Alphabeaver 2 finds a path in just 15,000 nodes... a pretty big step up from over 160,000. It also fixed all the weird pathing I was seeing on sea ice, and improved performance in a lot of common cases too. I've posted an update with the change (and another fix) now.

dinokilla7

I've been playing with your mod for a while, because hell I like the idea of it and it really saves time. But when I opened my game today I noticed a flash of red, green, orange tiles. So I slowed the game down and noticed I could visually see the path calculation of my pawn and I was wondering if theres a way to switch this off?

Zhentar

The current version shouldn't do that automatically, so updating should fix it. But it can be disabled/enabled using the Draw Paths option in the Dev Mode view options.

System.Linq

#175
I've noticed that my pawns still sometimes take weird paths through open areas, zig-zagging when a straight line would seem to be more efficient. Is there any reason for that?

P.S. Fantastic mod, love it.

terrordrone_nl

Quote from: Psychology on January 08, 2017, 10:05:41 AM
I've noticed that my pawns still sometimes take weird paths through open areas, zig-zagging when a straight line would seem to be more efficient. Is there any reason for that?

P.S. Fantastic mod, love it.

This is where, if you're curious, you enable the dev options and turn on "draw Paths". It should show you why the system thinks that path is the best. Remember that for example trees and certain floors reduce movespeed.

Zhentar

Quote from: Psychology on January 08, 2017, 10:05:41 AM
I've noticed that my pawns still sometimes take weird paths through open areas, zig-zagging when a straight line would seem to be more efficient. Is there any reason for that?

Yes, there is.


You probably want to know what that reason is? In 1.4, I took a page from Vanilla's pathfinding book and added a weighting to the heuristic. Now, it will accept paths that are about 5% longer than what it estimates is the optimal path. Most of the time, there are at least a few things in the way (like trees or items), and it underestimates by at least a few percent. When it does underestimate, it can spend a ton of time looking for the perfect path, so letting it say 'eh, good enough' can significantly improve performance (I know performance has been fine for most people, but there were some really bad edge cases so I couldn't honestly say I thought it was good enough to be the Vanilla pathfinder). But when there isn't anything in the way, it doesn't underestimate at all (sometimes it even slightly overestimates), in which case 5% allows for a lot of zig zags (I know it was really bad on sea ice and probably ice sheets too)

The 1.4.1 update I posted yesterday addresses the reason why it thought the zig-zaggy paths might be good and tried that before trying to just go straight. That improves performance and fixes most of the zig zags. If you're still seeing funny looking paths on that, post a screenshot and I'll investigate.

Rock5

This looks like an obvious misspathing. The optimum path looks to be under that little hill in the middle. Instead it goes up, after rounding the mountain, instead of searching in a straight line to the target.

Using version 1.4.1



[attachment deleted by admin due to age]
Rock5 [B18] Mods
- Butchers Can Count Meat
- Sun Lamp Planner
- JTZoneButtons
- RimSearch
- JTExport

mason_water

#179
why would my pawn path like this?

http://prntscr.com/dvodl0

edit: drafting him and having him haul it again has him make a normal path towards it