When defending, we will want to completely maximize our chances of success against the enemy. To better facilitate this, we will want to generate a concave formation of melee units on a chokepoint, to maximize the ratio of units engaged in the fight in our favor.
In order to generate a concave formation at any chokepoint, we will need:
- to retrieve the BWEM chokepoint data: the ends(sides) of the chokepoint, the center of the chokepoint, and the radius of the chokepoint
- generate a perpendicular line to the chokepoint ends, you can use
BWEB::Map::perpendicularLine
- determine which side of the chokepoint is closer to our area(s) of the map based on the perpendicular line
- generate the arch of walkable areas at the chokepoint where we can place units
This is just a general idea of how this should work. Further research should be done to refine how this should appropriately work.