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

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

Previous topic - Next topic

Litcube

Quote from: Zhentar on November 07, 2016, 12:30:51 AM
Quote from: Litcube on November 06, 2016, 04:51:31 PM
There's an issue with what I can only guess is "fast colonists".

One of my colonists, Peter, has a lot of bionics that puts him at 260% move speed.  I'd tell Peter to inject some Gojuice, and Peter would.  But as soon as Peter did, the game would lock up.  Not crash, just freeze completely.  No output.txt addendums.  Fuck, Peter.

Do you have a floor mod that makes colonists move faster? Try the 1.3 release candidate I posted a page back.

I tried it and Peter still can't gojuice without freezing the game.

Zhentar

Quote from: leestriter on November 06, 2016, 06:03:28 PM
Is this compatible with britnothe experiments https://ludeon.com/forums/index.php?topic=17094.0

Technically speaking, this is compatible with all mods that don't modify the pathfinding code, and as far as I know there isn't any other such mod, so this has universal compatibility.

Practically speaking, a few mods have caused bugs in my code to be encountered that wouldn't have otherwise, and it's theoretically possible that it could do the same to other mods.

This mod can be safely added to/removed from active saves, so if it does cause problems for you it can simply be disabled.


Quote from: Litcube on November 08, 2016, 11:58:39 AM
I tried it and Peter still can't gojuice without freezing the game.

Hmmm, I'll have to investigate further. Would it be possible for you to post the save, along with a zip of your mods folder?

System.Linq

This is something that's always bothered me when I see my colonists taking these inane zig-zag paths around my colony and I applaud you for putting your practical programming knowledge to good use. I'm also very glad that Rimworld is so flexible as to allow a mod like this to exist.

Litcube

Quote from: Zhentar on November 08, 2016, 02:11:19 PM
Hmmm, I'll have to investigate further. Would it be possible for you to post the save, along with a zip of your mods folder?

PM sent.

Zhentar

Thanks, I was able to track down the problem. I've posted an updated release that should work for you, although Peter can sometimes take paths that are a bit funny looking.

skullywag

Zhentar, incase you didnt see it on Discord:

Exception ticking Skullywag: System.NullReferenceException: Object reference not set to an instance of an object
  at BetterPathfinding.RegionLinkDijkstra.RegionLinkPathCostInfo (Verse.Region region, Verse.RegionLink minLink, BetterPathfinding.RegionLinkPathCostInfo& result) [0x00000] in <filename unknown>:0
  at BetterPathfinding.RegionLinkDijkstra.GetNextRegionOverDistance (Verse.Region region, System.Nullable`1& secondBest) [0x00000] in <filename unknown>:0
  at BetterPathfinding.RegionPathCostHeuristic.GetPathCostToRegion (Int32 cellIndex) [0x00000] in <filename unknown>:0
  at BetterPathfinding.PathFinder.FindPathInner (IntVec3 start, TargetInfo dest, TraverseParms traverseParms, PathEndMode peMode, HeuristicMode mode) [0x00000] in <filename unknown>:0
  at BetterPathfinding.PathFinder._FindPath (IntVec3 start, TargetInfo dest, TraverseParms traverseParms, PathEndMode peMode) [0x00000] in <filename unknown>:0
  at Verse.AI.PathFinder.FindPath (IntVec3 start, TargetInfo dest, Verse.Pawn pawn, PathEndMode peMode) [0x00000] in <filename unknown>:0
  at Verse.AI.Pawn_PathFollower.GenerateNewPath () [0x00000] in <filename unknown>:0
  at Verse.AI.Pawn_PathFollower.TrySetNewPath () [0x00000] in <filename unknown>:0
  at Verse.AI.Pawn_PathFollower.TryEnterNextPathCell () [0x00000] in <filename unknown>:0
  at Verse.AI.Pawn_PathFollower.PatherTick () [0x00000] in <filename unknown>:0
  at Verse.Pawn.Tick () [0x00000] in <filename unknown>:0
  at Verse.TickList.Tick () [0x00000] in <filename unknown>:0

this is with the 1.3 PR, is this what was fixed in the latest one.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Litcube

Quote from: Zhentar on November 08, 2016, 10:21:44 PM
Peter can sometimes take paths that are a bit funny looking.

We all know Peter's an idiot.

Alenerel

Im using the 1.3 RC (the one on page 5, not the 1.3 one you just uploaded, idk if they are the same) and this builder got stuck trying to build that wall you see. I saved and loaded and then he went around correctly, but drafting/undrafting didnt work to fix it before loading.

http://images.akamai.steamusercontent.com/ugc/147885146666556332/AB69CC687568C532A87B288978C45460ADAECC27/

Zhentar

That sounds like the same thing skullywag encountered. I think I know what's going on, so I've released a minor update that I hope will fix it.

hiepbg

Quote from: Alenerel on November 09, 2016, 08:11:02 PM
Im using the 1.3 RC (the one on page 5, not the 1.3 one you just uploaded, idk if they are the same) and this builder got stuck trying to build that wall you see. I saved and loaded and then he went around correctly, but drafting/undrafting didnt work to fix it before loading.

http://images.akamai.steamusercontent.com/ugc/147885146666556332/AB69CC687568C532A87B288978C45460ADAECC27/



Have the same problem with 1.3. But  drafting then undrafting can fix.

zava

Hi I've been having the same getting stuck problem. Drafting didnt fix it unless you had another pawn doing the job in the meantime.

Can you implement a fallback that uses the original pathfinding should the improved one bug?


skullywag

Did you try the latest version? it seems to have cleared my issue up (well I havent had it again in a few hours now)
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Litcube

When a raid comes, and the pawns decide to flee, some of them near doors freeze.  This causes lag to the point where I will get 1 frame per two seconds.  As the pawns die, while they're standing still, the frame rate increases.

I have a save.  Without the mod, they flee fine.  This save should still work ok with the mod packs I sent you.  If not, let me know.

https://www.dropbox.com/s/0zkycebpa6dmofi/Quicksave.rws?dl=0

Zhentar

Thanks for the save, I never would have found the issue without it. The problem only occurs when you have a door within range of at least 22 turrets. I'll finish up testing it tomorrow & post the fix.

Litcube