Procedural world graphing

Hello,

I’m developing an infinite, procedurally generated world and have been experimenting with A* Pathfinding for navigation - which seems really good and clear so far. The world terrain is generated / loaded at runtime, and the navmesh is calculated similarly. Tiles that hold terrain and other objects are streamed (loaded / unloaded) as the player moves around the world. With this context in mind I’m looking for advice for the recommended / best fitting solution to handle open world tile-based streaming with navmesh calculation on the fly.

So far I’ve tried:

  • Moving procedural grid graph as per one of the examples (too small area / performance impact if larger)
  • Grid graph / layered grid graph per tile (not enough fidelity on navmesh)
  • Recast graph per tile (pathing doesn’t seem to link across recast graphs)
  • One big recast graph (performance is slow, haven’t found a way to do this bit by bit yet)

The best solution I can find on the forum seems to be this: Recast Graph Serialize and Deserialize individual Tiles - #3 by Zaddo.

My questions are:

  • What is the recommended way of doing this?
  • Is one big recast graph better than multiple recast graphs?
  • Assuming yes, what’s the right way to recalculate parts of a recast graph on a per tile basis to avoid frame drops, particular to add new tiles as they are streamed in?

Thanks

Nathan

Hi Nathan,

If you don’t mind sharing, I would be interested in hearing what solution you end up going with, once you make a decision.

There are many ways to do what you want to do. But to test them all, would take a lot of time. The solution I posted has worked out really well for me as it fits my workflow. I am building my world, one terrain tile at a time, including the recast graph. So I can build/test each terrain tile, lock it away and move on to the text tile. Your situation has some similarities, but is different because you are creating the tiles at runtime

Hi

What is the recommended way of doing this?

The only built-in solution for infinite world streaming is the ProceduralGridMover. Recast graphs are probably too slow if your character moves around a reasonable amount (though in the beta version it is faster).

  • Is one big recast graph better than multiple recast graphs?

You should use one big recast, since, as you found out, different recast graphs do not link together.

It’s not currently possible to add tiles to an existing recast graph. It’s probably doable with some code modifications, but right now you can only recalculate existing tiles I’m afraid.

Thanks for the response Aron - for now I’ve gone with a custom solution that uses the equivalent of chunks and cells, which was the only way I could figure out how to do this performantly (not being able to bake any navmesh or anything ahead of time was the real performance killer here)

1 Like