I was thinking about this fact because in this game almost everything can be changed but one of the things that cannot be changed is the AI, as far as I understood only the formations and vaguely the behavior of the strategic AI can be changed but many things are hardcoded, I say this because in the end this could be said that it is an excellent game ruined by an AI that define terrible is little, in fact lately to make the game more balanced I manage almost zero leaving to the AI settlements limiting myself to managing only settlements where the governor is the leader of the faction and doing only battles where he is in charge, this speeds up the campaign, increases the role play and balances the game at the same time increasing also in my faction the stupidity that the AI does, of course it remains to me all the control of the troops in the strategic map and already only this is enough to make the game again enough in my favor, I play with medium difficulty because those high tend to unbalance the fighting, perhaps making the absurdly strong barbarians who can run away my legions creating absurdity just to keep the game balanced, I noticed however that the AI has some advantage anyway even on medium difficulty, the only one I noticed for now it is that the maximum of the troops that her city or army can accommodate is 22 and not 20 then I seem to have read that it has some vague economic bonus but nothing that has to do with the most powerful bonuses that it has at higher difficulties .
In addition in battles I often use the virtual assistant because I blocked the view on the general and therefore it is difficult for me to manage all the troops, in short with these tricks I think I have made the game more balanced even at medium difficulty by increasing the AI errors even in my faction, however, having improved AI thanks to the release of the source code could be great, obviously it is about the release of code to individuals for a fee and not to make the game open source.
RTW2 I have no idea if it has a better AI and unfortunately on my PC it lags too much, already the 1 tends to lag at maximum graphics, the 2 is just unplayable.