Detailed areas and not that detailed areas together


I have a large and mostly flat world (static) in which there are buildings with detailed, multi-layered interiors (instantiated at runtime), and I’m wondering what is the best way to achieve good-looking and fast pathfinding.

What I’m exactly doing now is that I have handmade meshes for those “interiors”, then I merge those meshes with the big one covering outside, then I create a recast graph from that big mesh only. (I’m not using navmesh graph beacuse I need navmeshCuts; my implementation needs to have deterministic movement, which I assume RVO lacks)

The problem is that, to have meaningful movement in buildings, the recast graph has to be a little detailed, but this detail level is absolutely redundant for outside.

It’s my understanding that having a single graph that’s covering the whole world is usually better way to go, but that would require a considerable deal of memory in my case. I’m thinking of multiple graphs, where I will have a less detailed recast for outside, and more detailed ones for interiors. When finding a path from “outside” to “inside”, I will query for two paths: one to source to “entrance” of the building, and one from entrance to target, then merge the paths.

Is this how it is supposed to happen? Am I in a correct mindset?



I have been thinking about adding a feature which does something similar. To mark certain tiles in a recast graph as needing higher resolution than some other tiles. I haven’t written that yet however.
Currently I am not sure if there is a very easy way to do it I am afraid.

You can use links to connect the two graphs, but I usually do not recommend that since there are always some edge cases right at the border between the two graphs. And you would have to make sure that they do not overlap at all.

Note that while it may take a long time to calculate the graph for the outside, the memory usage will usually not be that much higher. The final memory usage is proportional to the number of triangles in the mesh, not to the voxel count set in the graph settings (that is only used when calculating the graph).

1 Like