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

Victoria 3 - Dev Diary #59 - AI

16_9.jpg

Hello and welcome to the 59th Victoria 3 development diary! With the release of the game just a little more than a month away (which honestly feels surreal), one of the last remaining things for us to do alongside bug fixing is to put the final polishing touches on the AI for release. As such, this feels like a good time to talk about the AI of Victoria 3 - how it’s designed, how it operates, and what tools modders have available to tweak it. However, I won’t really be talking about which exact amount of difficulty the AI provides or which level skill it plays at. Firstly, because perception of AI performance is highly subjective and what is a ‘good AI’ means something different to just about every player, and second because there’s still a few issues to be ironed out before release, one example being AI-controlled countries too frequently experiencing revolutions (something that should hopefully be greatly improved now, but which has yet to be verified by QA).

So then, how does the AI in Victoria 3 work? Well, just as in our other Grand Strategy Games, the AI plays the same game you do. It uses all the same features, faces all the same restrictions, and does not receive the advantage of any ‘cheats’ (with some exceptions if you use certain Game Rules, but more on that later in this dev diary). In addition to this, there are four design principles that guides how the AI should act in Victoria 3:
  1. Roleplaying, not min-maxing: The AI in Victoria 3 should ‘roleplay’ rather than try to play optimally or ‘play like a player’. AIs should not exploit the game and should be acting according to their internally set goals - as an example, it’s perfectly okay for a small German state controlled by the AI to want to be absorbed into a unified Germany, even though being annexed is clearly not the optimal way to play Victoria 3.
  2. Transparency and clarity: The AI’s gameplay strategy and decision-making should be comprehensive to a player - if an AI dislikes the player or won’t go along with a player’s proposal, the player should be able to understand why, and the internal strategies that the AI follows according to the ‘roleplaying’ principle should be clearly shown to the player.
  3. Moddability, within reason: The AI should be as moddable as it is possible to make it without ruining the performance of the game. While it will likely never be possible (at least with current-gen hardware) to actually expose the AI’s core decision-making loop to modders, anywhere where we can allow modders to hook into its decisions through triggers, defines or scripted values, we should do so.
  4. Not too random, not too deterministic: The AI should generally make decisions based on something I like to refer to as ‘semi-randomness’: What this means is that an AI looks at the choices it can make, assigns a score to each, and then throws a set amount of randomness into the mix based on how unpredictable we want it to be for that particular type of decision. For example, if the AI is choosing between two different choices that have base scores 50 and 100, and the randomness factor (R) for this decision is 1.0, this means that the actual score ranges for each of the two is between (X / ( 1 + R ) ) to ( X * ( 1 + R ) ) - ie, between 0.5x to 2x the base score, or 25-100 vs 50-200 in this particular example. In other words, while the AI is far more likely to pick the option scored at 100, it’s not guaranteed to do so - the option worth 50 could end up scoring higher after randomization. However, if the AI was picking between two options scored 100 and 10 instead, it would always pick the 100-value option with a randomness of 1 as the randomness simply can’t beat out the gap in base scores. This is a type of weighting we use in all our games that lets the AI make ‘sensible’ decisions without being completely deterministic.

But enough preamble, let’s dig into the actual AI mechanics in the game! The most central mechanic to the AI in Victoria 3 is the AI Strategies, which follows from all three of these principles. Every AI country in the game is at all times governed by three AI Strategies - one Administrative, one Political and one Diplomatic. Generally speaking, the Administrative strategy decides how the AI develops its economy (for example, should it focus on building plantations for cash crops or try to Industrialize?) and balances its budget, the Political strategy determines which IGs and political reforms the AI favors, and how boldly it’s willing to pursue those political reforms, while the Diplomatic strategy determines what geopolitical direction the AI wants to go in (for instance, does it want to pursue colonization or maintain a stance of well-armed isolationism?). Which AI strategies an AI country picks is semi-randomly determined from a set of weights - as an example, countries with a powerful Intelligentsia Interest Group are more likely to pursue a Progressive Political strategy, but never guaranteed to do so.

Qing at the start of the game tends to have extremely conservative strategies - their goal is solely to maintain internal stability and defend what they already have
DD59_1.jpg

The AI strategy system is much more than just broad-strokes AI guidance though: It contains all sorts of values that can be tweaked and hooked into different strategies. Every AI has a hidden ‘default’ strategy which sets values such as how much it values an Obligation from another country, which Wargoals it’s interested in, how aggressive it should be (and against who) and what its baseline Neutrality is in Diplomatic Plays (more on that later). These default values can then be overridden or added onto by the active AI strategies. For example, the AI has a default scoring for the Conquer State war goal against any country against which it has the ‘Conquest’ strategic desire, based on the GDP and population of the state, whether the AI can reach it, whether it’s adjacent, whether it has a port if it’s not adjacent, and so on. Then, if this AI country has the ‘Unify Germany’ diplomatic strategy, this strategy will add an additional value for every North and South German culture state.

Some of the scripted logic that goes into AI evaluation of how much an Obligation is worth, something I’m certain modders are going to tinker with!
DD59_2.jpg

I mentioned Strategic Desires - this is something like a mini-strategy, which each AI country can have against every other Diplomatically Relevant (ie, country they can diplomatically interact with based on Interests, neighbor status and so on) country. Strategic Desires are semi-randomly determined, with weighting for each set in the AI strategies - for example, an AI country with the ‘Acquire Colonies’ AI strategy is more likely to want to conquer or subjugate Unrecognized countries than one that has ‘Maintain Power Balance’ as its AI strategy. A major upside of this whole system is that it makes it much easier when we want the AI to pursue specific objectives, such as completing Journal Entries - instead of having to write specialized code for behaviors such as Britain seizing a treaty port from China in the Opium Wars, we simply set the appropriate weights in the AI strategies and the rest handles itself.

The Ottomans have a Belligerent attitude towards Egypt because of their very low attitude score combined with their ‘Conquer’ Strategic Desire
DD59_3.jpg

AI strategies and Strategic Desires are of course not static across the entire campaign. Some are set in the history files, while others are allowed to be semi-randomly determined as mentioned above, but over time you can expect them to change. This change can be sped along by certain events - each individual AI Strategy and Strategic Desire has a ‘change points’ meter that causes it to be re-rolled when that meter hits 100, and there are a number of things that can happen to a country which immediately adds a bunch of change points and may trigger a re-roll. For example, if a country declares bankruptcy, all other AI countries will receive a number of change points on their Strategic Desire towards the country that declared the bankruptcy and will be more likely to roll a non-friendly desire, as bankrupt countries are seen as unworthy allies and easy pickings.

Another, less dramatic example is that whenever a country successfully enacts a new law, a number of change points are added to its Political strategy. Hitting 100 change points doesn’t necessarily mean a country’s Strategy or Strategic Desire will change though - it is entirely possible that the outcome of the ‘re-roll’ is to simply pick the same old thing over and over again, especially if the AI’s scripted preference for that strategy is high.

Now that we’ve talked about how the AI functions on a strategic level, let’s switch gears and talk about how it operates in another area, namely the economy. The economic management of Victoria 3 can be quite complex, and as such, making AI for it is no trivial task either. There’s a lot of factors to consider, even for the most straightforward-seeming action: As an example, let’s say the AI is considering whether to build a Tobacco plantation. Simple, right? We just look at the estimated labor costs involved versus the current market price of Tobacco and make a determination on whether it’ll turn a profit?

Well, no. For one, that market price is going to change as soon as the new building is complete and starts adding more Sell Orders of Tobacco to the Market. What’s more, goods substitution also comes into play here: The increased supply of Tobacco will, over time, lead to Pops buying more Tobacco as part of their Intoxicants need, increasing the demand for Tobacco while lowering it for other goods such as liquor (which then in turn would influence the AI’s decision making regarding any buildings with production methods that produce liquor).

So then, how do you account for all these factors without crashing performance every time the AI wants to build something? The solution is a system called Spending Variables, which is a rather unassuming name for how the AI predicts and charts the course of its economy and market. Each AI country’s Spending Variables tracks values such as the Buy Orders and Sell Orders that are going to be generated by buildings which are currently in the construction queue or in the process of hiring employees. This means that if the AI is facing a shortage of Tools, and starts building a Tooling Workshop, it can now understand that once the Tooling Workshop is completed, the shortage of Tools will be resolved, and thus doesn’t start constructing a second or third Tooling Workshop - and can, for example, queue up a construction after the Tooling Workshop that is going to use Tools as an input, even though that would clearly be a terrible idea under the current market conditions. The Spending Variables of course track a whole lot more data than just buy and sell orders, particularly any complex calculation that doesn’t need to be made all the time - such as determining whether the AI feels that it’s under a heightened military threat and thus should prioritize military spending.

Spending Variables are tracked and recorded even for player countries, where they are used for the purposes of prediction - in the shown example, you can tell that expanding the Wheat Farms in Peloponnese is actually going to result in reduced profits for the building due to the price impact on Grain, which means the AI knows this too!
DD59_4.jpg

When it comes to making spending decisions based on these variables, the AI actually uses a system that was actually inspired by the development process for Victoria 3 and the issue tracker that we use (JIRA). The AI collects a list of all changes to the government spending it could do, in both directions. For example, subsidizing a particular building, constructing Barracks in a particular state, or reducing the size of its Government Administration in another state. It then assigns each of these actions a Priority and a Score.

Priorities are a tag that determines the general circumstances under which the AI will consider increasing or decreasing their spending on this particular item. When increasing spending, the AI will always pick an item of higher priority over an item of lower priority, with the reverse being true when decreasing spending - low-priority items are cut first. It’s quite common for the same ‘item’ (for example, the same building type in the same state) to have a different priority when it comes to increasing vs decreasing spending, as the AI should generally be reluctant to downsize a building it spent a bunch of money to construct unless it absolutely has to.

The priorities are as follows:
Must-Have: This is something that the AI considers so critical it’d rather go bankrupt than be without it. The AI will always increase spending on a Must-Have, and never decrease spending. Must-Have is used sparingly, with an example being that the AI will never consider downsizing Government Administration buildings when in a Bureaucracy deficit, as lacking Bureaucracy decreases tax revenue and thus would likely just worsen the situation.
Should-Have: This is something that the AI believes is very important and should be acquired as soon as they have a small surplus. The AI is only willing to cut spending on a Should-Have if they’re in debt and can’t find any other way to balance the budget.
Wants-to-Have: This is something the AI considers fairly important and will be willing to increase spending on if they have a modest surplus, but isn’t willing to go into debt for and will cut spending on if they have a budget deficit (not counting temporary expenses, of course) and aren’t sitting on a large pile of gold reserves.
Nice-to-Have: This is something the AI considers low priority and will only be willing to increase spending on if they have a large surplus and nothing better to do with their money. They will cut spending on nice-to-haves the moment their surplus isn’t looking so good.
Should-not-Have: This is something the AI has determined it doesn’t want at all. It will not increase spending on this item under any circumstances and will cut spending on it as soon as possible.

Score is a numerical value that is semi-randomly determined and serves as a tie-breaker between two items of the same priority. So for instance, the Belgian AI might consider Barracks in either Wallonia or Flanders and a Naval Base in Flanders to all be Should-Have, but which of the three it actually ends up increasing spending on is determined by the score of each after randomness is factored in. Together, these two allow the AI to make decisions in a way that should neither be too deterministic nor too random, and makes it easier to handle special cases than a purely score-based system would.

AI spending data isn’t shown in the interface as we consider that to be *too much* transparency, but can be gleaned using the console. Here, you can see that Prussia thinks it has a good surplus of Bureaucracy and doesn’t see any pressing need for more Government Administration buildings
DD59_5.jpg

Moving on from the economy, let’s talk about how the AI behaves in Diplomatic Plays, as this is an area where a bunch of things have happened quite recently. If you’ve been following the official streams and various developer AARs, you may be familiar with the way that the alpha implementation AI used to decide which side to back in a Diplomatic Play: It would assign a score to each side, then add the value of a sway offer on top of that to determine if it was willing to be swayed (and sometimes join a side it strongly preferred even without being swayed). This system has now been enhanced with a few new values that govern AI behavior in Diplomatic Plays: Neutrality, Sympathy, Confidence and Boldness. We’ll go through each one in turn and explain how they influence AI decision-making when taking part in a Diplomatic Play.

Neutrality: This is a calculated value that determines how much an AI country wants to stay out of a particular Diplomatic Play, and is based on factors such as which Strategy the AI is pursuing, whether they’re in debt, the shape of their army, and whether they consider the conflict to even be worth caring about at all. In order for an AI to take a side or allow themselves to be swayed, the score of joining one side must now beat out both the score of the other side and their Neutrality Score - so if Austria and Prussia are opposing each other in a play, and Russia gives Austria a score of 30 and Prussia a score of -10 while their Neutrality Score is 50, they will be unwilling to join the play on their own accord and will demand a sway from Austria worth at least 21, while for Prussia the sway offer would need to be worth at least 61.

Sympathy: This is a value that is semi-randomly determined for each non-leader participant towards the two leaders, and which is added directly to their willingness to join that side in the play. Countries tend to have higher sympathy for the defender, lower sympathy for enemies of their allies, and higher sympathy for countries that are facing off against an enemy with high infamy. Sympathy will also change over the course of the play: Any side which adds additional wargoals will generate sympathy for the opposing side based on the Infamy of the wargoal added, and similarly any side which receives support from an uncommitted country will generate sympathy for the other side based on how powerful that new backer is in relation to the other countries involved in the play (conversely, losing a backer increases sympathy for the side that now finds itself with less support).

With nothing more in it for them than a little-valued Obligation, Great Britain has no interest in getting involved in this West African dispute as their Neutrality is simply too high
DD59_6.jpg

Confidence: This is a calculated value that only applies to the leader of each side of the Diplomatic Play, and determines how they feel about their chances to come out on top if the Play should escalate to war. This is primarily determined by the relative strength and mobilization level of the two sides’ militaries, but also by factors such as how well they can bear the cost of a war, how internally divided they are and how capable they think their own national forces are to fend off incursions into their territory. The lower the AI’s confidence, the more willing they are to back down, and the more keen they will be to try and secure additional support from uncommitted participants.

Boldness: This is a hidden value that is semi-randomly determined for each participant in the Diplomatic Play. Countries with certain Strategies, higher-ranking countries, countries with strong militaries, and countries that are facing annexation in the Play tend to have higher Boldness. Boldness plays a role in multiple different AI decisions such as how early it mobilizes, how willing it is to join plays without being offered anything, but the main role of Boldness is to be compared against Confidence to determine whether the AI is willing to back down rather than let the play go to war. For this, Confidence and Boldness are added together and the lower the result, the more likely the AI is to back down. There’s some other factors to this as well, such as how much the AI stands to lose from additional wargoals that could be pressed if the Play escalated to war, but Boldness serves as a way to provide ‘predictable randomness’ - that is, an AI Modena facing off against Austria alone would have such a bottomed-out Confidence score that it would need an very high random roll for Boldness to let the play escalate to war, even if they’re facing annexation.

Facing the prospect of war with both Prussia and Russia, there is a chance here that Austria is going to back down here if they can’t secure more support - though they might also decide that Bohemia must be defended at all costs given its integral status in the Empire
DD59_7.jpg

AI is a personal passion of mine (I actually started out as an AI programmer for Paradox back in 2013, almost 10 years ago now!) and I could probably keep talking about it forever, but this dev diary is getting awfully long, so to wrap it up I just want to cover the AI Game Rules that are available in Victoria 3, since they’re a bit different from the usual difficulty settings you might be used to. Because of the complex and interconnected nature of Victoria 3’s economy, and our general commitment to simulation, we didn’t want to simply have ‘High Difficulty’ mean that all of the AIs start producing more goods or have a bunch of income created out of nothing, or ‘Low Difficulty’ mean the same for the player. Instead we decided to focus on how the AI interacts with the player and the rest of the world on a geopolitical level. Following this philosophy, the two AI Game Rules we’ve added are called ‘AI Behavior towards Players’ and ‘AI Aggression’.

AI Aggression goes Low - Standard - High and is relatively straightforward: the higher this is, the more aggressively the AI will act in general towards all other countries. It affects which Strategic Desires they tend to prefer, how likely they are to start Diplomatic Plays to carry out those desires and how willing they are to take on Infamy.

AI Behavior towards Players, on the other hand goes Lenient - Standard - Harsh and affects only how the AI views player-controlled countries and is the closest thing to a Difficulty setting that we have. With the regular setting of Standard, the AI treats the Player the same as if they were another AI country, with no special considerations. However, you can also set it to Lenient if you want a ‘friendlier’ experience - this will make the AI more likely to have friendly Strategic Desires towards player countries, make them more likely to support the player in Diplomatic Plays, and will make them unwilling to conquer the player’s Homelands unless they have a claim on it. Conversely, if you’re an experienced hand at the game and want the AI to treat you like the agent of chaos that you are, you can put this setting to ‘Harsh’ - this makes the AI far more suspicious of the players’ intentions, less willing to support them in Diplomatic Plays unless they have something to very clearly gain from it, and more willing to knock the player down a peg or two should a good opportunity to do so arise.

I call this combination of AI Game Rules the ‘Metternich Mode’
DD59_8.jpg

Alright then! That’s it for this dev diary - I hope you find it enlightening, and I hope you find the AI in Victoria 3 fun and interesting to play with and against when the game releases. We still have some things to fix before then, and we’re of course going to continue improving, polishing and increasing the moddability of the AI post-release as we do with all our games. I’m particularly interested in hearing about any additional ideas for post-release AI Game Rules that the community may have, as I think that allowing players to tailor their individual AI experience is a great way to deal with some of that subjectivity I mentioned at the start of this dev diary. For now though, farewell and join us again next week as Michael introduces us to Modding in Victoria 3!
 
  • 180Like
  • 99Love
  • 22
  • 14
  • 1
Reactions:

commissar roach

Corporal
Community Ambassador
96 Badges
May 27, 2011
48
1.394
  • Sword of the Stars
  • Knights of Pen and Paper +1 Edition
  • Magicka
  • March of the Eagles
  • Naval War: Arctic Circle
  • Europa Universalis IV: Res Publica
  • Cities in Motion 2
  • Semper Fi
  • Sengoku
  • Ship Simulator Extremes
  • Victoria: Revolutions
  • Sword of the Stars II
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Third Rome
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
  • Heir to the Throne
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Darkest Hour
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Europa Universalis IV
  • Impire
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Divine Wind
  • Hearts of Iron IV: No Step Back
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Victoria 2
  • Stellaris: Galaxy Edition
  • Teleglitch: Die More Edition
  • Hearts of Iron IV Sign-up
This comment is reserved by the Community Team for gathering Dev Responses in, for ease of reading.


The Goldfinch said:


That's simply the best diary I have seen so far - beautiful immersive world!

My question would be, can we have some clarification on how AI calculates the cost of war?
- on the streams we have seen Great Britain lose over 300k Pop's in war with China; can we hope for a mechanism that AI actually realises how much it is going to lose so much people that the wargoal is not really worth it?
- another thing: when AI is passing a law that can potentially trigger a civil war, is it going to calculate that it night be too risky with reward being just passing non hereditary beaurocracy?
- is boldness described in the diary as property attached to Great Powers a factor that is going to push Great Powers to engage in more bloodbath wars for signuficantly smaller benefit? Are there aby mechanisms to mitigate this behaviour

Again I would like to say: many thanks for this juicy, transparent and informative diary!

Click to expand...
1) The AI does have some consideration here for how dangerous a war will be for it but I will say it probably needs a bit more work on actually comparing gains vs potential losses. May have time to do it for release, otherwise for sure an area where it'll be polished more post-released.
2) The AI does consider how much it *likes* the law it's passing compared to reluctance for civil war, but I don't think it should make further considerations than that - that would be too much meta-gaming for me.
3) The boldness factor from rank is relatively weak and is more meant to be something like 'a great power is more likely to throw the dice on something like WW1 because they *could* come out on top while a small power knows it's going to suffer horribly' rather than 'great powers always escalate to war'


dw70676 said:


In a diplomatic play, is the amount of sympathy a country receives dependent on their war goal? For example, would a country that demands the return of a part of its homeland be afforded more sympathy by outside actors than one that demands land purely on the basis of might-makes-right naked aggression? In a similar vain, are countries with claims to the lands they demand afforded more sympathy? Or are countries more sympathetic towards diplomatic actors trying to free a people from a discriminatory overlord, especially those countries whose primary cultures share a heritage or two with the people of that potential country?
Indirectly yes, in the sense that the amount of Infamy they took from the wargoal plays a role and 'rightful' wargoals like returning lost land results in much less infamy.


Andrzej2 said:


Im suprised that there is not a single word about ideological alingement affecting AI sympathy and decisions. Do I understand correcly that absolute monarchy has no higher chance of supporting fellow conservative regime for example against liberal revolution?


Of course it wasn't uncommon, especially with years passing, that monarchies were cooperating with revolutionary forces. In the end Russian absolute monarchy ended in alliance with French Republic and liberal Britain after all.

But I think that one of possible AI strategies should definitely be fight against revolution or the opposite - supporting liberal changes abroad.

At the beginning of Victoria The Holy Alliance was still sort of alive. Well at least Russia treated it seriously and was called "the gendarme of Europe". Russia wanted to march and crush French and Belgian revolutions but was stopped by November Uprising in Poland. Later Russians intervened and helped Habsburgs fight Hungarian revolution.

After Russia was betrayed in Crimean war by ungrateful Austria, their ideological zeal and readiness to support conservative regimes abroad was weakened. That could be in game terms - strategy change from crushing the revolutions to more pragmatic stance.

Austria also was focused on fighting revolution until Metternich fell in 1848. After that Austria changed their strategy.

Click to expand...
This is definitely a thing but for some reason I left it out of the diary! The AI has something called 'Ideological Opinion' which compares the ideology of its government to the ideology of the other country and which plays into diplomacy, strategy, who it's likely to sympathize with in diplomatic plays (especially revolutions) and so on. So it's a very important thing, I just forgot to write about it!


IntoTheStars said:


Any chance you could explain why this is? I certainly believe you - I’m not at all a programmer - this just seems like an interesting limitation I wouldn’t have expected. Does it just have to be formatted in an inefficient way to be accessible to modification?
In a word: Yes. To expose the core loop we would need to make the core loop run through a script language which would be insanely performance-inefficient. HOI3 tried this and it resulted in an AI that had to be 100% railroaded for the game to work at all.


Dyspho said:


There are reasons why games give bonuses to IA to increase difficulty.
An experienced player will always outplay an IA in a fair competition.
It doesn't matter how aggressive or how biased against the player you program your IA, a human will always perform better.
Refusing to give bonus to the IA can only result in an easy and unchallenging game.
Very sad that Victoria 3 is going to that direction.
It's very easy to add an AI bonuses game rule as a mod if that's something you want, but we really don't think it fits our vision for the base game.


Nnorm said:


Given price fluctuations, what is really preventing AI from entering the unbroken cycle of building / degrading buildings?
For one, the AI doesn't downsize production buildings - there's really no reason for it to do so and if it needs to prop up a building it can use subsidies. When it comes to government buildings, they're not going to downsize a gov. admin just because paper got more expensive - the AI will only downsize government buildings if it believes that there is no other sensible way to balance its budget because it doesn't want to throw away these invested resources.


Sovetskysoyuz said:


Shouldn’t that be 50 + 30 = 80 as the threshold for Prussia?
Nope. It doesn't need to beat the combined scores, just whichever is greater.


FleetingRain said:


How impactful will this opinion be? Will it be anything close to the Reaction triggered modifier in EU4?
It can range from just a little bit impactful to very impactful, it depends on how large the ideological gulf is and also on the AI's strategy - an AI that's preserving the status quo cares more about it while one that's playing in a more 'machiavellan' way cares less. It also varies with what kind of action it's influencing - for example, the AI cares more about ideology when signing alliances than when signing trade agreements.


Ferrous Will said:


If it beats the score diff but not neutrality threshold: "Yeah, I do want to help you.... but not enough to actually do it"
If it beats the neutrality threshold and not the score diff: "Yeah, I do care... but not in your favor enough sadly"
two different criteria, no need to add them up
Exactly this :)


christian908 said:


I only have one question really, I know we the player can ask "will you help for an obligation?" in our plays, but is there a way for us to say, "I'll help you for an obligation." In their plays?

From what we've seen all you can do is pledge to one side seemingly for free. Is there a way to ask, or are we at the mercy of the AI overcoming it's social anxiety to ask us.
Unfortunately this will not be in for release, but 'reverse-swaying' is absolutely something I want to get into the game sooner rather than later, as well as just adding more things to offer and be offered in Diplomatic Plays in general.


RageForOrder said:


When a new building is modded in, will the Spending Variables be updated to keep the AI decisionmaking sane?

Like if I added a new more efficient version of a maize farm and called it a potato farm, would the AI ever build potato farms?

Do Spending Variables need to be manually modded in for each new building created?
Spending Variables are dynamically calculated from building properties, not separately scripted - they should work seamlessly with new buildings, production methods and goods without extra effort.


joeski27 said:


All in all this is one of the most interesting reads I’ve had for a long time.

My only real concern on AI
( granted I’m sure there will be bits to adjust on release) is the extent with which a state may commit to foreign wars.
is it something that might be in the pipeline that a European state shouldn’t offer to bring its entire military to bare IF in far off parts of the world it has been persuaded to join a play, or is this already in there somehow?
The AI does have a target mobilization level for each play/war depending on their level of involvement, expected opposition, enemy mobilization and so on. The AI doesn’t just 100% mobilize France's army to help Sardinia against Tuscany or conquer a weak country in Indonesia - they will try to raise a proportional force to avoid unnecessary costs and attrition.


AurumGames said:


> Well, just as in our other Grand Strategy Games, the AI plays the same game you do.

This is a flat out lie. The AI in EU4 cheats. It does. It can see through Fog Of War.
The "no cheats" part specifically refers to V3 but the AI in EU4 does play the same game you do - it doesn’t just fake an economy or ignore restrictions that bind the player. Last time I worked with EU4 it also respected fog of war, at least when it came to enemy armies.


Tirin said:


How much interaction is there between the AI Strategies for a country? Will the Administrative AI understand it shouldn't prioritize advanced productions if the Political AI has decided to suppress the relevant IGs? If the Political AI is barely keeping a lid on French separatism will the Diplomatic AI avoid conquering more French territory?
They don’t really coordinate much on purpose - the AI deciding to industrialize while cracking down on the liberals should create some interesting (and historical) conflicts for example.


Nationis said:


Would a historical only game rule be possible? Similar to hoi4?
HoI4 covers a few years of a single (if massively important) war. V3 covers one of the most transformational centuries in history. It’s not really feasible, no.


hide said:


Does this account for Pops?
If AI conquers a state with only unqualified Pops, will the building still keep "Must-have" status?
It's not a property on the building, the new owner would calculate its own priority for it.


Jorlem said:


UI question: Is there a way to see in-game what you explained in the caption, namely that expanding the farm will reduce profits because of the price impact from increased supply? In the screencap, I can see the first half, that profits will go down if the farm is expanded, but nothing indicating why.
It's showing why right there in the screenshot - the added wages cost more than the added sale of goods bring in under the new market conditions.


Moe 3mperor said:


How would this revision and the said principles address the problem of UK taking an inland isolated province of Qing and Prussia annex Denmark mainland instead of Holstein?
That was just a bug with a script weight being inverted, not really relevant to the principles here asides from the fact that yeah, doing so isn't behaving very plausibly and thus is clearly a bug.
 
  • 15Like
  • 2Love
  • 1
Reactions:

CorneliusBottomly

Second Lieutenant
15 Badges
Apr 3, 2018
196
808
  • Europa Universalis IV
  • Victoria 2
  • Cities: Skylines
  • Surviving Mars
  • Surviving Mars: First Colony Edition
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome
  • Surviving Mars: First Colony Edition
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Victoria 3 Sign Up
  • Crusader Kings II
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
However, I won’t really be talking about which exact amount of difficulty the AI provides or which level skill it plays at. Firstly, because perception of AI performance is highly subjective and what is a ‘good AI’ means something different to just about every player​
Sounds like corporate for "we haven't programmed a good AI".
 
  • 144
  • 19
  • 10Haha
  • 1Like
Reactions:

druez

Second Lieutenant
72 Badges
Jul 19, 2008
112
536
  • Stellaris: Nemesis
  • Europa Universalis 4: Emperor
  • Battle for Bosporus
  • Stellaris: Necroids
  • Victoria 3 Sign Up
  • Hearts of Iron IV: No Step Back
  • Imperator: Rome - Magna Graecia
  • Stellaris: Federations
  • Hearts of Iron IV: La Resistance
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Deus Vult
  • Hearts of Iron IV: Colonel
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Mandate of Heaven
  • BATTLETECH
  • Hearts of Iron IV: Death or Dishonor
  • Age of Wonders III
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Golden Century
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome Sign Up
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Crusader Kings III
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • 500k Club
  • War of the Roses
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II
  • BATTLETECH: Flashpoint
That is a great dev diary. Love when you guys do these types. Also, I really like the approach you are taking with the AI meaning it should roleplay its place, rather than just min/max.
 
  • 24Like
  • 6
Reactions:

The Goldfinch

Major
1 Badges
Dec 11, 2018
741
7.313
  • Victoria 3 Sign Up
That's simply the best diary I have seen so far - beautiful immersive world!

My question would be, can we have some clarification on how AI calculates the cost of war?
- on the streams we have seen Great Britain lose over 300k Pop's in war with China; can we hope for a mechanism that AI actually realises how much it is going to lose so much people that the wargoal is not really worth it?
- another thing: when AI is passing a law that can potentially trigger a civil war, is it going to calculate that it night be too risky with reward being just passing non hereditary beaurocracy?
- is boldness described in the diary as property attached to Great Powers a factor that is going to push Great Powers to engage in more bloodbath wars for signuficantly smaller benefit? Are there aby mechanisms to mitigate this behaviour

Again I would like to say: many thanks for this juicy, transparent and informative diary!
 
  • 32
  • 5Like
  • 1
Reactions:

The Goldfinch

Major
1 Badges
Dec 11, 2018
741
7.313
  • Victoria 3 Sign Up
That's simply the best diary I have seen so far - beautiful immersive world!

My question would be, can we have some clarification on how AI calculates the cost of war?
- on the streams we have seen Great Britain lose over 300k Pop's in war with China; can we hope for a mechanism that AI actually realises how much it is going to lose so much people that the wargoal is not really worth it?
- another thing: when AI is passing a law that can potentially trigger a civil war, is it going to calculate that it night be too risky with reward being just passing non hereditary beaurocracy?
- is boldness described in the diary as property attached to Great Powers a factor that is going to push Great Powers to engage in more bloodbath wars for signuficantly smaller benefit? Are there aby mechanisms to mitigate this behaviour

Again I would like to say: many thanks for this juicy, transparent and informative diary!
Well to sum it up: is AI calculating the price of 300k dead Pop's it's probably going to pay to get this delicious colony in Mauritius or Christmas Island? Is there any mechanism making AI resign because goal is not worth so many casualties? (Be it civil war or diplomatic play).
 
  • 12
  • 2
  • 1Like
Reactions:

Voigt

General
66 Badges
Mar 15, 2012
2.126
2.453
  • Victoria 3 Sign Up
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron IV: No Step Back
I faintly remember that you said that if you play a game in tutorial mode, then the AI is less likely to attack the player. Does this means that the tutorial mode beside all the tipps and journal entires also sets the AI to Lenient towards the player?
 
  • 16
  • 1
Reactions:

Ferrous Will

I Invoke The Ancient Power That I May Return!
129 Badges
Jul 17, 2012
1.146
4.101
  • Sword of the Stars II
  • The Kings Crusade
  • Magicka
  • Majesty 2
  • March of the Eagles
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Ship Simulator Extremes
  • Sword of the Stars
  • Europa Universalis IV: Rights of Man
  • Cities: Skylines - Snowfall
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - After Dark
  • Magicka 2
  • Cities: Skylines Deluxe Edition
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: Pre-order
  • Stellaris: Galaxy Edition
  • Stellaris
  • Europa Universalis III Complete
  • Cities in Motion
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Darkest Hour
  • Europa Universalis III
  • Arsenal of Democracy
  • Divine Wind
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
The Ottomans have a Belligerent attitude towards Egypt because of their very low attitude score combined with their ‘Conquer’ Strategic Desire
Very curious about the full list of attitudes.

We've seen conciliatory, which is "currently our relation is bad but it should be better"

Is there one for appeasement I wonder? ("Just take the sodding state and leave us alone")
 
  • 7
  • 2Like
  • 2Haha
  • 2
Reactions:

Benjamintf1

First Lieutenant
79 Badges
Jul 13, 2013
201
270
  • Crusader Kings II
  • Europa Universalis IV: Common Sense
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • The Showdown Effect
  • Europa Universalis IV: Res Publica
  • March of the Eagles
  • Magicka
  • Leviathan: Warships
  • Hearts of Iron III
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Cities in Motion 2
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cradle of Civilization
  • Humble Paradox Bundle
  • Hearts of Iron IV: Colonel
  • Crusader Kings II: Way of Life
  • Hearts of Iron IV: Cadet
  • Stellaris
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Europa Universalis IV: El Dorado
  • Tyranny: Archon Edition
  • Cities: Skylines
  • War of the Roses
  • Warlock: Master of the Arcane
  • Teleglitch: Die More Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Rule Britannia
  • Victoria 3 Sign Up
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Apocalypse
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Rights of Man
I'm so excited to use ai moding for fun observer games and what ifs maybe. Seems like it could be really fun to set the ai to want everything when I already cheat to set them to have all techs to see what happens when qing starts the game with all technologies unlocked at start.

Really exciting dev diary. Some surprises, but it seems well thought out, reasonable, some things seemed to naturally flow and seems good and easy to reason about. Kinda wish I was on the dev team lol.
 
  • 2Like
Reactions:

dw70676

Private
73 Badges
Aug 13, 2011
24
159
  • Heir to the Throne
  • Divine Wind
  • Stellaris Sign-up
  • Warlock: Master of the Arcane
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Crusader Kings II: Holy Fury
  • Stellaris
  • Stellaris: Galaxy Edition
  • Age of Wonders III
  • Europa Universalis 4: Emperor
  • Hearts of Iron IV: Cadet
  • Crusader Kings III
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings Complete
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV
  • Stellaris: Nemesis
  • Stellaris: Ancient Relics
  • Europa Universalis IV: Dharma
  • Stellaris: Apocalypse
  • Stellaris: Federations
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Stellaris: Lithoids
  • Europa Universalis IV: Golden Century
  • Europa Universalis III Complete
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis III Complete
  • Stellaris: Necroids
  • Victoria 2
  • Stellaris: Humanoids Species Pack
  • Europa Universalis III Complete
  • Europa Universalis III
  • Magicka
  • Crusader Kings II: Rajas of India
In a diplomatic play, is the amount of sympathy a country receives dependent on their war goal? For example, would a country that demands the return of a part of its homeland be afforded more sympathy by outside actors than one that demands land purely on the basis of might-makes-right naked aggression? In a similar vain, are countries with claims to the lands they demand afforded more sympathy? Or are countries more sympathetic towards diplomatic actors trying to free a people from a discriminatory overlord, especially those countries whose primary cultures share a heritage or two with the people of that potential country?
 
  • 18
  • 3Like
  • 2
Reactions:

praftd

Major
64 Badges
Jul 5, 2015
725
2.411
  • Crusader Kings II: Charlemagne
  • Stellaris - Path to Destruction bundle
  • Stellaris: Galaxy Edition
  • Crusader Kings II
  • Semper Fi
  • Majesty 2 Collection
  • Hearts of Iron III Collection
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Holy Fury
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Mass Transit
  • Hearts of Iron IV: Death or Dishonor
  • Cities: Skylines - Campus
  • Cities: Skylines - Green Cities
  • Crusader Kings II: Jade Dragon
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Cities: Skylines Industries
  • Crusader Kings II: Conclave
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Cities: Skylines
  • Hearts of Iron IV: No Step Back
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Stellaris: Digital Anniversary Edition
  • Cities: Skylines - Snowfall
  • Prison Architect
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
Honestly, what paradox game has programmed a good AI?

Personally I think Paradox's AI is pretty good when you actually take into consideration the context of the game. Strategic and tactical AI is extremely hard to do. The sheer volumes of decision-making, performance consideration, and long-term strategy is insane. Way more than the majority of games. While by broad objective measure of "AI" the AI is very poor, compared to most other games, it is extremely good. People really need to give credit where credit is due. We all get frustrated with the nonsense that goes on, but it is important to look at things from a programming perspective.

And the fact that the AI doesn't typically cheat is huge. The overwhelming majority of games with "good" AI is just because they cheat to cover up how terrible the AI actually is. It is the same thing that mods do when they "fix" paradox's AI. Either they make the AI cheat or they force it to behave in hard-coded ways to mimic optimal player actions.
 
Last edited:
  • 70
  • 2Like
  • 2
  • 1
Reactions:

AskingForIt138

Sergeant
39 Badges
May 21, 2021
64
458
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Golden Century
  • Imperator: Rome
  • Europa Universalis IV: Third Rome
  • Hearts of Iron IV: La Resistance
  • Stellaris: Federations
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Battle for Bosporus
  • Europa Universalis 4: Emperor
  • Victoria 3 Sign Up
  • Hearts of Iron IV: No Step Back
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Crusader Kings II
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Rights of Man
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
I am actually super excited about this new approach to AI behavior versus AI difficulty. I play a lot of HOI4 and frankly the Veteran feels as easy as normal with extra steps.

I think this approach is pretty innovative and I’m expecting it to not be perfect (especially in 1.0) but very, very rewarding. Cheers!
 
  • 15
  • 4Like
Reactions: