• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

HOI4 Dev Diary - AI & Feature Updates

Hi everyone! From the time we show off features in dev diaries and release a lot happens. Usually it's just bugfixing and work behind the scenes, but sometimes it can be bigger changes too. So today we will pick out some stuff that's changed since you last read about it. But first, but not least, lets talk a bit about AI development!

AI Updates
When we started with 1.9 'Husky' and La Résistance there were 2 main things we wanted to achieve. First we wanted to nerf Germany (without actually nerfing them) by giving resistance more teeth. This worked pretty well, as after we had made the new resistance system Germany would consistently collapse to large Polish uprisings behind its lines and needed to be told how to manage all that as well as control its equipment production better. Resistance is now constantly hurting garrisons and you don't pre-build garrisons, so stockpiling and not rushing units is more important.

The second thing is also related to Germany (its WW2 after all). For HOI (no matter the version really) we have always striven for a balance where Germany defeats the Soviet Union if the allies do not take pressure off by invading. This ensures that all of the big sides need to be active and if played by a player you need to step up. Now before we jump to the 10 pages of comments discussing if this is a realistic target... It is, for gameplay I think. History wise I am personally convinced that the Soviets would have beaten Germany on their own. It just would have taken a lot longer and been much costlier, and there isn't much point in playing the UK or USA if Soviets will just take care of Germany on their own (now now, please keep reading the rest of the diary before we start arguing what-ifs :p).

Anyways, in 1.7 the allies seldom pulled off invasions well enough, and pretty much only if they got lucky in Italy or punched up through Greece or something like that. Firstly we have made a bunch of improvements and bugfixes to weird parts of the invasion logic for the AI that makes them perform better. The biggest impacts came from limiting the AI from shipping troops back and forth across the globe and simply getting them to buffer up its forces in specific allied territories. USA specifically here will now station troops ahead of time in UK so that when its time to do invasions they are already in the neighborhood. We have also improved prioritization of different fronts to make sure AI gets the importance of Europe and when landings have been made successfully.

One of our most important tools when working on high level AI stuff and history tuning is the "History Logger".
This is a tool that we developed to observe AI gameplay. When enabled, it collects & dumps data on how game progressed during a particular run and its output looks something like this when run through a web interface:
output.gif


You can find two example runs here if you want to experiment with it:
https://common-assets.paradoxplaza.com/hoi4-devdiary/history_viewer.html?zip=1.zip
https://common-assets.paradoxplaza.com/hoi4-devdiary/history_viewer.html?zip=2.zip
Watch out they are very javascript heavy and take a long time to load up :)

Other than showing country borders, it can also show many other other details for a selected country such as diplomacy status, army/navy mission/air mission positions, orders, taken decisions/focuses/ideas, executed operations/operative missions and many other things. On top of that, the things are logged using log effect will also appear in these logs so you can have custom logs in your effects if you want. Here is an example from USA:

upload_2020-2-17_14-32-21.png


The lines are invasion orders and red heat map is the army of USA. You can already see that USA successfully invaded southern France and has invasion plans for Northern France and Denmark.

And here is an example to things that are logged. Logs are filtered by country tag ENG and "operation" and here we see all operations that are executed by England.
upload_2020-2-17_14-48-59.png


We use this tool every day in our nightly automated tests. Everyday we run a bunch of AI only runs with history logger is enabled and at the end of the day we get an email like this:
upload_2020-2-17_13-58-7 (1).png


Our nightly tests inform us if the game is crashed or not, if there are some tests that failed and if there are performance issues. In this particular example in one of the machines Germany was not able to beat France. When we check history logger output for that particular run we see the following:
ger_fails.gif

(Green: Germany. Red: Enemies. Blue:Allies. Yellow: Potential Enemies. Heat map is the army position for Germany.)

In this run we see that Germany is attacking low countries way too early, before Poland falls and the front north west front is prepared. This allows France & England to be better prepared and push through. The fix was to add extra safety checks (we had broken some old ones too in an unrelated change a while back) for how the AI wants to feel prepared for this push.

This tool will be included with 1.9 so modders can take advantage of it. We think is going to be super good for anyone doing balance, AI or total conversion mods. There will be more info on that as well as some more details and info on how to set up the tests in the Friday diary :)


Espionage Changes
We have done some changes to operative recruitment. Rather than being a timer on actual operatives recruitment time the system now is tied to the actual slots you have.
upload_2020-2-19_10-46-12.png

This was needed because the old system was pretty confusing in practice, and giving more operatives from events, or historical operatives would really mess with the progression of the system so UK could gear up its agency way too fast.

Operations have also had a bunch of changes. The more visible one is the addition of the Outlook indicator:
upload_2020-2-19_10-57-4.png

This breaks down risks and the potential for better rewards on an operation. Both can be affected by agency upgrades and Operative traits. A 10% risk means that there is 10% something goes wrong. This usually means that the operatives will need to go into hiding for a while to avoid local investigations, or have suffered an injury, or more rarely, have been captured, killed or turned to the other side. When operations end you'll get to find out as risk trigger generally when trying to extract from the operation area.

We have also added some new ministers for nations. Having an Illusive Gentleman will be a good choice for those who want to go all in on making the strongest Agency possible:
upload_2020-2-19_11-7-40.png

You can also see that UK will get access to all programmers hero Alan Turing if they develop a cryptology department. He is more of a UK special though.

Portugal Changes
Hello everyone, Mano de Zombi here!
As many of you have already noticed, there have been some changes to the Portuguese Focus Tree since my last DD before Christmas, and today I’d like to talk a little bit about them.

Let’s begin with the National Spirit Unstable Republic:

01 Unstable Republic.png


The previous stability penalty (a flat 10%) has been changed to a -0.5% weekly stability penalty.
Salazar’s trait has also been changed from a flat stability bonus to a 0.5% weekly bonus.

As you can see, one stability modifier counters the other. The reason behind this is that while Salazar is in power, his Unstable Republic will be roughly under control. Stability might not increase but it will not decrease either (after all, even with some difficulties, Salazar historically managed to keep the Republic under control for decades).
But once you start tweaking your politics, you can find yourself in a tough situation where low stability might not be easily recovered, putting your country on the brink of civil war before changing your government. More on this later in the diary.


Now let’s take a look at the final focus tree:

02 Portugal tree.png


As you can see, there are some new focuses (12 to be precise), for a total of 122.
During Christmas I worked on a design for the historical Salazarist branch, as well as a bit of reworking and additions to other branches. Big kudos to Pedro, the original FT designer, who helped me a lot and provided me with incredibly useful documentation!


The Military branch looked quite small so we decided to include three more focuses. This branch has also seen some changes, so let’s take a quick look:

03 Military Branch.png


Army Organization, Metropolitan Army and Corpo do Estado Maior will each grant some Army XP. In addition to that, Army Reorganization will remove Unstable Army National Spirit and add a small stability penalty(-5%).

To the left, Metropolitan Army also grants two research bonuses, followed by a production bonus under Standardization. The defensive focuses have not been touched, you must still choose between heavy fortifications in Lisbon or a light fortification line along the coast. Finally, Portugal has two focuses that provide research bonuses for special forces.

Tropas Paraquedistas is based on the Parachute Rifle Battalion, a group of 12 Timorese soldiers trained in Australia during World War II to be launched in the rearguard of the Japanese forces occupying Portuguese Timor; as you can guess, this focus gives a research bonus for Paratroopers.

Regimento de Comandos is a reference to the (later) historical Portuguese Commando Regiment (a special forces unit prepared for counter-guerrilla operations) formed in the early 60s, as a consequence of the Ultramar War; it will provide two research bonuses for special forces, as well as a National Spirit that will slightly increase your special forces limit.

To the right, we have Corpo do Estado Maior, which improves army leaders and makes them cheaper, followed by Staff Wargames and its two research bonuses for land doctrine. Finally, Field Maneuvers will add more Army XP and an additional research bonus for land doctrine.

A final note on this, if you support a Spanish faction during the Spanish Civil War, you can access a focus that also gives you some research bonuses (different bonuses depending on the faction you support):

04a They Need our Help.png


04b Observation Mission.png


04c Assist the Requetes.png



Moving on to the political branch, you can see that some focuses have changed names. This is to clarify that they are related to the Spanish Civil War:

05 Focus Renamed.png


You may also notice that Securing the Free World is now available only through Allow Free Elections (aka Democratic path). This focus will guarantee the independence of every European minor country with a democratic/non-aligned government and not in a faction, as well as allowing you to create your own faction. It makes sense to have it as a democratic focus, since Communists have their own ways to deal with factions.

06a Securing the Free World.png


I would also like to clarify the requirements for the following focuses:

Protect Chinese Civilians: Will grant a wargoal against the owner of Guangzhou, the state surrounding Macau. This focus is available by completing either The Popular Front Bloc, They Need our Help or Allow Free Elections.

Intervention in Spain: This focus grants a wargoal against Spain if their ideology does not match Portugal’s. It is available only through They Need our Help and Allow Free Elections.

06b Focus Requirements.png



Regarding the change of ideology, throughout the different political branches (be it Communist, Democratic, Fascist or even Monarchist) you will always find something like this:

07a CW main.png


As you can read in the lower red tooltip, if you attempt to change your government through the Focus Tree, you better make sure that stability is high enough, otherwise you could find yourself in the middle of a messy and unexpected Civil War (hmm… This sounds familiar to me…).

You will find something similar in the following focuses:

07b CW.png


07c CW.png


07d CW.png



Now let’s talk about the historical path (cool new icons in the branch courtesy of our freelance artist @Indyclone77, who also made all the Portuguese Focus and National Spirit icons, event pictures, and plenty of other 2D assets... Big kudos to him!). We have added a new sub-branch by which Salazar will slowly strengthen his regime, eventually turning Portugal into a powerful nation, capable of dealing with great powers late-game:

08 Historical Branch.png


The National Spirit Estado Novo represents the Salazar regime and has several levels now, being improved by different focuses along the branch.

You get it when you complete Estado Novo focus, providing a small bonus in consumer goods and civilian factory construction speed.

09a Estado Novo 1.png



Strengthen the Regime represents Salazar dealing with all kinds of dissidents (historically, Communists were specially persecuted and oppressed, but there were also other groups, such as fascist-syndicalists). You will have to invest some manpower and equipment to strengthen the secret police, but you will get some Non-Aligned support, and your Estado Novo will get small bonuses.

Upon completion of Appease Monarchists you will get the support of most monarchists and will unlock a couple of Monarchist-related advisors (shared with the Monarchist branch). Historically, Salazar’s strategy was to co-opt the Monarchy supporters into the government and leave the restoration of the Monarchy open for the future. Among other benefits, this focus will add a small daily PP and a weekly stability bonus to Estado Novo.

Concordat with the Holy See: The Concordat of 1940 was an agreement between Portugal and the Vatican, which basically prevented the Church from interfering in the political affairs of Portugal. In-game, you will get a nice amount of PP and Estado Novo will get a bit more daily PP and weekly stability.

National Gold Reserves: During the War, Portugal played an important economic role (it was more complex than the simple “they sold tungsten to Germany”, but I'll leave that for another day). In-game this focus will give Portugal a National Spirit with some economic bonuses, as well as better trade relations with Germany and the United Kingdom. Keep in mind: you have to be at peace to complete this focus!

By completing Honor Anglo-Portuguese Alliance Portugal will join the Allies, gaining access to the focuses shared with the Democratic Path.

Proudly Alone is the final focus improving Estado Novo and finally removing Unstable Republic. From here Portugal can choose to leave behind the historical approach and go into the offensive against Japan or any major or neighboring Communist nation.

09b Estado Novo 5.png



Last but not least, The Capital of Espionage focus: There were countless agents and plots in Lisbon during the war, from double agents and traitors who cooperated with former enemies to spies who gathered information on trans-Atlantic shipments for the Germans. This is represented in-game with the following National Spirit:

10 Spies.png



Regarding Refuse the Naval Blockade focus, it is now available not only through the Fascist path after National Syndicalism, but also through the Monarchist path after Return of Duarte. Now the Kingdom of Portugal can take revenge on the United Kingdom and finally connect its Angolan and Mozambican colonies (Mapa Cor-de-Rosa).

11 Refuse Naval Blockade.png



For those of you concerned about not seeing any custom tech sprites during the streaming a couple of weeks ago, I can confirm that there are Portuguese tech sprites, but unfortunately they were not hooked-in on the build we used for the streaming.

12 Tech Sprites.png



And that’s all from me, as you can see Portugal has gone through a lot of work during the last months and I hope you enjoy playing the different paths once the DLC is released!

For the next dev diary you won't have to wait a whole week as on Friday we will be showing off a bunch of stuff for modders as well as post the full 1.9 patchlog in preparation for La Résistance release next week.
Don't miss the stream today where we will continue our playthrough as Germany. Tonight we also have an AMA on reddit where you can pop in and ask us questions.
reddit_proof_iama_20200219.jpg
 
Last edited:
  • 2
Reactions:
You are missing the point, the Reconquista was usuded by Portugal and Spain for their national unity. Having a "Reconquista" spirit does not necessarily means conquest Africa, but more stability for fascists and neutrals.

If you mean just 1 or 2 focuses for fascist Portugal and/or Spain that gives them stability and/or war support, there really isn't much point and I doubt they would need it.
 
So I had a play with those 2 example history views and a couple of interesting things jumped out at me:

1st link (1.zip)

- It seemed like Italy didn't invade France like they normally do. Or they got stuck in the mountains.
- France capitulated in approx 1 month 1940.1.2 -> 1940.2.1
- SCW was won by the nationalists 1939.2.1
- Japan was still fighting china on the mainland late into 1945. Interestingly, they'd already conquered Raj & Australia and most of SEA before they finally conquered CHN.
- GER attacked SOV ~ 1941.8.1
- From ~1941.11.1 onways, USA is doing tons of naval invasions. Intially from north africa, later from england
- GER has max "Army count" of approx 370 in 1942.3.1. It's unclear to me if this is a division count, or some kind of scaled metric of strength.
- GER capitulated ~ 1949.1.1

2nd link (2.zip)

- SCW was won by Nationalists 1939.10.1
- Japan capitulates china ~1942.1.1
- GER attacked SOV ~ 1941.8.1
- Big allied naval invasions into northern italy/southern france ~1943.9.1
- GER capitulated ~1945.6.1
- Japan attacks SOV ~1945.9.1. Takes large swathes of eastern SOV, but by the end of the run 1952.4.1 is being pushed back from SOV and RAJ


I'm sure there is even more to be pulled out via all the logs, but that was what I got from just eyeballing the map and playing around. I'm definitely seeing a lot more naval invasions and successful ones at that.
 
So I had a play with those 2 example history views and a couple of interesting things jumped out at me:

1st link (1.zip)

- It seemed like Italy didn't invade France like they normally do. Or they got stuck in the mountains.
- France capitulated in approx 1 month 1940.1.2 -> 1940.2.1
- SCW was won by the nationalists 1939.2.1
- Japan was still fighting china on the mainland late into 1945. Interestingly, they'd already conquered Raj & Australia and most of SEA before they finally conquered CHN.
- GER attacked SOV ~ 1941.8.1
- From ~1941.11.1 onways, USA is doing tons of naval invasions. Intially from north africa, later from england
- GER has max "Army count" of approx 370 in 1942.3.1. It's unclear to me if this is a division count, or some kind of scaled metric of strength.
- GER capitulated ~ 1949.1.1

2nd link (2.zip)

- SCW was won by Nationalists 1939.10.1
- Japan capitulates china ~1942.1.1
- GER attacked SOV ~ 1941.8.1
- Big allied naval invasions into northern italy/southern france ~1943.9.1
- GER capitulated ~1945.6.1
- Japan attacks SOV ~1945.9.1. Takes large swathes of eastern SOV, but by the end of the run 1952.4.1 is being pushed back from SOV and RAJ


I'm sure there is even more to be pulled out via all the logs, but that was what I got from just eyeballing the map and playing around. I'm definitely seeing a lot more naval invasions and successful ones at that.
Nice analysis
 
Cheers for the DD Podcat/ManoDeZombi, and the extra info from you both and from CraniumMuppet :). Great to hear the AI has had a good amount of love (I'll always contend that while it's not that 'sellable' (and this is in no small part due to people who buy games only complaining about AI after the fact, rather than buying games based on good AI), AI is what makes or breaks a games long-term longevity :). I can't wait to see how the AI is at release :D.

(now now, please keep reading the rest of the diary before we start arguing what-ifs :p).

You're a brave man! Took all my self-discipline not to bite :p.

This tool will be included with 1.9 so modders can take advantage of it. We think is going to be super good for anyone doing balance, AI or total conversion mods. There will be more info on that as well as some more details and info on how to set up the tests in the Friday diary :)

This is super-super-super-duper-super cool :cool:. These kind of tools are very helpful for modders - thank you very much to all in the team that made this being available to modders possible :)

A 10% risk means that there is 10% something goes wrong. This usually means that the operatives will need to go into hiding for a while to avoid local investigations, or have suffered an injury, or more rarely, have been captured, killed or turned to the other side. When operations end you'll get to find out as risk trigger generally when trying to extract from the operation area.

Question (probably best answered in the modding DD tomorrow) - is it possible to mod the results of a failure of operation to be something else - like war breaking out because of the diplomatic embarrassment or similar?

@Indyclone77, who also made all the Portuguese Focus and National Spirit icons, event pictures, and plenty of other 2D assets... Big kudos to him!)

Love you work Indy :D.

As you can read in the lower red tooltip, if you attempt to change your government through the Focus Tree, you better make sure that stability is high enough, otherwise you could find yourself in the middle of a messy and unexpected Civil War

Sensational work on the Portugese Focus Tree ManoDeZombi - lots of very cool stuff there. Really like what you've done with those stability mechanics :D.

For an AI-related naval pic, here's a picture of HMS Belfast's "Admiralty Fire Control Table". These are big analogue computers that did a whole bunch of fire-control calculations to point the guns in the right place to maximise the chance of hitting an enemy 15-20km away. It's not quite AI, but it's about as close to it that WW2 naval vessels got :).

800px-HMS_Belfast_-_6inch_transmitting_station_1.jpg
 
Yes, if you don't count over half of their copper, aluminium, rubber, explosives, aviation fuel and motorized transportation not to mention most rails that Soviet trains moved on were not their own and came from US lend-lease then they definitely would have won on their own.

I'm also sure that they eventually would have won despite the further loss of factories that would have happened while on the backfoot without those silly planes, tanks, ships, trains, boots and food they were given that allowed them to make up for their hundreds of thousands of lost supplies from Barbarossa and hold the line. They didn't need those silly things, Stalin had it completely under control.

So, where do I sign up for your history lectures? You're so smart.

Ah yes, I'm sure with all that in effect the German foot soldier could've easily conquered the Soviet Union at walking speed or on their horse
 
Nice picture
I don't see anyone 50 or over. :)

Interesting observation regarding the age of the 13 people in the photo of HoI4 developers.

Assumption: The average age is 30.
Assumption: Each developer has been playing wargames since age 15

13 people x 15 years = 195 combined years of wargaming experience.
195 years of combined wargaming experience is a goodly number.

In today's "Ask Me Anything", Floh0815 asked the following question:

upload_2020-2-19_17-5-1.png
 
Last edited:
Nice improvements. I especially like the changes to the Portugal tree where trying to change ideology with low support or stability can now trigger a civil war. I think that this should be implemented as a general feature for all nations, as I feel that it is currently too easy for nations to rapidly switch ideologies.
 
Anything with regards to building up radar and naval infrastructure in the Atlantic via Madeira, the Azores, and Cabo Verde? Also reinforcing Goa in India in case of conflict against Britain/British Raj. Same for Timor Leste against Dutch Indonesia.
 
We got some new skins for Spain actually, but we didnt have time to do anything for Portugal

Shameful. You still have a few days… so get on with it!!!!

Happy to see changes to the Portuguese tree though. I don't exactly agree with everything on it, but it is far better now.

History wise I am personally convinced that the Soviets would have beaten Germany on their own. It just would have taken a lot longer and been much costlier, and there isn't much point in playing the UK or USA if Soviets will just take care of Germany on their own

Truly alone? Doubtful. With american lend leases and without a 2nd or 3rd (allied) front in Europe? Definetely.

The US shipped countless billions' worth of equipment into Russia (more than 11 billions dollars). And even so the ussr army was quite ill equipped. Only God knows how bad they would have fared without american supplies.
 
Will the AI ever be able to build modern ships? It's frustrating that even though MtG was released, the AI still builds only old ships.I have never seen any (allied) Battleships II or III, excluding the HMS Vanguard which UK gets through a focus.
 
Doing some looking through the logs part of the history viewer...

Really fascinated by these strategy decisions by the AI.

Just as GER invades Poland
Code:
strat|ENG|protect_poland_against_germany
strat|ENG|protect_poland_against_germany_even_more
strat|ENG|USA_ENG_sync_invasions_on_europe
strat|ENG|defend_poland_against_germany
strat|ENG|east_prussia_invasion_is_death_trap
strat|ENG|ENG_trying_to_save_benelux_is_deathtrap
strat|ENG|ENG_the_channel_is_dangerous
strat|ENG|dont_get_sucked_into_FRA_and_die

and then just a bunch of really funny ones :D

Code:
strat|ENG|ENG_please_stop_stomping_italy_so_hard_in_africa_ty
strat|GER|stop_making_horsies
strat|USA|GER_is_bad
strat|USA|USA_TEST_help_uk_be_winnigest
strat|USA|JAP_USA_we_love_islands
strat|JAP|jap_invasions_of_gxc_are_super_tough_and_waste_manpower
strat|JAP|JAP_build_some_factories_jeez

EDIT: For all those concerned that the AI wouldn't use the OPeratives etc, there is a decent amount in the logs around the AI running operative missions etc.

Code:
operative_mission|ENG|Robert Lyons on Counter Intelligence Greater London Area ENG -1%
operative_mission|ENG|Thomas Seaton on Build Intel Network Brandenburg GER 7%
operative_mission|ENG|Alice Wolseley on Counter Intelligence Ile de France FRA -1%
operative_mission|GER|Joachim Barkhorn on Build Intel Network Moscow SOV 57%
operative_mission|GER|Hildegard Hartmann on Build Intel Network Greater London Area ENG 57%
operative_mission|USA|Jay Baxter on Build Intel Network Brandenburg GER 17%
operative_mission|USA|Benjamin Robertson on Build Intel Network Muntenia ROM 10%
operative_mission|USA|Eleanor Jones on Build Intel Network Latium ITA 10%
crypto|USA|1940.7.24: started decryption GER
crypto|ENG|1940.8.22: started decryption GER
crypto|ENG|1940.8.26: activated crypto ITA 28.069/8.464
 
Admittedly we all like to complain about the AI but just reset your Game too a much older version and look at it and you immediately see the difference, a lot has improved.
 
On the AI flooding supply zones issue. Why not use something akin to the sea zone access levels?

Green - feel free to flood, Yellow - only up to avalible supply, Red - This is my battle.

One issue might be who gets to set that level. The Americans that took a beachhead or the parts of France now liberated? In SP at least I'd say this is mostly a non issue but a mechanic like this might be able to be used to also balanced AI-AI gameplay actions.
 
Great changes, won't deny the attention to detail on some of those design decisions. However, I must still ask... Is the issue of Guard and Porto having switched populations and available slots fixed?
Guarda has Porto-tier population and slots, while Porto has Guarda-tier population and slots.
For those unfamiliar with Portuguese economy and demographics, switching Porto and Guarda is sort of like switching California with Colorado.

It is not fixed. However, I will look into that for a future patch.


Sensational work on the Portugese Focus Tree ManoDeZombi - lots of very cool stuff there. Really like what you've done with those stability mechanics :D.

Thanks a lot! :)
 
  • 1
Reactions:
I would really like some quick pictures of the spanish sprites just some quick screenshots of what to look forward to, I preordered the DLC but I won't be able to play till March due to work so some pictures would be neat.
You can see tanks/planes etc in the Music and Art diary. Spanish infantry is a reskin to match one of the greeishn uniforms from the war. I am not an expert but spanish uniforms were extremely varied so we didnt want to get overly specific (and making a different one for every faction and sub faction was out of scope) Here is what it looks like:

upload_2020-2-20_10-10-8.png
 
  • 1
Reactions:
You can see tanks/planes etc in the Music and Art diary. Spanish infantry is a reskin to match one of the greeishn uniforms from the war. I am not an expert but spanish uniforms were extremely varied so we didnt want to get overly specific (and making a different one for every faction and sub faction was out of scope) Here is what it looks like:

View attachment 546813
thanks hm a bit sad I would have preferred different uniforms for the different factions like the chinese warlord.s
 
Hi everyone! From the time we show off features in dev diaries and release a lot happens. Usually it's just bugfixing and work behind the scenes, but sometimes it can be bigger changes too. So today we will pick out some stuff that's changed since you last read about it. But first, but not least, lets talk a bit about AI development!

AI Updates
When we started with 1.9 'Husky' and La Résistance there were 2 main things we wanted to achieve. First we wanted to nerf Germany (without actually nerfing them) by giving resistance more teeth. This worked pretty well, as after we had made the new resistance system Germany would consistently collapse to large Polish uprisings behind its lines and needed to be told how to manage all that as well as control its equipment production better. Resistance is now constantly hurting garrisons and you don't pre-build garrisons, so stockpiling and not rushing units is more important.

The second thing is also related to Germany (its WW2 after all). For HOI (no matter the version really) we have always striven for a balance where Germany defeats the Soviet Union if the allies do not take pressure off by invading. This ensures that all of the big sides need to be active and if played by a player you need to step up. Now before we jump to the 10 pages of comments discussing if this is a realistic target... It is, for gameplay I think. History wise I am personally convinced that the Soviets would have beaten Germany on their own. It just would have taken a lot longer and been much costlier, and there isn't much point in playing the UK or USA if Soviets will just take care of Germany on their own (now now, please keep reading the rest of the diary before we start arguing what-ifs :p).

Anyways, in 1.7 the allies seldom pulled off invasions well enough, and pretty much only if they got lucky in Italy or punched up through Greece or something like that. Firstly we have made a bunch of improvements and bugfixes to weird parts of the invasion logic for the AI that makes them perform better. The biggest impacts came from limiting the AI from shipping troops back and forth across the globe and simply getting them to buffer up its forces in specific allied territories. USA specifically here will now station troops ahead of time in UK so that when its time to do invasions they are already in the neighborhood. We have also improved prioritization of different fronts to make sure AI gets the importance of Europe and when landings have been made successfully.

One of our most important tools when working on high level AI stuff and history tuning is the "History Logger".
This is a tool that we developed to observe AI gameplay. When enabled, it collects & dumps data on how game progressed during a particular run and its output looks something like this when run through a web interface:
View attachment 546510

You can find two example runs here if you want to experiment with it:
https://common-assets.paradoxplaza.com/hoi4-devdiary/history_viewer.html?zip=1.zip
https://common-assets.paradoxplaza.com/hoi4-devdiary/history_viewer.html?zip=2.zip
Watch out they are very javascript heavy and take a long time to load up :)

Other than showing country borders, it can also show many other other details for a selected country such as diplomacy status, army/navy mission/air mission positions, orders, taken decisions/focuses/ideas, executed operations/operative missions and many other things. On top of that, the things are logged using log effect will also appear in these logs so you can have custom logs in your effects if you want. Here is an example from USA:

View attachment 546511

The lines are invasion orders and red heat map is the army of USA. You can already see that USA successfully invaded southern France and has invasion plans for Northern France and Denmark.

And here is an example to things that are logged. Logs are filtered by country tag ENG and "operation" and here we see all operations that are executed by England.
View attachment 546513

We use this tool every day in our nightly automated tests. Everyday we run a bunch of AI only runs with history logger is enabled and at the end of the day we get an email like this:
View attachment 546514

Our nightly tests inform us if the game is crashed or not, if there are some tests that failed and if there are performance issues. In this particular example in one of the machines Germany was not able to beat France. When we check history logger output for that particular run we see the following:
View attachment 546515
(Green: Germany. Red: Enemies. Blue:Allies. Yellow: Potential Enemies. Heat map is the army position for Germany.)

In this run we see that Germany is attacking low countries way too early, before Poland falls and the front north west front is prepared. This allows France & England to be better prepared and push through. The fix was to add extra safety checks (we had broken some old ones too in an unrelated change a while back) for how the AI wants to feel prepared for this push.

This tool will be included with 1.9 so modders can take advantage of it. We think is going to be super good for anyone doing balance, AI or total conversion mods. There will be more info on that as well as some more details and info on how to set up the tests in the Friday diary :)


Espionage Changes
We have done some changes to operative recruitment. Rather than being a timer on actual operatives recruitment time the system now is tied to the actual slots you have.
View attachment 546544
This was needed because the old system was pretty confusing in practice, and giving more operatives from events, or historical operatives would really mess with the progression of the system so UK could gear up its agency way too fast.

Operations have also had a bunch of changes. The more visible one is the addition of the Outlook indicator:
View attachment 546547
This breaks down risks and the potential for better rewards on an operation. Both can be affected by agency upgrades and Operative traits. A 10% risk means that there is 10% something goes wrong. This usually means that the operatives will need to go into hiding for a while to avoid local investigations, or have suffered an injury, or more rarely, have been captured, killed or turned to the other side. When operations end you'll get to find out as risk trigger generally when trying to extract from the operation area.

We have also added some new ministers for nations. Having an Illusive Gentleman will be a good choice for those who want to go all in on making the strongest Agency possible:
View attachment 546551
You can also see that UK will get access to all programmers hero Alan Turing if they develop a cryptology department. He is more of a UK special though.

Portugal Changes
Hello everyone, Mano de Zombi here!
As many of you have already noticed, there have been some changes to the Portuguese Focus Tree since my last DD before Christmas, and today I’d like to talk a little bit about them.

Let’s begin with the National Spirit Unstable Republic:

View attachment 546336

The previous stability penalty (a flat 10%) has been changed to a -0.5% weekly stability penalty.
Salazar’s trait has also been changed from a flat stability bonus to a 0.5% weekly bonus.

As you can see, one stability modifier counters the other. The reason behind this is that while Salazar is in power, his Unstable Republic will be roughly under control. Stability might not increase but it will not decrease either (after all, even with some difficulties, Salazar historically managed to keep the Republic under control for decades).
But once you start tweaking your politics, you can find yourself in a tough situation where low stability might not be easily recovered, putting your country on the brink of civil war before changing your government. More on this later in the diary.


Now let’s take a look at the final focus tree:

View attachment 546337

As you can see, there are some new focuses (12 to be precise), for a total of 122.
During Christmas I worked on a design for the historical Salazarist branch, as well as a bit of reworking and additions to other branches. Big kudos to Pedro, the original FT designer, who helped me a lot and provided me with incredibly useful documentation!


The Military branch looked quite small so we decided to include three more focuses. This branch has also seen some changes, so let’s take a quick look:

View attachment 546338

Army Organization, Metropolitan Army and Corpo do Estado Maior will each grant some Army XP. In addition to that, Army Reorganization will remove Unstable Army National Spirit and add a small stability penalty(-5%).

To the left, Metropolitan Army also grants two research bonuses, followed by a production bonus under Standardization. The defensive focuses have not been touched, you must still choose between heavy fortifications in Lisbon or a light fortification line along the coast. Finally, Portugal has two focuses that provide research bonuses for special forces.

Tropas Paraquedistas is based on the Parachute Rifle Battalion, a group of 12 Timorese soldiers trained in Australia during World War II to be launched in the rearguard of the Japanese forces occupying Portuguese Timor; as you can guess, this focus gives a research bonus for Paratroopers.

Regimento de Comandos is a reference to the (later) historical Portuguese Commando Regiment (a special forces unit prepared for counter-guerrilla operations) formed in the early 60s, as a consequence of the Ultramar War; it will provide two research bonuses for special forces, as well as a National Spirit that will slightly increase your special forces limit.

To the right, we have Corpo do Estado Maior, which improves army leaders and makes them cheaper, followed by Staff Wargames and its two research bonuses for land doctrine. Finally, Field Maneuvers will add more Army XP and an additional research bonus for land doctrine.

A final note on this, if you support a Spanish faction during the Spanish Civil War, you can access a focus that also gives you some research bonuses (different bonuses depending on the faction you support):

View attachment 546339

View attachment 546340

View attachment 546341


Moving on to the political branch, you can see that some focuses have changed names. This is to clarify that they are related to the Spanish Civil War:

View attachment 546342

You may also notice that Securing the Free World is now available only through Allow Free Elections (aka Democratic path). This focus will guarantee the independence of every European minor country with a democratic/non-aligned government and not in a faction, as well as allowing you to create your own faction. It makes sense to have it as a democratic focus, since Communists have their own ways to deal with factions.

View attachment 546343

I would also like to clarify the requirements for the following focuses:

Protect Chinese Civilians: Will grant a wargoal against the owner of Guangzhou, the state surrounding Macau. This focus is available by completing either The Popular Front Bloc, They Need our Help or Allow Free Elections.

Intervention in Spain: This focus grants a wargoal against Spain if their ideology does not match Portugal’s. It is available only through They Need our Help and Allow Free Elections.

View attachment 546344


Regarding the change of ideology, throughout the different political branches (be it Communist, Democratic, Fascist or even Monarchist) you will always find something like this:

View attachment 546345

As you can read in the lower red tooltip, if you attempt to change your government through the Focus Tree, you better make sure that stability is high enough, otherwise you could find yourself in the middle of a messy and unexpected Civil War (hmm… This sounds familiar to me…).

You will find something similar in the following focuses:

View attachment 546346

View attachment 546347

View attachment 546348


Now let’s talk about the historical path (cool new icons in the branch courtesy of our freelance artist @Indyclone77, who also made all the Portuguese Focus and National Spirit icons, event pictures, and plenty of other 2D assets... Big kudos to him!). We have added a new sub-branch by which Salazar will slowly strengthen his regime, eventually turning Portugal into a powerful nation, capable of dealing with great powers late-game:

View attachment 546349

The National Spirit Estado Novo represents the Salazar regime and has several levels now, being improved by different focuses along the branch.

You get it when you complete Estado Novo focus, providing a small bonus in consumer goods and civilian factory construction speed.

View attachment 546350


Strengthen the Regime represents Salazar dealing with all kinds of dissidents (historically, Communists were specially persecuted and oppressed, but there were also other groups, such as fascist-syndicalists). You will have to invest some manpower and equipment to strengthen the secret police, but you will get some Non-Aligned support, and your Estado Novo will get small bonuses.

Upon completion of Appease Monarchists you will get the support of most monarchists and will unlock a couple of Monarchist-related advisors (shared with the Monarchist branch). Historically, Salazar’s strategy was to co-opt the Monarchy supporters into the government and leave the restoration of the Monarchy open for the future. Among other benefits, this focus will add a small daily PP and a weekly stability bonus to Estado Novo.

Concordat with the Holy See: The Concordat of 1940 was an agreement between Portugal and the Vatican, which basically prevented the Church from interfering in the political affairs of Portugal. In-game, you will get a nice amount of PP and Estado Novo will get a bit more daily PP and weekly stability.

National Gold Reserves: During the War, Portugal played an important economic role (it was more complex than the simple “they sold tungsten to Germany”, but I'll leave that for another day). In-game this focus will give Portugal a National Spirit with some economic bonuses, as well as better trade relations with Germany and the United Kingdom. Keep in mind: you have to be at peace to complete this focus!

By completing Honor Anglo-Portuguese Alliance Portugal will join the Allies, gaining access to the focuses shared with the Democratic Path.

Proudly Alone is the final focus improving Estado Novo and finally removing Unstable Republic. From here Portugal can choose to leave behind the historical approach and go into the offensive against Japan or any major or neighboring Communist nation.

View attachment 546354


Last but not least, The Capital of Espionage focus: There were countless agents and plots in Lisbon during the war, from double agents and traitors who cooperated with former enemies to spies who gathered information on trans-Atlantic shipments for the Germans. This is represented in-game with the following National Spirit:

View attachment 546355


Regarding Refuse the Naval Blockade focus, it is now available not only through the Fascist path after National Syndicalism, but also through the Monarchist path after Return of Duarte. Now the Kingdom of Portugal can take revenge on the United Kingdom and finally connect its Angolan and Mozambican colonies (Mapa Cor-de-Rosa).

View attachment 546356


For those of you concerned about not seeing any custom tech sprites during the streaming a couple of weeks ago, I can confirm that there are Portuguese tech sprites, but unfortunately they were not hooked-in on the build we used for the streaming.

View attachment 546389


And that’s all from me, as you can see Portugal has gone through a lot of work during the last months and I hope you enjoy playing the different paths once the DLC is released!

For the next dev diary you won't have to wait a whole week as on Friday we will be showing off a bunch of stuff for modders as well as post the full 1.9 patchlog in preparation for La Résistance release next week.
Don't miss the stream today where we will continue our playthrough as Germany. Tonight we also have an AMA on reddit where you can pop in and ask us questions.
View attachment 546552


Have you fixed the bug that AI does not build tanks? In early patches, they at least build light tanks. But in the current patch, they stop building light tanks at some point and never start building any other tanks.