I figured out a working solution! It’s not the most natural solution, nor performance efficient, and has limitations, but it’s 100% BP. I’m making heavy use of RVOAvoidance, the Avoidance Group, Groups to Avoid, and Groups to Ignore.
To start I made an empty character blueprint. (I called it “BP_AvoidSphereBase”) This BP will be used as the “Avoid area”. Disable all collision in the capsule component. They won’t be necessary:
Check use RVOAvoidance, set Avoidance Weight to 1. The consideration radius will require fine tuning.
Drag the avoid area BP into your enemy BP so they are added as child actor components. Put them at roughly where you want other enemies to avoid when this enemy performs an attack.
Set the enemy BP to also use RVOAvoidance but set Avoidance Weight to 0.
Now we have to set each enemy to use a unique RVO group. This is where the limitation comes in. This system would only work with up to 32 enemies attacking the player simultaneously, as BP only exposes 32 RVO groups. Pawns using the same RVO group will ignore each other’s avoid areas.
Anyways, I use this function to set the RVO groups:
What it does is it’ll ignore it’s own RVO but avoid all other RVO.
The idea is you give each enemy in your level a unique RVO (0-31), then run that function to set the enemy character and their avoid area children character’s character movement component RVO group to that.
For enemies that are spawned in at run time. I’m using this temporary solution until I build a smarter system (BP_MobBase is the parent BP of all enemies in my project):
It finds all actors and their RVO groups, increments until it finds a group that no one is using, and outputs that. If none is found, it returns 31.
So finally, at run time, use the “Set Avoidance Enabled” node to dynamically enable/disable these avoid areas. Play around with the avoidance radius until it suits your needs.
As the avoid areas has no inherit collision, players and enemies can physically walk through them while they are active. Making it possible for enemies to be tricked into hitting each other.
I hope this small guide helps anyone that comes across this!