Creating a NavMesh around multiple objects often generates areas that might be inaccessible to AI characters while path-finding, such as rooftops, the interiors of structures and so forth.
These inaccessible areas can be filtered out by using Seed Points, such that the triangles of a mesh that are not connected to a Seed Point are marked as inaccessible.
This accessibility is computed by performing a flood-fill algorithm within the NavMesh; islands with triangles that are connected to a Seed Point directly or by off-mesh links are accessible and hence colored blue, while the rest are grayed out.
Areas inaccessible from the Seed Point (center) are grayed
An island is any isolated area within the created NavMesh that contains a placed prop or object. In the images on this page, each of the placed structures are islands in themselves.
If the position of the Seed Point is changed, the accessibility to triangles is recalculated and updated accordingly. Similarly if a NavMesh had no Seed Points, it will not contain any inaccessible (gray) areas as shown below.
Navmesh (bottom-right) with no seed point
Any number of Seed Points may be included within a NavMesh, allowing the accessibility of multiple areas of importance to be computed.
Moreover, the AI characters included within GameSDK (Legacy Entities → AI → Characters → Human) are also considered as Seed Points, when placed within a NavMesh, provided the Agent Type of the NavMesh is the same as that of the character.
To set the Agent Type of a NavMesh,
Agent Types must first be defined and configured in the Navigation.xml file located under ProjectFolder/Scripts/AI/. Please refer to the Navmesh Agent Types documentation for more information.
Navigation Area
The position of islands and their accessibility is calculated only after the generation of a NavMesh has been fully completed. Moreover, the time taken to update a NavMesh depends on the size of the mesh itself.
Hence, when making any changes to a NavMesh in Game Mode, users must be aware that its accessibility information might be in an inconsistent state until the NavMesh has been completely updated.
If the inaccessible triangles of a NavMesh aren't used within a game, they're best discarded to improve performance; the fewer triangles a NavMesh has, the more efficient computational queries within the NavMesh become.
Enabling the Remove Inaccessible Triangles property of a Navigation Area removes inaccessible triangles when the level is loaded in the Game Launcher; this property is located under the Navigation Area tab of the Properties panel, when an existing Navigation Area is selected via the Level Explorer or Viewport.
Remove Inaccessible Triangles
The NavMesh from the first image with inaccessible triangles removed
The value of ai_MNMRemoveInaccessibleTrianglesOnLoad is ignored when loading a NavMesh in the Sandbox Editor, and is taken into account when in the Game Launcher only. Moreover, removed triangles might reappear when the NavMesh is updated, although they'd still be marked as inaccessible (gray).