Size limitations on navmeshes

225 views
Skip to first unread message

Gotisch

unread,
Mar 26, 2010, 3:40:30 PM3/26/10
to recastnavigation
Hello,

i was wondering if there are any size limitations on the Navmeshes,
either the Solo Navmesh or the Tile Navmesh. I see in the Demotool
that when choosing Tile Mesh there is a Tilesize and Max Tiles
indicator. Does he show the maximum number of tiles that can be put
into the navmesh?

I am currently using the navmesh to finds path in a huge area but only
small pathes. So i split the area into multiple navmeshes, the problem
though is that sometimes a path isnt found because it would require
traveling over to another navmesh and back, I though about creating
overlapping navmeshes and since the size of the path is fairly limited
this would work, although it would mean a huge memory increase for the
overlapping meshes. When i saw yesterday the new methods to save and
load tiles, i thought to myself: if i could put everything in a Tile
Mesh this would be awesome.

Thanks for the infos

Mikko Mononen

unread,
Mar 26, 2010, 4:56:34 PM3/26/10
to recastna...@googlegroups.com
Hi,

There are a couple of limitations. The polygons have the vertex
indices stored as unsigned shorts, which means that there can be up to
65536 vertice per each navigation mesh tile. The detail meshes index
polygons using unsigned short, so in practice that is also the max
number of navmesh polygons per tile. If you need to have more polygons
or verts, then you should split your world in tiles.

Each navigation mesh polygon is identified with an ID, which consists
of tile number, polygons number and special "salt" which is used to
track if the tile is the same as at the time of querying the ID. This
basically allows to detect that a polygon is invalid if the navigation
mesh changes.

That leaves 22bits to be used to store tile and polygon id. If each
tile has very few polygons, you can keep the max poly count low and
then you can have more tiles, and vice versa. Different games have
different needs. A simple way to tune this number is to generate some
meshes, and see how many polygons you get, multiply the max poly count
by 1.25 and round to nearest power of 2.

In your case it might be a good idea to load several tiles around the
location where the path finding happens and once the focus moves,
remove the tiles which are not needed anymore and load new ones in.
You need to do the book keeping of which tiles to load and remove
yourself.

If you have really big world, be aware of floating point accuracy.
Detour works well when the coordinates are in range -4000..4000,
although you may get some inaccuracies at those extremes.


--mikko

> To unsubscribe from this group, send email to recastnavigation+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
>

Reply all
Reply to author
Forward
0 new messages