Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Bug report) CanReach patch (While Path is blocked) sometimes causes Pathing Issues #691

Closed
Sn1p3rr3c0n opened this issue Mar 6, 2023 · 3 comments · Fixed by #692
Closed
Labels
bug Something isn't working C#

Comments

@Sn1p3rr3c0n
Copy link
Collaborator

Sn1p3rr3c0n commented Mar 6, 2023

The Issue occurs if a User wants to use the Advanced IO Ports while having the access to the DSU Blocked (No path to the DSU).
To allow Pathing they need to activate the CanReach Patch. Then in some cases the Pathing will fail.

There are currently two Scenarios in which I can reproduce that issue.

  • Standing Drafted
  • Distance Case

General Requirements

  1. The Path to the DSU is blocked
  2. The DSU Contains Items that the Pawn Wants
  3. There are not alternatives outside the DSU
  4. The CanReach Patch is active

Standing Drafted

seems to not occur for Food

  1. Have a Drafted Pawn near the Advanced IO Port
  2. It shall be closer to the Advanced IO Port then the DSU
  3. It shall not be directly next to the Advanced IO Port
  4. Undraft the pawn while it is standing Still

What Happens
If the Pawn is standing still when it is undrafted the Pathing will fail.
If the pawn is moving when it is undrafted the Pathing will work in most cases

Distance Case

  1. Have a Pawn Drafted or not
  2. It shall be closer to the DSU then the Advanced IO Port

What Happens
The Pathing to Items contained in the DSU will constantly fail.
Note a standalone Pawn that is closer to a Advanced IO Port then the DSU will not have any issues except the Standing Drafted Senario

Related Warning:

Erisen pathing from (268, 0, 160) to Thing_MealSurvivalPack27401 ran out of cells to process.
Job:Ingest (Job_20867) A=Thing_MealSurvivalPack27401
Faction: PlayerColony
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Warning (string)
Verse.AI.PathFinder:FindPath (Verse.IntVec3,Verse.LocalTargetInfo,Verse.TraverseParms,Verse.AI.PathEndMode,Verse.AI.PathFinderCostTuning)
Verse.AI.PathFinder:FindPath (Verse.IntVec3,Verse.LocalTargetInfo,Verse.Pawn,Verse.AI.PathEndMode,Verse.AI.PathFinderCostTuning)
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:UpdatePlay ()
Verse.Root_Play:Update ()

@Sn1p3rr3c0n Sn1p3rr3c0n added bug Something isn't working C# labels Mar 6, 2023
@Sn1p3rr3c0n
Copy link
Collaborator Author

For the Distance Case
The issue here is that the CanReach Patch Tells the Pawn that i can Reach the Item in question. (so far so good)
But then the Patches that actually make use of the Advanced IO Pot choose not to use them (ups..)
--> We need to detect if the Path to the DSU Is Blocked and then force pawns to use the Advanced IO Ports instead of selecting the shorter path

@Sn1p3rr3c0n
Copy link
Collaborator Author

All issues described in this Ticket should have been resolved.
One thing to note is that the Current Implementation of the CanReach Patch does not support the JobDriver_HaulToTransporter
This is Caused as the CanReach Check is Performed Differently for this case-
Here the Check is if the Position of the Item can reach the Transporter

@Sn1p3rr3c0n
Copy link
Collaborator Author

One Interesting side effect of those changes is that the Performance of the CanReach Patch has been significantly improved.

Before

CanReachBaseline
Note: The pink line indicates ~0.5ms
Regardless of if it was needed or not, CanReach takes a significant amount of time to run

After

image
Note: The purple line indicates ~0.06ms
The pink line indicates ~0.5ms

You can clearly see at what point the patch was no longer required and the associated load falling off dramatically.
Additionally the spikes are much lower now

Sn1p3rr3c0n added a commit that referenced this issue Mar 30, 2023
Fix CanReach Pathing issues for blocked paths #691
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working C#
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant