What is the ideal Navigation Mesh setup for LevelInstances used in WorldPartition level?

Hi, we are looking for advice on the ideal world/navmesh setup in WorldPartition based Main and sublevels (level instances)

Context:

  • World
    • We have a main level (I.e: WorldMap) (that is a WorldPartition level)
  • Sublevels
    • Our world is expected to consist of several sublevels (will exceed 16 sublevels)
    • Each sublevel is a WorldPartition level itself

Our main goals are:

  • Allow adding NavMeshBounds and building Navmesh within Sublevels (As our team rapidly iteration on sublevels)
  • Of course availability of Navmesh in cooked builds :slight_smile:

Problem:

  • On cooked builds
    • When UE load the world and is presented with sublevels that has Recast actors
    • It registers them in a stack up to 16 recast actors
      • Order is kinda random, determined by ActorIterator<ARecastNavMesh>
    • Additional recast actors are dismissed (that exceeds the stack capacity)
  • So, there’s a very strong chance that the main level’s recast actor won’t be the first to register, which fails AI systems relying on nav mesh availability

Solutions that we experimented:

  • 1- Preventing designers from adding Navigation to sublevels

    • Problems:
      • Very prune to human error
      • Hinders level designers workflow so badly
  • 2- Inheriting NavigationSystemV1

    • We overriden the functions (RegisterNavData and RequestRegistrationDeferred)
    • Utilize the boolean ‘CanBeMainNavData’ on Recast actors (False on sublevels, True on main level)
    • Add a Content Validation test to reassure the rules.
    • Problems:
      • After inspecting engine’s code, ‘CanBeMainNavData’ is safe to be utilized, but I believe it’s not safe, as we may interfere with some engine functionality in the future
  • 3- Using DataLayers

    • We have overriden the BuildPaths function anyway, so we added another step after the nav building process to add the generated recast actor to a Sublevel exclusion layer
    • Then in main levels, we exclude loading this layer
    • Add a content validation test to reinforce the rules.
    • Problems:
      • Even though this sounds the most compliant with UE, we are not sure if it’s the best approach.

Steps to Reproduce
Open the project

Cook the game

Run the exe

Once the pawn shows close the game

Open logs and look for “NavData:” or “NavDataPath:”

> NavData recast path for a WorldPartition sublevel looks like:

L_NavMeshLevel:PersistentLevel.RecastNavMesh_UAID_9C6B0079B680B99202-Default_9d0a4f1d966bfc5a

> NavData recast path for a the main WorldPartition level looks like:

L_NavMeshLevel:PersistentLevel.RecastNavMesh_UAID_9C6B0079B680A29202-Default

> NavData recast path for a Normal sublevel looks like:

L_NavMeshLevel:PersistentLevel.RecastNavMesh-Default_a22d1b5ff8af5366

We do not have a best practices for this at this time. WP navmesh support is still experimental and limited, and it will be the same way for 5.7. We are aware that there are workflow issues with the current setup, but other work has been higher priority. I do not know when we may get back to working on WP navmesh.

Are you attempting to do this with static or dynamic modifiers only navmesh generation? Are you using WP navmesh or the regular navmesh? We usually recommend one giant navmesh bounds, but having multiple is not a major issue. We have been using dynamic navmesh for FNBR and use dynamic with invokers for Lego FN. This allows for navmesh in your “sublevels” and main level for iteration. In FNBR, we do have a nightly cook of the navmesh for the island as we use a custom navigation system that loads a base navmesh for the island so we do not need to fully generate the navmesh when starting a match.

You could look into having various actors that are set for editor only to build navmesh, but strip them out for a cooked game. Using data layers for this could possibly be done, but the navigation system as is has very limited and rough support for data layers so you may encounter other issues with that approach.

-James

Cooked game log file

Cooked game zipped file