Off-mesh connections with streaming world and portals #768
Unanswered
EvanBalster
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Recast novice with a bit of an advanced question here. 😬 Trying to use Recast/Detour in a game whose setting is a spatial anomaly, but I'm still getting my head around the core concepts. I'm hoping someone more familiar with the library can comment on my plan.
My game is based on a portal renderer, and I plan to use Recast's tiled navmeshes for it. Each chunk (tile) has its own coordinate space centered on the origin. Each chunk has up to four neighbors in a mostly arbitrary topology (eg, West-North and North-West could lead different places, but they are limited to a sort of checkerboard of "even" and "odd" chunks). The graph is based on hash magic a bit like this and functionally infinite (around 2^54 chunks).
I believe I can make a working tiled navmesh by dynamically allocating the tile x/y/layer and corresponding spatial region assigned to each chunk but I'm still studying the details. I gather that I must be careful to keep neighboring tiles within 1 X/Z grid step of one another or off-mesh connections will not work. The main problem I foresee is how to handle off-mesh connections between tiles A and B when they can be loaded and unloaded independently. As far as I can tell, off-mesh connections are defined purely in spatial terms (rather than by reference to a specific polygon). If this is the case, I have to prevent the tiles from overlapping.
So here's my plan:
The dynamic navmesh would end up looking a bit like a skyscraper with one floor per tile, with the portal connections looking like elevators joining the floors together. Pawing through the code, though, I got the impression there may be an upper limit on tile layers or neighbors [32?] which might throw a wrench into things. I could probably double the limit by distributing tiles among four horizontal cells, but any more than that and I wouldn't be able to guarantee adjacency when it's needed...
Beta Was this translation helpful? Give feedback.
All reactions