Questions about GraphUpdateScene

I’m trying to find the most effective way to make certain areas of my graph unwalkable.

I have 2 cases to handle:

  1. Certain dynamic objects need to create entirely unwalkable areas - For example a fallen tree. I was just using a graph update but due to AI step height it was creating a walkable path along the fallen tree trunk which caused pathing issues as it was too narrow to actually walk on in some places. I put GraphUpdateScene on a boat that will update the graph when the boat lands on shore. What I don’t get is the rectangular gizmo. What is that for and does it have any effect on the graph changes? It doesn’t rotate with the object.

  2. blockout out large areas of a map like a water line - I thought drawing some points along the water edge would be easy but after scanning I’m not sure this will work.

Here’s a zoomed out view of my map where I placed points along the water edge. After a scan it has made tiles unwalkable, but the tiles are large so I get this jagged border that I don’t think is going to work.

Or is there a better way to blockout areas of a recast graph to make them unwalkable, either for areas of the map or on dynamic objects?

My main strategy so far has been to have a hidden mesh on an object on on the map with a very tall height so that breaks the navmesh pathing around that object with no way for the AI to get on top of it.

For example here’s my tree with a hidden capsule collider that affects the graph update.
Would it make sense to use GraphSceneUpdate on the tree? Can I calculate and set the points using the tree bounds after the tree has fallen over?

When the tree is cut down I do a graph update. Sometimes this is a problem due to where the tree falls as one end may be too close to the ground connecting the graph.

I think this is what would work, I added graphsceneUpdate at runtime and manually rescanned. I’m just not sure how to do this through code at runtime since the tree may fall anywhere, rotate etc.

Hi there! Lots of good questions here.

Quick counter-question, how large is your game world? Those are some large tiles for a grid graph, if the world isn’t very large. That would help with some of the jaggedness. However, in later screenshots you’re using a recast graph it seems.

For your fallen tree, I think you’d want to take a look at some of the various options you have for making graph updates during runtime, here. Specifically for a falling tree, I think NavmeshCut would be your tool.

Also, the GraphUpdateScene square just seems to be a gizmo for the bounds of the object. I’d imagine it’s basically “where it’s looking”. It shouldn’t have any effect on graphs beyond that :+1: It doesn’t change with rotation but it does with scale, seemingly taking the longest two points of the mesh and being at least that long in all three directions.

Hope that helpps :smiley:

The largest map I’m using at the moment is around 4k square. They are all recast graphs. It looks like a grid graph because I’m zoomed way out showing that shoreline and there are no other obstacles breaking it up.

I’m already using runtime graph updates, for example once the tree falls over I do the update which cuts out around the tree. I’m just trying to get the top of the tree to be unwalkable when I do that update.

GraphUpdateScene would work if I can set the points to be the bounds of the tree, if that’s how the points work, and can be set at runtime.

Hi

You can attach a RecastMeshObj component to your tree. That will allow you to mark its surface as unwalkable, which is exactly what you want.