Changing search heuristic scale (DT_OUT_OF_NODES )

69 views
Skip to first unread message

Pan Papik

unread,
May 18, 2020, 11:31:37 AM5/18/20
to recastnavigation
Hello all!

I have a similar issue as described here:

All-
I'm trying to path across quite a few tiles (I load roughly 60 or so
tiles) and it constantly ends at the same place.  My mesh is set to
have a maximum number of tiles at 13424 and max polys at 65536.  I did
change m_saltBits to be 64-bit, so I believe this shouldn't cause any
problems.  (Although every single salt is set to 1, I'm assuming it
only changes if I make changes to the tiles after they are initially
added).
Pathing with a smaller number of tiles, say 10, works perfectly fine.
Basically I always get DT_OUT_OF_NODES from findPath.
Anyone have any ideas as to why?  I'm seriously at a loss of where I
should start poking around.  I've obviously found where that status is
set, but not sure why it runs out of neighboring tiles.
findNearestPoly does succesfully find the start/end polys.
I get about 120 waypoints worth, but it's only about 20% of how many
waypoints I would estimate, and it's definitely not creating a path in
the right direction, as it goes right into a dead end.
Thanks in advance!
~ Tanaris
and the solution offered is changing static const float H_SCALE value in DetourNavMeshQuery.cpp as described here

I tried this solution, and it indeed worked. However, I am not sure about making such changes in a library code.

Is there any other way to set search heuristic scale? Or another solution that does not require library code change?

Thank you!

Jakob Botsch Nielsen

unread,
May 18, 2020, 11:42:29 AM5/18/20
to recastna...@googlegroups.com
If you run out of nodes you can change the node index type to be a 32-bit integer here:

Then you can pass a higher maxNodes to dtNavMeshQuery::init.

However, I am not sure about making such changes in a library code.  

The recommended way to integrate Recast and Detour is by a simple source copy into your project,
so I would recommend just changing the library code wherever you need.

--

---
You received this message because you are subscribed to the Google Groups "recastnavigation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to recastnavigati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/recastnavigation/75e9d338-8a8f-4f3a-8425-796c06e34ebf%40googlegroups.com.

Pan Papik

unread,
May 18, 2020, 12:25:33 PM5/18/20
to recastnavigation
Hello Jakob,

Thank you for your answer!

I tried changing the index type; however it did not work even if I increase the max node number to 65535. So, I changed the search heuristic scale to 2 as suggested.

For the future reference:
  • Increasing max node number giving to dtNavMeshQuery::init(...)
  • Changing the node index type and increasing max node number giving to dtNavMeshQuery::init(...) (if necessary) as mentioned by Jakob Botsch Nielsen above
  • Changing the search heuristic scale in DetourNavmeshQuerry.cpp as described here.
may provide a solution.

On Monday, May 18, 2020 at 5:42:29 PM UTC+2, Jakob Botsch Nielsen wrote:
If you run out of nodes you can change the node index type to be a 32-bit integer here:

Then you can pass a higher maxNodes to dtNavMeshQuery::init.

However, I am not sure about making such changes in a library code.  

The recommended way to integrate Recast and Detour is by a simple source copy into your project,
so I would recommend just changing the library code wherever you need.

To unsubscribe from this group and stop receiving emails from it, send an email to recastna...@googlegroups.com.

Jakob Botsch Nielsen

unread,
May 18, 2020, 12:28:25 PM5/18/20
to recastna...@googlegroups.com
With the node index type changed you can increase it beyond 65535. That limit is purely because the default variable type is 16-bit.
This is what I would recommend as overapproximating the cost in the A* search will make the algorithm return non-optimal paths.

To unsubscribe from this group and stop receiving emails from it, send an email to recastnavigati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/recastnavigation/5567aa88-a78e-4733-a268-85ec3bf441db%40googlegroups.com.

Pan Papik

unread,
May 18, 2020, 12:46:02 PM5/18/20
to recastnavigation
Gosh... Yeah, that was the whole point of changing the node index type...

Thank you for pointing out my obvious mistake! I think I should take a break for today... :D

I replaced the max node number with 1048575 and it works great now.
Reply all
Reply to author
Forward
0 new messages