How to path across multiple gridmaps

Hey,
So checked the docs and forums. Maybe I am missing something. I cannot figure out how to use multiple gridmaps.

My case is simple: I have a 2Kx2K world. I need 1M resolution on my grid. Max grid size is 1K. So i need 4 1K grids. Easy to do.
But no idea how to path across them. I can make some code to do this but assumed there was a built in way.
Let me know if there is a better way to do this.
Yes, i was using nav-meshes (and those work awesome) but for my case i really need cells (mainly for tagging).

Thanks,
Bill.

Hi

The 1024 limit on grid sizes is just an artificial limit. You can remove it in the GridGraph.CalculateDimensions method. These lines:

// Clamp the nodeSize so that the graph is never larger than 1024*1024
nodeSize = Mathf.Max(this.nodeSize, newSize.x/1024F);
nodeSize = Mathf.Max(this.nodeSize, newSize.y/1024F);

However there is a very good reason that there is a limit. Large grid graphs will use a lot of memory. In your case you would need a 2000*2000 grid graph. That’s 4 million nodes. If we would allocate just a single empty object for each node, i.e not storing any additional node information at all, that would use approximately 64 megabytes (16 bytes per object in .Net on a 64 bit system). Additionally you would of course need to store a reference to each node (for example in an array), this would be an additional 32 megabytes. And this is before we even get to the point of storing any pathfinding data. So while you can do this, be aware of potential memory issues.

[quote]Hey Aaron,
Yeah I figured I could do that but would rather have multiple graphs so I can unload if not needed or something. Is there a way to path across multiple paths is what I really want to know. This will help my planning.
Thanks,
Bill. [/quote]
If you want unloading, I’d still recommend keeping only a single graph loaded at a time.
It is possible to get characters to move between different graphs with a small amount of scripting, but in my opinion it is not worth the extra complexity to do so (primarily you can get some edge case behavior when agents are right at the border between two graphs).