Europa Universalis IV: Developer diary 43 - Artificially Improved

  • 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.

Wizzington

Game Director (Victoria 3)
Paradox Staff
41 Badges
Nov 15, 2007
12.596
142.670
  • Hearts of Iron II: Armageddon
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sword of the Stars II
  • Sengoku
  • Europa Universalis: Rome
  • Victoria: Revolutions
  • Europa Universalis III Complete
  • March of the Eagles
  • Majesty 2
  • Magicka
  • Heir to the Throne
  • Arsenal of Democracy
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Deus Vult
  • East India Company
  • Europa Universalis III
  • Divine Wind
  • For The Glory
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Prison Architect
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Holy Knight (pre-order)
  • 500k Club
  • Victoria 2
Today for the 43rd development diary for Europa Universalis IV, we're bringing in a very special guest: The AI or Artificial Intelligence of Europa Universalis IV. The AI, of course, is responsible for controlling all the nations that are not under the reins of a player, and has received a number of face-lifts and upgrades from past games. This is a look at some of the more major changes and improvements it has benefitted from.

Diplomacy
As mentioned in dev diary #17, Europa Universalis IV gets rid of much of the previous randomness in conducting diplomacy. You make a proposal and the AI country responds Yes or No with a detailed breakdown of its reasoning. This makes it apparent to the player why the AI nation will not accept an alliance, and what (if anything) they can do to get them to change their mind.

attachment.php


The AI also follows this system when dealing with other countries: AI nations will not offer alliances to countries whose alliance offers they would decline and will not bombard the player with requests that they know an AI would refuse, getting rid of much of the diplomacy spam that could happen in previous EU games.

The AI's ability to understand the various diplomatic interactions has also been improved, and it will now make use of certain diplomatic interactions that were previously the sole domain of the player, for example selling provinces when it is in its interests to do so.


Attitudes
The AI in Europa Universalis has strategic goals: Countries it wants to ally, provinces it wants to conquer, neighbours it wants to subjugate. These goals were largely invisible in previous installments of EU and could result in frustration on the player's part as the nation they just sent gifts turns on them without an obvious reason. In Europa Universalis IV, the AI's strategic goals towards a particular country are factored into an 'attitude' which reflects its long-term view on that country.

attachment.php


In the screenshot above, we can see that Bohemia has the 'Threatened' attitude towards Austria. This is a rather complex attitude where Bohemia will both try and ally with Austria and seek out alliances with their rivals, all in order to secure their independence against the threat Austria poses.

As indicated by the red blood drop, if Austria was played by an AI it would have the 'Hostile' attitude towards Bohemia, meaning that they would most certainly reject an alliance with Bohemia and actively seek to conquer them.

Attitudes affect almost every part of the AI's thinking including what diplomatic proposals they agree to, which nations they seek to befriend and what concessions they will seek in a war. One very special attitude, 'Outraged', also drives the formation of coalitions, as described below.


Coalitions
Coalitions have changed since they were first brought up in dev diary #23. All the previous restrictions on who can form a coalition have been removed and replaced with the single restriction of only being able to be in a coalition against one nation at any given time. Coalitions no longer have a 'leader', but are simply a group of countries that have declared themselves united in opposition against an aggressively expanding nation.

attachment.php

As discussed in previous dev diaries, Aggressive Expansion is a negative relations modifier that you get with other nations when you conquer territory, force-vassalize or usurp the thrones of other nations. The size of the relation hit depends on your size, your distance to the nation, and their cultural, religious and strategic interest in the provinces and countries that you conquered.

attachment.php


The more your relations drop, the more likely that the country will change its attitude to 'Outraged', representing anger and resentment towards your aggression. An AI country that is Outraged may take the initiative to form a coalition against you, and once formed, countries that hate or fear you may choose to join in even if they themselves are not Outraged. If you declare war or are declared on by any member of the coalition, all other members will automatically join in and a player who lets their AE grow out of control may find themselves fighting some very large coalitions indeed.


War & Peace
Another change towards transparency is the replacement of the old War Capacity value with War Enthusiasm. War Enthusiasm is a number showing you how much the AI wants to stay in the war, and what it thinks of its chances to accumulate more gains or turn a losing war around.

When negotiating peace with the AI, War Enthusiasm acts as a direct modifier on warscore in determining whether they will accept. If they have 10 warscore and 10 war enthusiasm, they will require a peace deal worth at least 20 to say yes. If they have negative war enthusiasm, you will likewise be able to demand deals that are better than your current warscore, though there is a limit to how much you can demand.

attachment.php


A common complaint about the AI in previous EU games is that it is easy to fool: Even if it manages to defeat you in a war, you can offer it a variety of useless but costly concessions instead of the province that it actually declared war for. This has been improved in Europa Universalis IV with the addition of a level of importance the AI places on each possible concession.

attachment.php


Items of great importance, such as taking core provinces or acquiring the wargoal, are shown with a green thumbs-up, indicating that the AI will value them at their full warscore cost in a peace deal. Items of some importance, such as taking provinces for its allies or an offer of gold are shown with a yellow hand indicating that the AI will only value them at a fraction of their warscore cost. This means that if you want to give the AI a bunch of things that it doesn't really want you will have to give up a lot more than if you just give it the things it went to war for in the first place.

Items that the AI absolutely does not want such as landlocked isolated provinces are shown with a red thumbs-down. Offers containing such a concession will always be rejected.


Armies
The AI's ability to command armies has also been improved, particularily in regards to allies. Vassals and AI allies who lack the army strength to operate independently will attach their armies to the war leader's troops, combining with them to form powerful coalition armies. The AI's ability to coordinate action between its armies has also been improved, as well as its ability to give priority to important provinces, especially the wargoal.

attachment.php


Large AI nations in Europa Universalis IV have a new trick up their sleeve: Hunter-Killer armies. Hunter-Killers are specialized armies that will avoid sieging in favor of hunting down enemy armies and wiping them out to the last man. When there are no enemies in sight, Hunter-Killers will instead act as protection for friendly sieges, lingering in nearby provinces ready to move in if the enemy should threaten its besieging allies.


Options
Lastly in this dev diary we'll talk about options. The difficulty and aggressiveness settings from previous EU games have been replaced with AI Difficulty and Handicap.

attachment.php


AI Difficulty
The AI Difficulty option determines the skill level at which the AI operates and how it behaves towards the player. It has the following options:
Easy: The AI plays at a reduced skill level and acts less aggressively towards non-AI nations.
Normal: The AI plays at its full skill level and will treat player and AI nations the same way.
Hard: The AI plays at its full skill level and acts more aggressively towards non-AI nations.

Note that because the AI is more aggressive towards the player this does not mean it will start suicide wars or refuse to ally them simply because of the difficulty, but it does mean that they will react more harshly to players accumulating Aggressive Expansion, for example. AI Difficulty does not provide any economic, diplomatic, military or otherwise bonuses to AI or Player nations regardless of the setting.

Handicap
The Handicap option controls which, if any, nations will receive economic, diplomatic and military bonuses. It has the following options:
Player: All non-AI nations will gain economic, diplomatic and military bonuses.
None: No nations receive any bonuses.
AI: All AI nations will gain economic, diplomatic and military bonuses.

Bonus: How Paradox’s Crusader Kings II to Europa Universalis IV save converter will work - Interview at PC Gamer
http://www.pcgamer.com/2013/07/31/crusader-kings-ii-to-europa-universalis-iv-save-converter-interview/

ps. Now we hope you feel ready to bring civilization out of the Dark Ages :)
If that is correct, please feel free to pre-order our game Europa Universalis IV here: http://www.europauniversalis4.com/buy
 

Attachments

  • eu4_1.png
    eu4_1.png
    526,5 KB · Views: 31.601
  • eu4_3.png
    eu4_3.png
    923,9 KB · Views: 33.545
  • eu4_4.png
    eu4_4.png
    261,4 KB · Views: 31.257
  • eu4_5.png
    eu4_5.png
    460,9 KB · Views: 31.356
  • eu4_6.png
    eu4_6.png
    490,2 KB · Views: 31.732
  • eu4_10.png
    eu4_10.png
    430,6 KB · Views: 30.900
  • eu4_11.png
    eu4_11.png
    668 KB · Views: 499
  • eu4_12.png
    eu4_12.png
    312,4 KB · Views: 30.524
  • eu4_13.png
    eu4_13.png
    551 KB · Views: 31.247
Last edited by a moderator:
This sounds great. If you offer an alliance, is there some randomness involved too?

There is some randomness in how the AI builds up its strategies and attitudes, but there is absolutely no randomness in the actual diplomatic interaction.
 
Why Iron Man is disabled? Does it need specific difficulty setings? I hope it doesn't need Lucky Nations!

Iron Man is disabled because of the specific dev build I was using.
 
I was worried for a second about not being able to play with the full AI and no bonuses or additional aggressiveness, but I'm glad it's possible.

I think I'll always play with normal AI and no handicap, but I'm not sure about lucky nations. Disabling them would maybe be better but I fear it might break the balance... (by that I mean I wouldn't want France to be destroyed every time if I disable lucky nations for example)

If you don't use historical lucky, don't expect the game to be anywhere near historical results. Its for the players who prefer more open sandbox.
 
Wiz, could you please explain what Lucky Nations does?

Lucky Nations grants a special set of bonuses to certain nations, on Historical for instance it will give them to the big historical winners like Austria, France, Ottomans etc.

1. So player can modify these features:
a) AI behaviour
b) AI diff + handicap ?

2. How many coalitions player can join in one time?

3. If player offer alliance to some country, and tooltip will say "Yes", there will be a 100% chance to positive response?

1) Correct.
2) A country can only be in one coalition, whether AI or player.
3) Yes, unless one of the calculations changed because you weren't paused and a random event lowered relations, etc.

What does the chess symbols in the diplomacy screen mean?

Threatened attitude.

Coalitions that everyone can create are great idea. This will be another way for Byzantium to resist the Ottomans or any other weak nations versus their stronger neighbours. How does that work anyway? Will nations in coalition against common foe get call to arms if one of them declares war on coalition target? Will they get call to arms in one of the coalition members is attacked by coalition target?

If a nation in a coalition declares war on coalition target, all coalition members that don't have a truce join automatically.

If a nation in a coalition is attacked by the coalition target, all coalition members that don't have a truce join automatically.

There is no call to arms, so if you do join a coalition you have to be prepared to fight at any time.
 
I have 2 questions:
1. Let's say you have war: GBR and Portugal vs all of continental Europe except of Spain where continental Europe has 7384579348759834768793456 land troops but GBR and Portugal have bigger fleet than their enemies combined so Europe can't really harm them.
Does "Relative strength of alliances" part of War enthusiasm takes that in consideration ?

2. Maybe not really AI related but:
If you have Army without artillery and your ally attaches to your army his army with artillery (which is slower) does your army slows down to keep it's "attachments" together?

1) No. Naval AI (and related things such as this) is a future prio though, and there are mechanics for resolving stalled wars such as the HYW where France can't invade England.
2) All land units move at the same speed in EU4.
 
Yes, but if we are talking about living off the land and camping out for the night... cavalry still penetrates a longer distance per day. Karl XII was able to gallop from Istanbul to Lund in 15 days. (Extreme example).

Small groups and scouting units, sure. Moving a whole regiment around doesn't work the same way. Anyway, it's a gameplay decision.
 
Regarding the first example in the DD, if i was playing milan and i wanted an alliance with austria bad enough, i'd build up some more troops/ships make an alliance with austra then disband what is over the forcelimit. How will the AI react to this? reconsider its alliances from time to time?

The AI will cancel diplomatic actions it no longer wants, but the cancel threshold is below the acceptance threshold so it won't cancel a deal it just agreed to because some very minor factor changed.

(Besides, you could just improve relations...)
 
I have a few questions.

Are the Hunter army more vulnerable to attritions? How will AI react to it?

In the interview says HRE can't be formed in EU4, does that mean the last reform is removed?

Maybe I really need to learn two games at the same time...

Hunter armies are only special in the sense that it's a AI designation for a large army it uses in a special way. They have no mechanics changes.

HRE can be formed in EU4.

I assume the answer to that is no, as vassals in eu tend to be more like puppet states and not semi independent states like they are in ck2

Correct.
 
I think if I recalled from a preview there is like a -1000 on the chance if they have more than X number of alliances a bit like in Victoria II.

Regarding actual upkeep I also seem to recall that there is a limit on Vassals base being 2 IIRC and if you go over that, you start spending a diplo point per vassal per month (not good news) much like being over the Royal Marriage limit (if that's still around) and the general limit (which is still around)

Each vassal uses a diplomatic relation, same as alliance. If you go over your cap of relations, you lose diplo power. AI will be very reluctant to do so.
 
Wow, a really good DD!! Showing what the AI is thinking takes out all the fustrating guessing why an AI will or won't accept things. But is there still that console command "view_ai"?

It's aiview in EU4 but yes, it's still there.
 
All seems significantly improved over EU3, but how fixed are the AI countries initial attitudes to their neighbours over time?
A nation's listed 'Threats' & 'Rivals' in EU3 varied considerably with subsequent changes in that nation's circumstances & I'm sure that will still be the case. But some questions spring to mind:

Regardless of the starting position & initial attitudes, the implication seems to be that any (over)expanding nation will naturally become seen as a threat by any nearby nations & thereby attract coalitions against it. But does a reduction in their over-expansion at least start to cause the gradual break up of a coalition that is forming against them, without necessarily a war?

e.g. If Bohemia has been forced to give up (some significant) territory in a peace treaty (even if in a separate war against a non-member of the coalition against it) would it cause the automatic & immediate break up of any coalition that had been forming against Bohemia?

Would the remaining powers in any coalition automatically stay together (at least initially) in the event of a White-Peace with the over-expanded nation? Or even in defeat, if the nation that the coalition were against is still considered by them to be over-expanded?

Does a truce with an over-expanding nation actually prevent or merely discourage that particular nation (re)joining any coalition against it?

Does a Bohemia that doesn't expand (or even loses some initial territory) ever lose their initial 'threat' status in the eyes of an AI Austria that may be achieving success elsewhere?

Yeah, if you let AE go down coalitions formed against you will break up eventually (the time it takes depends on how much AE you got in the first place).
 
I'd like to thank you Wiz for having so many options for the AI. Having a separate Difficulty/Handicap is very important for me. Its actually one of the things that has bugged me about the AI in total war games in the past. Normal difficulty gave me a slight boost and the next step up (hard) gave the AI a slight boost. There was no "balanced" setting.

Now I'm at work so I haven't had time to read through all the posts so I apologize if this has been asked before.

Are the AI settings exposed to modders? For example, could I either create or modify a difficulty setting increasing aggression or the handicaps further?

Thanks,

Jec

Handicap is moddable, difficulty is mostly hardcoded.
 
I'm very glad to see this dev diary. It addresses all the issue and concerns I had previously when Wiz was posting about improved AI. I do kinda wish that there where a few more settings in the list for how aggressive the AI is, but this is fine. Just one last question, will there be tooltips on the menus that explain exactly what each setting is and does to help new players out?

Yep.

I really hope that the algorithms for AI concession acceptance are good, or even better if they're modable. If it's set so the AI always turns down offers of provinces which neighbour none of its own, are not colonies, and aren't of the AI's culture or cores, that would help so much keeping borders prettier. And more importantly (to me) prevent the all too common occurrence of continental European powers getting random coastal provinces in England or Scandinavia. It would save me a lot of hassle trying to 'fix' borders, if the game itself could be made so gaining overseas/distant provinces that aren't colonies requires exceptional circumstances (like inheritances, invasions, basically stuff that doesn't grab single coastal provinces just cuss the AI algorithm tells it said province is worth a lot of gold and stuff).

All variables involved are moddable (though modders can't add new ones, but you can tweak stuff like how likely the AI is to prefer border provinces, how much it will factor in overextension, how far away it will take provinces etc). Attitudes are also fully moddable, as well as a lot of diplomatic and economic variables.
 
ahh dam it you still have hardcoded places again

Making the AI fully scriptable is just not feasible without a total redesign, sorry. I try to export variables wherever I can though.
 
How likely it will take bordering provines, shouldnt bordering provinces always be imperative?
This would avoid ugly borders after all

It's an important factor but obviously not the only one as that itself could lead to some absurd decisions (nope, not gonna take my core Baghdad because I prefer these three desert provinces on my border). It won't ever take landlocked enclaves though, and snaking is rare. Anyway it was just an example of a variable you can tweak, if you should want to.
 
Will you ever be able to offer early concessions/surrender early on when you know you can't win in order to avoid losing everything or does the ai still insist on fighting you first/fighting until it could demand more then the original war goal?

Yes, if you know you're gonna fold it's actually best to do so early as the AI will be more unwilling to peace if it's gaining in warscore. For example if you're playing as England in 1444 and sue for peace with France immediately, they will generally settle for a couple provinces.
 
A couple of questions:

Does having a diplomatic relation with another nation in and of itself give an opinion bonus? So would the AI look at your relations and determine that it's at +2 and offer you an alliance, but then when looking at it afterwards there'd be a "We have an alliance! (+20)" modifier raising the total to +22?

You said that Naval AI is something that you want to work on. In EU3, the AI suffered no attrition with its navies, would you say that it's a goal to make the ai suffer attrition at sea, and understand how to deal with it? Or were you primarily talking about considering naval power more intelligently in terms of war capacity and for diplomatic reasons.

Alliances, RMs and such give opinion boosts that in turn make other diplomatic interactions easier. Additionally, they can change the AI's attitude of you which also affects diplomacy.

My ideal AI is one that plays by the exact same rules as the player. That ideal may not be realizeable anytime soon, but yeah I would like to get naval AI up in good enough shape that it doesn't need the attrition cheat. Ultimately though, my first consideration in regards to AI is always going to be whether it's good gameplay, so until that day the no attrition stays.
 
One IA problem in EU3 appear when IA win a naval fight and take a lot of ships.
The IA can take a lot of ships and destroy its naval limit, wich destroy the economy.
Then, the IA isn't able to recruit soldier because she loose too much money ...

PS : sorry for my " english "

The AI keeps a budget with income and expenses and will take appropriate action if an expense gets too high.

Amazing diary, I am eager to see how this all works in practice.

Does the status of land and naval maintenance and/or how close you are to your force limits affect the "attitude" of your neighbours towards you to any degree? I imagine that if I am a strong nation in peace time, yet I am churning out unit after unit with my maintenance on 100% all the time then my neighbours would be loosening their collars a bit, even if we are on amiable terms.

Only in the sense of relative military power.

A total redesign.

does that mean it was possible from the start to make it not hardcoded

if so why didn't you guys do it was there some kind of problem?

First of all, I've only worked at Paradox since March and some of this code goes back several years. Secondly, even if it's possible to make entirely scriptable AI it's certainly not as easy, and our first priority is always going to be a game that runs and plays well over one that is 100% moddable.

Thank you. I like your ideal as well, but really, we just need the most playable game and opponent we can get, so I like that choice.

One thing I've always wondered, would it be feasible to give the AI more time, e.g. when we're paused, to make plans? I remember the old days you could let your chess program think while you took your turn, or not, depending on the difficulty you wanted (now, of course, the calculator on my watch could beat me). I've often wondered what an AI could do if I periodically left the game running on pause while I slept or went to work and it could use that time to plot my demise. I don't know how much each individual AI could actually accomplish on a paused game, it's the dynamic stuff that needs computing power, I assume.

Maybe the AI nations could engage in ex parte diplomacy.

CPU cycles isn't really the big limitation on our AI. Mostly it's a matter of development time rather than processing time.