UpdateGraphs(guo) in tiled graph is updating whole graph

I only want for the area inside the bounds given by the GraphUpdateObject to be updated, but the whole graph is being updated, which takes an unnecessarily long time.
requiresFloodFill, updatePhysics and updateErosion are set to false.
What could I be missing?

Thanks,
Tiago Francisco

Hi

It should only update the tiles that intersect the bounds. Are you sure your bounds object is not too large?
How do you know it updates the whole graph?

I’m outputting the bounds and they’re pretty small (extents: 11, 10, 11).
I placed a cube in an area away from the bounds and it updated the navmesh around the cube.
Bounds are at x 37, cube at x -64…

Hi

Could you post a screenshot or two?

Before updating graph

After

Only the area around the building on the right should have been updated, but the area around the white cube is also updated.
Is there anything else in particular I can send I screenshot of?

Here’s the update call code:
GraphUpdateObject guo = new GraphUpdateObject(bounds);
guo.requiresFloodFill = false;
guo.updatePhysics = false;
guo.updateErosion = false;
AstarPath.active.UpdateGraphs(guo);

wait… updatePhysics is set to false. Then it shouldn’t even recalculate ANY tiles. It should just update the fields of the existing nodes. You are sure you are not updating the graphs from somewhere else and that you are not calling AstarPath.active.Scan() somewhere, right?

Phew!
There was indeed a rogue call to update from somewhere I had missed.
Glad I found it. Sorry for the trouble and thanks for the help. :slight_smile:

1 Like

Great that you found it :smile:

I’m also getting null reference exceptions from Pathfinding.TriangleMeshNode.ClosestPointOnNode
Any idea what that might be?
I’m only making the call if isScanning and IsAnyGraphUpdatesQueued are both false

NullReferenceException: Object reference not set to an instance of an object
Pathfinding.TriangleMeshNode.ClosestPointOnNode (Vector3 p) (at Assets/AstarPathfindingProject/Generators/NodeClasses/TriangleMeshNode.cs:77)
Pathfinding.BBTree.SearchBoxClosest (Int32 boxi, Vector3 p, System.Single& closestDist, Pathfinding.NNConstraint constraint, Pathfinding.NNInfo& nnInfo) (at Assets/AstarPathfindingProject/Generators/Utilities/BBTree.cs:420)
Pathfinding.BBTree.SearchBoxClosest (Int32 boxi, Vector3 p, System.Single& closestDist, Pathfinding.NNConstraint constraint, Pathfinding.NNInfo& nnInfo) (at Assets/AstarPathfindingProject/Generators/Utilities/BBTree.cs:453)
Pathfinding.BBTree.QueryClosest (Vector3 p, Pathfinding.NNConstraint constraint, System.Single& distance, NNInfo previous) (at Assets/AstarPathfindingProject/Generators/Utilities/BBTree.cs:401)
Pathfinding.RecastGraph.GetNearestForce (Vector3 position, Pathfinding.NNConstraint constraint) (at Assets/AstarPathfindingProject/Generators/RecastGenerator.cs:1035)
Pathfinding.RecastGraph.GetNearest (Vector3 position, Pathfinding.NNConstraint constraint, Pathfinding.GraphNode hint) (at Assets/AstarPathfindingProject/Generators/RecastGenerator.cs:978)
Pathfinding.NavGraph.GetNearest (Vector3 position, Pathfinding.NNConstraint constraint) (at Assets/AstarPathfindingProject/Generators/Base.cs:172)
AstarPath.GetNearest (Vector3 position, Pathfinding.NNConstraint constraint, Pathfinding.GraphNode hint) (at Assets/AstarPathfindingProject/Core/AstarPath.cs:2830)
AstarPath.GetNearest (Vector3 position, Pathfinding.NNConstraint constraint) (at Assets/AstarPathfindingProject/Core/AstarPath.cs:2799)
AstarPath.GetNearest (Vector3 position) (at Assets/AstarPathfindingProject/Core/AstarPath.cs:2790)