-
Notifications
You must be signed in to change notification settings - Fork 6
AI Navigation
The engine uses a few different types of AI Navigation Maps depending on use case: Navmeshes, Waypoints and Volume Spaces. In the older games, all map types have the .aimap extension and are differentiated by the map type field inside them. For newer games, they also use separate extensions (.ainvm, .aiwayp and .aivspc).
The main type of pathfinding navigation, used for basically every grounded creature that allows movement along surfaces in arbitrary directions. It's based on industry standard Recast navigation (Recast Github, Alternative documentation) with some slightly extended features. REE Content Editor uses the .NET port DotRecast.
The main navmesh consists of a paired set of mostly overlapping triangles and polygons, both of which are used for different parts of the pathfinding algorithm. These are not intended (and not feasible) to be edited manually through modelling applications but are generated based on map collisions and some customizable parameters to adjust the output.
The format also has some additional features that aren't strictly part of the default Recast implementation (expressed as additional content groups in the file), as well as custom map attributes, that are currently not yet supported and will be discarded on navmesh regeneration.
In order to generate navmeshes for a map you need to have loaded all the relevant scene files into the editor and have proper colliders set up. REE Content Editor is currently limited strictly to Mesh Shape colliders (.mcol files) referenced by scenes, although this will likely get expanded in the future. Below is a screenshot of the current state of how the navmesh generation process works.
Open the root scene of the level for which you want to generate navmeshes, expand the Navmesh Editing mode (1., 2.) and select the AIMap component containing the aimap you wish to edit (3.). If the component contains multiple navmeshes you can pick the one from the list (4.) or manually select a file. You are now able to examine the navmesh file and see how things connect.
In order to (re-)generate the navmesh, you can use the "Bake navmesh" button, which will open the Navmesh Baker window. There, you have two main sections to modify - one is the bake parameters (6.) and one is the list of colliders to use as a base for the generated navmesh (5.).
Collision filters list is used as a quick filter for which colliders should be taken into account for navmesh generation. Most scenes have several types of colliders that don't all affect movement, so this lets you easily ignore what isn't relevant. The source colliders list is then used to further tweak which colliders should be used.
There's a "Bake" button at the bottom of this window that will trigger the navmesh generation based on the current parameters, this should usually be relatively quick. After it's done, you can see if it looks right or not, and further adjust the parameters and collider list until satisfied. Once the navmesh looks good, you can open and save the map file as you would with any other file (using the "Open Map File" button, through the navmesh edit mode menu, or the open files list).
These are generally used to guide NPCs along specific paths (long distance navigation / pathfinding in open world games and for specific cutscene paths). Visual editing of these is not fully supported.
These are mostly only used for flying enemies. Consists of many overlapping bounding boxes. Editing is not yet fully supported.
The engine supports additional extra / off-mesh links between navmeshes that can connect arbitrary meshes together (for example, jump / climb / drop off points). These are stored as additional Boundary/AABB content group nodes. These can be moved around and will automatically regenerate the correct links for navmesh files. Adding new links is currently not yet implemented.