- Home /
How to make 2 groups of agents attack eachother?
I'm working on a small RTS game where I want 2 small armies (100 or so on each side) to be able to fight eachother. The user controls one army whilst the AI controls the other one. I was thinking that the AI would automatically attack when the user gets too close.
I was looking around on how to get this to work, but couldn't find any usefull resources.
Should every agent try to attack the opponent closest to it? That sounds pretty computationally intensive since they would calculate the path (I'm using navmesh) to each other enemy totalling,10.000 paths. I can't use a simple Vector3.Distance since the scene has a lot of obstacles.
Attacking a random one doesn't sound good either. Should I split the region up using a KD-tree? But that would probably run into the same issue that the scene would be too complex.
For now the units are all just easy melee units, does anyone have any tips? Or could anyone point me to some usefull resources?
Thanks!
Your answer
Follow this Question
Related Questions
RTS Grid and Pathfinding 2 Answers
Pathfinding and AI for an RTS game 3 Answers
RTS dynamic formation width and length 0 Answers
Boids/Flocking Tutorial 0 Answers