RTS Movement - I'm doing it wrong

I’m working on an RTS where units move in groups. If you’ve ever played Age of Empires III, Battle for Middle Earth II or Star Wars: Empire at War, it’s basically like that, except groups can get pretty big (>15 units).

It makes sense to me to calculate pathfinding once for the whole group, then have all the units follow that path. I’ve been having nothing but problems: Units furthest from the group center will get stuck on walls and corners, units bump into each other, the front-most units are actually pushed ahead by the others and get twitchy, and when/if they reach the destination, the entire group degenerates into a mosh pit of tanks trying to get to the center.

I’m sure I’m doing something fundamentally wrong here. Any ideas what the best approach would be for this?

Also, I really don’t want to use stuff from the Asset Store here. My budget is zero and since this project is just a prototype, I need to be able to port my eventual solution to other platforms and languages outside of Unity.

Check out Boids stuff - there’s even a couple of implementations in unity. It’s a flocking algorithm and sounds like it might be what you’re in need of (mass of units all moving to a common point).

Also, could be relevant: Colliders slow for crowds? - Questions & Answers - Unity Discussions

Well, I wound up just using the cohesion part of Boids, while adding a more intelligent pathfinding system that actually follows the path instead of going from waypoint to waypoint :slight_smile: Combined, they create an issue where large groups slow down, but I’ll figure that out eventually.