Jump to content
  • Advertisement
Sign in to follow this  
Atrix256

Navmesh and static / dynamic obstacles

This topic is 3047 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
Advertisement
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?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!