1. Victoria 3
  2. News

Victoria 3 News

Dev Diary #61 - Data Visualization



Hello all, today we are going to talk about some of the data visualization in Victoria 3, how we on the team have iterated on it since our UX dev diary and what we think through when talking about such iterations.

Aron is very busy doing what last bits of polish can be done before we lock down the game for release certification, so I have been asked to write this dev diary for you in their stead. I’m not officially a UX Designer but I do have my qualifications in user experience as QA and I also am quite opinionated about pie charts and other forms of data visualization as many of you in the community are no doubt aware of. I regularly get to be Aron and Henrik’s rubber duck as we talk through solutions to problems on the UX side and it's part of my job that I thoroughly enjoy.

(In fact the first draft of this diary was a full thesis on why pie charts are bad, but I was encouraged to tone down the rhetoric a little, so I will conclude they are aesthetically pretty but are horrible for conveying data.)

Just how angry is Paul? Even with the visualization you would still be guessing…

Now most of the time when we talk about Data Visualization in games, especially Paradox Games, the first thing that comes to mind is either line graphs or charts of some kind - giving a visual representation of data instead of just a pure numerical representation on the screen. This is not wrong, but data visualization is not solely about making some form of visual representation of abstract data. It is also about increasing the inherent cognitive understanding of the player by using known trends and patterns that are well established.

An easy example is the capacities, they are color-coded. When things are positive: it's green, when it's bad: it's red. We have a human tendency to impact meaning to color and thus it's a general rule of UX to never use Green and Red unless you are representing Good and Bad.

A quick glance at the capacities bar tells you all you need to know for the moment by color alone, and when you get its tooltip it continues such color coded summarization:

Have any of you who’ve seen streams or images noticed that this dynamic changes in regards to income? When your nation is in a deficit the balance can show either as white (neutral) or red (bad) in the capacity summary and there is an inherent reason for that?

We do not show a negative income balance as red until it reflects an unhealthy economy, but what do we mean by this? Nations run deficits all the time, but not all deficits are bad, especially those which are investments into the country such as construction. Construction is classified as a temporary national expenditure as opposed to a fixed one, meaning that we calculate your fixed revenue vs expenditure to be positive once the construction is finished, and we keep the income balance showing a neutral tone because of it.

This is to reflect that your money is going down, but the fundamentals are fine. What this allows you to notice is when this fundamental changes and turns red, signaling a larger issue of your economic fundamentals being out of balance that could cause future problems.

We may be losing money now but the fundamentals of the economy are okay if we ever stop building new factories…

This is a lot of what we have been trying to iterate on in Victoria 3 at this point in its development: we don’t want to just show you the static image of what’s going on just that moment but we want you to know the dynamic trends of where the data is going.

What do I mean by this? Well let me give you an example: see our buildings list (to make it clearer about what I am talking about I have gone with the minimized mode - didn’t know there was a minimized mode? Now you do!)

Behold the glorious minimized building menu and color-coded gold reserve bars.
(Bars are color coded on regular view as well)


Before cash reserves were only golden, and you would have to physically watch the bar tick along and hopefully notice the trend of your reserves. The data was still informative but you were only able to easily glance if your business had cash reserves (meaning it could afford a price disruption or could help supplement the investment pool). Now we use the historical data we would normally use to fill out a line graph to color the bar and add trend markers to show if the cash reserves is going up or down, coloring it green or red respectively.

Now at a quick glance you not only see how your economy is doing, but where it is going and you would be amazed at how significant such a small change can be. This is combined with our usage of red, white, and green to symbolize whether productivity is good or bad - to give you further depth of information: sugar industries in this picture are not failing but soon will be if you do not do something about it. Meanwhile the arms industry has stalled outright.

A lot of these data visualization changes, you might never see or notice, because when they work well their understanding becomes second nature, but here’s another one I want to call out: we recoloured the market summary tab:

Behold the new Market Panel, with corrected colors and balance bars to show the magnitude of the effect.

The older Market Panel, serviceable but flawed with its data presentation.

Okay we changed like 3 things, I hear you say - but why is that so damn important? I’m glad you asked that community strawman here’s why.

We removed the Red/Green visualization of the balance and by doing that we helped make our understanding of the market system clearer to the player. Remember, this is Victoria 3, imbalances are not inherently bad. Sometimes maintaining a shortage of a good can be done intentionally to prop up an industry or ensure the wealth of specific pops. (I went into the logic of why for this in my talk at PDXCON and if we are lucky at some point in the future I will get a copy of that up on the forums as well). We found that when we colored the items green/red we were inherently having players react in ways that they themselves found was not always good or what they wanted. In this case, this mostly meant players reacting to red numbers being “bad” and trying to make the number go green.

We also added balance bars, to help show you the magnitude of what those numbers mean in the scope of its total buy/sell volume and price scale. Can you tell from the old version above what the relative difference to your economy the liquor and sugar shortages are?). By giving more perspective on these offsets from equilibrium we help you better understand the cause and effect of your actions or most importantly; opportunity cost. If merely looking at high prices you might find yourself focusing on furniture or paper, but technically getting food prices lower is shown to have a larger impact on your economy, which is illustrated by the bars below the Balance values. The more blue or gold that bar is, the higher impact that Good’s imbalance has on your market. This impact may differ greatly per Good if it is good or bad, but that’s up to you to determine.

That’s just a few examples in the game of where we are iterating on data visualization. Mostly because these are the one’s I can easily remember and chat about. We are by no means done, Henrik, Aron and myself will continue in the trenches experimenting and iterating on such workflows throughout the game. We look forward to reading your feedback on release and use that to help us prioritize our backlog of ideas.

If you thought this dev diary was a sight to behold, just wait till you hear about the next one, which is the Audio of Victoria 3 which will be written by Franco Freda, our Head of Audio.

Dev Diary #60 - Modding



Hi folks! I'm Mike, one of the Game Designers who specializes in content for V3, and today we're going to talk about the delights of modding.

Modding is a whole world of things in Paradox games. Some mods are total overhauls, some are just simple little tweaks. I've seen sweet little mods that just add a person's pet as a graphic, or even one that I spotted on Hearts of Iron's workshop page as I wrote this that added in a dearly-departed office cat as a replacement for Joseph Stalin. There's all sorts of mods out there! And, hopefully, by the time you've finished reading this dev diary, you'll know how to create the start of your own mod for Victoria 3, too.

[h2]Starting with the launcher[/h2]

First thing's first: the way the innards of Victoria 3 operate is similar, but not exactly the same as, Crusader Kings 3 and Imperator, since they're all derived from the Jomini engine we also use. If you know how those games tick scripting-wise, you're 90% of the way to knowing how to make a V3 mod. If not, I will happily let Crusader Kings 3 explain a bit about how scripting in Jomini works.

If that stuff still leaves you a little baffled, don't worry about it! We're gonna walk through the basics of making a whole mod, from the first point of creation to actually running the darn thing.

So! Let's start from the top. When you fire up Victoria 3, you'll be greeted by the game's launcher. If you look in the upper-left of the launcher, you'll see four little options: Home, DLC, Mods, and Game settings. Click the Mods one. Go on. You know you want to.



From the Mods menu, you'll be greeted with three buttons. If you click "Mod tools" in the middle, you'll be greeted with a prompt to create a new mod if you haven't got any yet, otherwise you'll have to find the button on the menu and click it to bring up the Create new mod prompt.

Let's make something simple, shall we? How's about we make a country out of Ohio. Yeah, let's just make one country and make it show up in-game, that'll be a good test of all this stuff.



Slam that create button, and the launcher will create a new directory in your mod folder wherever your savegames and such are stored. In my case, and in most of your cases, that'll be in some place like



Found the directory? Good. Inside that directly, you're gonna find a folder named ".metadata", with a single file inside that, called "metadata.json". That folder and file is where all the data is stored that the launcher reads when checking out the mod, including the mod's name, version number if you wanna be fancy, and so forth. If you want to tinker with that stuff later, go on ahead, but we're not gonna touch it for this. Go back to the main directory, so that you're looking at "[...]\Paradox Interactive\Victoria 3\mod\It's Ohio!"

[h2]Mucking with files[/h2]

Let's start defining Ohio. The key thing with how to set up a mod is that you have to essentially copy the paths used in the main game, so the game reads everything right. In V3, country definitions are stored at "Victoria 3\game\common\country_definitions", so in our "It's Ohio!" directory we're going to make a "common" folder, and then a "country_definitions" folder within that. This mimics the path of the base game (that "Victoria 3\game" bit), so when the game reads this mod and tries to figure out how it interacts with the base game, it doesn't scream and die.

Inside our mod's "common\country_definitions" folder, we're going to make a little file I've arbitrarily called "ohio.txt". Open it up, and we'll paste text like this bad boy into it:



Wow! We've defined Ohio. Now let's tinker with history files so Ohio appears in-game.

Country control of a state is defined in a couple history files, found in the following directories:
  • common\history\buildings
  • common\history\pops
  • common\history\states


All three of these will need the base game files copied over- we sadly can't just add a new entry in a new file, because we also need to remove/replace the USA-related data in these as well. Make sure you duplicate these folder paths in the It's Ohio! mod folder, like you did with common\country_definitions.

Starting with the buildings directory, what we do is find "STATE_OHIO" among the buildings files- turns out it's in 05_north_america.txt. Copy that file and plop it into your mod's history\buildings folder, open it up there, then search for STATE_OHIO. You'll find a section that starts off with



and goes on from there. What's happening there is that we've declared that within the state region of Ohio (that is, "s:STATE_OHIO"), there should be a state controlled by the USA ("region_state:USA") that constitutes American Ohio. But we're making an independent Ohio, so all the data referring to American Ohio is useless and will confuse the game. All we're going to do is change that "region_state:USA={ " line to "region_state:OSU={ " so the same section now reads



Now, instead of telling the game that within the state region of Ohio we want to create a state controlled by the USA filled with the following buildings, we've told the game to create a state in Ohio that is just… Ohio, and that should be filled with the following buildings.

The same thing applies for common\history\pops. There's a 05_north_america.txt file we're gonna copy over, and we're going to find the STATE_OHIO entry, and change USA control to OSU.

State history is all saved in a single file, so in common\history\states\ you're just going to copy over the entire 00_states.txt file into your mod directory, and again crack open the file and search for STATE_OHIO. There, you'll find this entry:



A state is created out of provinces, which are all just x + whatever the hex code (a color expressed as six characters) for their province color is in the province map we used to create the whole map. In places like Ohio, there's only one state created per state region, but in places like Germany this section looks far more chaotic, as it is possible to create multiple states within a single state region. Don't think about Germany though, think about Ohio.

Hopefully you've picked up on the pattern of changes we've been doing- here again, we're just going to change that "country = c:USA" bit to "country = c:OSU", so that the whole STATE_OHIO section becomes



Exciting! I wonder what happens if we start up the game now?

[h2]Checking our work[/h2]



First, we need to get the darn thing enabled in the launcher. Open up the launcher, add a new playset, and call it "ohio!" or the name of your choice.



The launcher's going to say that the playset looks empty, so click the "ADD MODS" button that appears, so you can add mods, and then add “It's Ohio!”

Make sure the playset is enabled, and then let's play the game and see what happens.



Hold on… something feels wrong here. Let's quit out of the game, right-click on Vicky 3 in Steam, open up properties, and change the launch settings by plugging in "-debug_mode".



This enables the error log to appear in game. Let's see what happens when we load up the game now.



We have errors! We'll open up the error log, which can be found at "...\Paradox Interactive\Victoria 3\logs\error.log", and let's take a look at the error messages. Any time you're working on a mod, I cannot emphasize enough how useful it is to run the game with debug mode on and do your best to resolve any issues reported in the error log.

Please read the error log and fix errors reported there. I'm not even talking to just potential V3 modders now. Please, I beg you… read the error logs and fix the errors reported there.

Anyways! In our case, there's four sources to these errors:
  • By removing Ohio from the USA, we've reduced wine consumption enough that a scripted trade route that the USA starts with needs to be changed or removed. Easy enough, I'll copy the trade route history file over and remove that entry outright so I don't have to think about it anymore.
  • I didn't localize the Ohio tag (OSU)! I'll get around to localization after fixing the next two items.
  • I've completely forgotten to add country history, so Ohio's technological know-how hasn't been defined at all.
  • Starting pop prosperity, located in a separate "populations" file, hasn't been defined for Ohio.


Country histories cover technology and politics. To make this easy on myself and avoid scripting everything from scratch, I'm going to copy the country history of Ohio's natural counterpart at vanilla game start: Belgium. All I'm going to do is get to "common\history\countries\bel - belgium.txt" in the base game, copy that file over to the same path in the mod, rename it to "osu - ohio.txt", and open it up real quick. Inside, the file has a whole section enclosed within "c:BEL". That section contains several effects that set the starting laws and ruling interest groups of the country. I'm just gonna change that c:BEL there to c:OSU, so all those effects regarding politics and technology now apply to our OSU tag, then I'm gonna save the file and close out there.

The other history file I need to add is a population file. The population file contains some scripted effects which distribute health and literacy rates among a country's starting pops. We're going to find the Belgian one at "common\history\population\bel - belgium.txt". Like with the country history stuff, we're going to rename our copy to "osu - ohio.txt" (as long as it's named anything other than an existing history file, it won't accidentally overwrite anything, but keeping the same naming convention in place is useful for organization), and inside that file change the scope from c:BEL to c:OSU so the effects of the population file actually apply to Ohioans.

Speaking of "Ohioans", let's get that localization sorted. Base game localization is stored at "Victoria 3\game\localization" and further divided into the various languages the game is available in. I'm an Anglophone, so I'm going to default to English for this stuff. We're going to recreate the whole English-language localization folder path in our mod (so "It's Ohio!\localization\english"), then we're going to create our own little loc file to throw in there- let's call it ohio_l_english.yml just to stick to the theme. Now, all we need to add in that file is



And now our country should have a name and an adjective!

Some of you folks with modding experience may have noticed that existing localization in our games tends to have a number after the colon in these localization entries (like 'FRA:0 "France" ', for example). Those numbers are just there to help us and our translators keep track of when entries are changed and require revised translations- they have no functional purpose beyond that, and if you're just modding in one language and don't intend to translate your mod with the same tools we use, there's no need for you to include that number bit after the colon.

With those errors hopefully fixed, let's start up V3 again.



Ladies and gentlemen, we have Ohio. It still doesn't have a scripted flag- you can read more about how those work and are scripted here - but it's a country that functions. You could select Ohio and play as Ohio now, if you wanted, or you could elaborate further, and start writing events and journal entries. You could script up individual characters, or replace all Yankee pops in Ohio with your own bespoke Ohioan culture where everyone has names like "Bud" and "Janet". Explore the game itself, and the insides that make it all work!

In our Dev Diary next week, Paul will be talking about Data Visualization!

Victoria 3 Discord Q&A

Mark your calendars for the 29th of September! We will be having a developer Q&A session, so get your questions ready!

Join our Discord server here: https://discord.com/invite/victoriagamePDX

Dev Diary #59 - AI



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
  5. ( 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

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!

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

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!

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

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

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

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’

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!

Dev Diary #58 - Interest Revisions



Hello and welcome to yet another Victoria 3 development diary. Today is going to be a fairly brief dev diary discussing some design changes in diplomacy that happened as a result of internal playtesting and feedback, specifically to the mechanics of Interests and their significance in the game.

Interests, as you may recall from Dev Diary #19, are essentially a country having a diplomatic presence in a particular Strategic Region, either as a result of owning territory there, having a subject that owns territory there, or through a Declared Interest. Back then, Interests merely limited where you start Diplomatic Plays and Establish Colonies, and acted as a guide for the AI in terms of which countries it needed to care about

With so many Great Powers maintaining Interests there, Europe is a perilous place to start a Diplomatic Play in

So, what has changed between then and now? Well, basically, playtesting revealed two principal issues with Interests in the game. The first was that they simply didn’t feel significant enough, because they only tied directly into colonization and diplomatic plays. The second was that the number of declared Interests a country had available to them was based solely on rank, which meant that Austria with its miniscule navy was able to maintain almost as global a presence as the British with their, well, definitely not so miniscule navy.

To solve the first problem, we decided to do a little experiment - what if instead of just limiting colonization and diplomatic plays, Interests were required for all forms of diplomacy, up to and including trade? This was an idea we’d kicked around previously, but the concern was that it’d simply be too limiting, particularly where trade was concerned, because as mentioned, the only way to get more Interests was to increase your country rank, and once you were a Great Power, well that was it. No more trade partners, at least not of your own choosing.

The solution to the second problem, then, turned out to also be the key to the first one: tying the navy directly into declared Interests. The number of declared Interests from rank were reduced, and instead, Naval Bases now produce declared Interests, with one declared Interest provided per 10 flotillas that a country has. In other words, while Austria can now maintain a handful of declared Interests around Europe to look out for its national interests (pun intended), the size of Britain’s fleet allows it to poke its nose into the business of just about any corner of the world that it wants to.

Spain’s navy may not be what it once was, but it’s still large enough to allow the Spanish a greater diplomatic reach than their Major Power rank would otherwise allow

With this change made, our experiment truly came together, and allowed us to greatly expand the scope of the Interest mechanic. Instead of just being a requirement for taking over land, Interests now signify a formal diplomatic presence in a region without which you simply do not have the ability to interact with that region at all - no French diplomats in Southeast Asia means no French diplomacy in Southeast Asia.

In no particular order, here are all the mechanics that now tie into Interests:
  • Diplomatic Plays & Colonization: As before, a country must have an Interest in a region to start a Diplomatic Play or begin colonizing there.
  • Diplomatic Actions: To conduct diplomacy with a country, you must now have at least one overlapping Interest - meaning they must have an Interest in any strategic region where you also have an Interest. For example, Texas can conduct diplomacy with Britain if Britain maintains an Interest in the Dixie Region, even if Texas has no Interests outside the Dixie region.
  • Trade: To establish a trade route between two markets, one of the two market owners has to have an Interest in any region where the other market is present. For example, if the USA maintains an Interest in La Plata where the Argentine market is present, then Argentina and the USA can trade with each other, even if Argentina doesn’t have an Interest anywhere in North America.
  • Notifications: You will only be informed about diplomatic going-ons between countries with which you have an overlapping Interest, and in states where you have an Interest in the region.


As much as the Sikh Empire might desire European allies against Britain, their landlocked position limits their options - without a coast they will have to wait for one of those powers to take an interest in North India

Ultimately, the result of these changes were threefold: It made Interests a far more central mechanic to the game, it increased the need for maintaining a large fleet-in-being for empires with global ambitions, and it increased immersion by having who you could and could not deal with simply make more sense. An isolated Bhutan in the Himalayas now truly feels isolated, rather than inexplicably being able to send embassies to Paraguay at a whim.

That’s it for today! I’ll be back next week with another Dev Diary on a hotly anticipated topic: The AI of Victoria 3.