Getting Started with the Navigation Lab: Using Multiple Sectors

In most console and PC game projects, the game terrain mesh is too big to fit entirely in memory at any time. It is typically split into multiple sub-levels, or sectors, which are streamed in and out of memory in response to gameplay events, such as the player character entering or leaving a particular zone. The Gameware Navigation SDK provides a built-in mechanism for handling multiple sectors, automatically swapping and stitching NavData as needed in order to ensure that Bots can move across the boundaries between adjacent sectors. For background information on handling sectors in the SDK and in the NavData generation process, see Sectorizing the Terrain.

The Navigation Lab also supports multiple sectors. You can set up separate sub-levels by providing multiple .obj files as input, and you can generate, view, and test the NavData for the sectors independently. You can even set up exclusive or swappable sectors, which typically represent the same area of the terrain in two different states.

For a sample that illustrates most of the concepts discussed below, open generation > castle_multisectors_swappable.LabSample from the Samples panel.

Creating and managing multiple sectors

Each time you drag and drop a new .obj file into the Navigation Lab, or open it through the File menu, the Navigation Lab creates a new sector for that input geometry. It adds a new entry to the list in the Scene panel, with the name of the .obj file used to create the sector.

All seed points and TagVolumes that you create for a sector are also listed in that sector's entry. After you generate NavData, each entry also contains the NavData generated for its corresponding .obj file.

You can toggle the checkboxes in the Scene panel in order to show and hide the data associated with each sector.

Providing seed points and TagVolumes

Each sector in the Navigation Lab maintains its own list of seed points and TagVolumes, which apply only to that sector. If you have multiple sectors in the Navigation Lab, and you attempt to add a new seed point or TagVolume, you will be prompted to select the sectors that each new seed or TagVolume should apply to:

While this window is open, the 3D view is updated to show only the sector that is selected in the drop-down list. Close the window when you are finished adding seed points or TagVolumes.

Note that if you add a seed point to any sector, you will have to add at least one seed point to every other sector as well.

Rebuilding NavData for selected sectors

By default, the Navigation Lab always generates NavData for all sectors listed in the Scene panel. However, you can choose to restrict data generation to a particular set of sectors.

Click the SectorsToBuild button in the Generation panel. A small window opens with a list of all known sectors.

Select the ones whose data you want to generate, then launch the generation process.

Overlap data

Wherever the input geometry associated with two or more sectors overlaps, the data generation system automatically creates extra data in the area of overlap that reflects all the possible combinations of sector geometries that can occur when the sectors are streamed in and out at runtime. For background information on overlap data in the NavData system, see Handling Sector Overlaps.

By default, the Navigation Lab does not display overlap data. Instead, it transparently swaps the NavData in the area of overlap in and out of the 3D view to match the geometry of the sectors that are visible in the 3D view. This matches the behavior of the runtime Database class in your game: as you stream sectors in and out of memory, their overlap data is automatically swapped in and out in the same way.

Swappable sectors and CellBoxes

As described under Handling Sector Overlaps, the Gameware Navigation SDK provides ways to tailor the generation of overlap data:

  • If you know that a particular combination of sectors will never be loaded at the same time, you can flag those sectors as exclusive. No overlap data is generated for those combinations.
  • If your sectors are axis-aligned or grid-based, you can reduce overlap data by specifying the exact extents of your sectors in the grid of cells used by the NavData generation system to internally partition your terrain.

For more on these approaches and how to use them in the Navigation Lab, see Handling Sector Overlaps