LOD grids for huge procedural worlds

I have a game in the making. And that game has huge procedurally generated worlds, with buildings that have multiple floors.
I have enemies from a pretty big area that needs to target and pathfind to the player.

The paths don’t need to be accurate. They are zombies in a city. But they do need to be able to walk up stairs of the building the player is in.

My issue:
Only option is using the Procedural Grid Mover to move a Layered Grid Graph around the player. Everything else is too slow for runtime.
The Layered Grid Graph needs to have a grid size of about 2.5 to make stairs work, making it too expensive to fill the rendered approx. 300x300 world. (1 unit = 1 meter)

I have seen you recommend NOT using multiple grids, but I feel like I have to ask again, as I don’t see any other options. Would it be a bad idea to switch between multiple grids depending on a Seekers distance to their target, like a LOD system?

One high res grid for enemies close to player.
One med res grid for enemies far awar.
One low res grid for enemies even further away.
All using the Procedural Grid Mover following the player.

If you have any other ideas, I’d love to hear them.

(I bought this pathfinding system specifically for this purpose. I’m eager for a solution)

City Grid layout looks like this

1 Like


I recommend going with a single large recast graph. And use the beta version to get improved scanning performance.

Oh, maybe I didn’t make myself clear.
If the player moves to the end of the world, new world will be generated.
So the grid will have to be expanded/reloaded up to multiple times a minute, if one grid was to cover everything.

From my testing, it would take about half of the playable time, just to wait for recast graphs loading.

And with the Recast Graph being completely static, with no option of adding new tiles to the existing graph data, I don’t know how that would be possible. (At least very ineffective)

Ah, I see.

Well, in the beta version, the ProceduralGraphMover actually works with the recast graph too. Depending on your game, it could work better.

If you really want a type of LOD system, you could have one high res grid and one low res grid, and then change which graph the agent uses depending on the distance from the player. You can change this on the seeker component.

Thank you so much, that’s perfect!
How do I get the beta?
On the unity asset store page, you say a big release is coming in the next couple months. Are these features included, and is it worth waiting, to not have to remake the whole system?

You can get the beta here: A* Pathfinding Project

The release that is coming is essentially the beta version, but slightly more polished.