Many a people desire deployable defenses for troops, as you have stated for infantry/ archers vs cavalry, and noted in other posts, for crossbowmen with their massive shields.
I plus +1 this idea wholeheartedly, but struggle to see how a fair system can be implemented so the AI can also make effective use of it.
I am getting sick of fights with Khuzaits and their horses, but changing soldier upgrades to both archer and pikemen have putting them into a circle or square formation been an effective countermeasure, as if a pikeman proceeds to 'lance' a horse, it stops its charge dead in its tracks.
Regards.
Unit_3397