While the forums seem quite divided on a lot of questions in which direction EU4 should go in the future, one point where most people seem to agree is that making the AI more competent, especially in terms of warfare, would be great.
Probably the concern which is voiced most often and loudest on the topic is the AI not engaging in battle but instead fleeing to faraway provinces or using military access through other nations to siege down some of the attackers faraway provinces. As there currently does not seem to be a solution and in a recent thread it was mentioned that also the devs are not sure what causes it.
So I decided to have a look into it:
Not having access to the source code for the AI is obviously a big hindrance but one can still see some of the problems with the AI evaluation mapmode and the AI behaviour governed by the defines.
And I think the threat calculation is what leads to this:
As you can see here Ramazan gets attacked by the Ottomans and is already under siege. Their army has fled as it has nowhere to go because the ottoman armies are far too strong and almost all of Anatolia is considered to dangerous for the 7k stack. But still some of the ottoman provinces in the Balkans are bright green and if Ramazan had mil. access via Crimea they would go around the black sea and try to siege down the Balkans.
Now how does one fix this? In the situation above there really is not much to do for Ramazan as they are simply outclassed and there are no allies in sight, so their behaviour actually makes some sense. The only thing one could do here to script the AI to just ignore the threat or accept a far higher threat if in a desperate situation like this where it cannot win anyway. But this would be up to preference.
The case which is far more severe is when a country which would actually stand some fighting chance just does not engage but just siege races. And especially for larger countries this is where the region assignment algorithm comes into play:
While the threat evaluation takes into account enemy armies in the vicinity of the target province but it has difficulty to take into account the strength of other friendly armies this can be seen in the following example:
Mings 20k stack does not think it can handle the 22k rebel stack and therefore does not engage,
Once the rebels move away the army wants to free the province from occupation,
When they arrived there another ~20k stack has moved there too and together they feel strong enough to attack the rebels.
So what do we learn from this (or maybe already know):
(i) The threat evaluation is very conservative, the first stack could have handled the rebels even with 18 mandate
(ii) If Ming had one bigger army they would have engaged the rebels immediately, which would have been better than relying on the two stacks meeting. While this may have worked out in this case in a war this would be far more problematic as both armies can not go near the enemy alone they often act independently of one another and never meet up. This leads to them permanently dodging the enemy when all that would have been necessary was a bigger stack to begin with which would realize that it is strong enough to confront the enemy and just attack.
(iii) It is interesting that the AI considers the 2 armies combined to be much stronger as we currently have combat width 22 which would have been already filled by the first army and cannons are not yet available. Therefore the other army would just sit uselessly in the back row. The threat evaluation seems to be off here.
That the army of large nations gets split into multiple small stacks which in many cases are below combat width is part of the region assign algorithm introduced some time ago. This also to some degree coincides with players getting the feeling that the AI fights worse. One can easily compare the current system with the old system by changing the defines namely by setting MAX_ARMIES_NEW_REGION_ASSIGN_ALGORITHM to 0.
From my observation the new armies are far better at avoiding attrition and behave a lot more "intelligently" in that regard. But while doing so they also often reduce to smaller stacks which leads to them being scared by enemy armies. In contrast the old assignment is quite stupid and mostly ignores attrition and just doomstacks, but this often turns out to be more effective.
With these observations I find that there are some possible solutions might try to improve the AI in that regard:
If two nations face off where one is only slightly weaker than the other the best place to fight is forts with defensive terrain. Giving the AI a boost to their strength evaluation when going to fight there might be good. (I think to some degree this has already been done but I propose to do this even more),
Investigate if the threat evaluation accounts for all relevant factors (especially combat width),
Make the single armies assigned by the region assignment algorithm larger. If the threat evaluation works correctly the best size would be dependent on combat width. One might need to increase supply limits?,
If the AI is desperately outnumbered try to attach to an allied army. If the AI is alone in the war just suicide on a fort? ( I am not sure about this),
Make the threat evaluation less conservative in general. This should be easy and help vs rebels,
Especially at later techs the AI falls behind because it tends to not have optimal infantry/artillery ration and therefore not a full back line. Try to improve the region assignment algorithm in that regard. Another way of handling this which would have the benefit of reducing late game stack size ( for attrition) would be to reduce the combat width of the back row. This would also be a substantial buff to late game cavalry. (The opinion of someone who is well versed in MP warfare would be highly appreciated)
If anyone is interested using the mapmode to study AI behaviour and comparing the strengths of the new and the old assignment system would probably lead to very useful observations.
As said above I do not have access to the code and therefore cannot say how difficult it would be to implement these relatively concrete ideas. If this were moddable I would be happy to take a look myself on how to implent this.
Probably the concern which is voiced most often and loudest on the topic is the AI not engaging in battle but instead fleeing to faraway provinces or using military access through other nations to siege down some of the attackers faraway provinces. As there currently does not seem to be a solution and in a recent thread it was mentioned that also the devs are not sure what causes it.
So I decided to have a look into it:
Not having access to the source code for the AI is obviously a big hindrance but one can still see some of the problems with the AI evaluation mapmode and the AI behaviour governed by the defines.
And I think the threat calculation is what leads to this:
As you can see here Ramazan gets attacked by the Ottomans and is already under siege. Their army has fled as it has nowhere to go because the ottoman armies are far too strong and almost all of Anatolia is considered to dangerous for the 7k stack. But still some of the ottoman provinces in the Balkans are bright green and if Ramazan had mil. access via Crimea they would go around the black sea and try to siege down the Balkans.
Now how does one fix this? In the situation above there really is not much to do for Ramazan as they are simply outclassed and there are no allies in sight, so their behaviour actually makes some sense. The only thing one could do here to script the AI to just ignore the threat or accept a far higher threat if in a desperate situation like this where it cannot win anyway. But this would be up to preference.
The case which is far more severe is when a country which would actually stand some fighting chance just does not engage but just siege races. And especially for larger countries this is where the region assignment algorithm comes into play:
While the threat evaluation takes into account enemy armies in the vicinity of the target province but it has difficulty to take into account the strength of other friendly armies this can be seen in the following example:
Mings 20k stack does not think it can handle the 22k rebel stack and therefore does not engage,
Once the rebels move away the army wants to free the province from occupation,
When they arrived there another ~20k stack has moved there too and together they feel strong enough to attack the rebels.
So what do we learn from this (or maybe already know):
(i) The threat evaluation is very conservative, the first stack could have handled the rebels even with 18 mandate
(ii) If Ming had one bigger army they would have engaged the rebels immediately, which would have been better than relying on the two stacks meeting. While this may have worked out in this case in a war this would be far more problematic as both armies can not go near the enemy alone they often act independently of one another and never meet up. This leads to them permanently dodging the enemy when all that would have been necessary was a bigger stack to begin with which would realize that it is strong enough to confront the enemy and just attack.
(iii) It is interesting that the AI considers the 2 armies combined to be much stronger as we currently have combat width 22 which would have been already filled by the first army and cannons are not yet available. Therefore the other army would just sit uselessly in the back row. The threat evaluation seems to be off here.
That the army of large nations gets split into multiple small stacks which in many cases are below combat width is part of the region assign algorithm introduced some time ago. This also to some degree coincides with players getting the feeling that the AI fights worse. One can easily compare the current system with the old system by changing the defines namely by setting MAX_ARMIES_NEW_REGION_ASSIGN_ALGORITHM to 0.
From my observation the new armies are far better at avoiding attrition and behave a lot more "intelligently" in that regard. But while doing so they also often reduce to smaller stacks which leads to them being scared by enemy armies. In contrast the old assignment is quite stupid and mostly ignores attrition and just doomstacks, but this often turns out to be more effective.
With these observations I find that there are some possible solutions might try to improve the AI in that regard:
If two nations face off where one is only slightly weaker than the other the best place to fight is forts with defensive terrain. Giving the AI a boost to their strength evaluation when going to fight there might be good. (I think to some degree this has already been done but I propose to do this even more),
Investigate if the threat evaluation accounts for all relevant factors (especially combat width),
Make the single armies assigned by the region assignment algorithm larger. If the threat evaluation works correctly the best size would be dependent on combat width. One might need to increase supply limits?,
If the AI is desperately outnumbered try to attach to an allied army. If the AI is alone in the war just suicide on a fort? ( I am not sure about this),
Make the threat evaluation less conservative in general. This should be easy and help vs rebels,
Especially at later techs the AI falls behind because it tends to not have optimal infantry/artillery ration and therefore not a full back line. Try to improve the region assignment algorithm in that regard. Another way of handling this which would have the benefit of reducing late game stack size ( for attrition) would be to reduce the combat width of the back row. This would also be a substantial buff to late game cavalry. (The opinion of someone who is well versed in MP warfare would be highly appreciated)
If anyone is interested using the mapmode to study AI behaviour and comparing the strengths of the new and the old assignment system would probably lead to very useful observations.
As said above I do not have access to the code and therefore cannot say how difficult it would be to implement these relatively concrete ideas. If this were moddable I would be happy to take a look myself on how to implent this.
- 1