Spoiler: Click for technical modder details

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 }

Code: blocked_for = { GER }



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 }



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 } }





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 } }





3. But which template to focus production on:

Code: production_prio = { factor = 1 modifier = { factor = 1 } }



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. 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: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: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 = {armorWhile 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: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.50Pretty 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: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 welcome2. Upgrade priority: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: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.

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 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?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.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.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.Greetings, friends! SteelVolt here againThey 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.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):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 HoI4Next 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)