Navigating between grid graphs

  • A* version: 5.1.6
  • Unity version: 2022.3.12f1

Hi, I’m working on a RTS-like game with grid graphs where tiles can be loaded at runtime. I’m trying to understand my options for associating a grid graph per tile with paths routing between different tiles.

This is similar to this post Seek path over multiple gridgraph's.

I’ve tried the method suggested in that post, by overlapping grid graphs and I do find that the agent is able to route between graphs but it pauses at the boundary for a few seconds before calculating the path on the new tile. Any insight into what determines the length of that pause?

image
image

Thanks

Hi

I strongly recommend using a single graph.
If you need to move the graph, try out the ProceduralGraphMover component.
See ProceduralGraphMover - A* Pathfinding Project

The agent is probably just pathfinding to the edge of the first graph, and then it randomly becomes slightly closer to the other graph, and starts navigating using that instead.

Hi, thanks for the tip.

I gave the ProceduralGraphMover a try and it seems pretty easy to use. However, I’m trying out a design where the terrain is moving along with the graph. I’m getting the feeling that the agent is confused or that planning is happening in world rather local space.

Would you suggest any particular approach for agents that walk around on moving tiles?

I was hoping to just animate the base transform and synchronize the grid with the tilemap using the ProceduralGraphMover but I’m not sure about the agent.


image

Hi

That’s trickier. There is an example scene called Moving which does that somewhat.

See Recast graph on a moving surface - A* Pathfinding Project