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
Create a new project from a template in the Games category. In this example, we selected the Third Person template.
In the editor, click File > New Level. Select the Open World map type and click Create. Save the 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
Go to the World Settings window and scroll down to the World Partition section.
Expand Runtime Settings > Grids > Index [0].
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.
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
Click Settings > Project Settings to open the Project Settings window.
Click the Navigation Mesh category and scroll down to the Runtime section. Click the Runtime Generation dropdown and select Static.
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.
Click Add + > Volumes > NavMeshBoundsVolume to add a Navigation Mesh volume actor to your level.
Select the NavMeshBoundsVolume actor in the Outliner window and go to the Details panel.
Scale the actor so it covers the playable space in the level.
Press P to see the navigation being built in the viewport.
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.
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:
Click Edit > Editor Preferences to open the Preferences window.
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.
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:
Enter the following console command in the command line and press Enter: n.bNavmeshAllowPartitionedBuildingFromEditor 1
Click Build > Build Paths to build the Navigation Mesh in your level.
In the Build Navigation Settings window, click Ok to build the Navigation Mesh. You also have the following options available:
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.
Clean Packages - Enable this if you want to remove all world partitioned NavMesh actor packages from your project. This will not build the navigation.
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).
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
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.
Click Build > Build Paths to build the Navigation Mesh in your level.
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.
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.
Enter the following Navigation Mesh Gameplay Debugger console commands in the command line and press Enter:
ai.debug.nav.RefreshInterval 0.3
ai.debug.nav.DisplaySize 100
These commands adjust the display size and how frequently the Navigation Mesh visualization is updated.
Press Play to start the game. Open the command line by pressing tilde (~), then enter the following World Partition debug commands:
wp.Runtime.ToggleDrawRuntimeHash2D
wp.Runtime.ShowRuntimeSpatialHashGridLevel 2
These commands display which World Partition cells are loaded around the player.
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.
Move around the level and see how the Navigation Mesh is loaded as each World Partition cell is 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.