Children at ease with this drama.
Formation should be in 2 ranks, 2 broad categories.
1 Ranged Units
while the cavalry is very flexible with placement because of their mobility but try to keep them together.
when breaking down the categories to more specific units, the first rank should have archer cavalry on the side (scenario 1) lined with the archers for maximum volley damage or archers (scenario 2) on the side with gun men in the middle for secured range.
Behind these should be both swordsmen and anti-cavalry units (halberds and pikemen) that should be defending the ranged units at all times.
When receiving a charge the second rank breaks into 2 more ranks. swordsmen and anti cavalry units
1 Archer Archer Archer ArcherCav
2Pikemen . Halberd . Pikemen
3Swords . Swords . Swords
That way they can counter a charge more flexibly on flanks. more units can move either left or right compared to this diagram showing 2 ranks
Unless you really have to, never use your cavalry in a charge. if they route a bunch of units will panic and route!
-Your Dearest Jay