Enemy AI grouping too close together when close to the player.

I haven’t tried this with player characters, but what I do when there are many enemy characters attacking a large object like a building, is to calculate locations along the perimeter of the building. Like for example, if it’s a spherical power core that the enemy is trying to destroy, you can calculate points on an imaginary circle along the perimeter. You can then just get a random location from these points and set it as the target location for each enemy unit. You can even go a step further and keep track of locations that have already been assigned, and only assign unoccupied locations to new enemy units. It works quite well for stationary objects, but for a moving object like player character, you’d have to update the enemy target locations dynamically.