MOBA-style Pathfinding Question

We’re trying to implement pathfinding like Heroes of the Storm or League. Where:

  • All units path through a map
  • Heroes avoid other heroes smoothly
  • Creeps avoid heroes and other creeps (though clipping is okay)

So far we are looking at a GridGraph with the heroes as a DynamicGridObstacles. And the creeps use RVO.

Is this the right approach? Or is a better method?

Thanks!

Hi

Using dynamic grid obstacles will not work while they are moving of course (they will try to avoid themselves) but you usually only want them to avoid each other when stationary (and maybe use RVO when moving) so I think your approach will work.

Thanks! It’s working so far using just the GridGraph, RVOController & Funnel + Smoothing + custom RVO agent.

My only current issue is that if I place the pathing target inside an invalid location (e.g., a wall marked red by the navmesh), it will still try and path into that area. I’m looking into it and will post if I have any further questions (I’m hoping I just have a setting wrong).

Follow-up question:

Using the GridGraph with mesh colliders to mark out non-navigable area using Height testing, I can still get the agent to path inside the area once the agent starts its move close to the red zone (if the agent starts far from the collision, pathing works properly). The Seeker component is using Closest On node for both Exact Start & End points.

If I change the mesh collider’s layer and use the Collision testing, the bad area is clearly marked with cube gizmos and the agent will no longer path inside the area.

Why is there this difference between height testing and collision testing?

Hi

Height testing changes where the graph thinks the ground is. So for the first case what has likely happened is that the graph has placed walkable nodes on top of those mesh colliders, which the agent will happily used if it gets closer to them than the nodes outside it. When using collision testing it will detect the colliders as obstacles and will never try to use those nodes for pathfinding.

Thanks! That would explain getting closer without actually using them. We switched to the collision-testing only and it works great.