Navmesh and static / dynamic obstacles

Started by
2 comments, last by Bimble Bob 13 years, 9 months ago
I have a navmesh that i generated by doing a flood fill on a terrain model (stopping where the terrain got too steep).

I have some objects i'm placing on the terrain too (like trees, bushes and rocks) and i want my entities to path around them.

Some of these objects are static, and others are dynamic and can be destroyed.

Only considering the static objects right now, I was thinking about taking a rectangular bounding box of each object and cutting that shape out of the navmesh.

For the dynamic (destroyable) objects i was thinking about doing the same thing except after the rectangular piece was cut out, I could fill it in with navmesh data, and mark it as disabled and not be pathable. When the object was destroyed, it would mark the navmesh data as enabled and be fully pathable.

That seems like it'd be a ton of work though and pretty complicated to cut up the triangles and keep track of the neighbors etc.

What do you guys think? Is this a good way to handle static obstacles? Any other techniques out there? (:

Thanks!
Advertisement
bump
Quote:Original post by Atrix256
I have a navmesh that i generated by doing a flood fill on a terrain model (stopping where the terrain got too steep).

I have some objects i'm placing on the terrain too (like trees, bushes and rocks) and i want my entities to path around them.

Some of these objects are static, and others are dynamic and can be destroyed.

Only considering the static objects right now, I was thinking about taking a rectangular bounding box of each object and cutting that shape out of the navmesh.

For the dynamic (destroyable) objects i was thinking about doing the same thing except after the rectangular piece was cut out, I could fill it in with navmesh data, and mark it as disabled and not be pathable. When the object was destroyed, it would mark the navmesh data as enabled and be fully pathable.

That seems like it'd be a ton of work though and pretty complicated to cut up the triangles and keep track of the neighbors etc.

What do you guys think? Is this a good way to handle static obstacles? Any other techniques out there? (:

Thanks!


The bounding box method would probably be a good start. A good nav-mesh implementation is a TON of work. For example, a tall tree with high branches may only need to cut the shape of its trunk from the navmesh. But what about a tree with low branches? If it cuts from the navmesh, then small AI units could not walk under the branches, but a tall AI unit should not try and use any navmesh that would end up under the branches. If you go with a bounding box, things like a tree with long branches that stretch out could be problem if you ever want to path underneath them, as the bounding box would pretty much prevent that.

Seems like you'd have to get a more accurate bounding box you'd need to grab just the verts of the model that were near the terrain, and create a bounding box with those verts. In the case of a tree that might let you creating a smaller bounding box that might better represent the tree trunk itself.

Additional problems you may face would have to do with AI units of different widths, so thin AI units can squeeze through a tight space, but a fatter AI unit shouldn't even try to use that space.

I'm under NDA so I can't give many details on current implementation details I'm aware of, but I have seem other nav-mesh implementations that can cut dynamic objects from the nav-mesh, and they do in fact recalculate the triangles of the mesh nearby any time there is a change. I wonder how difficult it would be to track any changes to the original nav-mesh, so you could revert the affected areas when the dynamic object was gone, without having to re-calculate everything again?
Would it be possible to perhaps use the nav mesh for normal terrain and static objects and use a different "sub" steering technique to detect dynamic or moving objects and find a way around them.

This has a bunch of examples of what I mean: http://www.red3d.com/cwr/steer/
It's not a bug... it's a feature!

This topic is closed to new replies.

Advertisement