HOI4 Dev Diary - Czechoslovakia and AI Update #2

  • 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.

podcat

Game Director <unannounced>
Paradox Staff
12 Badges
Jul 23, 2007
12.811
38.516
  • Europa Universalis IV
  • Hearts of Iron III
  • Semper Fi
  • 500k Club
  • Europa Universalis III: Collection
  • Europa Universalis IV: Pre-order
  • Hearts of Iron II: Beta
  • Europa Universalis: Rome Collectors Edition
  • Mount & Blade: Warband
  • Paradox Order
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Together for Victory
Hi everyone, this week we will be looking at the last nation for Death or Dishonor and get an AI update from SteelVolt. Lets dive in!

Czechoslovakia

Czechoslovakia is probably the biggest what-if of the pre-war period. What if they had made a stand? What if the Allies had not rolled over and abandoned them? Or perhaps - what if Czechoslovakia had come to an “arrangement” with Hitler? What if they had decided not to rely on a France and Britain that failed to defend the Versailles settlement and decided to form an alliance of their own?

upload_2017-5-31_10-59-4.png


Of course, standing up to Germany requires you to prepare the ground, and Czechoslovakia is not entirely without its problems. The marriage between the Czechs and the Slovaks is not a very happy one, you share a long border with the Germans and time is short until you have to make a choice to fight or surrender. You will have to make tough choices on what area to focus on first.

hoi4_46.jpg


Extensive fortifications in the Sudetenland can slow the enemy down and possibly buy you the time until the western powers come to your rescue, but will take a lot of time to finish. Time you might want to spend on modernizing your army, expanding your air force or building up your industry.

Historically, Czechoslovakia punched well above their weight in the arms business, keeping pace with several major powers in the fields of aviation and armored warfare. This is represented in game by the national spirit “Skoda Works”, which gives you a fairly sizable boost to your factory output. Together with the export focus branch, you can potentially keep up with Germany in production of war material for a short while.

hoi4_45.jpg


Diplomatically, you have two basic choices: stand up to Germany or bow down. You then have several options on how to do either. If you decide to make a stand, you can put your trust in the west (Spoiler alert: this did not work out historically), or you can create an Entente of your own, with Yugoslavia and Romania. This path will likely take you to conflict with Hungary down the road.

Alternatively, you can also decide to side with the world revolution and join the Comintern, but that might not make you very popular with your neighbors.

Should you decide that living on your knees is better than dying on your feet, you can try and appease Germany by handing over the Sudetenland right away and becoming a German puppet later. However, with Hitler seemingly hell-bent on humiliating the western powers, the Germans might not even accept such a low-key solution.

Finally, you can go fascist and try to meet eye to eye with the Germans, becoming either a full-fledged partner in the Axis or a German Satellite state (what that means exactly will be discussed in a future Dev Diary).

Czechoslovakia also comes with voice overs for troops, new 3d models (the Czech have sweet tanks) and leader pictures adding flavor.
RenderCzechoslovakia.png

upload_2017-5-31_11-50-42.png


AI Update #2
Greetings, friends! SteelVolt here again :)

They tell me it is time for yet another AI diary. Let me start off by thanking all of you who came to my talk at PDXCon. It was fun to see it be so popular that we could barely fit everyone in the room, and there were great questions, several of which I wish I would have had time to elaborate even more on.

At any rate, today I will be talking about the second major AI improvement that has been in the works for 1.4; roles. This is a major addition, plus some smaller changes, to how the template designs for the AI are scripted.
I am going to start off by apologizing to the modders: you will need to revisit you old scripts. The good news is that the scripting is now a far more powerful tool for directing the AI in what to build.

First of all: the AI no longer tries to make designs based on equipment. This led to some rather horrible wastes of XP, not to mention the template progression often took some rather strange turns. In stead, the target templates are grouped into roles, with the possibility to set individual uppgrade priorities both for roles as well as for templates. The details about how this is done can be seen in the examples in the spoiler further down.

What this means is that the progression through types of equipment, for example armor types, can be grouped into a single role (armor). The production/deployment AI is also now scripted to build roles rather than specific equipment. That means that you through script set it up to have X% of the desired force as a specific role. This also means that entire roles can be turned on or off through script.

A role can contain any number of target templates, which each have some new tweakable values attached to them, including a factor for production priority. This tweaks a base value calculated on the fitness score of each available template.

What all this means is that we have been able to improve the scriptability both of what the AI designs as well as what it builds, and while we have improved all of this for the base game through the script, I suspect modders will be able to spend significantly more time on it than we have had available for this update.

The last thing this ties in to is how the AI uses these roles, and for now it is a bit static: the AI will prioritize heavily to put divisions explicitly tagged with the 'garrison' role, into the garrison orders. As a bonus, here is a screen shot showing that, plus two new things that are scriptable through the system; division icon and reinforcement priority.

hoi4_1.jpg


The ability to prioritize roles for orders is something I want to make fully scriptable, but we have not had the time to do this properly for the next update. It is certainly something I am looking at for further improvements of the system.

How to move old AI template design script to the new way it is scripted (plus all new bells and whistles explained):
1. The new 'role' scope;
armored_GER = {
This can be named anything. It should not even matter if they have the same names across multiple files for different countries. This example will encompass all the target template entries related to this role. If you want several different armored roles, you are free to make multiple entries for armored. Really, it is all up to you.
But before we get to the templates themselves, there are a couple of things that need to be set for the role:

2. Who is this available for:
Code:
available_for = {
    GER
}
Doing this means that this role is available only for Germany. Adding any tags will make it available for them as well. If you do something like this:
Code:
blocked_for = {
    GER
}
Means that the role is blocked for Germany, and available for everyone else. This field also takes an arbitrary number of tags.

If neither of these are set, the role will be available for everyone.


3. What actual roles is this entry supposed to fill:
This one is important, because it is what the production and deployment AI will be looking at.
roles = {
armor
}
While you CAN use multiple roles, in the typical case it is recommended to stick to only one. The garrison role would have one looking like this:
Code:
roles = {
    garrison
}
And this would make the AI really want to put them in the garrison order.

4. Which existing templates should be included in this role:
match_to_count = 0.50

Pretty straight forward. There needs to be a way for the AI to guess which template belongs and which does not. Be careful with this one. Make sure you test it to get a limit that works well for your setup.

5. How important is this role right now:
Code:
upgrade_prio = {
    factor = 2.0

    modifier = {
        factor = 5
        OR = {
            has_tech = basic_medium_tank
        }
    }
 
    modifier = {
        factor = 2
        has_tech = main_battle_tank
    }
}
Setting the base factor to the same for all your roles means that a small random factor will make the AI update different roles each iteration. The modifiers are all multiplied in with the factor given that all the triggers in them are tested as true.


And with that, you can paste your existing template entries into the scope. Here are a couple of new features in those scripts:

1. The template entry name:
light_armor_default_GER = {
This used to be vital to be correctly formated. This has no effect anymore, as it is no longer trying to match it to equipment. So name it whatever you want, even the same name within the same role should not matter. You're welcome ;)

2. Upgrade priority:
Code:
upgrade_prio = {
    factor = 2

    modifier = {
        factor = 2
    }
}
This is completely analogous to the role one, except it is only compared to the other templates within the same role, and has not effect on which role is updated, only which template.


3. But which template to focus production on:
Code:
production_prio = {
    factor = 1

    modifier = {
        factor = 1
    }
}
The AI will build the template with the best score for the role it is assigning to a deployment line. This score can be altered with this. You can use triggers in the exact same way as you would the upgrade prio seen higher up.

And that is it! The rest is exactly as it used to, only more reliable. Since bugs have been fixed in the match score functionality, you may need to tweak the balance of some numbers, but there is no other new functionality in the system.

Of course, all of this comes with a bunch of bugfixes in the template design code. The match score, for example, was still not properly calculated. For this update I actually had the time to sit down and really go through all of that properly.

All in all I think and hope that this will give everyone, from modders to casual players alike, a richer experience in HoI4 :)

Next week we will be covering lots of bits and pieces, among them the new subject levels for axis nations.

Don't forget to tune in for World War Wednesday today at 16:00CEST at https://www.twitch.tv/paradoxinteractive as we will be continuing our single player campaign as Yugoslavia! (SteelVolt will also be there to answer AI questions)
 
Last edited:
Looks great, definitely sounds like an exciting playthrough. Sorry to bang a week old drum, but I must have missed something. Why is it that Yugoslavia doesn't get voice-overs? I mean it is a shame since everyone is getting them. Great work otherwise, looking forward to the release date!
 
@SteelVolt is it possible that the AI for divisions transporting through the English Channel / Atlantic for Germany and Italy in 39/40 will be fixed (as in reduced / not so suicidal / some awareness to hostile sea zones or low infrastructure states) in 1.4?

Thanks! (Also love the AI division template improvement.)
 
PDX 6th June is coming ;) don't let us down :p
 
btw, SteelVolt will be in the stream today if you have AI questions!
 
Will the German ,French and British AI respond in a predictable way to the choices that a Czechoslovak player might make or is there a random element to the response
 
Looks great, definitely sounds like an exciting playthrough. Sorry to bang a week old drum, but I must have missed something. Why is it that Yugoslavia doesn't get voice-overs? I mean it is a shame since everyone is getting them. Great work otherwise, looking forward to the release date!

I answered that on stream last week, but basically there is no good language choice to go with. There were/are several languages and picking one for the military doesnt make sense depending on paths selected, and recording 4 different languages for one country, that likely wont turn out to fit well is problematic and be a turnoff for people from the area. tl;dr its too hard to pick a single language that would work for them that everyone would be ok with, and doing 5x the voice content isnt something players would pay for/or us being able to even find voice artists for. I'm a little sad by it, but I think its better to have no VO that one nobody will be happy with
 
I just hope you fixed Jaroslav Krejčí as the fascist leader, he was a puppet prime minister (1942-1945) and was as much as fasicst as president Hácha. His son was even part of resistance....there was only one true fascist leader in pre-war Czechoslovakia and that was Radola Gajda.

Oh and gen. Tesařík (the one eyed dude) was a tank commander on the eastern front and when the war ended, held the rank of CAPTAIN, he was 21 years old in 1936.....

And if that last one is gen. Šnejdárek, he retired in 1935...
 
Last edited:
Soo, in theory, specific roles like garrison should help AI to e.g. defend it's coastline and not randomly abandon it?

It would be interesting if you could create an "expeditionary" role so that AI would be likely to send those specific divisions to other continents e.g. Germany to Africa.
 
Picking Czechoslovakia and becoming a german satellite would be suicide at the moment, given the fact that the german AI is likely to be at war with the rest of the world until 1942 latest without having actually bothered to build a sizeable army, let alone place its divisions properly on the map. Its a problem I sense with pretty much any nation featured in the new DLC, siding with Germany is suicide at the moment. You can pick Italy and manage to stabilize the situation but you have to exploit any opportunity to seize minor nations before WW2. If you're the Czechs or Hungary there will be a russian bear sitting on a steamroller, rolling through your front garden, often long before 1943.

What would help a lot is a feature of HOI2, assuming command of the armies of other nations in your faction. That would also convince me of allowing other nations into my faction, which I do not under any circumstances at the moment.

Just a personal note, I would pay to get said feature. It would enhance the gaming experience a lot for me because at the moment I consider any other nation a bugger, I even decline their expeditionary forces because these give me the creeps. The idea of assuming command of the entire axis or allied armies and manage the entire conflict for my faction without having to witness my "allies" screwing up, committing suicide, launching the same poorly planned naval invasion all over again etc. is very appealing to me.
 
Last edited:
Please make AI have several divisions guarding capilats or other major victory points. Every game, every single game I can have this:
b429053985f2493a925deda9b71fd41a.png

And AI surrenders not long after that. A token garrison could prevent such AI flaw because Berlin, Moscow and Paris fall just like another vallage because there were no one to proetct them.
 
Czechoslovak Legion as single focus... I hope it give you really nice bonuses as National Spirit, because single Army experience would be dissapoitment for me.

For those who dont understand - Czechoslovak Legion was volunteer forces fighting in WWI on Entente side and after that they fought in Russian Civil War against Bolsheviks. They managed to defend whole Transsiberian Magistrale and, well, they learned how to fight enemy with more manpower. And after WWI mens from this Legion were integrated into newformed Czechoslovak Army - and their officers had that valuable experience. Ofc after Communist coup in 1948 was legacy of this Legion supressed - only because they were involved on wrong side of Russian Civil War (and thus red path should remove Czechoslovak Legion NS if it is there)...
 
Do we seriously still not have a release date? Come on..
 
Do we seriously still not have a release date? Come on..
I would say that release date will probably be announced in the stream today, like it was the case with Third Rome yesterday.
 
I answered that on stream last week, but basically there is no good language choice to go with. There were/are several languages and picking one for the military doesnt make sense depending on paths selected, and recording 4 different languages for one country, that likely wont turn out to fit well is problematic and be a turnoff for people from the area. tl;dr its too hard to pick a single language that would work for them that everyone would be ok with, and doing 5x the voice content isnt something players would pay for/or us being able to even find voice artists for. I'm a little sad by it, but I think its better to have no VO that one nobody will be happy with
Thanks for the reply even though it is last week's topic ^^ Eugen Systems used Serbian for Wargame. However, of course, as you mention in the focus tree, there are options to alter the officer corps composition. Still, thank you for giving an explanation.