Navmesh question
Hi all
Ive created a navmesh but im unsure on how the ai will move across the mesh. Ive read the ai has more freedom for movement on a navmesh but im just unsure on how to use this mesh. Ive searched the net but theres not much info there. If anyone could share there knowledge or point me in the right direction that would be great. Thanks.
I'm going to assume that the navmesh you have created is composed entirely of triangles(any convex shape is viable, but triangles are the easiest to break a map's walking surfaces down into). So, you're familiar with graph search algorithms such as A*, right? You've probably seen demos that present a grid through which a character has to navigate, and A* is used to generate a path through the grid, cell by cell, for the character to follow? Navigation meshes, at their simplest, are really not much different conceptually.
The only difference here is that instead of pathing from cell-to-cell in a grid, you are pathing from triangle to triangle in a navmesh. You may use the centroids of the triangles as your "cells" if you wish, and that's what I would do if I were starting out learning navmeshes. When two triangles are adjacent to each other, then they are connected in the same way that adjacent cells in the grid are connected.
And another thing to remember...even though the navmesh is visualized in 3D....it's still just a 2D connected graph as far as the graph search algorithms(A*) are concerned.
If I was too vague, assumed too much, or didn't explain thoroughly enough, ask again and I'll try harder.
The only difference here is that instead of pathing from cell-to-cell in a grid, you are pathing from triangle to triangle in a navmesh. You may use the centroids of the triangles as your "cells" if you wish, and that's what I would do if I were starting out learning navmeshes. When two triangles are adjacent to each other, then they are connected in the same way that adjacent cells in the grid are connected.
And another thing to remember...even though the navmesh is visualized in 3D....it's still just a 2D connected graph as far as the graph search algorithms(A*) are concerned.
If I was too vague, assumed too much, or didn't explain thoroughly enough, ask again and I'll try harder.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement