Skip to end of metadata
Go to start of metadata

To create navigation meshes, Navigation Areas need to be added to your level in the Editor. Below, you'll find a simple overview of this process.

The following menu items can be found inside the "AI" menu from the main menu.

Menu Item

Description

Create New Navigation Area

Create a new Navigation Area, similarly to shape objects.

Request a full MNM rebuild

Recalculate entire navigation data.

Show Navigation Areas

Show or hide the Navigation Areas.

Add Navigation Seed

Add Navigation Seed object.

Continuous Update

Enable or disable automatic mesh updates while editing the map.

Visualize Navigation Accessibility

Display navigation reachable areas in blue and unreachable areas in red.

Debug Agent Type

Agent type for which debug information is displayed.

Debugging in Launcher

Visualizing the navigation mesh in the Launcher is possible. The following CVars are required:

  • ai_debugMNMAgentType MediumSizedCharacters
  • ai_debugDraw 1
  • ai_debugDrawNavigation 1 (or one of the other options associated with this CVar)

To create a new Navigation Area:

  • Click on New Navigation Area. This is also available via the "AI -> NavigationArea" option in the RollupBar.
  • Create the shape enclosing the area where you want the AI characters to navigate.
  • Set the Height property of the Navigation Area to suit your needs.
  • Set the agent type properties of the Navigation Area to match the agent types of the AI characters which need to use the navigation mesh.
    • Two agent types are included with the SDK by default: MediumSizedCharacters and VehicleMedium.

The generation of the navigation mesh goes in a separate thread, so it doesn't stall the Editor.

To see the generated mesh, set the console variable ai_DebugDrawNavigation to 1, 2, or 3. Make sure you also set ai_DebugDraw 1. Or simply use the DebugAgentType option in the AI menu.

A common mistake when creating navigation areas is to create them on or above the terrain surface, or object surface. This can cause the mesh to fail.

Make sure you place the base of the shape underneath the terrain/object and the roof of the shape above the terrain/object, allowing for plenty of clearance.

Bad Mesh - Debug Navigation OffBad Mesh - Debug Navigation On
Good Mesh - Debug Navigation OffGood Mesh - Debug Navigation Off

If you don't want navigation mesh to be generated in some areas within a navigation area:

  • Create a new Navigation Area as described above.
  • Set the Exclusion property of it.

Exclusion Areas will be colored red to indicate they cannot be used by AI to navigate within. The same will also happen to Navigation Areas which simply cannot be reached by AI (blocked by terrain/objects, etc)

There could be cases in which areas marked as non-reachable are still important for the level design. In this case, you can place a Navigation Seed on this areas to inform the navigation system that you want to consider that spot like if an agent was placed there.

Note that the "Navigation Seed" position will be used for all the navigation meshes the seed is enclosed into, while a specific agent will calculate the accessibility only for his specific navigation type.

The following picture shows a part of a level where the Navigation Area object is much bigger than the section where the medium sized characters are placed and where they can actually find a path:

If the upper part of the valley is important for your gameplay design, just place a navigation seed on it and it will be marked with the blue color:

Seed points are used to highlight isolated areas of the navigation mesh:

  • Add seed points to the mesh.
  • Execute the following console command: ai_MNMCalculateAccessibility.
  • Areas of the mesh that are reachable from the provided seed points will be displayed in blue, all other areas in red.

If Continuous Update is on, modifying the map (e.g. adding / deleting / moving objects or modifying the terrain) that affects navigation causes the navigation system to automatically recalculate the navigation mesh to reflect these changes.

Only those parts of the navigation area which are affected by the change will be recalculated.

You can quickly tell if the Nav Mesh is being updated by a small character icon being displayed in the top left of the screen.

If you don't wish for the navigation data to be processed on-the-fly like this, you can simply disable "Continuous Update" in the AI menu:

You may sometimes receive a "Navigation System Warning" when trying to save/export your level while the navigation is being updated. This warning is to prevent the navigation that is being processed from becoming corrupted and you should avoid interrupting it to be safe.

 

  • No labels