- Home /
When using NavMeshQuery and the rest of the experimental Pathfinding for long paths the GetPortalPointsOperation fails
Hi there,
Some context: I've recently abandoned the regular navigation as there is a hard limitation for how much nodes it can explore and I was surpassing it, I opened a topic about it on the forums and @snacktime suggested me using the new Experimental navigation.
Now I'm using the new Navigation tools from UnityEngine.Experimental.AI and I might have found an issue, but since I'm unsure whether it's on my end or on theirs I figured I'll ask it here first to see if someone knows about it.
I have a test scene with a fairly complex navigation mesh (while it's highly connected it has a lot of nodes and paths tend to have lots of points, it also has a large feature in the middle that is designed to work as a sort of dead end where pathfinding usually has trouble).
When resolving paths on this mesh I need to give a really large number of nodes (1M, I tried with 100K and it runs out of nodes for long paths).
With the above considerations, the NavMeshQuerry works for short, long and really long paths, no problem. But after the querry ends you get a NativeArray of PolygonId and need to process it to get the actual path; for this I'm using the code they used for the Nordeus Demo in Austin and call the FindStraightPath method. This works for short and medium paths but when you start to get to really long paths one of the GetPortalPoints operation it performs along the way fails. It doesn't fail at the beginning or right at the end, it seems to be failing mid-way through the path. The max length isn't consistent either, it depends on the Start/End Position, but once a point starts to fail it'll always fail (and continue to fail when you move it further away).
The top point is the destination, same in both cases.
The red point on the left is a long path that is valid.
The red point on the right is a path where the "GetPortaiPoints" at failed midway.
As you can see both pathfinding requests follow the same path until one fails at a seemingly random spot (and then goes to (0,0,0)).
Does anyone have any insight on why this might be happening? Am I missing something obvious? Is there some bug on the PathUtils.cs code from the demo?
Have a nice day and thanks for the help!
I've continued testing and turns out the issue is not related to the straightening of the path or the GetPortalPoints method, the path seems to be improperly calculated but returned as a success. Here you can see the bug report: https://fogbugz.unity3d.com/default.asp?1197062_vu8555f45apq1qh1
Your answer
Follow this Question
Related Questions
How do I fix two NavMeshAgents fighting for the same position? 1 Answer
Pathfinding & Navigation in 3-dimensional space (proced. generated) 2 Answers
Do your NavMeshAgents choose different paths in the editor? 0 Answers
How do you create an AI that works like this ? 1 Answer
NavMesh WalkableMask 2 Answers