Europa Universalis IV - Development Diary 19th of July 2022

  • 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.
Showing developer posts only. Show all posts in this thread.
Very nice. The one thing that I would expect to find under AI is the blatant aggression of natives, did you address that? Or is fixing the bug that gives colonized tribal land and unowned cores to a newly formed federation tag enough? It looks like colonizers are succesful again in the overnights, which is good :)
It's not in the patchnotes, which is a mistake. It has been fixed. It can still happen, but waay less common
  • 23Like
  • 7
  • 2
REALLY crucial question. Is the Timruids start going to be taken into account with the change that allows AI to declare independence while at war? Currently one of the most crucial things to do when playing them is to stay at war until youre able to grow strong enough on your own. I worry the change can make unifying as Timurids completely unviable
It was taken into account. Since Cradle of Civilization, Timurids was supposed to be a really hard start. The strategy to stay at war always felt like an exploit (at least to me).
So yes, Timurids will be a lot harder now. But it will definitely be possible.
  • 20Like
  • 7
This change is so great! But is it possible for the natives to become less OP and not eating up my colonial nations the year after I form them? And also, can the colonial nations colonize faster? I'm sick that some of my colonial nations only start colonizing in 1600, which only passes from 5 to 6 provinces!

Anyways, these changes are very useful, can't wait to test them!
Yes to both. Natives won't attack your CNs anymore (at least not like before), and I fixed an issue with AI budgeting that made small-medium sized countries often not send colonists.
  • 8Like
  • 3
  • 2
How will the new AI updates impact forging alliances within a culture group? I am cynically imagining an HRE game where minors will not ally each other due to their desire to each consolidate their culture group.

There should be some sort of balance between AI desiring to ally within their culture group and wanting to consolidate their culture group. Perhaps have this AI behavior change with the Age of Absolutism. As in, during the earlier eras the AI would desire to ally within their culture group and then when Age of Aboslutism hits they switch to domineering towards their culture group. This would also reflect historical realities.

Another option is to make the AI weigh the dev of their culture group vis a vie the dev of the their neighboring non-culture group. Is our culture group higher dev than the threat next door? Consolidate our culture group. Is the threat next door more powerful than us? Time to ally-up.
This is an important point.
The desire for same-culture provinces is only on "province of interest" (yellow) level, never "vital interest" (red). This basically means the AI will happily take it in a peace deal if it can, but it will not directly create hostility. It can indirectly create some hostility by making the AI create a claim on the province, but that effect is barely noticeable in my experience.
  • 14
  • 1Like
Is there any easy local workaround for this bug? E.g. change some files, or at least know beforehand how many subsidies are needed.
The issue is that the AI in a sense gets "addicted to" its budget surplus, and then doesn't want to cut it. So to force them to start colonizing, you need to bump their surplus by more than the cost of a colonist from one budget evaluation to the next (every couple of months). If you raise subsidies (or their economy grows) slowly, they will just get accustomed to a higher surplus.

So: give them a huge subsidy (let's say 5 ducats just to be sure) for a couple of months to start them colonizing. Then you can remove the subsidy and they will most likely keep colonizing. There's a small chance you have to redo it after the colony is done, but usually they'll keep going with a new colony.

Just to clarify: this is a workaround for 1.33. Whereas 1.34 fixes the bug.
  • 19
  • 2Like
  • 1Haha
In one of the earlier dev diaries for 1.34 was mentioned that performance improvements will be worked on, any info on this?
We have worked a bit on performance, with some significant improvements. But it's the kind of thing that easily worsens by itself as more code and script is added, so we don't normally want to make any claims on how much it's improved until we're closer to release.
But it's definitely something we have worked on and continually keep in mind.

EDIT: Actually, one thing I probably can say is that we fixed a freeze (up to several minutes) when a huge war starts. Try to get 100+ countries into a coalition against you and you'll see what I mean. For the Computer Science minded, the complexity was O(N^5).
Last edited:
  • 12Like
  • 6Haha
  • 4Love
Will the AI changes fix the issue where allies just hang out in their own lands and not engage the enemy? This was a major problem in 1.33.
Yes, that's the bug I mentioned where they get stuck on the coast.

How do the AI changes interface with setting objectives for your allies? How does the AI balance following an objective you set for it with its own AI logic/desires?
The army AI uses a utility function over the set of provinces. The objective simply adds a bias utility to a province.
Everyone's heard of accidentally quadratic, but accidentally quintic is pretty impressive!
For each country being added to the war (1), each country already in the war (2) updated its relations with every other country in the war (3).
A "updating its relations with" B includes, among other things, counting the number of war enemies they have in common; which was unfortunately done by doing a linear search (4) for B among the war members of each war, for each country on the side opposite A (5).
Of course, we only get O(N^5) if the countries are spread out over both sides, but otherwise it's still O(N^4)...
  • 6
It seems like AI manages each stack as an individual entity. Is there any chance to get it start "thinking" in terms of army groups which move together, protect each other (e.g. sieging stack and protecting army nearby), reinforce battles? Also, when there are a lot of small AI armies in the same area they tend to act chaotically, while it would make sense for them to form an army group and act in a coordinated manner
It has at least two abstractions that do this. One is for mini "splinter armies" that do little sieges next to the main army's siege, or just try to join up with the main army after being recruited. The other is an abstraction for coordinated attacks against forts (EDIT: I mean against hostile sieges of an AI-controlled fort). They will be a little bit more prominent in 1.34 than in 1.33.

But overall, your point is completely valid and it would be nice if the AI thought more in terms of army groups. Unfortunately it might be too big of a change to make at this point, especially since it would risk causing bugs in a hundred other places, which could take months to find. :/
Last edited:
  • 4
  • 2Like
Yeah, I've seen a few of these "splinter armies" lately, they seem to act quite sensibly and I like this!

However I've also seen AI armies splitting in half and going into different directions in the vicinity of enemy, thus simplifying stackwipes instead of trying to avoid them.

Also, AI doesn't manage to join fleets together, thus greatly simplifying beating it in naval battles. In particular, it seems to avoid adding transport ships to battle stacks which is a deadly mistake. In general, fleet AI is perceived as weaker than army AI, and I think this is caused by fact that armies are often hidden from player under FoW, but fleets often act in the open.

Isn't AI (at least, part of it) shared between all Paradox games? Because when I played Stellaris I've seen it having similar troubles with coordinating actions of separate fleets.

As for risk of bugs, I see a few possible solutions:
  1. Allow both old and new versions of modified AI code path to coexist, so it's possible to select between "old" and "new" AI at run time via setting. In this case you can ship new AI turned off by default so that enthusiasts can test it and report bugs.
  2. Keep development of new AI in a branch and release it separately in a beta channel, so that interested people could install it, try out, report bugs, and if things are too bad, switch back to mainline version. I assume there are not many developers working on AI code on permanent basis, so keeping some changes in a separate branch should not result in significant conflicts.
  3. Make AI pluggable, so that modderns could create alternative AI engines, and ship modified AI as a separate plugin.

Lots of interesting stuff here.
- AI splitting armies has been somewhat addressed in 1.34 by making the AI "reference army size" a bit bigger.
- You're completely right that the AI keeps transports away from its main battle fleet. This could kind of make sense in some scenarios (e.g. battle fleet locks enemy fleet in port, while transport fleet does its thing), but usually it was more like the opposite (transport fleet doesn't trust battle fleet to stay put so doesn't dare do its thing). So I actually changed this up for 1.34. Now, most of the time the AI will merge its battle and transport fleets and it will multitask.
- There is no common AI code in our engine worth mentioning. You'll see similarities between the games for a number of other reasons:
- * They try to solve the same kinds of problems in the same kinds of games.
- * We have regular meetings between the AI programmers to share ideas and insights.
- * In particular the fleet AI of EU4 and Stellaris may have been designed by the same person. (Please don't think I'm saying it's because this person "did the same thing wrong". Multi-agent coordination is probably the single hardest thing to do right in PDS AI).

Your ideas 1 and 2 would help with reducing user impact, but would not necessarily reduce the development cost. 3 is a promising idea IMO, but would have a huge development cost to set up. So it's probably not for EU4.
  • 5Like
  • 5
I’m disappointed that Prussia still didn’t naturally form in these photos. It never forms currently, and the Teutons were given so much attention this upcoming dlc. Prussia was such a relevant country during this era and it’s sad to never be able to interact with it as a separate country
It's definitely a sentiment I agree with. But in Prussia's defense, it does form every few games. Sometimes it goes on to form Germany, I don't recall 100%, but I think that's what happened in the 5'th game I posted here.
Unfortunately, Prussia forming is still not an expected outcome, but we have definitely made some progress in that direction.
  • 9Like
  • 2
I'm a little concerned about the tendency to blob in Central Europe. Historically, the HRE structure did succeed in preventing that to the extent that it still existed by the time of the French Revolution. I would suggest these tweaks: allow the Emperor to join the defender in wars with Conquest CB declared within the HRE, instead of only being allowed to demand return of conquests post hoc; add a loss of IA every time a HRE member ceases to exist; adjust AI so the Emperor knows to intervene to prevent a HRE member from ceasing to exist; and adjust AI so small HRE members with larger neighbors which have claims/cores on their territory prioritize the Emperor not being an ally of those larger neighbors, not having opinion of them <-20, and being powerful, in that order.
I'd just like to highlight that the saves I posted are from 1821. In historical terms, that is after Napoleon. Within the game, that is often after decades of really good CB wars (revolution, imperialism). The AI also has some secret sauce in the end-game to make it go a bit crazy (which has been in the game for years, but you can somehow feel it more now).

If we were to look at the HRE for the first couple of hundred years (which is when most people play most of the time), it will usually be a lot more intact.
  • 6Like
  • 4
  • 1