Hello,
Is there any way to surpass the limit of 31 graphs? My game uses asynchronous loading. Each scene is 1km square, with most of the area being open terrain. Having graphs cover the entire 1km sq would be a lot of overhead & memory, so only the small towns need graphs. Ideally I would use around 90-100 graphs at any time, each scene having 10+ graphs, and the game will asynchronously load 9 scenes total.
It is possible with some modifications to the scripts.
In the GraphNode class, there is a variable called “Flags”, it consists of lots of values which are bit-packed into a single integer. The graph index is part of that variable.
What you need to do is to change the constants defined in the class to give the graphIndex variable 2 extra bits or something (by reducing some other variable).
I would however recommend that if you have the pro version, try to use a tiled recast graph because it can handle levels that are very large.
Thanks for such a quick response! Couple questions to make sure I understand what I’m doing.
Flags is defined as a uint which is 32 bits, but it seems like the full 32 bits are not even used up yet. Are there any problems using the full 32 bits? I want to resize graphIndex to be size (512-1), increase FlagsAreaMask to even more bits, and then shifting FlagsTagMask (32-1) to use the remaining upper bits 31-27.
Also, what is the FlagsAreaMask actually mean? Is it how many unique triangles or grids are possible on a graph?
Thanks so much for your help, I’m really hoping to use this great asset in our game.
The grid node connections used to be part of that mask and use up the remaining 8 bits. Either I have forgot about some part of the code using those bits now, or they are actually free and I have just forgot to expand other bit packed values to use those bits. If they are really free, thanks for spotting it, that means I can up the cap for some variables.
I’ve done some more testing. As far as I can tell, the full 32 bits are not used. I increased the graphIndex to 9 bits, and FlagsAreaMask to 12 bits. I made a test script that creates 511 recast graphs. Everything seems to work so far. It just takes 12 minutes to scan
Thanks so much!
-Mark