Isolate one single island of nav in the scene (recast graph)

  • A* version: 5.4.4
  • Unity version: 6000.2.5f1

Hello.

My game relies on the navmesh for several systems like generating patrol routes and finding cover for AI. These systems work under the assumption that the AI can actually get to any point on the navmesh.
When generating on my level, there are hundreds of disparate islands of nav scattered throughout every nook and cranny of the level. Even if I manually tagged all props as unwalkable, there would still be areas with wall crevices or otherwise totally unreachable points that would take hours to manually mark off with volumes.

I only need one interconnected island, and that’s the largest island in the level. How can I make it so there’s only one interconnected island of nav in the level? I bought this asset after spending days writing a BFS flood-fill algorithm to do this with Unity’s system, only to find that you couldn’t actually set the navmesh manually.

Help appreciated. Thanks

Oh, so already tried using the “Min Region Size” property. But this doesn’t work if you have tiles (regions sharing two tiles will always remain), and if I turn off tiles, the entire system breaks! Scanning gives me no navmesh. Very strange.

I think you may want to look into IsPathPossible which you’d have your agents call before committing to a location if there’s no way to access it from where they are.

That’s not the issue! I’m baking a bunch of nodes around the level with the assumption that it can be traversed to. Having nav behind walls would be very inefficient (baking takes lots of comp) and would completely mess up patrol routes!