• 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 - A Tech Lead's Life

Hello everyone, it's your favourite (and only) tech lead, The French Paradox!

In this diary I'll tell you more about our tech, give some insights into the programmer's job, what we've been up to for the past year (and some change) and offer you a chance to ask any question you may have about tech.

Saying old platforms goodbye

First, with the upcoming 1.11 patch we will be retiring some old Linux and Mac platforms that aren't maintained by their own developers anymore.
This means that starting next update the minimum OS version to run HoI will be Ubuntu 18.04 (on Linux) and macOS 10.11 (El Capitan) on Mac.
There shouldn't be much to worry about though, as the previous versions are older than HoI itself at this point and our telemetry shows almost all of you have upgraded long ago.
For those on Windows who look anxiously at their aging Windows 7, keep calm and carry on, we have no plans to drop support for it (although as a friendly tech person I'd still suggest you consider upgrading ;)).

Why do we make those decisions you may wonder? Two reasons: one maintaining old tech comes with a cost that we would rather spend on improving the game for 99% of the users, and two sometimes it blocks the adoption of new tech that would make our programmers job easier and more efficient.
Without going too much into details, the general idea is that we can only use tech that is supported on all platforms, so basically we're only as modern as the oldest thing we support. If you take the case of Linux for example, the previous Ubuntu release was from 2016, meaning HoI could not use anything released since then (and probably a bit before, as Ubuntu LTS releases usually don't ship with the latest shiny goodies). Some time we can work our way around it, but not always.
Speaking of new tech...

Renderers.PNG


DirectX 11

That's right, the next HoI4 release will join Stellaris and the other more recent PDS games by adding DirectX 11 support.
DirectX 9 will still be the default for now, but you will be able to select another renderer in the launcher settings.

There shouldn't be any visual difference between DX9 and DX11 (and OpenGL for that matter), we have been working on making sure the experience will be the same.
The game should load a bit faster however, especially if you use a lot of mods that bring extra textures and models.
Working remotely for more than a year, we also noticed less issues playing with remote desktop and the like, which might not be a big deal for most of you but was quite appreciable for our devs during development.
Finally it did help us tweaking & fixing the new railways & trains graphics (as most graphics debugging tools have dropped support for DX9).


Performance

We know that performance is always at the heart of every discussion about our games and as a Tech Lead I have been keeping a close eye on it.
So far it looks like our release candidate is roughly on par with the current 1.10 patch, performance wise.

Why not better, I can already hear you typing? The main reason is that the game on 1.11 is a different beast 1.10 (which itself is quite different from the original 1.0 release).
Namely, the supply simulation is now much more deep and complex, and needs to account for all those railways across the world and the fact that now allies can supply each other.
While I am writing those words, our compatibility lab is working hard at running the game on various hardware configurations to give us a more complete picture and perhaps a few suggestions for an updated recommended configuration, as the one you can see on Steam right now dates back from the original release.


20211103_120703.jpg

Toying with a 11th generation i9 and a RTX 3090. Will it take off?

On the topic of measuring performance, the Barbarossa update will include an in-game profiler that you can use to measure how your machine performs.
You should be able to spawn it from the console using the magic line imgui show profiler.

For example here is the current release candidate on my home i7-10700 with a RTX 2080 SUPER:

hoi4_1936_RC.PNG

1936 fresh start, speed 5, Direct 11, vsync off

hoi4_1943_RC.PNG

1943 test save, speed 5, Direct 11, vsync off

As you can see this offers a few metrics that can be collected by toggling the Enable/Disable Collection button at the top.
A few things you can get from it:
  • Render time: the average time to render one frame over the last second
  • Render time excluding present: same as previous but excludes the time spent waiting on the GPU to actually present the frame on screen. The difference is usually due to vsync.
  • Frames per second: the FPS count, you know this one
  • Ticks per second: how many in-game hours were simulated over the course of the last second
  • Last tick: the time it took to simulate the last hour or new day/week/month
  • Last 24 ticks average: same as previous but averaged from the last 24 (or less depending on how much time was spent collecting data)
Next you have a nice graph representation of where (in which system) that time was spent. We use it to quickly eyeball a performance report, especially when external programmer tools are not available (for example when it happens on a non-dev machine).

Final tip: if the profiler doesn't show up with the magic console command, try turning it off and on again using imgui off then imgui on.


A personal pet peeve

Programmers at PDS are rarely just that. Most of us get involved in the game development by offering insights on design, balance or content, and I am no exception.
So now is the time to talk about French Communism.

If you remember the French focus tree from La Résistance, if you go communist you get this guy:

Momo.PNG


Maurice Thorez was historically the leader of the Parti Communiste Français (PCF).
If you walk through some cities in France you can even find streets bearing his name still today.
But he had one characteristic trait: he was a die-hard Stalinist who followed the Moscow line until his death in 1964. He had a city and an institute named after him in the USSR.
On the day the Molotov-Ribbentrop Pact was signed, he is in vacation in the Alps and the PCF changes its stance on Germany and Poland overnight following Moscow's instructions without asking him. When he comes back, he just shrugs and goes along with it.

With that in mind, I felt that it was weird you would keep him as a leader if you do not go for the "Loyalty To Moscow" sub-tree.
I did some research in French sources and found a better candidate to replace him. Behold:

1635946239203.png


René Nicod was a member of the PCF in 1939, but when the party decided to realign itself following the Pact, he and a couple other MPs quit the party and founded the Union Populaire Française (UPF) or French Popular Union in English. They denounced the Pact and supported the government's decision to stand with Poland.
In Barbarossa if you own La Résistance and go either Anti-Fascist Coalition or Loyalty to the cause you will get a new party and leader:

Tree.PNG
Tree2.PNG


Each branch will give a different flavour of Nicod inspired by his published opinions pieces during the Great War (he both supported in the French Army and lost his hand in the trenches but also denounced the war on ideological grounds and hoped the French and German workers would unite in a common cause).

Finally, it turned out to be a bit difficult to find a good portrait for our artists. My initial research in the French National Assembly online database only yielded a low-res blurry picture.
But luckily a small French shop decided to sell its stock of old photos on eBay and his mayor portrait was one of the articles.
We could have stopped there and used the ad's preview picture as a source, but of course we had to buy and ship to Sweden.

So here he is, looking over the HOI corner in our Stockholm office!


IMG_20211102_203447.jpg

IMG_20211102_203534.jpg
And with that, I'll happily take your questions :cool:

PS: a few back we talked about Modding Changes. @Aurelien Delay looked at your feedback and has more insights to share that should help you convert your mod to the new character system.
 
  • 130Like
  • 26Love
  • 12
  • 4
  • 3
Reactions:
Do you take charge of part of script language, like adding new scripts or fixing bugs on it? Does it take a lot of effort? Many times it seems that modable parts only be added when game designers will use these parts, instead of adding in advance. I know little about HOI modding, but I think amount of work is similar between PDS games.
Script support (used by both modders and our own content designer) is specific to the game. Usually each time we add a new mechanic to the game we give script the bindings it needs to interact with it. It's not super costly.
The tricky part comes when content (or mods) want something specific to a country or focus tree. As a general rule, if something will only be used once, it is usually made in script unless it proves hard/impractical to do with the current script system, at which point it is redesigned as a more generic code feature.
Predicting the future being a difficult job, we sometime end up making a script system that gets popular and should have been a code feature instead, and sometimes it's the other way around, there's a generic code system that turns out to be used in only one concrete case.
 
  • 16
  • 1Love
Reactions:
Are you going to change the names of Eastern European countries with communist ideology to historically correct ones? Some are spelled correctly, but not all.
Screenshot_20211103-224712_Browser.jpg
 
  • 6
  • 1Like
Reactions:
Laval was technically the PM of France on Jan 1st, 1936 (although not for long, as the failure of the Laval-Hoare plan made him unpopular). As a Frenchman I do understand that it feels weird at first to see his face on the starting screen, as today we remember him much for his role in the Vichy government than for his political career in the interwar period.
As for Daladier, to follow history you would need to have France go for the Front Populaire but fail to keep popular support and have Blum ousted.
And then fail to resolve the Winter War in a satisfactory way, leading to Reynaud becoming PM.

There might be a place somewhere for content mechanics that simulate the French Third Republic's infamous instability, but as you can see it would require more thought and a much more substantial change than just changing a leader when doing a focus.
Has there been any consideration to using events in place of focuses for more things as some mods do?
 
  • 1
  • 1Like
Reactions:
I think the best way to improve late-game performance, is to tell the AI to stop creating a new unit template every time they want to add a brigade. Right now, every nation has over a dozen different templates in use at a given time, never updating and deleting them.
 
  • 11
  • 3Like
  • 1
Reactions:
I think the best way to improve late-game performance, is to tell the AI to stop creating a new unit template every time they want to add a brigade. Right now, every nation has over a dozen different templates in use at a given time, never updating and deleting them.

Having diverse templates does not affect performance. Having many fielded divisions does.

If you have 100 templates with 1 fielded division each vs 1 template with 100 divisions fielded, the peformance will be the same. It is only a visual hassle to a human, not a computer.

Performance drops come from number of executed operations, which is not affected - i mean, it doesnt matter where you pull data for a division from.

The same is true about having 1 garrison order of 24 divisions vs 24 garrison orders of 1 division each (actually, the latter is probably even less performance intensive because it doesnt require internal juggling between garrison points).

What people don't often get is that what is computationally daunting to a human can be meaningless to a computer, and vice versa.

Actually, the AI DOES phase out old templates, and only gradually updates the template, training new units from only the latest one. Which is better than if it had been constantly converting all its units to the most modern template and deleting all the old ones, like a human does.
 
Last edited:
  • 2
  • 1Like
  • 1
Reactions:
While we are adding some additional things to the French tree, could you also add perhaps a new focus somewhere in the army tree for France to make it possible to get Georges Catroux and Marie-Pierre Kœnig without capitulating and turning into Free France? They have nice portraits from La Résistance but its a shame barely anyone sees them as many don't play as Free France and would really help normal France's issue with a lack of non-Old Guard generals.
 
  • 5
  • 1Like
Reactions:
Simple, have a scripted event for Blum to get replaced by Daladier in a similar way to how Azaña replaces Zamora, then another event caused by the Winter War white peace to replaced Daladier with Reynaud. I'm not a modder (I tried to make a mod for the game and it failed :(), but (since you actually know what you're doing) it doesn't seem that hard to implement.

I agree at 100% with you, whe should have an event to remplace Laval, it always look weird to me to fight against nazis with him leading france while knowing his real history.
 
  • 2
  • 1Like
Reactions:
Since the performance has been improved and is presumably the best it's ever been, would it be possible to add more provinces to the world map? It seems like a certain number of provinces would need to be added to the map in certain locations in order for the Devs to create a more realistic 1936 railway map.

I read there might be a too low limit on provinces. Could that limit be lifted entirely or made higher?

Is Paradox planning on upgrading the Clausewitz engine to DX12 ever? Seems like a lot more performance could be gotten from it. It works really well in some games.
 
  • 1Like
Reactions:
Thanks @MatRopart, as a single HOI player with lots of mods and I already had a recommended system running Win11...
  • RECOMMENDED:
    • OS: Windows 7 64-bit or newer
    • Processor: Intel Core i5 750 @ 2.66 GHz / AMD Phenom II X4 955 @ 3.20 GHz
    • Memory: 4 GB RAM
    • Graphics: ATI Radeon HD 6950 or NVIDIA GeForce GTX570 with 2GB VRAM
    • DirectX: Version 9.0c
    • Storage: 2 GB available space
    • Sound Card: Direct X- compatible soundcard.
    • Additional Notes: Mouse and keyboard are required. /
... in what order should I upgrade my hardware?

:Newer/faster CPU; More memory; Faster memory; Better graphics; More graphic memory; Newer/faster SSD?
 
I am by no means a hardware guy, so if this question sounds stupid, please forgive me.

Would the Paradox loader be able to detect hardware (just as an example: NVIDA GTX vs RTX technology) and adjust performance according to present hardware? I am aware that yet oldest to newest technology would have to be included in the files (and probably increase overall folder sizes). Nevertheless, it would make it possible to adapt performance to present hardware. To what extent is this implemented?
 
  • 1Like
Reactions:
I am by no means a hardware guy, so if this question sounds stupid, please forgive me.

Would the Paradox loader be able to detect hardware (just as an example: NVIDA GTX vs RTX technology) and adjust performance according to present hardware? I am aware that yet oldest to newest technology would have to be included in the files (and probably increase overall folder sizes). Nevertheless, it would make it possible to adapt performance to present hardware. To what extent is this implemented?

HOI4 has very little in terms of you being able to turn up performance manually because the game isnt bottlenecked by gpu. You can remove 3d models and hd textures and such, but its impact is marginal when compared to the cpu strain, which cannot - and would not - be changed.

All in all, nothing the devs can do here. Only gpu-bottlenecked games can have performance increased by sacrificing fidelity. You can turn down texture size, but you cannot fit more bytes in a kilobyte.
 
  • 1
Reactions: