AI avoidance converging on the same target

Hello! I looked through the forums and there’s a lot of stuff about AI with avoidance, but they don’t seem to fall into what I’m about to show you:


using Seeker, AI Path, Simple Smooth Modifier, RVO Controller, Funnel Modifier, Grid graph and the method 'AIPath,SearchPath() to get a point to the target

They all have the constrain inside graph checked on and they all avoid each other, but man do they suck at it. All the beetles want to attack the turret from the same point, so they’re all trying to converge onto one node. Very often, one gets to attack its target while the others hover around it trying to get a shot at it, rarely settling near the target and attacking it. In most cases, they behave like in the vid.

How can that behavior be avoided? I would think the solution would be to NOT return a path if another agent is already on the end node(s for bigger AI like the beetles) occupying it(or heading there), so instead it should head to the next closest valid node to the target. No idea how to do that though :frowning:

Hi

What many games do for this is to keep a circle of ‘attack points’ around each opponent. For example 6 points in a circle. When a unit wants to attack an enemy it reserves the closest attack point to make sure no other unit will try to take up the same spot, and finally it moves towards that attack point. The next unit to try to attack the same enemy will have to go for another attack point that is not already reserved. This is a relatively easy way to make the agents cooperate and surround the enemy relatively well. You may want to disable the local avoidance between agents that have reached their attack points though, to allow other units to reach their attack points.

That sounds like a very good idea, thanks a lot!