Pathfinding with multiple GridGraphs and UNET

Hey,
I tried to convert the working System I wrote to an UNET Based scene.

The Idea I had was to let each player Calculate the NPC´s in their Range so the Host dont have to calculate all the npcs in the Open World Map.

Since it seems UNET does not support to sync the NPC´s position from non Server clients I have to change the way I thought and have to calculate it on the host.

But I still dont want to make a very large grid cause this would cost to much ressources.
Now I thought it would might be possible to have f.e. 4 Grids where each of them is synced with the players position.

Well I checked out the script for the moving grid. But how would it possible to assign a specific grid to a transform and then the next to another?

Hi

The ProceduralGridMover script selects which graph to use in the Start method

graph = AstarPath.active.astarData.gridGraph;

That will just select the first graph in the scene, you can change it to select another graph like

graph = AstarPath.active.astarData.graphs[graphIndexHere] as GridGraph;

Note that updating the nodes for a moderately sized grid graph is not free, and when updating 4 of them you may see some lag. I am not sure if this is running on the server (where it wouldn’t matter that much) or on a player’s computer (where it would matter).