How to make the AI surround it's target instead of piling up?

Hi! I set up an AI that can aggro the player or other NPCs from different factions, my problem is that they just pile up on each other when engaging in combat instead of surrounding their target. I was thinking about a solution in EQS, I tried to generate a circle grid around the target but I don’t know which test should I run to make it work. A simple example or explanation would be very appreciated.