UDN
Search public documentation:

NavMeshManualCreation
日本語訳
中国翻译
한국어

Licensees can log in.

Red links require licensee log in.


Interested in the Unreal Engine?
Visit the Unreal Technology site.

Looking for jobs and company info?
Check out the Epic games site.

Questions about support via UDN?
Contact the UDN Staff

UE3 Home > AI & Navigation > Creating Navigation Meshes Manually

Creating Navigation Meshes Manually


Overview


Occasionally it is useful to create portions of the mesh using means other than that of the automatic generation. This doc explains one method for doing so by way of importing a pre-existing mesh and converting that to navmesh. This is accomplished by converting one or more static mesh into specialized imported pylons.

These 'imported' pylons will then be left alone by the automated mesh generation process. Once the automated mesh is generated, it will attempt to link the imported meshes to the rest of the mesh. Either by adding direct edges in the case of imported meshes which are close to co-planar, or by splitting the generated mesh along boundaries between the imported mesh and the generated mesh (more on this later).

Currently the only way to create a manual mesh is to convert a staticmesh (or staticmeshes) to a special imported pylon. This is accomplished by selecting one or more staticmeshes, right clicking and selecting convert staticmesh to navmesh. The code will then take the vertex data directly from the static mesh and convert it to navmesh datastructures.

When multiple staticmeshes are selected, it will attempt to snap/align the meshes to each other so they're contiguous where possible (e.g. line of boundaries) and then throw the result into a single navmesh on an 'imported' pylon. This ability to import more than one mesh at a time allows you to cobble together manual meshes in special situations that require non-automated navmesh generation.

Converting a StaticMesh to a NavMesh


Converting a staticmesh to a navmesh is as simple as right clicking and selecting convert static mesh to navmesh.

ConvertSMToNavMesh_0.png

Keep in mind that the geometry in the staticmesh is going to be used almost verbatim, so backfaces and such will come with the conversion. Here is my example mesh which consists of a flat plane and two tris:

ConvertSMToNavMesh_6.png

After converting to navmesh you will see your mesh now in beautiful green and red navmesh drawing.

Notice that redundant polys will get merged together.

Also notice this imported mesh is not yet linked into the rest of the (automatically created) navmesh.

ConvertSMToNavMesh_1.png

Upon building paths after adding your new imported navmesh, the auto-generated mesh will be split along boundaries with the imported mesh. As you can see here:

ConvertSMToNavMesh_2.png

Also note the dashed-purple line along the bottom boundary indicating a connection between the imported poly and the base auto-generated poly.

Converting multiple StaticMeshes into a single imported Pylon

It is also possible to convert several staticmeshes into a single pylon. This is helpful if one is cobbling together a manually created mesh out of base shapes. This is quite useful for building arbitrary structures out of a handful of very simple staticmesh shapes (e.g. rectangles, arch, etc.) that can be scaled and arranged together to form a larger shape.

To do this simply arrange the staticmeshes next to one another, select them all and click convert to navmesh. There is some tolerance build in here for adjacent staticmeshes. That is, it will try to snap the adjacent meshes together so they form one contiguous shape.

Here is another example using the simple square shape cobbled together:

ConvertSMToNavMesh_3.png

And after conversion:

ConvertSMToNavMesh_4.png

And finally, After paths are built:

ConvertSMToNavMesh_5.png

Again, notice the dashed purple line linking the meshes together, and the solid purple line linking the imported polys together. These are important to watch out for when building your own imported meshes to ensure there is a proper connection between meshes and mesh polys.

Words of warning


It is possible to add imported meshes that are coplanar with the auto-generated mesh, but there may be artifacts when linking into the rest of the mesh if the imported mesh is off the grid.

Also, imported meshes will be trusted implicitly by the AI, so if you build a configuration that doesn't make sense, the AI will trust it and look dumb :)