• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Europa Universalis IV - Development Diary 25th of January 2022

Hello folks, Gnivom here.

Today I’ll talk about some of the many AI updates coming in the next patch, 1.33. At the end I’ll also mention some minor but impactful changes to the rules of land combat.

Our last major update, we shipped some AI improvements, but a few new issues slipped through as well. Two of those in particular (advisors and forts) were too complex to make it into any of the hotfixes. For 1.33, we have not only addressed those issues, but done a range of further AI fixes/improvements as well. Because of the large number of changes, some new AI issues will probably slip through this time as well. Our goal is to have a public beta for 1.33, which could help a lot with early feedback and time to address it before the final release.

Forts

The issue introduced (or at least worsened) in 1.32 was that the AI deletes many of its forts, and seldom builds new. This was likely triggered by changes we did to tighten the AI’s budget, as it had had serious budget issues for a number of versions before that. Clearly we couldn't just revert the changes blindly. Instead I wanted to dig deeper and fix underlying issues with the AI's handling of forts.

For example, there has for a long time been a bug that caused large countries to only build level 2 forts. In simplified terms: When the AI "defense minister" considered upgrading a fort, it wanted to make sure it could afford upgrading all its forts to the same level, or it would only upgrade to a lower level. So it asked the AI "finance minister" if it can afford maintaining e.g. 10 level 4 forts, but the finance minister says no, reasoning that "you shouldn't need this much money for building one fort". So the AI was in a stalemate, where it could only build the lowest level of forts.

Another issue was fort mothballing. The AI would often mothball forts in a way that allowed players to blitz them.

The result after spending some time with this is an AI that seldom deletes any forts, often upgrades forts to higher levels, sometimes builds new forts (especially in strategic locations with good terrain), and is much more careful/intelligent with mothballing. Of course, the AI will still delete forts it really can't afford (such as QQ at game start), and it doesn't have human-level tactical or strategic understanding of fort positioning. But overall, I hope you will find it a big improvement :).

ai_forts.png

(All of these are level 8 forts, in an 1821 AI-only game. Maybe it’s a bit front-heavy…)

Advisors

In 1.32 the AI rarely hires advisors, and often fires them as soon as they're at war. This too was the result of code intended to tighten the budget. Like with forts though, it turned out that there were other issues worsening the problem.

One such bug was that when deciding which mana it needed the most, two of them could tie for first place - causing the AI to pick the third (worst) type instead. This made the AI hire diplo advisors way too often. Another obscure bug was that if it took the AI too long to save up the money for the initial advisor cost, it could lose track of it, making the money "earmarked" but ever used.

In 1.33, the AI will usually keep a reasonable amount of advisors, often prioritizing military or admin. A reworked threshold system makes it not hire-and-fire advisors frivolously. AIs with Meritocracy will realize the importance of having enough advisors to keep it growing. With these improvements, and considering how it stacks with some Monuments and Estate Privileges, we've decided to remove the -20% Advisor Cost modifier for Lucky Nations. Most of them are doing more than fine.

Other budgeting

Other areas where the AI sometimes didn't spend enough include colonists and missionaries. Colonial Nations and AIs with Colonialist personality in particular will spend a larger amount on colonization. One neat addition is that Colonial Nation subjects will now direct all received subsidies towards colonization, in addition to what they would otherwise have spent, unless they have loans. This lets their overlord (or anyone else ;)) make sure they put their colonists to work.

Peace-time armies are now also a greater priority for small nations, especially for those without powerful allies/guarantors. You should find for example uniting Ireland to be more challenging.

Now of course you may wonder, if all these things get more spending, won't the AI go into debt spirals again? It turns out there were a couple of places where spending could be cut:
- Drilling armies: The AI now only does this only if it has a large budget surplus
- Corruption: Sometimes it makes sense to get "free money" for corruption, but the AI overused that, and then found itself rooting it out at several times the cost.
- Navy Force Limit: It makes sense for some AIs to go above Naval FL, but this has been reduced somewhat.
- Consolidate Regiments: When the AI finds itself with troops it doesn't need at the moment, usually after a war or a battle with rebels, it will consolidate regiments.
- Fort maintenance: Wait, didn't I say the AI is better at maintaining, building and upgrading forts? Sure. But in some cases, in particular poor OPMs with an expensive capital fort, mothballing it really can be worth it.
- Inflation: By giving a higher prio to reducing inflation, many AIs reduce all expenses by several percent.

If these measures are not enough, when the AI goes into longterm deficits and debt, it will implement progressive austerity measures. Firing advisors, reducing army size, and even deleting forts. As far as I've observed, this only happens during/after severe crises, and works fairly well.

The budget is also significantly helped by increased crownland, which we'll get to later.

eth_economy.png

(16’th century Ethiopian budget, recouping after an expensive war. They’ll soon lower army maintenance and mothball a couple of forts to get a better surplus)

Monarch Power (mana)

At release of 1.32, there was a major issue with AI mana spending, causing the AI to often fall behind in tech and/or ideas. This was made worse by how it interacted with the new institution tech cost, and by the issues with advisors mentioned above. Although a hotfix was issued including a fix to the main issue, we've spent more time looking at the AI's mana economy. The AI now:
- better understands when to buy tech vs. ideas vs. other things.
- uses more advisors (as mentioned before).
- uses Estate Privileges for free mana.
- better understands when to prioritize a certain mana, in terms of National Focus, Advisors, and Estate Privileges.

It also turns out that if you play a Republic, and especially with Plutocratic ideas, choosing randomly between the event options of those events can cause you to spend a majority of your ADM on boosting stability. We've gone through many of the events affecting Stability and/or Republican Tradition, and made the AI pick the better/safer option.
Estates

When the Estates system was last redesigned, AI was written to interact with it. But that AI wasn't necessarily written/tested too carefully, and years of design changes and lack of proper attention have made it worse.
It turns out that by making the AI play a fairly simple estates meta, but play it consistently, it gets quite a nice set of bonuses; from tax income and autonomy reduction, to mana; at very small cost.
The AI will:
- Seize Land even when it causes revolts (but only after maintaining troops and forts)
- Occasionally Call Diet to temporarily increase Loyalty, although it doesn't usually try to complete it
- Prioritize Privileges that give loyalty and mana
- Sell Titles only when crownland is high and/or the money is badly needed

Naval Invasions

1.32 saw some fixes in this area. 1.33 will have a couple of further small improvements/fixes that should reduce friction for multi-continent empires in particular. For example:
- Armies that have nothing to do are less likely to refuse an invasion mission
- Invasions will no longer wait for faraway ships to help out, unless they are necessary

In one game, I actually saw AI Portugal conquering a third of India by 1700 or so, while also having colonies in the Americas and Africa. But in fairness, that is not a common sight. AI naval invasions will remain an Achilles’ heel.

Army Quality

This is a major one. And huge thanks to @Tempscire, who has helped me with running simulations, with mathematical analysis, and schooling me on how EU4 land combat actually works.

The question the AI is trying to answer here is whether to start a battle, or even a war. To do so, it must estimate the quality of troops. Basically: how many Swedish soldiers does it take to equal 1 Prussian soldier? Until 1.32, the AI did this by applying a series of modifiers, based on Discipline, Morale, etc., that were tuned on gut feeling. From 1.33 (and somewhat already from 1.32) we have proper math and simulations to back them up.

The AI now appreciates the value of morale more than before. It understands how a general’s impact on a battle depends on the terrain. It understands the interplay between e.g. Infantry Fire, Fire Pips of the Unit Type, Fire Damage, and Infantry Combat Ability. It also understands combat width and flanking, but it doesn’t yet understand army composition between infantry/cavalry/artillery. That is definitely something to continue working on.

With this improved confidence in its understanding of army strength, the AI’s safety margin for starting attacks has been reduced somewhat. It has also been made more aware of nearby armies on both sides. You will find the AI starting more winning battles, and hopefully fewer losing battles. Although the reduced safety margin combined with bad understanding of army composition can make the AI fail in this regard.

Changes to Land Combat

The thought that went into the army quality AI made us realize (again, with @tempscire’s guidance) we should change some things about how combat works. As mentioned in last week’s DD; Unit Type Fire and Shock pips now affect morale damage as well strength damage. This makes the choice between Unit Types less imbalanced. Contrary to what was said last week, and in part because of feedback on that post, this will also apply to morale defense from backrow. The fact that this makes artillery more powerful and battles longer is counteracted by some more important changes we decided to do:
  • Infantry and Cavalry can no longer deploy/reinforce to the backrow.
  • Backrow regiments will now retreat when reaching 0% morale (same as frontrow regiments).
  • Constant 0.03 morale damage per day is now only applied to reserves, and not to regiments on the battlefield.

I’m sure many of you (just as myself not too long ago) do not understand how this affects the combat meta in practice. Without making this DD much longer than it already is, some important effects are:
  • It’s no longer critically important to have a full combat width of artillery in the battle on day 1.
  • An army of 2x combat width infantry is now superior to an army of 1x combat width infantry. Previously they were roughly equal.
  • You’ll need more artillery than just the combat width to last a long battle.


That’s it for this week, hope you’re as excited for 1.33 as I am!
Next week @Pavía will make a Dev Diary on the subject of “Script Debt”.

Thanks again to @Tempscire, but also to @xorme whose AI mod inspired some of the improvements. And thanks to everyone who provides great feedback on this forum and elsewhere!

Oh, and here is a full list of AI-related changes from the in-progress changelog:

- Fixed Celestial Emperor advisor budgeting issue.
- Rewrote AI savings logic.
- Colonial nations spend more money on colonists.
- Increased AI minimum colonization budget.
- Reworked AI fort mothballing forts.
- Fixed issue that AIs in debt didn't convert provinces.
- Made AI consider flanking.
- AI better understands importance of generals' pips.
- AI now considers units' drill before starting a battle.
- Fixed bug where AI thought 'coordinated attack' and instead sent individual armies to die.
- Fixed multiple issues with scripted ai_army, one of which made it not work at all. It can now also be debugged with the 'mapmode armyeval' command.
- The AI now makes smarter decisions regarding Patriarchal Authority in events.
- AI better at consolidating regiments before battle.
- AI can now declare wars when overextension is up to 50% (previously 25%), but only if already coring everything.
- AI considers nearby units more when considering a battle.
- AI will now seize land from estates more often, but raise army/fort maintenance.
- Added AI priority to a few conquest missions of France and the Ottomans in order to ensure them prioritizing their missions.
- Better at taking home troops overseas (instead of disbanding).
- Build a bit more universities.
- Made AI Care about beijing, nanjing, canton for mandate.
- Made AI Care about corruption for mandate.
- Celestial Emperor more aggressive towards countries that refuse to pay tribute.
- Colonial Nations without debt are now likely to spend all subsidies they get on colonists.
- Colonial subjects will care more about wars against countries in their colonial region.
- Coordinated offensives will now focus on committed sieges.
- Fixed AI army ignoring terrain for some threat evaluation.
- Fixed bug that AI sometimes ignored armies with insufficient troops for siege.
- Fixed bug that caused exiled armies to behave erratically.
- Fixed bug that made AI less afraid of non-rebel armies, when it should be rebel armies.
- Fixed bug that made AI not declare easy wars as often.
- Fixed bug that made colonial nations not colonize islands in their own colonial region.
- Fixed issue where armies would refuse to do things nearby, because it was assigned to a region far away.
- Fixed issue with colonists not being recalled when they should be.
- Fixed issues sometimes preventing AI upgrading forts to higher level.
- Fixed issues with colonial budgeting (causing bankruptcy spirals).
- Fixed that autonomous sieging could go back and forth between provinces that were flipped back by a fort.
- Improved AI understanding of native uprising risks (less africans getting stackwiped taking a shortcut).
- Improved AI handling of estate privileges.
- Improved army quality calculations.
- Improved handling of corruption.
- Improved handling of inflation.
- Improved logic for where to build forts.
- Improved national focus (mana) handling.
- Improved the AI decision making for Orthodox events.
- Increased budget priority for saving money.
- Made AI less eager to demand return core treaty unless it likes the benefactor.
- Made AI less eager to go over naval forcelimit.
- Made AI less likely to mothball forts when risky.
- Lowered AI priority on building great projects over other buildings.
- Lowered AI safety margin when attacking to compensate for other fixes.
- Made AI aware of risk of rebels spawning in a province.
- Made AI chase your small armies in more cases.
- Made all chinese countries want to conquer the 3 Mandate cities, if they have 1 already.
- Made AI armies which are afraid of enemies, prefer safe terrain even more.
- Made AI more likely to enforce rebel demands (peace treaty) in the rare case that it can do so.
- Made AI more likely to promote cultures (with large development).
- Reduced maximum budget for subsidies to 10% of income.
- Several fixes and improvements regarding advisors.
- Somewhat more competent at naval invasions for large empires.
- Subjects with loans will keep a standing army again (although it will be small).
- The Ethopian AI will no longer move its capital while being at war.
- Tweaked AI siege priorities.
- Very small countries with scary neighbors will now keep a larger army when at peace.
- Made AI less likely to split armies in threatening places.
- Made AI more happy to hunt nearby armies.
- Army AI only takes its own armies on fleets.
- Fixed small AIs militarizing also when Rights of Man DLC disabled.
- Improved Strong Duchies AI.
- AI can handle reassigning merchants.
- AI no longer sells provinces to charter cheaply, and added new malus for presence of great projects in the province too.
- AI no longer uses pillage capital state when it has nothing to gain from it.
 
Last edited:
  • 126Like
  • 59Love
  • 13
  • 5
  • 2
  • 1Haha
Reactions:
  • 7Like
  • 5Haha
  • 5
  • 1
Reactions:
That would make colonising garbage compared to trade companies.
no not really, u get over 50 base force limit from mexico for example that is too much, colonies also where worse compared to colonies in the beginning, the colonisation of the americas also needed to happen because the native died to the plagues brought in through the europeans, I think limiting the force limit buff to ten for crown colonies 5 for the others would be just fine. U still get the trade and later the nation will build manufactories for u for free. The trade gain is the biggest bon. Gold pays for war.
 
  • 1
Reactions:
Maybe ive missed something but if we remove the daily .03 morale hit to all deployed units, wouldnt that mean that artillery (assuming you keep enough infantry in the front line) never take morale damage and would thus not retreat (unless you mistime your reinforcements with infantry and the artillery wind up on the front line taking damage)
 
  • 1
Reactions:
Maybe ive missed something but if we remove the daily .03 morale hit to all deployed units, wouldnt that mean that artillery (assuming you keep enough infantry in the front line) never take morale damage and would thus not retreat (unless you mistime your reinforcements with infantry and the artillery wind up on the front line taking damage)
Cannons do take moral damage but it never mattered since they still do their damage even at 0 moral and never retreated.
 
  • 3
  • 1
Reactions:
Are there any plans to change how cannons are deployed? Currently if you have more cannons than entire enemy cav+inf, those extra cannons will be put to your frontline position to flank, preventing your inf/cav from taking that position, even opposite to enemy cannons in the frontline, and it can be disasterous if the enemy reinforces.
 
This... ain't it, chief.
>backrow artillery will now take regular morale damage from the front and will retreat
Do I need to spell out why this isn't a good change?
>An army of 2x combat width infantry is now superior to an army of 1x combat width infantry. Previously they were roughly equal.
No skill involved in land battles anymore, you don't even have to stagger troops... just doomstack!
Can anyone explain how this could possibly be a positive change?
> - Previously the main reason for having artillery was to make sure your inf and cav didn't go into the backrow. Now they won't do that anyway, so the main reason is the firepower they bring
The DEVS don't think that artillery does damage?
Yup, definitely, every time I've bought artillery it was only to make sure my units didn't get sent to the backrow!
> - Note that artillery would previously stop firing after reaching 0 morale, so it would just stand there.
Immediately proved wrong on Page 4 https://forum.paradoxplaza.com/foru...ary-25th-of-january-2022.1507905/page-4#posts
Re-read the front part of the dev diary, you talked to another dev that's an "expert" on the battle system and "knows" how everything works, but that dumb change that's completely incorrect got through?
I pray you guys aren't the ones working on EU V lmao
 
Last edited by a moderator:
  • 14
  • 9
  • 1Like
Reactions:
If
no not really, u get over 50 base force limit from mexico for example that is too much, colonies also where worse compared to colonies in the beginning, the colonisation of the americas also needed to happen because the native died to the plagues brought in through the europeans, I think limiting the force limit buff to ten for crown colonies 5 for the others would be just fine. U still get the trade and later the nation will build manufactories for u for free. The trade gain is the biggest bon. Gold pays for war.
well before the Force limit bonus in leviathan was added everyone was complaining that colonial nations are too weak. Now they say they’re too strong?

I think an easy way to fix it is that you steal your colonial nations force limit instead of it just being added to you without taking anything From the colony. Then it would be more like a vassal so more balanced

EDIT: a major problem I see is that trade companies are just busted OP with their investments and tolerance, so colonial nations have to be strong to compensate. they could always change it to 25% of force limit instead of 50%, but buff tariffs so they’re no longer halved for no reason. Then it would be on par with trade companies still. otherwise it would mean everyone would just colonise Indonesia and Africa instead of the americas
 
Last edited:
  • 2
  • 1
Reactions:
Not really. If the AI doesn't think it stands a chance, it won't suicide attack, nor will it stand its ground if that means getting killed. I personally don't see this as an AI issue really, but more an issue with military access and (lack of) attrition.
Fix this and I swear I'll never say anything bad about EUIV ever again. This is what I need to come back to this game.
 
  • 1Like
Reactions:
I am worried that this changes makes the battle just throw all to 1 battle and hope you win. with this changes you have to worry about additional cannons in the battle, instead of using the cannons to make other stacks and try to cut the reinforcements for the main battle, this is something that happen alot in multiplayer games and make the wars very fun and not just granting the winning to the stronger side.

Other thing that make me worry. is that if "Backrow regiments will now retreat when reaching 0% morale (same as frontrow regiments)." so backrow receive the some moral damage that the front line, so that means we will need a 1/1 ratio in cannons and infantry this is going to favor a lot the rich countrys that can afford that ratio. Also it promotes retreating the cannons. with no casualties but no moral from the battle and wait the month ticket outside the battle and rejoin. Considering how expensive cannons are compared to infantry receive some morale damage in the infantry in exchange for "refilling" the cannons moral is probably profit

The only benefit i can see with this changes is that this may help the IA "meta" of throwing all to the battle and hope he wins. but sice you will need more cannons and the IA will allways be worst in economy compare a good player it will end up losing any ways

I think the way to solve this is instead of the backrow receiving the some moral damage that the front line. The backrow receives only 1/4 of the frontline so you will need only 1 cannon per 4 infantry instead of the 1/1 ratio that you are promoting at the moment
 
  • 11Like
Reactions:
Nice AI changes, it's good to see the AI improving and some major bugs about them getting fixed. Hopefully it makes AI more of challenge. Continue the good work.
I do like the new combat changes, especially the infantry/cav not deploying on the back row.
But the fact artillery will retreat automatically and now we need to reinforce the battle with artillery is eeeh. It does make sense but it reinforces the reinforce meta (no pun intended). We should discourage the reinforce meta, not encourage it.
What Im trying to say is, it's reasonable to artillery to be retreat when it reaches 0 moral, but it's not fine that the game encourages us timing when infantry and now artillery reinforcements should enter the battle. Because otherwise they would take moral damage while being in reserve doing nothing.
New players and AI already get abused by the reinforce meta, both in SP and MP. Personally I find it hard to understand why do troops take moral damage in reserve.
If it's to discourage mass flooding into 1 battle it didn't work, people still flood 1 battle but instead they time their reinforcement by milliseconds to win battles.
If it to discourage deathstacks it does work to a certain point, still it's a bad mechanic to counter deathstacking since it doesn't always work, it should be attrition (like in hoi4) that should discourage big deathstacking. But oh well, attrition is capped at 5% so its pretty irrelevant until the cap is changed in some way.
If it's to allows players to beat bigger armies, because they timed their reinforcements well, a "measurement of skill". It's lame, it's just people abusing the AI because the AI doesn't know how to time their reinforcements...so we have people beating AI grand coallations with 5x their numbers that should be impossible by using reinforce meta (instead of picking strategic battles etc). Needles to say it also doesn't make much sense.
I suggest removing moral damage of being in reserve. All moral damage received in reserve should be removed, like hoi4. Use attrition as a more balancing mechanic. It's probably an unpopular thing to do (especially in MP community), but there are better ways to measure skills in eu4, better ways for weak nations to stand up agaisnt stronger foes (like alliances and attrition in terrain etc) than just how well you play a flappy bird game of timing troops into 1 battle or more.
 
  • 4
  • 2
  • 1
Reactions:
Fix this and I swear I'll never say anything bad about EUIV ever again. This is what I need to come back to this game.
Yeah, this is all the more reason to fix the attrition issue, which is effectively just a massive nerf for nations like Russia, Switzerland, and Ethiopia for which enemy attrition should be a major part of the strategy. And yes, plus we get silly things like the AI sending a 3k stack on a tour of the Sahara instead of trying to regroup in a more defensible position when it's outnumbered.

What would make sense to me is either a modest global buff to manpower recovery to offset an increase in attrition, or a global nerf to reinforce speed. It would require pretty much a total rework to implement actual supply lines in the game, but either of those ought to cut down on the wild unrealism of 1-3k armies being able to gallivant around Lapland as a legitimate strategy to keep from being stackwiped or armies from simply being able to march through the Alps virtually unscathed (and the AI ought to avoid crossing through terrain that gives high attrition unless it can't be avoided).
 
  • 3
Reactions:
Not really. If the AI doesn't think it stands a chance, it won't suicide attack, nor will it stand its ground if that means getting killed. I personally don't see this as an AI issue really, but more an issue with military access and (lack of) attrition.
Then we NEED heavily increased attrition. An army that marches thousands of kilometres should suffer. Otherwise, the AI is not fit for the way the game is currently designed. If the armies would bleed from moving provinces and need to wait to heal it could also solve the issue of armies running round in circles to dodge you with inhuman reaction times.
 
  • 8
  • 2Like
Reactions:
This may hurt some people but I think the ai has been good enough for a long time.

The only two things that annoy me are when it impacts performance and when the ai wants to do a merry go round chase across the Mediterranean and it doesn't sound like either of those were improved.
 
  • 3Like
  • 3
Reactions:
The only two things that annoy me are when it impacts performance and when the ai wants to do a merry go round chase across the Mediterranean and it doesn't sound like either of those were improved.
Honestly this is my biggest issue with the game. It makes wars tedious and boring. I have played way less because of this, it is so demoralising and demotivating when wars, which should be one of the most fun parts, just feels like a drag.
 
  • 1Like
Reactions:
Something I wish the AI was smarter about was fufilling their own mission trees and forming new nations. Like if AI Brandenberg's had a goal in mind to try and form Prussia, and took steps to fulfill it such as rivaling Poland or converting to protestant/reformed. Then again, that might make things to predictable, but it could be interesting to test out.
 
  • 4Like
Reactions:
I think Russia MT need a rework. They have low count of mission compared to other European great power like austria, gb, spain, france, etc
Totally agree with you. Russian missions are simply to small for such a huge nation. They could add conquest of Caucasus or Central Asia for example.
 
  • 2Like
  • 2
Reactions:
  • An army of 2x combat width infantry is now superior to an army of 1x combat width infantry. Previously they were roughly equal.

In what way, though? You'd still want to feed in extra frontline infantry as appropriate, unless I'm misunderstanding. The only way I can interpret this statement is being true, is if "Infantry and Cavalry can no longer deploy/reinforce to the backrow" is misleading, meaning that infantry/cavalry cannot deploy at all once battle is started and they were not in the battle at the start.

Like the optimal state is to keep your frontline filled with infantry and your backline filled with artillery. So if reinforcing infantry can fill in at the front, what difference is there between the two that this changed?
 
  • 3
Reactions: