Pathfinding Solution for a Clash Royale-style RTS Game

Hello. I’m working on an RTS and I’d love your expertise to figure out the best approach for me: should I build my own solution, or is this package the right fit? And if the package is suitable, how should I go about integrating and using it?

To give you an idea, the game is similar to Clash Royale: units move autonomously, the map is small and fixed in size, and each player owns one side.

Requirements:

  • Navigation must be frame-independent so I can time-jump and instantly simulate complete matches using a fixed timestep.
  • Units are circles (three different sizes).
  • Obstacles are rectangles (some rotated 45°) and can be destroyed.
  • When a melee unit is attacking another unit or a building, nearby units should move around it, resulting in melee units naturally surrounding enemy units and buildings.
  • Agents should be able to hold a position, either alone or in a group. While holding, they should step aside to let other units pass. A group holding a narrow passage should not block the way.

How would you implement this system? I’d appreciate as much technical detail as possible — I’ll study whatever is necessary. Thank you.

Bump - I’m still looking for advice on this, any pointers welcome.

There is support for different time scales. Different agents handle it differently. IIRC the FollowerEntity agent handles it the cleanest.

Check :+1: All agent scripts are circle/cylinders

There’s a lot of ways to incorporate this depending on your usecase, such as just having them scanned as obstacles, the NavmeshCut component if you’re using Recast Graphs, GraphUpdateScene– lots of options.

Also supports rescanning and rescanning in specific areas.

This is doable but I wouldn’t call it working “out of the box”. Things like Local Avoidance don’t have a huge concept of “going around towards the objective” but there’s definitely ways of making it happen.

This is doable with Local Avoidance as well– you can give priorities to different units so that they’ll part when another unit wants to get through. I do want to note again, that Local Avoidance is just that: local. It’s not a magic bullet for “avoiding things” but can certainly help with the believability of your units movement/spreading out/getting out of the way.

I think just start with the tried and true RecastGraph and FollowerEntity combo. This getting started page goes over just that. And if you need help we’re always here to get you where you need to be :saluting_face:

1 Like