Is there a way to apply GraphUpdateScene only on specific Graphs?

Hi,

I’m using a RecastGraph and a PointGraph and I want to use GraphUpdateScene areas on the RecastGraph but not the PointGraph. Is there a way to do so?

If I also want to use a negative Penalty in an area, which is fine for the RecastGraph since it has an initial penalty, it can cause a StackOverflowException in the PointGraph, since this one doesn’t have an initial penalty (probably because of negative penalties not supported).

In this case I should be able to work around this issue by applying an initial penalty to the PointGraph as well, but it would be nice if I would be able to not apply those modifiers at all to the PointGraph.
Also if I would make this area not walkable via the GraphUpdateScene it would also make it not walkable for all Graphs.

StackOverflowException: The requested operation caused a stack overflow.
Pathfinding.BinaryHeap.DecreaseKey (Pathfinding.BinaryHeap+Tuple node, System.UInt16 index) <0x17243b38080 + 0x00026> in <c078dda1266c4ce8b5ecda5bc5e16616>:0
Pathfinding.BinaryHeap.Add (Pathfinding.PathNode node) (at Assets/AstarPathfindingProject/Core/Misc/BinaryHeap.cs:137)
Pathfinding.PointNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/PointNode.cs:76)
Pathfinding.PointNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/PointNode.cs:82)
Pathfinding.PointNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/PointNode.cs:82)
Pathfinding.PointNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/PointNode.cs:82)
Pathfinding.PointNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/PointNode.cs:82)
Pathfinding.PointNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/PointNode.cs:82)
Pathfinding.PointNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/PointNode.cs:82)
Pathfinding.PointNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/PointNode.cs:82)
Pathfinding.PointNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/PointNode.cs:82)

Seems I found a fix for it.

Added possibility to define a GraphMask to GraphUpdateScene and its inspector and set it as NNConstraint in the GraphUpdateObject.

guo.nnConstraint = NNConstraint.Default;
guo.nnConstraint.graphMask = ApplyToGraphs;
1 Like