Hey there, everyone, Carlo here. As Content Designers, and developers, we not only make content, but we’re always trying to find new tools to do our job better and faster. And since HoI4 is crazy moddable, these tools are available to modders too, these are some of the new things you’ll be able to do when making mods, starting with Joint Focus Trees.
How do you make a Joint Focus Tree?
Well, at its core, a JFT is a Shared Focus Branch, one where depending on conditions, has a set of member countries, and the completion of the focuses is shared between them, and different effects apply either to the country completing them, to the rest of the countries or to all of them equally. After that it’s all Joint Focuses, and they’re different in a few ways. First thing you’ll notice is the text_icon parameter, we’ll talk about later, but the SECOND thing you’ll notice is the joint_trigger section. It’s a trigger that determines which countries will be considered part of the JFT and get their corresponding effects. In this case it’s checking if you have the alliance leader flag or you are in a faction with this country. The other thing that’s different from normal focus trees is there’s 3 (THREE) different sections for Completion Rewards. First one, regular old completion_reward does its effect in every valid country in the Joint Alliance, the same for everyone. Then there’s completion_reward_joint_originator, that only applies the effect in the country that completed the focus. And finally the completion_reward_joint_member, which applies the effect on every valid member of the alliance that is not the country that completed the focus. That’s basically it. It’s a simple system, but we hope it’ll be flexible enough to have a bunch of use cases and variations, specially since it doesn’t need to be a faction! We used a faction as the most obvious use for it but you can make any amount of related or unrelated countries share the tree. Every country in a continent? Sure. Every communist country? Go ahead. Countries on both sides of a war? Can’t stop you! I can’t wait to see what you do with it.
Focus Title Background
In the previous point I mentioned a text_icon parameter, that’s the way we are giving you the ability to change the background for the Focus titles. It’s one of the features that were added to enhance the Joint Focus Tree, but can be useful for any kind of focus tree content.. It came about because we wanted a way to quickly differentiate normal focuses from joint focuses. At first we thought about just making them have the same framing on the focus icons but that proved… Not ideal. The biggest problem is that it immediately made every focus icon be too busy and hard to read. Plus, when the whole tree was pentagons everywhere, it looked way too repetitive. Eventually, we accepted that we couldn’t solve this problem with art or design, and we were gonna have to resort to an extreme measure… Talking to a programmer D= We barely survived, but after an arduous process we agreed to make a system to change the title background changeable. It was the best option; relatively simple to implement, noticeable, and we didn’t need to make every icon from scratch. Of course there was still a bit of trial and error to get the look right. Setting them up is relatively easy. First, you will have to set up the 4 GFX entries you set up in the nationalfocusview.gfx, in our case, most of the animations and masks work just fine so it was mostly copy-pasting. There’s a new file called 00_titlebar_styles where you can add style entries and specify the GFXs for each state, and set one as default so you don’t need to specify the style for every single focus.. And now you just use your new style with the focuses you want in the text_icon parameter. They’re set on a focus by focus basis so you can go wild and do dumb stuff with any kind of focus!
Dynamic Focus Icons
Another feature that we added thanks to the Joint Focus Tree. You now can have the focus icons change depending on conditions. This is something I’ve wanted for a long time but never found a big enough excuse to do it… Until now. The reason we finally added it for the JFT is that we want to have the option of playing it as more than one ideology, while still giving you some thematic distinction. After all, a democratic alliance should have a very different look from one formed by monarchies and dictatorships. How they’re set up is very simple. Instead of specifying a GFX, you can open brackets and enter a trigger and a value. First one to be true becomes the icon for that focus! Just remember to add the “dynamic = yes” parameter so it’s updated more easily.
Showing Event Option Tooltips
One of the things I hate the most when doing events is showing the effects of both sides of the events in tooltips. Usually, when we have an event option that sends another event to another country, we have to show you what will happen in your country, and in the other country, so you can better judge what’s the right choice. This has always meant adding effect_tooltips and duplicating the other side’s effects inside it, which is time consuming and annoying to maintain and keep track of. Well not anymore! (Kind of). We’ve added an effect called event_option_tooltip, that allows you to show the tooltip that option will display. This is also very useful for those effects that go after the “If They Accept” tooltip. It does have some limitations, like ignoring anything inside a FROM so you don’t accidentally crash the game with an infinite loop if you have a show_event_tooltip on both sides, but it’s already been a time saver and we hope to improve on it in the future. .
Modifying the Effectiveness of Forts
You know, not every fort is built the same, but until now they were in HoI. To make it easier to represent just how bad and outdated fortifications were in Norway and Denmark we needed something extra, so we added a couple of percentual modifiers that change the attack penalty inflicted on the attacking enemy by forts: land_bunker_effectiveness_factor and coastal_bunker_effectiveness_factor. Before, if we wanted to represent having bad forts, our only option was reducing their production speed, which numerically could make some sense but feels a bit off thematically. You can be very fast in making really bad forts and vice versa. For example, if a fort normally inflicts a 15% penalty and you have a -50% value in land_bunker_effectiveness_factor, that penalty will be reduced to 7.5%. Forts are already plenty effective so we’re mainly using this to make them worse, but of course, there are exceptions here and there. And that’s it for me, but Mano de Zombi has a bunch of other stuff to show you! Mano de Zombi here! After returning from a sunny vacation to this Swedish deluge I really needed to go through some of the code support we've been getting lately in order to give meaning to my life and remind me of the things that I enjoy and that not even this weather can ruin for me. So here you have a selection of functionality, tools and improvements that have been added during the past months by our amazing coders: Scripted Loc can now be used in Dynamic Modifiers Your dynamic modifiers can now dynamically change name (previously we needed to create duplicates and swap the modifiers and it was really painful and ugly T_T) New Generator Parameters for create_wargoal effect We can now use an array as the generator in the effect create_wargoal, allowing us to set the generator states based on the world conditions by the time the effect is executed:
You can use an already set array if you so desire:
Or you can create your own array and add states based on whatever requirements you'd like:
New Functionality for CTRL + ALT + Click
We’ve added more functionality for the (debug-only) hotkey CTRL+ALT+Click on certain UI elements. For those of you who might not know about this hotkey, this is an extremely useful tool for scripting and debugging: when used on a certain object in the UI, it will automatically open the file and lead to the line in which said object is defined, so you can immediately see the script behind it, and do whatever you need to do with it. Quick example: (with debug mode on) you can CTRL+ALT+Click on a focus and it will open the appropriate focus file and lead you to the line in which it is defined: As a reminder, this could already be used in focus, events (clicking on any of the event options), decisions, ideas (National Spirits, Designers, Laws, Officer Corps Spirits), characters (advisors, country leaders, unit leaders), technologies and doctrines. Please forgive me if I forgot something, I can barely hear my thoughts on this rain… Now, our amazing coders have fixed an issue with unavailable advisors not working with this (now they do!), and new functionality has been added so that we can now CTRL+ALT+Click on:
Designer Modules in the Ship/ Tank/ Plane Designers
Battalions in the Division Designer
Production Lines and Equipment in the Production Tab
Intel Agency Upgrades
Operations and Phases
MIOS and Traits
Improvements for Division Commanders.
We have improved a bit the way of scripting Division Commanders (Field Officers). Now you can define them with a localized name and with portraits, both in OOB files and inside the create_unit effect:
Parameter random_select_amount
This useful new parameter can be added to all the every_[scope] effects (every_character, every_state, every_other_country, etc.). The parameter takes an integer as value, and this value is the number of times the effect will run before breaking the “for” loop running behind the scenes. Previously, we had a few different ways of applying effects to, let’s say, 3 random states, but all of them required an unreasonable amount of script and custom tooltips in order to make sure that the effects could not be applied to the same state twice, and they all generated very shitty tooltips. Now, the use of random_select_amount allows us to apply effects to a number of random scopes (states, characters, countries…) in a very simple way with no possibility of choosing the same scope twice and generating a standard tooltip that indicates the actual states targeted by the effect:
Filter for including invisible unit leaders in effects & triggers
If you ever had the need to apply effects to all your land and navy officers, regardless of them being visible to the country or not (due to, for example, the country not having completed a focus yet), you will find the new parameter include_invisible pretty useful. This parameter is now available as an optional parameter in the full set of scoped triggers and effects related to unit leaders (every/random/all/any_unit/navy/army_leader). By default is set to false, so you only need to use it if you want to scope to all the unit leaders belonging to a TAG, regardless of them being visible (unlocked) to the country or not. This is the full list of effects and triggers that benefit from this parameter: every_unit_leader random_unit_leader every_army_leader random_army_leader every_navy_leader random_navy_leader all_unit_leader all_army_leader all_navy_leader any_unit_leader any_army_leader any_navy_leader
Use of Variables as tag in targeted modifiers
Now it is possible to input a variable as the tag parameter inside the targeted_modifier block, allowing us to store the appropriate country inside a variable and then apply the National Spirit targeting the appropriate country very easily! And this is all for me, I’ll see you soon in a future Developer Diary but in the meanwhile I wish you all a great summer!
Velkommen tilbage to Danne’s Danish corner and the country where one of its leaders looks like Santa Claus while another one is literally named Christmas. It’s time for another Danish bashing Dev Diary, where we’ll look at what kind of alt-history shenanigans Denmark can do to avoid their world-breaking record for fastest capitulation. Will they be able to withstand German Panzer divisions? Will they be able to ally with the Germans? Will they be able to avenge their humiliating defeat of 1864? Will anyone finally make sense of the Danish language? Of all these questions, I have the least hope for the last one…
Before we get started, you might want to read up on the Historical Dev Diary if you haven’t done so, and keep in mind that all of this is still a work in progress - things might and will change before release.
Let’s start off with looking at a bunch of art assets that I either forgot last time around, or that weren’t finished back then. Here you can see Denmark’s standard infantry at the very top, together with the Danish Brigade and the Resistance militia divisions. And down in the left corner, you can see the literally brand new militia unit - based on Denmark’s WW1 uniforms. Fun fact: the faces of the Danish soldiers are in fact modeled after a real-life Danish officer who fought in WW2.
And here are 2 airplanes unique for Denmark - and definitely alt-history since these designs never left the design phase:
Aligning with Your Overlord
Denmark (in)famously capitulated two hours after the German invasion, and if you capitulate to an invading enemy the Occupation Branch becomes available and you’ll be able to gather foreign support to eventually topple your evil overlord and become free once more. That’s all historical and nice and all - but what if you could join forces with your overlord and go on a conquering rampage through the Nordics? Wouldn’t that just be swell? Well, if that sounds interesting I got just the thing for you, chap!
Why not take advantage of being a puppet and use your overlord for your own gains? By completing the Focuses Align with Overlord and Contribute to the War Effort you unlock Denmark’s Military Branch again and you can conquer the rest of the Nordic countries you’re not in a faction with. Sometimes it just feels good being bad! This doesn’t preclude you from backstabbing your overlord though; you can still pursue your independence by building up a resistance movement, declaring your independence, and waging war against your former masters. Or, if you against all odds have had your fill of war, blood, and steel (I doubt it though), you can work on becoming independent through peaceful means.
Rearming Denmark
But what if you really don’t wanna become a puppet of a bigger, stronger neighbor? Well, there’s something for that too. If you want to withstand the onslaught of the Wehrmacht, you better rearm and seek out allies in the Rearmament Branch.
Historically, there were forces within Denmark that wanted to rearm and strengthen the defenses - Christmas Møller, the leader of the Conservative Party, being a notable example. Thorvald Stauning, the Prime Minister of Denmark, even tried to seek an alliance with the rest of the Nordic nations, but those plans fell through. He then tried to initiate cooperation with the UK, where he under no uncertain terms was informed that they could not guarantee Denmark’s safety and wouldn’t make any commitment to military support. This cemented Danish pacifism and neutrality even further. But you don’t have to suffer the same fate…
Let’s start off with the sub-branch that is shared with the Historical Path:
This branch is all about building up and improving your industries and production. You’ll add 1 level of infrastructure in all of mainland Denmark, before having to choose what kind of regulations you want to impose on your industries - if any at all.
The astute among you will have figured out that there is no pure communist path for Denmark - but that will not be an issue if you want to overthrow the king and let the people’s revolution sweep across the nation! You simply have to use the election system implemented for Denmark ;) But they do have a Focus only they can take, namely Introduce the Five Year Plan
And if you don’t wanna go commie, you can have a Limited Social Mobilization to face any German looming threats
Now, let’s get to the meat and bones of the Rearmament Branch. One thing that’s prudent to do is to prepare every facet of society for the coming war, which you can do through the various Preparation Focuses before being able to do a Full Social Mobilization
Preparations are all fine and dandy, but it might still be a bit challenging to hold back German Panzers all on your own. As luck would have it - you don’t have to do it all by yourself. Completing the Focus Seek Protection will open up two distinct possibilities for you; seeking out a Guarantor of sorts, or joining a Faction. Both of these sub-branch's effects will vary slightly depending on the choices you make. But let’s break them down individually, shall we?
Signing a Non-Aggression pact might seem like a silly focus to do, and not at all worthwhile - but there are benefits to be reaped eventually. Completing the Sign a Non-Aggression Pact will open up the decision Seek a Guarantor, where you can choose between different countries to approach. Mind you, they will all have different ramifications for the following focuses!
Then with Negotiate a Trade Deal you get a couple of Subsidies for various equipment targeting the Non-aggression signator country - plus a Licensing Agreement with them
With Enter a Research and Partnership Program you start to truly see the effects of your previous choice of country to sign a pact with:
And the last focus of this sub-branch, Territory for Protection (which is precisely what it sounds like), is where the true effects of your choice of signatory country comes into play; which piece of your nation are you willing to part with in order to get a guarantee from a major power?
But there are other ways of getting friends if you don’t feel like parting with a single territory of your realm. All you have to do is seek Strength in Numbers, which will remove your National Spirit Declaration of Neutrality - which also means that you no longer will have the option of instantly becoming anyone’s puppet in case of an invasion. Completing this focus will give you a Decision to choose what nation you want to form an alliance with; do you want to join an existing one, or maybe start a brand new one? You also open up the Joint Focus Tree if you want to have deeper cooperation with your Nordic neighbors. But as with Sign a Non-Aggression Pact, the choice of ally will have ramifications for the following focuses.
Yeeeeeaaaaah, that’s one BIG tooltip, isn’t it? I’m afraid it’s necessary in order to show the different outcomes of each choice you can make; I would rather have a well-informed player than remove crucial information.
Last but not least, you can invite the other Nordic countries into your faction. But see, the Scandinavian nations weren’t too keen on joining any alliances at this point in time, so what do you do if or when they turn you down? Well, I suppose they would still need protection, whether or not they realize that themselves. And I suppose it would be best if a fellow Nordic brethren did the protecting. And I suppose you, who understand and see the severity of the situation, would be in the best position to offer said protection. And I suppose you have been rearming Denmark for a reason, so you might just as well put that brand-new grand army to use - to protect the Nordic peoples of course.
But what if you want to take a more… proactive approach instead of letting the Germans come to you? Well, you can always-
Let the King Assume Power
Now, historically King Christian X didn’t meddle too much in politics - not after the Eastern Crisis, when a Civil War almost broke out in Denmark - even though he had the authority and power to do so. He actually served for quite some time in the army before becoming King, and as such he often wore uniform and maintained his identity as an officer. But even so, he can’t just overthrow the government and grab power for himself willy-nilly. You gotta work for it, where the first step is to Unify the Right and start to gather the right-wing parties in a form of coalition. The first few focuses in your effort to give Christian X full authority of the government will be all about strengthening the support for the Non-aligned party and undermining the Democratic parties, but also to gaining the support of the officer corps and strengthening them too. But while doing so, you’ll also boost the Fascist party - so be mindful not to let them become too powerful!
Having come to power, Christian X can promote unity with For Konge og Fædreland, where you’ll get access to the Chief of Navy and begrudgingly bad-ass-looking crown prince of Denmark.
And just here’s a non-game related picture of the future bad-ass-looking King of Denmark, Frederik IX covered in tattoos. Who knew royalties were even allowed to get inked?
You’ll also be able to realign the industries and economy to better serve national interests with Align the Industries to National Interests and Economic Mobilization and making sure that Denmark isn’t a technological backwater by expanding Copenhapen’s University and gaining one more Research slot.
While you can take a more proactive foreign political stance, you can still choose to join forces with the Allies, imperial Germany, or any of the Nordic nations and access parts of the Rearmament Branch. This would preclude a more offensive approach though - but the choice is there.
If you choose to take the offensive to your enemies and turn your gaze toward a Europe in turmoil you have first to secure your Northern Flank with Scandinavian Security. You’ll have to decide if you want to create your own faction, or if you wanna solo it completely.
After that, the Nordics are your oyster! You can try to influence countries around the Baltic Sea and eventually offer them proper protection in the form of subjugation - there is after all something to be said about the pen being mightier than the sword.
Or you can try to reclaim old Danish territory. Norway was after all united with Denmark for literally hundreds of years, and Sweden really should know its place under Danish rule - just like in the good old Kalmar Union days. On your way to conquering the Scandinavian countries, you’ll be helped by a nifty National Spirit;
But, if you manage to convince one of these nations to accept your protection and become a puppet, the focuses will offer other benefits;
And with Sweden under your control you can exploit their immense mineral wealth, and even offer resource rights to a nation for guarantees:
And lastly, we have the end focuses for Denmark - all based on different time periods in Danish history. You can either take on the Germans with Avenging 1864 - to make sure that they never threaten the Danish heartlands ever again. Or, you can pick up the Danish ambitions of establishing a Baltic Sea empire, the Dominium Maric Baltici; Danish expansions into the Baltics go back to medieval times and they fought the Swedes over dominance in the region.
Lastly, you can turn your gaze even further back in time, to when Denmark first emerged as a unified country, and try to re-establish the Danelagen, or the Danelaw. This will allow you to re-form the old Viking realm of the North Sea Empire.
But this last focus is only available to the fascists. Oh, I suppose we have to talk about-
The Fascist Options
Having overthrown the government and installed a new one, you might not want to empower the monarchy any further, but take Denmark in a different direction. Well, then you’ll have to have the Fascists March on the Capital to show how discontent they are with the lack of influence they have in the new regime. And after reaching the capital you have to make a choice; do you wanna go alone about conquering the world, or do you wanna team up with your fellow Fascists down south, just across the borders; the German Reich?
If you simply Seize Power for yourself, a civil war will ensue, but after that, you can put Denmark First and create a faction of your own - but this will of course remove your National Spirit Declaration of Neutrality.
On the other hand, if you want a big, strong neighbor helping out in your expansions you can always turn to the Germans and Ask for Support. You can then deepen your cooperation with the focus Dano-German Military Cooperation.
But the country’s been through quite a bit at this point - not one, but two coups! - so you’ll have to Rally the Nation before moving on.
But after that is done you can wreak havoc as you see fit. The Fascist path largely shares the same expansionist focuses that the Monarchist path does, so you know all about that part already. But what the Fascists can do is Institute Corporatism
You’ll also get the opportunity to Prioritize Søværnet or Prioritize Hæren
And if things are going really badly for you and you find yourself being pushed back on all fronts and losing ground, you can declare Total Krig - Total War
I think that’s about it for alt-historical Denmark. I hope you’ve enjoyed reading these Dev Diaries and found at least one of the branches intriguing - I have had a blast working on Denmark! I think their history with the occupation was really interesting, and trying to incorporate that somehow was a lot of fun. Their failed attempts to join or create an alliance were also really useful. Their rich history ranging from the Viking era to their different forms of empire throughout the ages gave a lot of inspiration to where to take their alt-history paths too. Hopefully, you can take this small nation and restore it to empirehood once again (I’ve heard that those pesky Swedes have been bad-mouthing the Danes - so go and teach them a lesson in humility)!
Summer break is over here in Sweden, most of the team is back from vacation and it's full steam ahead towards the finnish line. As mentioned in the last Swedish DD there’s two designers for the Swedish tree, so you might see both of us answer in the comments below. Without further ado
Communist Sweden
In game the path to communist Sweden is to the left side (we finally managed to have the communist path on the left and the fascist one one the right) of the democratic historical path where you instead choose to align with the Swedish trade union to unlock some communist advisors
When your support for the cause is high enough, you can flip communist with the leader Nils Flyg. This guy definitely does not fit into the HoI mold as he became disillusioned with the Soviet Union and became pro-axis.
In game this means that the non-comforming Flyg can join the Axis (for the rest of you historical figures it would really help us if you only stuck to your designated 4 allowed ideologies please)
Flygs grip on power will be challenged by Karl Kilbom after a period of time, where you can choose to align more with the allies for a less radical future.
As you flip communist the fascists are not all too pleased and will start gathering support for a counterrevolution, eventually also dragging in the military if you wait too long. Preventing a counter revolution will expose the big ringleaders of the plot.
The ringleaders are 3 of your generals, and you get to decide what to do with them. Either you prosecute them for treason using the legal system, which retires them permanently but gives stability, or you “promote” them away from power where they can do any real harm, keeping them as generals but getting a debuff.
In any case fascism is crushed in the country and we now get to a cornerstone of the communist branch, socialist reforms. All those toasters that you used to throw away? They are now used for something
You also get to enact different policies that relates to consumer goods, turning your civilian population into a potential powerhouse.
To the left there are two refuge focuses. The first one is quite self explanatory.
The second allows Sweden to get foreign communist advisors depending on what focus path other countries are going for. In this example Portugal has gone down the Iberian Wedding path, Poland has gone with the April constitution and Ethiopia has gone down the Fascist path, so these advisors will flee to Sweden and become available. This list will grow or shrink depending on what other countries pick as their focus path. Regardless, the player will always get the specialized Communist Military Council.
State planning committee and Establish Politibury both expand on the consumer goods decisions and give some needed factories, while the Starve the fascists/allies of iron embargoes your future enemy and increases your output at the cost of consumer goods.
The end of the tree deals directly with your neighbors, for Norway and Denmark you can more easily influence them and eventually topple their government in a civil war for that James Bond (™) spy experience.
The Finnish version is more about actively helping the Finns and use them as a buffer state against a potential angry USSR.
The capstone focus of the tree is when you offer everyone a base minimum income, which will help with newly conquered states compliance. At the end the path merges with the late game focuses as described in the first DD.
As you might see, a lot of this path is focused on using consumer goods in a beneficial way. You can control how much/little goods you spend, thus increasing the strength of Folkhemmet at the cost of your consumer industry.
In this extreme example I have gained a lot of bonuses
But it has also resulted in my civilian economy tanking.
Small changes since last time
There's some small changes since the last DD that I think I should mention, first of which are changes to how Hungershield works.
Previously if you were under a % stability threshold the game would roll a die each month, and if the player were unlucky enough they would get strikes. While being under the threshold had the desired effect being at unease I never liked putting the player at the hands of RNGesus for such a critical component.
The most likely outcome if a player got a bad roll would probably just be reloading from the latest autosave, which was something I wanted to avoid.
The system is now more deterministic. The player can always see the conditions for the strikes starting to tick down, and it gives you some time to adjust your strategy accordingly, which is a more fair system. If you have ever played Mexico this might look familiar to you.
The Nordic defense council branch also got some additions. There are some new focuses, and the entire branch now hooks directly into the tail end of the democratic branch so that it is no longer just a dead end..
And if you get to a fully powered council you get to build the ultimate battleship, but it might sink your economy for a little while.
If you are unlucky and no one accepts your invitation, you can now coax them to join, so even if no one initially joins its not game over and you have to restart.
And here is the council portrait itself
Raoul Wallenberg is now an advisor and operative and Sweden now gets a snow focused armored car
Resource balance boggolo two
Unrelated to Sweden here are some new numbers on the upcoming steel changes coming in the accompanying patch. All stats are at game start (‘36), with infrastructure and no production lines. The (start) rows are with the starting trade law of the country, while (total) is on closed economy.
Germany
PRE-AAT
AAT
Delta
Steel (start)
381
253
-128
Steel (Total)
508
284
-224
Austria
-
-
-
Steel (start)
5
15
10
Steel (Total)
10
29
19
France
-
-
-
Steel (start)
457
313
-144
Steel (Total)
914
625
-289
UK
-
-
-
Steel (start)
229
262
33
Steel (Total)
452
524
72
As you can see Germany and France still get axed in regards to some of their steel production, but not as bad as before. With the drastically reduced steel production presented in the first dev diary Germany had no option to go on any other law (unless spending massive amounts of resources on trade).
While making Germany more reliant on trade and reducing the overabundance on steel that the game has, essentially allowing Germany and France to bypass a lot of the resource aspect of the game was a goal, I did not want to force players to be on limited trade and that was the end all be all, which would be the same as free trade being the end all be all before.
Now a German player has the ability to go on Free Trade while still hovering on the green (barely) at game start with no additional mils (using the starting lines).
If the goal is to build civs for the first years of the game free trade might still be lucrative for you, but once you start ramping up military production you will probably be forced to change laws.
Vice versa if you are more into a mil rush build you might want to bump the law to export focus instead.
France instead has gained some steel from before, mostly due to Africa.
Northern Africa's deposits are now more abundant than before (note that you don’t access it all due to compliance at the start but can unlock it all with the Blum -Violette proposal). My hope is that it is gonna incentivize the Northern African campaign from both sides, with the allies wanting to secure the steel and the axis wanting to claim it.
As you can see the UK has also gained some resources, those are from the Sierra Leone and Ghana mines
This is to give a larger purpose to areas of Africa that historically in game has had little reason of justification to hold or conquer. The real value of the steel is a bit higher than is presented here but is lower due to occupation and compliance.
Germany also has 1 new focus where it can gain resource rights for Västerbotten, giving them a nice 49 tungsten, 55 steel and 21 chromium, and some nice buffs to Sweden’s economy
Additionally Operation Weserübung now has the additional effect of adding civilian factories if Germany controls Narvik. This hopefully will add some extra incentive to control the port. However this also gives the option of the UK launching Plan R 4
If the UK invades Narvik they can be given the option to go into Sweden, blow up the Swedish iron ore mines and get out. Successfully doing this will remove all the civilian factories that Germany has gotten from controlling Narvik, and sabotaging the Swedes mines. It will also give the UK the option to white peace Sweden to avoid a full scale Swedish war. This will only be available for a short period though as if you fail the operation the public will see through the charade of “we are just trying to help the Finns”, leading to a large drop in stability.
Currently the resource gained from compliance has also been increased from 60% to 65%, but as always balance is in flux and these might be changed later. Germany still starts with 2 extra civs.
Fascism and Monarchism
Let’s dive into the other ideological alternate history paths for Sweden, those being monarchism and fascism. It isn’t really accurate to categorize Swedish far-right activity during this period as simply fascist. The public were largely disdainful of Italian style fascism, seeing it as a foreign ideology trying to undermine the foundations of their nation, much the same as they viewed communism. Instead, many would-be fascists looked to German National Socialism for inspiration due to the strong cultural and economic links between Sweden and Germany. While this would make the movement more palatable to Swedes, it would have repercussions for the movement in the long-run.
The National Socialist movement in Sweden during this time period, while active and visible, was unsuccessful in gaining much traction with the public. There were many reasons for this, but we shall try to summarize the main points. Perhaps the primary factor that undermined them, and the communists for that matter, was the success of the Social Democrats in providing a strong social safety net and employment for the masses. This meant people were less likely to be radicalized in the same way that occurred in Germany or Italy following the Great Depression. Furthermore, there were multiple National Socialist parties all bickering with one another, keeping the movement fragmented.
Geo-political factors also contributed to undermining far-right activity. The historic animosity with Russia led many to see communism as a Trojan horse for Russia to gain influence over Swedish affairs. This prevented the communists gaining too much support and in turn prevented large numbers of would-be National Socialists joining movements to curtail them, as had occurred in Weimar Germany following WWI. Furthermore, Swedish neutrality over the previous century meant there was little appetite for the militaristic rhetoric that was so successful in other nations of the time period and there were no seriously pressing territorial disputes that could be called upon to galvanize the public against a common foe. Instead, most of the public supported the nation’s continued neutrality, save for the Winter War when many Swedes were prepared to fight in defense of their eastward neighbor, Finland.
As mentioned above, the far-right in Sweden were predominantly National Socialist in character and this would ultimately be the undoing of the far-right in Sweden. Once World War II began there was a shift in Swedish attitudes against National Socialism, due to the threat Germany now posed to Swedish independence. While there were those of a ‘Quisling’ persuasion who hoped to be swept to power by a German occupation of Sweden, the National Socialist Movement fragmented further and was forced to drop their militaristic uniforms and tone down their rhetoric to maintain any semblance of support among the public.
With regards to the monarchy during this period, King Gustaf V had reigned since 1907 and had overseen the transition of the nation from a highly centralized power structure around himself, to a constitutional monarchy with universal suffrage. While there was much controversy over the King’s actions during the time period and high proportion of aristocrats in positions of power in the military, there was no movement advocating for the return to absolute monarchy.
Given all of this, you might be wondering if we even bothered to make a fascist or monarchist path for Sweden. Well, rest assured that we did. And whilst it took some time to figure out how to do it, I think we were successful in creating some engaging alt-history narratives that give players an immersive experience into how different things could have been in little old Sweden. So let’s get into it.
As you’re well aware by now, the National Socialists and the monarchy both suffered from similar issues and their supporters shared common grievances. Therefore, the path to restoring the monarchy or installing a National Socialist regime are initially the same. By taking the focus ‘The Old Enemy Stirs’ players can use the public’s fear of the Soviet Union and communism to gain support for their nationalist agenda. Players will have to walk a tightrope between lowering stability enough to gain support for radical political changes, while not enraging the political opposition too hastily and triggering civil disobedience.
The first real choice in this path is between undermining the fascists or revoking the anti-militia laws. ‘Undermine the fascists’ will put the player on the path towards restoring the powers of the King and becoming an absolute monarchy once more.
Meanwhile, ‘Revoke the Anti-Militia Laws’ will lead to the National Socialist movement coming to power. The historical context for this focus comes from 1931 when the Munckska kåren, a paramilitary organization of anti-communists were unveiled which led to a debate over such groups among the public. In 1934, the government would outlaw such organizations before they could get out of hand. This prevented the same sort of street violence that occurred in other nations during the time period, but in this scenario we are reversing course. In game play terms, this will allow players to recruit Stormtrupper militia divisions. These will be crucial to the player should the nation be embroiled in a civil war.
The following focus is shared between the monarchist and National Socialist branch, but allows the player to increase support for their respective ideology via decisions. However, these boosts in support will come at a price. Once democracy is suspended, missions will be activated whereby the player must fulfill their obligations to these benefactors, or face severe hits to stability.
On the National Socialist Side, another path must be chosen between pursuing a purely independent movement in Sweden, or approaching the German Reich for support. Gaining the support of Germany will be the easiest path for changing ideology and offers great rewards, however it will come at the cost of becoming their puppet. At least for now…
Let's take a closer look at the ‘Delegation to Berlin’ sub-branch first. As you can see, there are multiple mutually exclusive focuses here that allow the player to tweak the nation to their play style. While many will be content to fight alongside the Axis as a puppet, there are those who enjoy the challenge of overthrowing an overlord, both options are viable here. The path culminates in a decision to become the master of Scandinavia in the German sphere of influence or to backstab the Germans by declaring an independent Swedish Reich and attempting to defeat them militarily. Timing your betrayal of Germany with the war turning against them can be extremely fun.
Over in the independent part of the branch, the path to power requires gaining enough support to orchestrate a putsch. With the country undergoing so much internal turmoil in such a short space of time, the following focus gives a boost to rebuilding the nation and preventing adversaries from undermining the new regime via espionage.
If a monarchist play through is more your interest, you’ll have noticed the ‘Meet With the King’ branch. This section was inspired by three main factors, one being the historic ties between the Swedish royal family and Germany. The King’s wife, Queen Victoria, was one of many royals of German descent for example. These historic ties lead many to believe that King Gustaf was somewhat sympathetic to Germany during the time period. This wasn’t helped by him writing to Hitler of his support for the invasion of the Soviet Union in 1941. The second factor that influenced our narrative was that the King invited the leader of the National Socialist party, Sven Olav Lindholm to the royal palace for a meeting. The third factor in our narrative was King Gustaf’s willingness to insert himself into political discussions despite the undemocratic nature of doing so. For example, in 1940 he threatened to abdicate as a means of forcing his preferred policy option during the ‘midsummer crisis.’ In our monarchist path, we’ve expanded on these factors so that we can see what might have happened if the King had been a little bit more politically active. The ‘Meet With the King’ focus triggers an event for unifying the nationalist movements of the nation under the banner of the King. Decisions are then unlocked to boost support for the King and the restoration of his authority. In order for this to work, the authority of the Social Democrats and the unions has to be undermined in the following focus. Finally, with enough support and destabilization, the King can return to power as absolute ruler.
Now, with either the King or the National Socialists in power, we come to ‘The Counter Revolution’ and the job of rebuilding Sweden upon a new ideology. This focus triggers the previously mentioned missions for fulfilling obligations to the supporters of your chosen movement as well as removing the Social Democrats’ Folkhemmet national spirit. This in turn allows the nation to more rapidly expand the military at the expense of stability. You may have noticed a number of hits to stability in this branch of the tree, this is because we wanted the process of changing Sweden from a well established, neutral democracy to a more authoritarian government to feel challenging.
Finally we come to the foreign policy aspect of this alt-history branch, which unsurprisingly allows for multiple expansionist opportunities at the expense of your neighbors. While we won’t go into every possible route today, the overarching theme for initial expansion is similar to Germany in the 1930s. These focuses give Sweden the opportunity to create an international crisis over small territorial disputes with their neighbors that ultimately undermines the integrity of said neighbors and allows Sweden to eventually conquer or puppet them.
However, we also have more co-operative methods of foreign policy here too. Sweden has the opportunity to approach the Allies and join their faction in exchange for Sweden’s historical overseas territories being returned to them. If accepted, Germany will be starved of much needed Swedish resources during the war and give Sweden territory in the Caribbean, Africa and India.
To the opposite end of this branch, we have opportunities to cooperate with the Axis and Finland in their dealings with the Soviet Union. This side culminates in Sweden gaining claims on the lands of Eastern Europe that once had historical ties to the Swedish vikings in centuries past. For those unaware, much of Russia and Ukraine was invaded or colonized by vikings who used the river networks of the region to navigate deep into the continent. While this may seem far fetched at first, it’s not unheard of for nationalistic movements to demand some sort of ownership of distant lands due to long forgotten or dubious claims. So it seems fitting that such a movement in Sweden would make such outlandish claims too. Plus, you’re still going to have to conquer and occupy those regions which offer interesting challenges.
The ultimate culmination of this branch though, is the creation of the Greater Nordic Reich. This focus allows Sweden to fully integrate the Nordic regions of their empire, gaining greater access to their resources and manpower.
That’s it for this week's dev diary! Hopefully you enjoyed this foray into alternate history Sweden and are looking forward to playing it for yourself in the not so distant future! Next week’s diary will be on alternate history Denmark with Daniel. See ya!
Hej everyone, it’s me, Carlo! Katten has been staring at me from the other side of the office all morning, which can only mean one thing: it’s time for me to write another Dev Diary! Now, I’ve already talked about Historical Norway, the Joint Focus Tree, and modding stuff so there’s only one more thing I could write about, and that’s our favorite kamerat, LevTrotskij.
Known outside of Norway as Leon Trotsky, he was one of the most prominent members of the bolsheviks in the Soviet Union, renowned marxist theorist, known for his permanent revolution, and even more permanent exile. He was Lenin’s successor apparent, but Stanlin’s political maneuvering forced him out of the government and eventually out of the Soviet Union. After that, he was allowed to move to Norway, with the newspaper editor, Konrad Knudsen. So far so good.
The important thing for us happens in an August much like this one, in 1936, when Quisling’s thugs ransacked Knudsen’s house, and would’ve gotten away with it if it wasn’t because Knudsen’s daughter drove them off. So much for the tolerant left, smh. This event will be represented in AAT’s Norway, regardless of the path you take, and it’s the start of trotskij’s event chain.
Historically, the pressure from fascists and stalinists was too much for the Nygaardsvold Cabinet, so he was put under house arrest in a farm in Hurum, which, by his own account, was one of the worst periods of his life. After that he was allowed into Mexico, and received by the artist Frida Kahlo and her husband Diego Rivera. And then they lived happily ever after. Though he was, indeed, kicked out when Diego Rivera found out he was having an affair with Frida Kahlo and then was killed with an ice pick by a Soviet Union agent. Other than that he had a good time in Mexico by all accounts.
Of course, you don’t need to care about what happened historically. You can just imprison him, or send him to Mexico right away and use this altercation as a justification for increasing political repression, send him straight to Stalin, and even put him in government. Those last two are especially useful if you’re going the communist route by the way.
Communist Route?... Oh, right, that’s what I was supposed to write about, Alt History content for Norway! Since I already wrote about Trotskij's fate, let me tell you about the options you have for turning Norway even redder.
First step, the labor movement needs to regain its momentum, with the ‘A Resurgent Labor Movement’ focus. This will set Norway on to the path of Communism, but which one? You can compromise with the NKP to adopt their Stalinist stance or prosecute them and let the Labor Party embrace Trotskij’s teachings, and if you kept him in Norway you’ll also have him as an advisor and general.
Each path has advantages and disadvantages: you can be beholden to the Soviet Union and their support, or you can go your own path and bring the Permanent Revolution to the rest of the world.
Regardless of your communist goals, you will need to rouse the proletariat in states that are industrialized enough, and when you’re ready you can trigger the communist revolution and fight in a civil war against the old Norway! Now of course, riling up the workers has its cost, because they’ll do some heavy damage to your factories and infrastructure once they rise up for the revolution.
Let’s take a better look at the ‘Rouse the Proletariat Decisions’. The first level will grant you the state once the civil war starts, but will leave your buildings in a pretty rough shape.
You can reduce this damage by bringing it to Level 2 and you will also be granted 2 irregular divisions.
Then if you’re really serious about that state you can fully rouse its working class, reducing the damage to the buildings and upgrading those troops to Militias.
And before you think “But Carlo, what if I just rouse the whole country and I skip the civil war?”, I’ll tell you now, that won’t work. You will have to choose carefully how to approach these decisions, as you can’t go over 20 Total Support for the Revolution and no matter what, the other side will have Oslo.
Ok now, let’s go over the things you’ll be able to do once you’ve seized the means of production in Norway. If your senpai Stalin noticed you, there will be plenty of improvements to your industrial base, manpower and a close collaboration with the Soviet Union, and even help them invade Finland. Maybe the Arms Against Tyranny thing is just aspirational.
If instead, you decided to go with uncle trotskij, as I said before, you’ll get an extra advisor and general, and that will put you behind the wheel of your very own communist faction, the Norintern with the focus ‘The Permanentest Revolution’. That’s what it’s actually called, and nobody has complained about it so I guess the name is final? Defend Finland, bring the war to Stalin, Sweden, Norway and even Hitler, bringing about a new, Trotskyist world order.
To summarize, with Stalin you’ll get soldiers and industry. With Trotsky you’ll get easy wargoals and offensive bonuses. Your pick.
Now let’s move slightly to the right. To the allied democratic branch, which starts with a fictional Vote of No confidence that the Nygaardsvold government loses. This branch is what happens when militaristic industry tycoons take control of the government. It overlaps somewhat with the democratic branch, except you can skip the whole Broken Gun thing and go straight for rearmament, so you’ll have more time to get ready for what’s coming, but at the cost of a lot of civilian industry.
This path leads to a more centralized government, so all the local preparations are pooled together, letting you start nation-wide initiatives, both during peacetime and war time.
It also overlaps a little with the Trotskyist path, just not the commie parts, and you’ll be able to join the allies instead of forming your own faction.
Let’s keep going, I have actual work to do, so I’m gonna skip the historical path. A few things have changed, but not enough to care, and the dog is still there so onwards to the fascist path, which, of course there is one.
It starts with The Stumbling Storting, in this reality the labor party fails to secure political stability for Norway, leaving the door open to fascists, and other undesirables.
Let’s go with Undesirable Elements #1, fascists. In this scenario Quisling is somewhat good at making people think he’s competent and that fascism is reasonable. The Nasjonal Samling will lurk in the shadows and build support for their agenda state by state, seeking support from the Fatherland League (A proto-fascist nationalist movement), industrialists, conservatives and even fascists abroad.
Eventually, you’ll reach a familiar focus, ‘Quisling’s Coup’, except this time, you’re ready for it, you have built the support needed to make the takeover as easy as possible for you and the foreign fascist invaders, whom you invited! Yes, in this path you can invite the most suitable fascist regime to invade Norway so you can take over the government and help them on their fascist crusade. Don’t worry if they say no, that rejection will also allow you to start the coup without them, who needs Hitler anyway.
The coup, as expected, will trigger a civil war in which, unlike the communist one, you’ll only control Oslofjord. That’s alright though, you prepared for this, which means that you can take over states where you built support in. If you only prepared base level support, you’ll get the state, not too shabby! But if you built more support, you will be rewarded for your efforts with a brand new Military Factory, and maybe even a couple of militias too if you fully prepared it.
This should put you on the right footing to start your fascist campaign, have fun making the world a worse place! Eventually, you’ll make it to your outlandish viking theme claims around the North Atlantic. Classic.
Now onto the last branch: The monarchist branch. For some reason a lot of people who want nordic focus trees also want a monarchist path, I can understand why, but I still think they’re wrong. I still made a monarchist path for Norway, whose king was reluctant to become their king, and even when he took over, by all accounts had no intention of becoming anything more than a figurehead.
This reality starts much like the fascist one, with the Storting devolving into chaos, and the Royal Chamberlain, Anker Peder Wedel-Jarlsberg uses this opportunity to build support for a more involved monarchy, with his steady hand at the helm of course. Obviously, he is not part of the real Wedel-Jarlsberg noble family that lives in Norway, any similarities are purely coincidental, etc. He’s not Wedel-Jarlsberg with a ‘-’, his is a minus symbol. Just do me a favor and don’t tell the legal team, they don’t need to stress about it.
Peder Anker will travel all around Norway proselytizing his monarchist cause, giving you bonuses for building defensive buildings, and adding more building slots, which will of course reduce the available manpower in the state, because, you know, they’re all busy being monarchists so they don’t have time to be soldiers.
Except… If you go all the way with your monarchism you get 2 free militia divisions, and once you get the power as the Regent of Norway you can edit to your heart’s content. They’ve been so converted that they are now soldiers for monarchism.
Once the Absolutist Regency is the rule of the land you’ll recruit the crown prince, Olav to join either the Navy or Army staff, since he was indeed employed in both during the war. In this case you’ll probably want him dedicating all his efforts on one thing, so he can become either a General or an Admiral and will allow you to specialize your country further.
And of course you can get an extra set of outlandish claims. Faroe Islands, Iceland, Greenland, part of Russia, and even part of Sweden. At the end you’ll be able to consolidate your kingdom to make it easier for Peder Anker to rule over his king’s land.
And well that’s it. Obviously there’s tons more to unearth if you ask the right questions ;) and many more things I’ll either keep as a secret for release or haven’t implemented yet, like the new Trotskij portrait and the [Redacted] of [Redacted]. Also, don’t forget to stay tuned for the Sweden alt history Dev Diary, where you’ll see how wildly different the world would be if Sweden had privately managed vacation instead of state managed ones.
As the warmth of summer fades and the brisk embrace of winter draws near, we are thrilled to unveil the pre-order for the upcoming expansion, "Arms Against Tyranny." Mark your calendars for its grand release on the 10th of October.
To add an extra touch of coziness to the impending chill, by securing your pre-order, you will unlock exclusive access to the captivating bonus track, "Säkkijärven Polka". Oh, and did we mention? Sweden's getting a communist focus tree. Because who doesn't love a cozy ideological makeover?
Hey everyone! I’m Plankie and one of the programmers on Hearts of Iron. Large parts of my work consists of feature work, bug fixing, and general game improvements. My absolute favorite part of game development is working with the AI and trying to make it more fun and interesting and immersive to play with. So, in this week’s dev diary I’ll focus on showing how the AI interacts with one of our major new features: The International Market
On a very high level, there are a few things that the AI needs to be able to do in order to utilize the market:
Gain market access so that we can see what other countries have put up for sale
Sell equipment to others, i.e. putting equipment up for sale on the market
Buy equipment from others, i.e. decide what we want to buy and how much
It also needs a surplus of equipment to sell, but fortunately the AI already knows how to produce equipment, so that just needs a little bit of tweaking!
The basis of the AI’s behavior on the International Market is the surplus/deficit it has of different types of equipment on the production stockpile (you know that list of equipment you see under the logistics tab). In general, it will try to buy equipment it has a deficit of and will offer to sell equipment it has a surplus of. This base behavior is then modified by other factors, such as AI strategies.
The familiar logistics tab showing what equipment is available on the production stockpile. The right-most number showing surplus/deficit is an important component of how the AI interacts with the International Market.
Putting things up for sale
Before anyone can buy equipment from the AI, it obviously needs to put equipment up for sale. Just like for a human player, it is only possible for the AI to add equipment to the market if it has a surplus of it. However, just because there is a surplus doesn’t mean that it’s a good idea to put all of that surplus up for sale. And if the surplus disappears and we start lacking equipment again, the AI should take the equipment off the market so it can use it itself instead. We basically want something like the following behavior:
If we need the equipment ourselves, don’t sell it
If we have a lot of surplus equipment, start selling some of it, but not all of it
The problem is that we need to define how much “a lot” is so we know when to start putting the things up for sale. This could depend a lot on what type of equipment it is and what situation our country is in. We could do something simple and say that “if we have a surplus larger than 200, then start selling”, but 200 infantry equipment and 200 strategic bombers are on completely different scales so using absolute numbers is not a good idea. But manually having to define the numbers for different equipment types and situations and countries also means a lot of work and balancing, so we at least want some good default behavior with a possibility of tweaking it.
In one of the first iterations of the market AI, we just made it put a certain ratio (say 20 %) of its surplus equipment up for sale. Despite the simple approach it worked pretty well, and since it’s simple it’s also easy to understand and debug. It had some shortcomings so we modified it a little bit, but it’s still the basis of how the AI puts things up for sale. Every market AI update, it calculates its total surplus of every equipment type (surplus on production stockpile + anything on the market stockpile) and makes sure that the ratio is correct.
This means that if the AI needs the equipment themselves, they have a total surplus of zero, so they put 0.2*0 = 0 equipment up for sale, i.e. they won’t sell it. They will also pull back anything already up for sale so they can use it themselves. And if they have a total surplus of 100 equipment, it will put 0.2*100 = 20 equipment up for sale (assuming a ratio of 20 %). So the more surplus it has the more it tries to sell, while still retaining a buffer in case things go sour and it starts needing the equipment itself. It also means that we don’t need to specify an absolute number for the threshold, it adapts itself to the situation.
But as mentioned, the approach had some shortcomings. The AI had a tendency to “trickle in” equipment on the market, trying to sell 1 rifle as soon as it had a surplus of 5 rifles, etc, and this felt very artificial and not very human-like. This led us to modify the algorithm so that the AI thinks about the equipment in batches instead of singular weapons. The size of a batch is roughly how much equipment can be delivered in one month using one factory for payment, so instead of seeing the AI try to sell 3 rifles, it now waits until it reaches around 350 rifles (one “batch” of surplus) before putting it up on the market.
At this point we had a reasonable default behavior for how the AI puts equipment up for sale, but we still needed the capability of tweaking it. This is done through scripted AI strategies! If you don’t know what AI strategies are in HoI4, it’s essentially a way that content designers and modders can tweak the AI behavior through script. With AI strategies, it’s possible to modify things like
how much equipment is needed before considering it as a surplus to sell on the market
the ratio of equipment the AI wants to put on the market
the min and max amount of equipment to put up for sale (overriding the default batch size)
With the AI strategies, it’s possible to for example prevent minor countries from selling all their trains (which aren’t used much before the war, so they are technically a surplus). It is possible to script Germany to not sell their huge surplus of weapons when preparing for war (fun fact: the German AI isn’t really aware that its going to end up in a big war until just a few months before the war breaks out, so without different scripted AI strategies they wouldn’t prepare enough for it). Needless to say, the AI strategies are a very useful tool for the designers!
Buying equipment
If the AI is lacking some type of equipment, it will consider buying it from the International Market (assuming there is someone offering to sell it). First of all it decides how many civilian factories it is willing to spend on purchasing equipment. Second, it looks at all the available equipment up for sale and determines if there is anything there that matches what it needs. After that, if the AI has factories to spend and there is equipment it wants to buy, it’s just a matter of deciding what to buy first and how much of it. This is done by computing a score for each potential deal, a score which takes into account:
Construction cost of needed equipment - we prefer to fix our biggest needs first
How good the equipment is - we prefer newer equipment with better stats
How expensive the equipment is - we prefer cheaper stuff
Applicable subsidies - if we have any subsidies we prefer to use them
Scripted AI weight - we want to make the content designers and modders happy
Example of a debug info window for the market AI. Here, the US AI has a deficit of 294 tactical bombers and almost 19k infantry equipment. It would prefer to buy bombers since the value of the lacking bombers is higher than the value of the lacking infantry equipment, but for the moment only British infantry rifles are up for sale, so the Americans start buying that instead.
So, now we know WHAT we want to purchase, but what about HOW MUCH? If we asked to buy 19k infantry equipment but only were prepared to pay with one factory, we could end up with a deal that would go on for years. In order to circumvent problems like these, the AI tries to create contracts that are neither too small nor too large by tweaking the amount of equipment and assigned factories until the completion time is acceptable. At the time of writing (and subject to change), the AI avoids purchasing more equipment than what can be delivered in about 10 months. It also uses the aforementioned “batch size” as a minimum limit of how much equipment to buy.
Paying off 19k infantry equipment with just one civilian factory takes a couple of years. Long-term weapon deals sound better before you do the math…
Of course there are also AI strategies for affecting how the AI purchases equipment. These are values that either go into the scoring calculation (affecting what the AI prefers to buy and from whom if there are multiple alternatives), or that tweak things like the threshold of when it wants to buy equipment of a certain type.
Establishing market access
Now we know how the AI puts equipment up for sale, and we know how they determine what they want to buy. But all that is for nothing unless the AI has access to another country’s market, so of course it needs some way of gaining market access.
This is a relatively simple process since market access is nothing more complicated than a normal diplomatic relation, like docking rights or a non-aggression pact. Naturally, the AI is able to respond to requests for market access if you ask them, but it would be a pretty boring feature if they never took the initiative themselves. The exact factors that go into the AI’s desire to have market access with another country are of course subject to change as we balance the game, but at the time of writing the most important factors are:
Diplomatic opinion - I really like this since I think opinion is underused in HoI4. It makes it possible for you to achieve market access with a country as long as you are prepared to spend some sweet PP to maintain it ;)
Trade influence
“Ideological” opinion - Some ideologies like other ideologies more or less
Competing factions - If the two countries are in different factions
The Soviet Union is really not interested in opening their market to those British capitalists.
The result of this is that you tend to see something similar to trade blocs, groups of countries that trade with each other (often along faction or ideological lines). The boundaries between the trade blocs are soft, however, and it’s often possible to convince countries to trade with you by raising their opinion of you.
Producing surplus equipment
Finally, since the International Market revolves around surplus equipment, it wouldn’t be much fun if there was no equipment to trade with. This ties into some changes to how the AI produces equipment, especially when they have already fulfilled all their own needs.
As some of you may have noticed, since BBA a lot of smaller countries have been bad at fully utilizing their military factories. As soon as they have fulfilled all their equipment needs (including having a buffer for any armies in the field), they stop using their military factories. This behavior was not introduced with BBA, but because of some other changes to how the AI recruits armies the problem became much more visible. The reason they stop producing equipment is because they technically don’t need any more equipment, and if you don’t have any equipment you need to produce… well, they simply stop producing it. As human players, we know that a war is looming on the horizon and there is no reason to stop production just because “we have enough”. It’s better to be prepared with a larger stockpile. And with the International Market making its entry, we can suddenly satisfy our inner capitalists and earn something by selling our surplus equipment.
So, now, when the AI gets to the point where they have enough equipment to fulfill their own needs, they start transitioning into a “surplus production state”. In this state, they once again use AI strategies to determine what to produce. This makes it possible to script countries to produce different types of surplus equipment, which in turn would allow for more “equipment diversity” on the market place and a larger selection of equipment to choose from.
Summary
We are nearing the end of this dev diary, so let’s quickly sum it up!
We did a little deep dive into the AI for the new International Market feature, and got to see the logic for how it puts surplus equipment up for sale and how it constructs purchase requests. In addition, we looked at the factors affecting how the AI opens up their market to other countries, and finally, how surplus equipment is produced when all other needs are fulfilled.
I hope you found it interesting to see some of the inner workings of the market AI, and I definitely hope you will enjoy playing the game with your new trade partners! In next week’s dev diary you will get to join some of our content designers for a closer look at how to mod Hearts of Iron! Stay tuned!