A navigation mesh is a collection of two-dimensional convex polygons (a polygon mesh) that defines which areas of the environment are traversable by agents.
Better said, a character in game can freely walk around within those areas unobstructed by trees, lava or other barriers that are a part of the environment.
Adjacent polygons are connected to each other in a graph.
If you want to create a navmesh route, (As AB's navmesh doesn't yet cover whole world) you should use the GPS editor.
Navmesh in GPS editor looks like:
There few simple rules:
1) Each navmesh polygon should be a triangle. AB navmesh builder accepts only triangles from gps database file.
2) Each triangle can be marked as Lowdanger\Highdanger\Road\Jump. Those are default set to Lowdanger. Areas with aggro mobs are recommended to be set as Highdanger.
3) You can create offmesh connections with links (Can later be used for one way movements and jumps). Navmesh builder accepts only OffMeshConnection and SingleOffMeshConnection link types!
4) When you create your navmesh, you should consider only obstacles (Trees\Rocks\Houses) except all dynamic obstacles.
Dynamic obstacle (all doodads\creatures):
Static obstacle:
After your gps mesh is ready, you should create AB navmesh with AB plugin editor:
If action succeded, you'll receive C:\navmesh.ABmesh file, that can be used for navmesh movements:
MoveTo \ ComeTo (AB core functions) will use navmesh movement.
AB Navmesh APIs contains:
public void BuildNavMesh(Gps gps, string meshPath);
public void LoadNavMesh(string meshPath);
public bool forceNavMeshMovements;
public float[] GetNavPath(double sX, double sY, double sZ, double eX, double eY, double eZ);
Better said, a character in game can freely walk around within those areas unobstructed by trees, lava or other barriers that are a part of the environment.
Adjacent polygons are connected to each other in a graph.
If you want to create a navmesh route, (As AB's navmesh doesn't yet cover whole world) you should use the GPS editor.
Navmesh in GPS editor looks like:
There few simple rules:
1) Each navmesh polygon should be a triangle. AB navmesh builder accepts only triangles from gps database file.
2) Each triangle can be marked as Lowdanger\Highdanger\Road\Jump. Those are default set to Lowdanger. Areas with aggro mobs are recommended to be set as Highdanger.
3) You can create offmesh connections with links (Can later be used for one way movements and jumps). Navmesh builder accepts only OffMeshConnection and SingleOffMeshConnection link types!
4) When you create your navmesh, you should consider only obstacles (Trees\Rocks\Houses) except all dynamic obstacles.
Dynamic obstacle (all doodads\creatures):
After your gps mesh is ready, you should create AB navmesh with AB plugin editor:
Code:
var gps = new Gps(this); //create new GPS
gps.LoadDataBase(@"D:\Games\my_gpsmesh.db3"); //Load gps database
BuildNavMesh(gps, @"C:\navmesh.ABmesh"); // Build navmesh from gps mesh
If action succeded, you'll receive C:\navmesh.ABmesh file, that can be used for navmesh movements:
Code:
LoadNavMesh(@"C:\navmesh.ABmesh"); // load Navmesh
forceNavMeshMovements = true; // enable navmesh movenets for all MoveTo\ComeTo
MoveTo \ ComeTo (AB core functions) will use navmesh movement.
AB Navmesh APIs contains:
public void BuildNavMesh(Gps gps, string meshPath);
public void LoadNavMesh(string meshPath);
public bool forceNavMeshMovements;
public float[] GetNavPath(double sX, double sY, double sZ, double eX, double eY, double eZ);