- Home /
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.
Answer by DallonF · Jun 25, 2011 at 08:04 PM
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 :) Combined, they create an issue where large groups slow down, but I'll figure that out eventually.
Hi DallonF, can you describe how did you solve that problem?
Answer by Chris D · Jun 02, 2011 at 11:23 PM
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: http://answers.unity3d.com/questions/21618/colliders-slow-for-crowds.html
Your answer
Follow this Question
Related Questions
Group Movement (RTS style) using Unity Pro NavMesh 0 Answers
Better Point to Point Movement 2 Answers
Physics based click to move 1 Answer
Racing Ai? long read 1 Answer
Pathfinding and AI for an RTS game 3 Answers