I’m currently messing around with , and I’m not sure what the best approach is; I’m wondering if anyone can offer some insight.
My default enemy character attacks by melee; his AI instructions are a simple “Move To Actor”, followed by an attack. The problem is, if there are many enemies on screen, like 30-40, they all tend to clump into a knot trying to reach the player.
By enabling RVO Avoidance, I can partially solve problem; the first wave of enemies nicely fan out in a circle around the player, each within attacking distance, and rest.
The problem comes with the second wave of enemies; since there is no valid way for these enemies to reach the player, they sort of gently shove their way around the first ring of enemies permanently, and never “sleep” where they’re standing.
My instinct was to mess with stuff like “does path exist” to check for circumstances like … But RVO is path agnostic, and the presence of other enemies doesn’t actually communicate " path is obstructed" to other enemies, so they don’t understand that the player is unreachable.
I also considered using some sort of timer check; i.e. If you are attempting to reach the player and it doesn’t work, simply idle. The problem with is, if the player is simply running around in a way that prevents enemies from ever getting to the player, they’ll eventually give up the chase (determining it to be “impossible”) and just stand around; obviously is not desired.
I tried more complex stuff (i.e. a BT Service that performs a simple sphere overlap check for other nearby enemies and attempts to determine a point away from these actors to move to instead of the actor, so that enemies which are too near other enemies will instead just go somewhere else) but is all not working as expected; the sphere check doesn’t properly follow the actor in question, and often fires very far from the actor’s actual position.
Tutorials are no help here; everyone is keen on demonstrating how to set up good AI for single actors (i.e. patrol, check for ammo, find player, etc) but there’s very little on making multiple actors cooperate in rudimentary fashion (I’m not talking flanking or flushing out or anything like that, just acknowledging when a target is already surrounded and standing still), and what little info is available on crowd navigation seems devoted to “decorative” actors like npc crowds that only exist to be and act like crowds, not using that sort of logic to help a group of enemies behave intelligently.