Skip to content

Commit 0af3c98

Browse files
committed
Add documentation markdown files
1 parent 2fb8e5d commit 0af3c98

6 files changed

Lines changed: 115 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#Connecting NavMesh Surfaces
2+
3+
![Connecting surfaces example](Images/ConnectingSurfaces-Example.png)
4+
5+
If it is desired to allow an agent to move along multiple NavMesh Surfaces in a Scene, the surfaces need to be connected together using NavMesh Links.
6+
7+
In the example scene above, the blue and red NavMeshes are defined in different NavMesh Surfaces. A wide NavMesh Link is added, it spans from one surface to another.
8+
9+
Things to keep in mind when connecting surfaces:
10+
* You can connect surfaces using multiple links.
11+
* Both the surfaces and the link must have same agent type.
12+
* The link’s start and end point must be only on one surface. It is OK to have multiple NavMeshes at the same location, but then selecting a NavMesh becomes ambiguous.
13+
* If you are loading a second NavMesh Surface additively and you have “dangling” links in the first scene, check that they do not connect to unwanted surfaces.

Documentation/NavMeshLink.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#NavMeshLink
2+
3+
![NavMeshLink example](Images/NavMeshLink-Example.png)
4+
5+
NavMesh Link allows to create a navigable link between two locations. The link can be from point-to-point, or it can be wider in which case the agent uses the nearest location along entry edge to cross the link.
6+
7+
The link is necessary to connect different NavMesh Surfaces
8+
9+
* Agent Type – the agent type which can use the link.
10+
* Start Point – start point of the link, relative to the Game Object.
11+
* End Point – end point of the link, relative to the Game Object.
12+
* Align Transform To Points – clicking this button will move the Game Object at the links center point and alight the transform’s forward axis towards the end point.
13+
* Cost Modifier – When the cost modifier value is non-negative the cost of moving over the NavMeshLink is equivalent to the cost modifier value times the Euclidean distance between NavMeshLink end points.
14+
* Bidirectional – when checked the link can be traversed from start-to-end and end-to-start, when unchecked only from start-to-end.
15+
* Area Type – the area type of the link (affects path finding cost)
16+

Documentation/NavMeshModifier.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#NavMeshModifier
2+
3+
![NavMeshModifier example](Images/NavMeshModifier-Example.png)
4+
5+
NavMesh Modifier allows to fine tune how a specific object behaves during NavMesh baking. In the above picture, the lower platform has modifier attached to it, which sets the object to have Lava area type.
6+
7+
The NavMesh Modifier affects hierarchically, that is, the Game Object where the Components is attached and all of its’ children are affected. If another NavMesh Modifier is found further down the transform hierarchy it will override the modification for its children.
8+
9+
The NavMesh Modifier affects the NavMesh generation process, this means the NavMesh has to be updated to reflect changes to NavMesh Modifiers.
10+
11+
Note: This component is a replacement for the old setting which could be enabled from the Navigation window Objects tab as well as the static flags dropdown on the GameObject. This component is available for baking at runtime, whereas the static flags are available in the editor only.
12+
13+
##Parameters
14+
* Ignore From Build – when checked, the object and all if its’ children are skipped from the build process.
15+
* Override Area Type – when checked the area type will be overridden for the game object containing the Modifier and all of it’s children.
16+
* Area Type – new area type to apply
17+
* Affected Agents – a selection of agents the Modifier affects. For example, you may choose to exclude certain obstacles from specific agent.
18+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#NavMeshModifierVolume
2+
3+
![NavMeshModifierVolume example](Images/NavMeshModifierVolume-Example.png)
4+
5+
NavMesh Modifier Volume allows you to mark the area that falls inside the volume with specific area type. Where NavMesh Modifier marks certain objects with an area type, the Modifier Volume allows change the area type even more locally based on a volume.
6+
7+
The modifier is useful for annotating certain areas over walkable surfaces which might not be represented as separate geometry, e.g. danger areas. It can be even be used to make certain areas non-walkable.
8+
9+
The NavMesh Modifier Volume affects the NavMesh generation process, this means the NavMesh has to be updated to reflect changes to NavMesh Modifier Volumes.
10+
11+
## Parameters
12+
* Size – dimensions of the modifier volume.
13+
* Center – center of the modifier volume relative to the GameObject center.
14+
* Area Type – describes the area type which the volume applies.
15+
* Affected Agents – a selection of agents the Modifier affects. For example, you may choose to create danger zone for specific agent type only.
16+

Documentation/NavMeshSurface.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#NavMeshSurface
2+
3+
![NavMeshSurface example](Images/NavMeshSurface-Example.png)
4+
5+
The NavMeshSurface component represents the walkable area for a specific agent type. The NavMesh Surface component defines a part of the world where a NavMesh should be built. A scene can contain multiple NavMesh Surfaces.
6+
7+
The preferred way to use the NavMeshSurface component is to create an empty Game Object containing the NavMeshSurface component. There’s a menu option for that: GameObject > AI > NavMesh Surface. This creates an empty Game Object with a NavMeshSurface component attached to it.
8+
9+
The NavMeshSurface component can be also added to any game object. This is useful for cases where you want to use the Hierarchy to define which objects contribute to the NavMesh.
10+
11+
##Parameters
12+
* Agent Type – the agent type which will use this NavMesh Surface. The agent type is used for bake settings, as well as to match a NavMeshAgent to proper surface during pathfinding.
13+
* Collect Objects – defines on a high level which objects should be used for baking.
14+
* All – use all active objects.
15+
* Volume – use all active objects overlapping the bounding volume (defined later)
16+
* Children – use all active objects which are children to the NavMeshSurface component, in addition to the object the component is placed on.
17+
* Include Layers – defines the layers on which the objects must be to be included in the bake. This allows further culling of objects from inclusion in the bake e.g. effects or animated characters.
18+
* Use Geometry – selects which geometry is used for baking.
19+
* Render Meshes – use geometry from rendered meshes and terrains
20+
* Physics Colliders – use geometry from colliders and terrains. When using physics this is usually a better option than Render Meshes. This way the agents will be closer to the physical bounds of the environment.
21+
22+
The main settings for the NavMesh Surface component allow you to filter the input geometry on a broad scale. To fine tune how input geometry is treated on a per-object level when building a navmesh, see NavMeshModifer component.
23+
24+
Game Objects which have a NavMesh Agent or NavMesh Obstacle will be excluded from the baking process automatically. They are dynamic users of the navmesh – and hence should not contribute to the navmesh building.
25+
26+
##Advanced Settings
27+
28+
![NavMeshSurface advanced](Images/NavMeshSurface-Advanced.png)
29+
30+
31+
The main settings will cater for most use cases, but for anything not covered by the main settings, the advanced section has the following additional parameters
32+
33+
* Default Area – defines the area type generated when building the navmesh. The default value is Walkable. The NavMeshModifer component can be used to modify the area type in more detail.
34+
* Override Voxel Size – The override voxel size controls how accurately the input geometry is processed for NavMesh baking. It is a tradeoff between speed and accuracy. A good value to start with is 3 voxels per agent radius (6 per diameter). This allows to capture most of the narrow passages, like doors and still have quick baking. If you have big open areas, you might go down to 1 or 2 to speed things up. Or if you have tight indoor spots, you can use smaller voxels, and use maybe 4-6 voxels per radius. More than 8 is usually not really worth it.
35+
* Override Tile Size – In order to make the bake process parallel and memory efficient, the world is divided into tiles for baking. The white lines you can see on your NavMesh are tile boundaries. The default tiles size is 256 voxels. It is a good trade-off between memory usage and NavMesh fragmentation. The smaller the tiles are the more fragmented the NavMesh is, and this can sometimes cause non-optimal paths. NavMesh carving also operates on tiles. If you have a lot of obstacles, you can potentially speed up carving by making the tile size smaller, say 64-128. Also, if you plan to bake the NavMesh at runtime, you may choose to use smaller tile size to keep the maximum memory usage low.
36+
* Build Height Mesh – Not supported yet.
37+

Documentation/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#High-level NavMesh Building Components
2+
3+
Here we introduce four high level components for the navigation system:
4+
5+
* [NavMeshSurface](NavMeshSurface.md) – for building and enabling a navmesh surface for one agent type.
6+
* [NavMeshModifier](NavMeshModifier.md) – affects the navmesh generation of navmesh area types, based on the transform hierarchy.
7+
* [NavMeshModifierVolume](NavMeshModifierVolume.md) – affects the navmesh generation of navmesh area types, based on volume.
8+
* [NavMeshLink](NavMeshLink.md) – connects same or different navmesh surfaces for one agent type.
9+
10+
These components comprise the high level controls for building and using NavMeshes at runtime as well as edit time.
11+
12+
##Techniques and Patterns
13+
* [Connecting NavMesh Surfaces](ConnectingSurfaces.md) using the NavMeshLink compoenent.
14+
15+

0 commit comments

Comments
 (0)