• 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 - Modding Changes

Hello, and welcome back to another Dev Diary for No Step back and 1.11 Barbarossa. Today we will be pulling back the veil a bit and show you how modders can affect and use the new features coming in 1.11.

For those of you who do not get unreasonably excited by hearing about new script commands and changes to databases, the long and short of it is this: We made some fundamental changes to the way the game handles some things, which will probably require your favorite mods to spend some time updating. On the flip side, those changes also allow for some exciting possibilities down the line. If you came here hoping for a release date, we must ask you for just a little more patience. We promise the announcement is very close - but not today.

Characters

Probably the biggest change is in how we handle people on the backend (or ponies, for that matter - we do not discriminate). In the current live version, the game has no real concept of a person as a distinct thing. It only knows about country leaders, military leaders, political and military advisors, and operatives. Cases where a country leader could also be a general had to be handled manually, leading to lots of exciting bugs when the country leader was removed but the general was forgotten about and other such cases.

We have overhauled that side of the game from the ground up with the introduction of characters. This should dramatically reduce the amount of potential zombie generals shambling around, which I am sure the non-zombie population will greatly appreciate.

Characters are defined in the common/character folder, and their definitions look like this:

Screenshot_4.png


Every character is defined as a container for different roles they can fulfill, like General (corps_commander), Advisor, country leader etc. Due to technical concerns, Operatives remain their own thing. On the character level itself, things like name and gender are handled. This also means that character names can now be localised and you can refer to a character by ID instead of by name (this helps a lot with character names that have non-english characters in them - turns out this broke some triggers and effects).

Screenshot_5.png


This also means that if a character is removed from play - say, through a purge - they are automatically removed from all roles that they could have, which makes such systems a lot easier to do script-side. It also means that if we wanted to allow Zhukov to become a country leader, we could simply add a country leader role for him in the character file, like this:


Screenshot_6.png

Or we could also add the role later on, via focus, event, decision... like we do here with Beriya:


Screenshot_7.png

That means there is a lot less confusion and duplication of effort necessary when putting a character into a new role, since stuff like portraits, name etc. are already handled. A broken portrait only needs to be fixed in one place instead of five etc.

Once defined, characters are recruited in the country history file in order to be added to the game. As you can see in the first screenshot, you can use visible triggers for unit leaders to ensure they are not shown if you don’t want them to be.

Characters that can potentially become country leaders are made into country leaders using the promote_character effect, like so:

Screenshot_8.png


This is a clear departure from the practice in the live version of the game, where you would create a new country leader in that effect. The old script with create_country_leader and other such effects should still be working, but obviously you don’t get any of the advantages of the unified character system.

So let’s talk about some more things you can do with it!

You can set and check character flags for nefarious purposes:

Screenshot_9.png


You can change the traits of advisors without having to make a whole new advisor:


Screenshot_10.png

You can check if a character is a certain type of character:

Screenshot_11.png


You can save the character as a variable to refer to them later, such as spamming debug messages in the console!


Screenshot_12.png

Tank Designer

Next, let’s talk a bit about how the tank designer works on the backend. It shares a lot of concepts with the ship designer, such as modules and module slots. It does, however, work a little differently in some other, important aspects.

While the system pretends that there are only a handful of chassis (light, medium, heavy, super-heavy, amphibious, modern), this is not technically true. Instead, the system maintains a whole host of other, dynamically created chassis. This allows us to make sure that tank designs with the tank destroyer role actually go into tank destroyer battalions etc.

However, these dynamic chassis are still generated from the base chassis, so any changes to them will carry over.

The roles are enabled and disabled on individual modules:

Screenshot_13.png



Screenshot_14.png

For the unlock of new module categories, you can then use this on a module to unlock that category:

Screenshot_15.png


Railways

Railways function a little differently from other buildings. While they are technically province buildings like forts, they are in reality closer to a building that connects two provinces. A railway line is effectively a series of two-province connections, and the lowest one in the chain determines the level of the railroad connection between two supply hubs.

To make it easier to change and maintain the historical railway setup, we have added an option to draw railways into the nudger tool, which you can access by using the nudge command in the console.
Screenshot_16.png


The railway setup is in the supply menu in the nudger, and you can easily add new railway lines to the existing setup in this way. It took me about a week and a half to do the entire 1936 setup, including tracking down reference maps (with a lot of help from some of our testers).

If you want to add railways through script, you have the build_railway effect. It gives you a lot of options, with the most basic one being to lay out the path one province at a time:

Screenshot_17.png


This is obviously a little cumbersome for longer railways, especially if you don’t really care about the exact path. For that, you have the option to define a start and an end province:

Screenshot_18.png


The game will then automatically generate a path from one end to the other using advanced neural network-based self-learning algorithms that use blockchain (read: I have no idea how it works but this sounds impressive).

If finding the province is too much work, or if you want to be somewhat dynamic, you can even use start and end states (also note that you can specify what level of connection should be built):

Screenshot_19.png


Note that you can’t mix these, so you can’t define a starting province and a target state for example.

There are also corresponding triggers like can_build_railway and has_railway_connection:

Screenshot_20.png


The first checks if a railway can be built between two locations, while the other checks if one such connection already exists.

Finally, there is has_railway_level, which checks if the specified state has a railway line in it with the specified level:

Screenshot_21.png

Miscellaneous new effects, triggers, modifiers

In addition to the things described above, we have added a number of useful things that some of you might find useful:

  • Building_cost_factor: a new modifier that affects the construction cost of buildings. This takes the buildings from the 00_buildings file, so it should work with mods that add more buildings.
  • Core_state scope list, allowing you to run effects and triggers on a country’s core states:
Screenshot_22.png


  • Add_equipment_to_stockpile effect can now take a variant name to ensure that you add the right kind of equipment.
That’s all for today, I hope you enjoyed these little insights and we are all excited about what crazy things you will do with the new tools at your disposal.
 
  • 106Like
  • 23Love
  • 23
  • 10
  • 2
Reactions:
Does this mean Generals can now be captured/killed instead of being invincible?

Zero chance of that happening. Some nations have 2-3 non-generic generals. Losing even a single one would ruin playthroughs.

There arent enough characters in the game, and the scope is too large, to get so particular about characters (which begs the question though why aces exist...)

Actually, can characters become aces? Im guessing not, since aces can die? Which we are incessantly reminded of
 
  • 1
Reactions:
You can still transfer leaders that have been created elsewhere to a different country.

Extremely low chance of that happening.
thank you for your explaination. But there is one more question which is......I mean, is it possible for two countries to have the same general at the same time? The same character object, not transfer...
sorry my description is so terrible, English is not my mother language.
 
Regarding the Tank designer. How would one go about modding new tanks and chassis types?
Would we be able to add say an "infantry tank" chassis and the designer would then dynamically create TD, AA and SPG "variants" of the new chassis ow would we need to specify which variants the chassis has access to?
If i want to mod mechs into HOI would i be able to allow the player to customise them in the tank designer?
What about if we want to add a new variant to the tanks like say a command tank by using an improved radio? Previously variants were seperate equipment each but would it now dynamically create variants for all the chassis?
Is the tank designer hardcoded/limited to only work for tank equipment or would it be possible to mod it to make other equipment types like planes or artillery?
Or would we have to perform some dark modding magic where our infantry equipment technically qualifies as a tank chassis in the code but ingame the player can now design exactly what guns and gear(the modules) is part of the infantry 1 equipment(the "chassis")?

Secondly regarding something that haven't been talked about that i'm really curious about, how would the railway gun artillery function in regards to modding?
Is it possible to use the "deploy similar to ships" behaviour for other units/equipment? Would the resulting unit mimic the railway gun in behaviour or is it possible to change it to function like a regular unit?
Would we be able to make other equipment production limited by factories?
Is the "railway only" movement hardcoded into the railway gun unit/equipment?
Can we limit other units like say a modded armoured train to railways as well?
Is it possible to change what the movement limitations are?
And if so would we be able to say blacklist mountains and then have a unit that cant move into mountains? Or would it only function as a whitelist where we have to specify the conditions the unit can move to?
 
Last edited:
OWB is probably going to have a field day with the tank designer

Given the fact they made Robots take the place of tanks, you could really have fun with an Automatron set-up making all sorts of crazy robots
 
We Have New DLC About Barbarossa but We Have No Still New Dev Diary About Germany. Funny...
I don’t know why the post is regarded so negatively.

Some adaptations with Germany have to be made at least to accommodate new content (e.g. infrastructure, tank designer, etc). Maybe they are not as distinct as with the USSR, but the man has a point.
Time will tell - or the 23rd next month, as we now have a date.
 
  • 1
Reactions:
I don’t know why the post is regarded so negatively.

Some adaptations with Germany have to be made at least to accommodate new content (e.g. infrastructure, tank designer, etc). Maybe they are not as distinct as with the USSR, but the man has a point.
Time will tell - or the 23rd next month, as we now have a date.

One, that post sounds like "reee why no focus tree for X nation"

Two, the misc changes, what few there were, were already mentioned here and there, and they do not amount to much, way not enough to cover a whole dev diary. They mentioned historical tank variants, and that railway focuses get railways instead/in addition to infrastructure. Nothing more is expected, nothing more is required. It doesn't make more sense to cover Germany than it does Hungary.

Three, it has bad grammar, so it automatically turns heads

And it has nothing to do with this dev diary. Just dilutes the topic.
 
  • 3
  • 1Like
  • 1
Reactions:
No mention of navy leaders was made in the post nor the comments, but i presume navy leaders will be done through the character system aswell

But will i be able to create a character that is both a general and an admiral?

Edit: I also would like to know if it's possible to transfer characters between countries, like it is currently possible for generals? Say if i want to make an event where Tukhachevsky escapes the great purge and sides with mexico lead by Trotsky, can i still transfer the general, and can i in addition transfer rest of the character roles, like theorist?
 
Last edited:
  • 3Like
  • 1
Reactions:
With regards to characters, will this change portrait pathing at all in the new update? Will it still be the same DDS file locations in Hearts of Iron IV\gfx\leaders\TAG?

Also, with the character localization stuff, will it be possible to change leader names without changing the checksum? For example, lets say I don't like Hirohito, I replace his portrait with one of Tojo the usual way, will it be possible now to change Hirohito's name to Tojo in the localization without editing Japan's history file, and therefore still keeping the mod ironman compatible?
 
  • 1
Reactions:
IgoUgo games are a waste of a computer

Wash your mouth out with snow from the Russian steppes :p One of the benefits of IgoUgo games is that they can sometimes spend a bit more time crunching AI (as there's an expectation of at least some pause between turns - and at least WitE one could have a minute or two crunching away) which can help with the AI side of things. They're also really good if you want to play an MP game asynchronously with someone not located locally :)

And, strictly speaking, you could play make HoI4 IgoUgo in MP by having everyone having an allotted 'hour' in which they could move each half-day or so, and then slowly moving through the hours. People in the same faction moving on the same hour, to cope with their being more tags than hours and to enable multiple turns per day. Not that I'm suggesting this is a good idea :)

Back to the topic of the DD though, I'm really excited about the character modding changes, lots of fun stuff to be done in terms of immersion and adding more historical characters :)
 
  • 3Like
  • 1
Reactions:
Wash your mouth out with snow from the Russian steppes :p One of the benefits of IgoUgo games is that they can sometimes spend a bit more time crunching AI (as there's an expectation of at least some pause between turns - and at least WitE one could have a minute or two crunching away) which can help with the AI side of things. They're also really good if you want to play an MP game asynchronously with someone not located locally :)

And, strictly speaking, you could play make HoI4 IgoUgo in MP by having everyone having an allotted 'hour' in which they could move each half-day or so, and then slowly moving through the hours. People in the same faction moving on the same hour, to cope with their being more tags than hours and to enable multiple turns per day. Not that I'm suggesting this is a good idea :)

Back to the topic of the DD though, I'm really excited about the character modding changes, lots of fun stuff to be done in terms of immersion and adding more historical characters :)
their is snow on your steps?

so since I want to completely derail the DD apparently, hoi4 is technically a IgoUgo game, it just doesn't have the feel of it, and when it does people melt down on the forum about a tick that lasts a few seconds.

While I have never seen the code under the hood of either game series, both are exploitable, and both offer a challenge if you dont know how to exploit them. So I'd rather not stare at my screen for 30-90 seconds wondering when I get to do something again.
 
  • 1Like
Reactions:
their is snow on your steps?

so since I want to completely derail the DD apparently, hoi4 is technically a IgoUgo game, it just doesn't have the feel of it, and when it does people melt down on the forum about a tick that lasts a few seconds.

While I have never seen the code under the hood of either game series, both are exploitable, and both offer a challenge if you dont know how to exploit them. So I'd rather not stare at my screen for 30-90 seconds wondering when I get to do something again.

I was mostly just being silly - definitely not suggesting everyone should play IgoUgo, and can very much empathise with not wanting to wait each turn :)

Also agree about not going too hard on derailing the topic. To swing back to topic, if you were going to add one character to the game via modding (who isn't in it already), who would it be?
 
One, that post sounds like "reee why no focus tree for X nation"

Two, the misc changes, what few there were, were already mentioned here and there, and they do not amount to much, way not enough to cover a whole dev diary. They mentioned historical tank variants, and that railway focuses get railways instead/in addition to infrastructure. Nothing more is expected, nothing more is required. It doesn't make more sense to cover Germany than it does Hungary.

Three, it has bad grammar, so it automatically turns heads

And it has nothing to do with this dev diary. Just dilutes the topic.
One - what if he is a modder who wants to update Germany?
Two - what if he is interested how Germany ties into modding changes?
Three - Congratulations on being a native English speaker or having learned from an Oxford nanny. This guy might not be as elaborated as you are, but is trying. Maybe not written as refined as someone else would but genuinely interested.


Always the benefit of the doubt - cheers!
 
Last edited:
As this is the big land combat update, it would be interesting if within an army, there was a 'section' you could assign units to that would be kept back from the frontline in a reserve but follow up behind. This would make it easy to pull troops off the front line and have extra divisions following up your armies. obviously you can do this manually but this could be helpful to the AI and would be convenient and thematic to the player.
 
In my mod, a person has a different portrait in different countries, can the new coding shows it or do I have to create another "character" for that person?
Or can I state if he exists in a country, then another country cannot have another he?

Furthermore, did the legacy id limit digit? Like can I use a 6-digit number or even an alphabet to avoid collision with other people mod?
And I see we can use tokens, did the line be like "token = SOV_Zhukov"

And I have another question:
If I use the old way to promote or recruit a general in the NSB patch (i.e. without giving it a character file )
is that mean that General cannot be promoted to advisor or use the generic advisor portrait instead?
 
Last edited:
Every character is defined as a container for different roles they can fulfill, like General (corps_commander), Advisor, country leader etc.

If I'm not mistaken, does it mean some characters can only be generals but not advisors, or vice versa? I'd like to know if you have any plans of changing the role of some in-game characters who were historically generals but only currently represented as advisors (like Franz Halder, Nagumo, Liu Bocheng, and many more) that we'll be able to put them from the advisor seat to the commanding post? Hopefully this isn't forgotten
 
  • 1Like
  • 1
Reactions:
If I'm not mistaken, does it mean some characters can only be generals but not advisors, or vice versa? I'd like to know if you have any plans of changing the role of some in-game characters who were historically generals but only currently represented as advisors (like Franz Halder, Nagumo, Liu Bocheng, and many more) that we'll be able to put them from the advisor seat to the commanding post? Hopefully this isn't forgotten
Well we already know that there will be a mechanic added to promote any general of sufficient level to the high command and make them an advisor. So I don't think there will be any characters that can only be generals. There's been no indication of going the other way, though, and I'm not convinced it would make much sense within the paradigm they've indicated; it's one thing to go from a general with an array of stats and traits to an advisor with a single trait, going the other way just doesn't make sense. Also most advisors don't have corresponding large portraits and such portraits cannot be easily generated (whereas shrinking a general-sized portrait to advisor-size is relatively easy)
 
  • 2
Reactions:
I was mostly just being silly - definitely not suggesting everyone should play IgoUgo, and can very much empathise with not wanting to wait each turn :)

Also agree about not going too hard on derailing the topic. To swing back to topic, if you were going to add one character to the game via modding (who isn't in it already), who would it be?
you... a brilliant Navy guy Admiral SirAxeAlot
 
  • 3
  • 1Haha
Reactions: