Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maxTiles value in the navmesh initialization parameters #679

Closed
UltraEngine opened this issue Dec 27, 2023 · 1 comment
Closed

maxTiles value in the navmesh initialization parameters #679

UltraEngine opened this issue Dec 27, 2023 · 1 comment

Comments

@UltraEngine
Copy link

I used this code from the demo to set up my navmesh creation parameters:

int tileBits = NavMesh::rcMin((int)NavMesh::ilog2(NavMesh::nextPow2(tw * th)), 14);
if (tileBits > 14) tileBits = 14;
int polyBits = 22 - tileBits;
params.maxTiles = 1 << tileBits;
params.maxPolys = 1 << polyBits;

int tileBits = rcMin((int)ilog2(nextPow2(tw*th)), 14);

This is resulting in maxTiles equaling 64. Whenever we go over that value, a DT_OUT_OF_MEMORY error is returned by dtnavmesh::addTile. If I don't use the code above, then dtnavmesh->init produces an DT_INVALID_PARAM error.

Does recast allow navmeshes with more than 64 tiles?

@UltraEngine
Copy link
Author

Rubber-ducking wins again. I think in that code, tw and th should be the number of tiles in the X and Z directions of the mesh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant