Navmesh rules

**Navmesh Rules**

Lets talk about the rules involved in a navmesh. If any one of these
rules are broken, your navmesh will not work in the game and will cause a crash
to desktop on load.

First, a simple explanation is in order:  A Navmesh or Navigational Mesh is the 3d
model that represents where the bots can walk around on a map.   It uses the simple obj format which is
compatible with most 3d modeling programs.
In the editor the Navmesh is represented in green.  All editing has to be done with 3d modeling
programs.  The editor has no Navmesh
editing capability.

**Must be one island - no isolated Islands**

The Navmesh must be one complete, continuous object.  Because the navmesh is simplified version of the terrain in which it covers, it is easy to visualize it as an 'island.' There can not be two or more separate pieces of navmesh, or 'islands', in the level.  Frequently, the editor will create multiple islands when generating a Navmesh.   The islands are not always needed, so one solution is to delete the extra islands. The other solution is to connect the islands together.

An example of the main island, with a floating isolated island and an illegal 'manifold' polygon attached by only one vertice. These are very easily fixed.  A poly or 'face' must always have one side
connected to the mesh, never just one corner.

**Every Polygon must be a triangle.**

By default, the navmesh generation process will never produce a poly that isn't
a triangle, but it is worth noting that if you are creating extra mesh by hand,
it must always be subdivided back to triangles. This will also be covered in
depth later.

**No Manifold Poly's.**

This is when a poly is attached by only one vertice to the main mesh like in
the example picture to the right.

**No Floating vertices.**

Also pretty rare and only really turns up if you follow the wrong processes
when deleting and/or editing parts of your mesh.  A vertice is just one of the little purple
dots at the corner of each triangle in the picture. Just make sure there are
none of these floating in space.

**Must be non-self-intersecting.**

This means that the mesh must never pierce itself. When dragging vertices
around for an hour its quite easy for this to happen. As shown in the picture a
vertice has accidentally been placed up through another face. So this is now
classed as self intersecting.

BF2 does not take kindly to this sort of barbaric, face piercing behavior!

**No Double Edges, Vertices or Faces.**

No double edges. See in the example how more than 2 faces share an edge. This
is not allowed. Also, Double vertices are not allowed. Vertices must never be
in the middle of an edge, but always at the corner of a triangle.

N**o Opposite Facing Normals**

 Another rare one but worth mentioning. This is when two faces are connected to
each other but actually face in opposite directions. Also bad, and only really
happens when you're up till 4am every night, eyes half closed and you are
welding vertices together haphazardly with an almost drained rechargeable
mouse, while in the midst of a micro-nap.

That about sums up what NOT to do to navmesh geometry. Most of these are caused
by the mistakes of the user.  The only
ones that the navmesh generator usually gets wrong are floating islands
(isolated poly's.)

**Best results:**

* vehicle navmeshes should be between 0 and 1 meter above the ground and must be within the Infantry navmesh (or bots will abandon vehicles)
* infantry navmeshes should follow the terrain as close as possible.  It is better to have the navmesh a little below the ground rather than have it too far above, which can cause an in game crash.