World Partitioned Static Navigation Mesh

An overview of how to use a static Navigation Mesh with World Partition.

Choose your operating system:

Windows

macOS

Linux

This document provides an overview of how to use a world-partitioned Navigation Mesh with Unreal Engine's World Partition system.

World Partition is an automatic data management and distance-based level streaming system that provides a complete solution for large world management. The system removes the need to divide large levels into sublevels by storing your world in a single persistent level separated into grid cells, and provides an automatic streaming system to load and unload those cells based on distance from a streaming source.

Learn more about the system by reading the World Partition documentation.

This document refers to the world partitioned static Navigation Mesh only.

1 - Required Setup

  1. Create a new project from a template in the Games category. In this example, we selected the Third Person template.

    Create a new project

  2. In the editor, click File > New Level. Select the Open World map type and click Create. Save the level.

    Create a new Open World level

    The Open World default map type is designed as a starting point for creating large open-world maps and has the following features enabled by default:

    • World Partition

    • One File Per Actor

    • Data Layers

    • Hierarchical Levels of Detail

  3. Go to the World Settings window and scroll down to the World Partition section.

    1. Expand Runtime Settings > Grids > Index [0].

    2. Change the Loading Range value to 12800. The smaller value will make it easier to visualize when the Navigation Mesh is loaded by World Partition.

    Create a new Open World level

Section Results

In this section, you created a new project with a level set up to use World Partition. In the next section, you will configure a Navigation Mesh so it works with World Partition.

2 - Configuring the Navigation Mesh to use World Partition

  1. Click Settings > Project Settings to open the Project Settings window.

    Click Settings > Project Settings to open the Project Settings window

  2. Click the Navigation Mesh category and scroll down to the Runtime section. Click the Runtime Generation dropdown and select Static.

    Click the Runtime Generation dropdown and select Static

  3. For bigger maps, you can enable the Fixed Tile Pool Size checkbox and set a Tile Pool Size to limit the amount of memory used by the Tile Pool. When setting a Pool Size, make sure you include enough tiles so all World Partition cells that are loaded have their corresponding NavMesh tiles loaded as well.

    Enable the Fixed Tile Pool Size checkbox and set a Tile Pool Size

  4. Click Add + > Volumes > NavMeshBoundsVolume to add a Navigation Mesh volume actor to your level.

    Add a Navigation Mesh volume actor to your level

  5. Select the NavMeshBoundsVolume actor in the Outliner window and go to the Details panel.

    1. Scale the actor so it covers the playable space in the level.

    2. Press P to see the navigation being built in the viewport.

    Select the NavMeshBoundsVolume actor in the Outliner window

    Press P to see the navigation being built in the viewport

  6. Select the RecastNavMesh-Default actor in the Outliner window and go to the Details panel. Scroll down to the Generation section and enable the Is World Partitioned checkbox.

    Select the RecastNavMesh-Default actor in the Outliner window

    Enable the Is World Partitioned checkbox

Section Results

In this section, you added a Navigation Mesh Bounds volume to your level. You also configured the Navigation mesh to work with World Partition.

In the next section you will configure the editor to improve your workflow.

3 - Configuring the Editor

Since you are most likely working on a really big level, it is recommended that you disable automatic Navigation Mesh generation to improve your workflow.

To do so, follow these steps:

  1. Click Edit > Editor Preferences to open the Preferences window.

    Click Edit - Editor Preferences to open the Preferences window

  2. Scroll down to the Level Editor section and click the Miscellaneous category. Scroll down to the Editing category and disable the Update Navigation Automatically checkbox.

    Disable the Update Navigation Automatically checkbox

Section Results

In this section, you configured your Navigation Mesh so it does not update automatically. This generally improves your workflow as you work with large worlds using World Partition.

In the next section, you will build the Navigation Mesh in your level.

4 - Building the Navigation Mesh

When working with a world partitioned map, some assets are usually loaded while others are unloaded. Because of this, building the entire Navigation Mesh requires a different process.

To build the Navigation Mesh in your level, follow these steps:

  1. Enter the following console command in the command line and press Enter: n.bNavmeshAllowPartitionedBuildingFromEditor 1

    Enter the command n.bNavmeshAllowPartitionedBuildingFromEditor 1

  2. Click Build > Build Paths to build the Navigation Mesh in your level.

    Click Build - Build Paths to build the Navigation Mesh in your level

  3. In the Build Navigation Settings window, click Ok to build the Navigation Mesh. You also have the following options available:

    1. Verbose - Enable this checkbox if you want to see a more detailed log of the build process. You can find the output log named WPNavigationBuilderLog.txt in the Saved > Logs directory of your project.

    2. Clean Packages - Enable this if you want to remove all world partitioned NavMesh actor packages from your project. This will not build the navigation.

    Build Navigation Settings options

  4. Go to the Outliner window and notice that you now have four NavDataChunk Actors. These actors hold the navigation data loaded and unloaded by World Partition. The number of NavDataChunk Actors created depends on the size of the Data Chunk Grid (see section 6 for more details).

    Go to the Outliner window and notice that you now have four NavDataChunk Actors

Section Results

In this section, you learned how to build the navigation for your level. You also learned about the different Navigation Settings options and how NavDataChunk actors are created in your level.

In the next section, you will learn how to build navigation outside of the editor.

5 - Building the Navigation Mesh with the World Partition Navigation Data Builder

It is also possible to build a world partitioned static Navigation Mesh outside the editor by using the WorldPartitionBuilderCommandlet with the WorldPartitionNavigationDataBuilder.

Follow the instructions in the World Partition documentation, under the World Partition Navigation Data Builder section to learn how to do this.

6 - Additional settings for your Navigation Mesh

  1. Go to the World Settings window and scroll down to the Navigation section to find the Navigation Mesh settings for the level.

    The options are as follows:

    Setting

    Description

    Navigation Data Chunk Grid Size

    This defines the size of the data chunk actors loaded with each cell of World Partition. The smaller the number, the more granular the data.

    Navigation Data Builder Loading Cell Size

    This defines the size of the loading cells used to load the Navigation data into memory.

    Set the Navigation Data Chunk Grid Size to 25600. This lower value better shows how the Navigation Mesh is loaded and unloaded by World Partition. This value should be adjusted based on your gameplay needs, loading range, and required granularity.

    Set the Navigation Data Chunk Grid Size to 25600

  2. Click Build > Build Paths to build the Navigation Mesh in your level.

  3. Go to the Outliner window and notice that you have many more NavDataChunk actors in the level. This is expected as the Chunk Grid Size is smaller than before.

    There are many more NavDataChunk** **actors in the level

Section Results

In this section, you learned how to change the Navigation Data Chunk Grid Size and how it affects the number of NavDataChunk actors that are created in your level.

In the next section, you will see how the Navigation Mesh is loaded and unloaded as the player traverses the level.

7 - Viewing your results

Follow these steps to view how the Navigation Mesh is loaded and unloaded with the World Partition cells.

  1. Enter the following Navigation Mesh Gameplay Debugger console commands in the command line and press Enter:

    1. ai.debug.nav.RefreshInterval 0.3

    2. ai.debug.nav.DisplaySize 100

    These commands adjust the display size and how frequently the Navigation Mesh visualization is updated.

    Enter the ai.debug.nav.DisplaySize 100 command

  1. Press Play to start the game. Open the command line by pressing tilde (~), then enter the following World Partition debug commands:

    1. wp.Runtime.ToggleDrawRuntimeHash2D

    2. wp.Runtime.ShowRuntimeSpatialHashGridLevel 2

    These commands display which World Partition cells are loaded around the player.

    During gameplay you can see a display of which World Partition cells are loaded around the player

  2. Press single-quotation (‘) to enable the Gameplay Debugger and press zero (0) to switch to the Navigation view. You can now see the Navigation Mesh loaded around the player.

    You can see the Navigation Mesh loaded around the player

  3. Move around the level and see how the Navigation Mesh is loaded as each World Partition cell is loaded around the player.

    Move around the level and see how the Navigation Mesh is loaded around the player

    Top view of the Navigation Mesh being loaded around the player

Section Results

In this section, you learned how to visualize when the Navigation Mesh is loaded and unloaded by World Partition.