AI armies

What would be the best way to implement large armies, I want to create something which combines total war and mount and blade style of gameplay so a third person rtt where you can give orders to the AI, i know it will be hard and the optimizing it will be even worse but still I would like to try
The things that came up to my mind were

  • MassEntity/MassAI i tried to make it using the plugin but it seems you can’t create custom tasks in the state trees for mass AI so can’t do it that way or maybe I missed something

  • I know that niagara can help achieve large crowds and armies but are you able to command them e.g. move forward, stop, change formation, and make them fight with each other

  • Treating the whole squad as one actor by duplicating the models and skeletons in blender

only the first row of soldiers would fight while the ones behind them would wait for either death of the ones in front or a near death state and then change with them