Obstackles with non-phisycs-based grid graphs

Hey,

In our game we have a Grid Graph that is generated based on 2D array without colliders using Grid Graph Rules. The rule basically adds a pass that sets nodes walkable based on what data we have in the array. It works great so far, even with the GridGraphMover (we’re using world streaming), however we also have a couple of objects in the world that is not part of the array, but we’d like agents to avoid them. Enabling collision check for the whole graph seems too expensive just for a couple of objects so I’d like to find some approach that let me change walkability of the nodes that are in the objects range (these objects don’t move after being streamed in). I saw the DynamicObstacle class, however if I understood the source code right those are ignored if the collision of the graph is disabled. I’d implement some system (a graph rule I think) where my obstacles can register themselves and the walkability would be set to false to nodes when they are in the range, but before that I wanted to ask: does the asset have any solution for such scenario?

Thanks in advance!

There’s also Navmesh Cutting that may be an option? I haven’t peered at the source code, though, so I can’t say for certain. There’s also tags and GraphUpdateScene that could yield some results. Do any of these seem like possible drop-in solutions for you?

Navmesh cutting won’t work for grid graphs. They only work for navmesh/recast graphs.

I think your best bet, if you don’t want to enable collision checking (which really is not that expensive), is to use a custom grid graph rule.

Gotcha, thanks for the answer!

I actually just wrote up an explainer on gridgraph to pointgraph checks. I dont know your game, but it sounds like you might be using a checkerboard system like I am? If so, converting to pointgraph, or at least checking my post just now might assist.

-Anne

1 Like