Is it possible to create a prefab of a room that includes a A* grid graph that has been carefully configured for that room.

Then when placing several of these rooms together merge the multiple grid graphs into one?

If it is possible are there any computational overheads at run-time due to taking this approach?

Thank you

It is not possible to directly store a grid graph on a prefab (ok, it is possible actually, but not in any useful way). See http://arongranberg.com/astar/docs/save-load-graphs.php

Merging of grid graphs is possible, or actually linking of pre-existing grid graphs is possible. There is an unexposed beta feature in gridgenerator.cs, a variable called

autoLinkGrids and autoLinkDistLimit. You can enable those and then when all grid graphs are scanned together, they will link together.

What could hinder your progress however, is that there is a limit on the number of graphs there can be in a scene. I think the limit is 32 graphs currently and this might not be enough for you. I would recommend that you try to get a single grid graph to work for all rooms, it will give you a more seamless world.

The GraphUpdateScene contains a toggle for World Space. If you uncheck it, it will convert the coordinates to local space.

Thank you Aron for your fast response. I set up the tiles so that I could use a single grid graph. However, I also spent ages setting up empty objects with graphUpdateScene script tagging some nodes as cover, light cover etc.

Now putting the prefabs together I have suddenly relised that the x,y,x coordinates marking the area are in global coordinate system. Thus all my carefully prepared node tagging - didn’t help.

So now the question. Is there an easy way to convert the “GraphUpdateScene” points to local coordinates so that I can use them in prefabs to autotag areas?

how embarrassing… Thank you very much Aron