Hello everyone,
I need some advice/ opinions on what combination of pathfinding solutions could I use to approach my problem. I have this setup currently https://imgur.com/a/bJvXDjb . Two armies approach eachother from different parts of the screen, units are about 32x32 but may vary in size. Each unit should approach its closest enemy and take up a free spot and duke it out. Currently the problem comes when multiple units meet up or multiple units on a single unit, they either get stuck, they don't know how to go around eachother, or take a better position. I am using steering + flowfields (but flowfields are useless for my usecase as I don't have a single goal). All units are AI controlled. I've went through 4 iterations of the movement, from pure steering to grid-based movement, to A* to this that I have now. And all of them had the same problem (some of them had more than one) of meeting with the opposing unit and taking a proper place to attack.
Any advice on what I could do to approach this problem would be really appreciated, I am sick of trying something new to see that it fails halfway of what I want it to do. I've seen that SC2 uses boids/ steering for this but I haven't found how they get the units to surround and stuff in more detail. My armies wouldn't be as large, no choke points, everyone is always moving, everything is AI generated so there is no interaction with the player, etc… All of these points do make it a bit simpler but I still need it to be somewhat performant as its happening on the server.
Any additional information I'll be glad to provide. I am writing my own engine tho so any articles/ resources on the details of implementation are greatly apprecited!
Some more videos