Nav Mesh problems/disappearing

Hi,

On my project we are having some issues with navigation meshes. For example actors cannot navigate unless you regenerate navigation mesh before playing in editor, even though navigation mesh looks fine in editor.

I am under impression that a lot of these problems are caused because we do not automatically generate navigation meshes for our project. This did let me find some interesting problems. In some cases when saving a level navigation mesh gets lost entirely. Here is test case:

Under Editor Preferences → Level Editor → Disable Update Navigation Automatically

  1. Open a test level and build navigation mesh for it. Build → Build paths.
  2. Enable paths so they are visible in editor (P by default).
  3. Observe navigation mesh is there.
  4. Save level.
  5. Restart editor and load level.
  6. Observe navigation mesh is still there.
  7. Make a change in level blueprint and save blueprint.
  8. Restart editor and load level.
  9. Observe navigation mesh is gone.

Running our project debugger tells me that AI fails to navigate because FPImplRecastNavMesh::ProjectPointToNavMesh fails on DetourNavMesh == NULL. Yet this doesn’t explain why nav mesh goes missing if you save level without regenerating nav mesh. So I really don’t want to fix this problem as problem seems to be elsewhere. It looks like not everything is being loaded properly in some cases.

Anyone have any ideas on what I can do to fix this?

Hey ,

Thank you for your report. I was able to reproduce this exactly as you have described and have entered a report to our Navigation/AI team. Please let us know if you encounter any other unexpected behavior.

Some updates on this issue. DetourNavMesh is not loaded because ARecastNavMesh::SerializeRecastNavMesh checks if there are dirty areas. If there are dirty areas Nav Mesh is not loaded.

When a level is loaded it adds level collision to Octree in UNavigationSystem::AddLevelCollisionToOctree. Every time a node is added it is also added to dirty areas array and thus preventing Nav Mesh from being loaded.

Wouldn’t it make more sense if this is only done if no navigation data is found? Even better would be just allowing user to run with outdated navigation data, because having to rebuild it every time seems a bit redundant.

Hi Antonio,

It looks like this has been fixed internally, though fix still needs testing. It won’t make it into 4.6 at this point, but will likely appear in 4.7.

Hello, .

Maybe fix this in 4.6.0?

This issue stop my game development, i’m wasting my time !!! :frowning:

Can you please show link to this issue, it on github?

I’m very-very-very waiting this fix!

Project Settings
Navigation Mesh > Runtime > Force Rebuild on Load = true

I had this problem in 4.22 in case anyone else is searching this 2014 thread :wink:
above setting sorted it out, though it may have some ramifications.

1 Like