the phalanx also has the fact that defenders shoot first on its side, resulting in many attackers getting killed before they can shoot. if the defenders get that, which kind of makes sense, then the attackers deserve something else. i heard an idea of making terrain in outside the fort. a mountain could allow attackers to shoot down into the fort, and a river could provide cover, as well as trees. there could also be cliffs, which prevent the movement of attackers, sort of limiting it. and the terrain of a fort could be random, but it would have to be viewable by potential attackers at all times.Realistically it could / should pick someone else, but the intention of this is only to simulate the ease of hitting someone within the closely-packed group, so it may as well be the person you would normally shoot at - just to keep it as simple as possible but still have the desired overall effect of more shots aimed at that group actually hitting their target every round.
If they don't do something like this (or alternatively, perhaps increase the maximum number of allowed attackers to more realistic odds) then the almost-invulnerable 'phalanx' will simply remain the best / preferred defensive formation, as ludicrous as it clearly is.