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

Developer Diary | Small Features

Hey everyone! I'm Plankie, one of the game programmers on hoi4, and one of my favourite parts of developing a game is to work on the game AI. So when I was asked, almost a year ago, whether I wanted to take charge of a small AI feature, I was delighted! The goal of this feature was to make the AI better at concentrating their hardest and meanest divisions instead of spreading them out along an entire front line. This is something we've wanted to do for a long time and with the Germany-focused Götterdämmerung expansion, we had the perfect opportunity. We call this feature AI Force Concentration, or AIFC for short (an acronym which has caused many football-related jokes in the team).

AI Force Concentration

So
WHY did we want to focus on this?
Well, first of all, the AI has frankly not been very good at handling their armoured divisions. Sure, they produce tanks and assign them to fronts, but they are seldom concentrated enough to actually pose a threat for the defender.
Second, the AI always pushed along the entire front with equal effort. There's nothing strictly wrong with that, but most military operations have a strategic goal like capturing a city or a supply hub rather than just taking ground, so making a concentrated offensive effort towards a specific goal seems more realistic and human-like.
Third, we want to make the combat gameplay more dynamic and interesting for you as a player. If the enemy concentrates more and better divisions in a certain sector, it requires you to make choices. Should you meet the anticipated offensive head on, will you lure them into a trap, or use the opportunity to attack somewhere else?

small_features_1_aifc_1.png

The days before Operation Barbarossa. The AIFC divisions are visible in the right picture as the turquoise army, preparing to quickly take a supply hub in Volyn when the war kicks off.

Cool! How does it actually work then?
For the most important fronts, the AI considers whether it wants to concentrate its forces. If it has enough units available to both hold the line and still allocate units for offensive duty, then it will create an AIFC army. This army will receive the "best" divisions along the frontline, taking into account factors like attack and breakthrough stats, how experienced they are, how fast they can move, and so on.

The AI then evaluates possible targets close to the front line, for example supply hubs, ports, large cities and so on, and it finds a path from the front line to the chosen target. This path is determined according to the path-of-least-resistance principle, which essentially means that it tries to avoid river crossings, bad terrain, fortifications and so on, while also following railway lines in an attempt to avoid ending up in a situation where it can't supply the troops.

small_features_2_aifc_2.png

The paths evaluated by Germany before Barbarossa.

The AIFC armies follow those paths-of-least-resistance and will continuously update their orders to make sure that the front lines match up with the intended path. Of course, since placing too many units too close together might cause some problems with your Amazon deliveries (a.k.a. your supply situation), they will spread out somewhat along the neighbouring provinces.

But as they say, "a plan never survives contact with the enemy". This can be true for the AI as well. Because of this, it keeps track of how well an AIFC offensive is going. If the offensive is going well, by all means let's continue pushing. But if it stagnates and fails to make progress towards the target, then the AI sooner or later decides that the plan indeed didn't survive the enemy contact, and it tries to find another target for its next offensive. Similarly, if the offensive succeeds and the target is taken, the AI will start looking for new opportunities to concentrate their forces and break through, taking into account the newly conquered areas as a potential start of the offensive.

In order to make it feel like the AIFC behaviour is not static, the degree to which it is used is (mainly) tied to the doctrines an AI has unlocked. This means there will be a difference between for example fighting an early war Soviet Union compared to a late war Germany. Doctrines which narratively and stats-wise promote a higher force concentration will make the AI prefer using AIFC to a higher degree (fully scriptable of course, so all our wonderful mod creators can play around with it).

small_features_3_aifc_3.png

On the receiving end of an AIFC offensive.

More New Things
Thomas here now to add some more info about a selection of other things we have been working on. Aside from the AIFC, we have - as we tend to do - tried to touch up things here and there during the development of Götterdämmerung. So let’s take a quick look at some of the other smaller features and changes we have done:

New Technologies
The tech tree has as mentioned in the Special Projects Developer Diary received a few new techs relating to Special Projects. But those are not the only changes we have made to it. We have also added a few new techs to make research and gameplay slightly more diverse, and give you a few more options.

First of all we have added a few new Transport Plane Techs and related tech and equipment icons. The main benefit of researching these is that your transport planes gain more range, allowing you to paradrop or supply your troops at a greater distance.

small_features_4_transport_planes.png

One cannot have too many Junkers, right?

The other, slightly bigger change we have made is to forts. Previously everyone could build level 10 forts everywhere from the get go. Now the max fort level depends on the terrain the fort is in, and the techs you have researched - as well as other modifiers you can get from e.g. focuses. This means the engineering tab has received 5 new techs for forts - one general, and two each for Land Forts and Coastal Forts.

Initial maximum fort levels, without techs or other country specific modifiers are set to 6 for all Coastal Forts, and Land forts are as follows:
Plains: 5
Hills: 5
Urban: 5
Forest: 4
Mountain: 4
Desert: 4
Jungle: 3
Marsh: 3
(Note that values might change before release. Yes I know that I’ve said this already, but just to make sure the message gets across :) )

small_features_5_fortification_techs.png

The new fortification techs,

small_features_6_forts_in_state.png

Here we have upped our fortification capabilities a bit, just need to construct the actual forts

Command Power Cap
We have also slightly changed how the Command Power Cap works. The base Command Power Cap has been reduced, but your High Command will now increase it, so that with a good set of military commanders, you will have more Command Power at your disposal. This should make it less punishing to build up your high command, rewarding you for having a competent staff.

small_features_7_command_power.png

By adding von Rundstedt to our staff, we increase the Max Command Power by 20

Dams
As Mentioned in other dev diaries, there are now Dams in the game. They can be targeted by Raids which makes them a bit of a liability, but not by strategic bombing so they are relatively safe. What do they do? Their main effect is that they boost the state they are in, making it easier and better to invest in industry there. You can’t build new dams except through specific focuses.

Landmarks
Another thing you can see on the map, and that several of you have already noted in previous diaries and streams are what we call Landmarks. First of all, these look super cool on the map, and make countries more unique. But additionally they have small country level effects. A bit like National Spirits, but as buildings on the map. The cool thing with these bonuses is that they only apply to the country that originally owns the Landmark, so by capturing for example the Statue of Liberty, you can deny the USA their bonuses, but you won’t get them yourself.

small_features_8_landmark.png

A landmark in the UK

State and Province UI - minor QoL changes
In order to make the difference between State and Province effects a bit easier to see at a glance we have made some changes to the State and Province UI. The main focus of these changes were to ensure that Province Effects are in the lower part of the window, and state effects are in the upper section.
A special area for all state effects and a summary of all state related effects from buildings has been added at the bottom of the “State section”.

Some of the more unique Province level buildings, such as Dams, Landmarks, and Experimental Facilities, are displayed in the “Terrain section”, while the rest are displayed beneath it as before.

small_features_9_state view.png

The upper section, marked in yellow in this image, contains things that are relevant for the entire state, so e.g. state related modifiers have been moved up there. Down in the bottom section, we have collected all the info that relates to the province, such as terrain, weather, victory points etc. Not a drastic change in any way, but hopefully it should be a bit easier to understand what relates to what.

Area Defense QoL
We have also done some minor quality-of-life updates to the Area Defense settings. First of all, no specific settings are active by default when you open it up (unlike the old behaviour where all settings were activated by default). Instead, if no special setting is specified, the divisions will spread out as evenly as possible in the selected area. We changed this since a very common pattern when using Area Defense was to immediately unselect all the options one wasn't interested in, which led to a lot of unnecessary clicks.

small_features_10_ad_1.png

The new Area Defense settings for guarding borders and special project facilities (red arrows), and the updated supply setting (orange arrow).

The supply setting has received some small changes: Instead of trying to cover the supply hubs and ALL the railways, it will now cover supply hubs and railway junctions. It has also received a new icon depicting a supply crate instead of the previous railway icon. We have also added two new settings to Area Defense: Guarding borders, and guarding special project facilities.

small_features_11_ad_2.png

The new Area Defense setting for guarding borders

Horsies with different colours
All horses aren’t bays, or browns for that matter. This is something one of our artists, who happens to really like horsies, was very aware of and wanted to do something about. So after having convinced one of the programmers that this was a brilliant idea, they set out to make a few new textures and ensured that the horsies in the game now have more varied and realistic colours.

small_features_12_horsies.png

I assume these would be Hanoverians…

There's Always More....
That was a selection of the things we have been working on aside from the major features for Götterdämmerung. Of course, we have been up to more things. There is always some balancing, tweaking, and bug fixing work going on. And fixes to code and to the AI in general. We have made some changes to how we script things for example, that we hope to describe more in the upcoming modding diary (together with some other cool stuff). But for now, we hope that you have enjoyed this diary.

 
  • 90Like
  • 64Love
  • 6
Reactions:
Reserved for Developer Replies~

The Tallying up of dev responses has been quite late from me, apologies I am doing a little too much of everything lately ahah

Wrongwraith replies;
Hi, I would like to ask how the fortress level limit affects the magionot line and Czechoslovak fortresses in Sudetenland.Thanks :)
Through content basically. There is the possibility to add modifiers both on Country and State Level

Are landmark models dynamic? If I dropped a nuke on London would Big Ben change?
It would probably break, right? ;)
Will the new Transport Planes be upgradable through the aircraft designer? E.g. adding additional fuel tanks but decreasing paratrooper carrying capacity.
No, they are predefined planes. There really are too few options for them to validate having them in the designer.

Can camels also get diffrent colours? :)
There's an idea.... ;)
Love changes to Command Power cap.
What are the modifiers of landmarks? How big/important/impactful they are?
A few people have asked. They are on the small side. Like 5% stability (and yes we have modified history files to match where we felt it was needed) or similar even smaller modifiers. They are mainly aesthetical, but they do have some game impact
will it be possible to build new landmarks mid-game e.g. Germany could build the Volkshalle?
I'm gonna decline to comment on this... For now...

Plankie replies;
Will the "guard borders" settting for area defense also make your divisions line up against your puppets and faction members' borders? This seems counter-intuitive.
It uses a "is-friend" criteria to determine which borders to not guard. This means it will ignore countries with military access, faction members and puppets/overlord.
Does this mean there are some changes on how frontlines AI work in general or that stay as is?
No larger changes to the "normal" frontline AI as of now (apart from general bugfixes and so on). Maybe needless to say, but the frontline AI is a rather complex system and not always super easy to work with. Revamping it while working on AIFC would have increased the scope quite a lot. Instead, the AIFC sort of works as an addition to the normal AI frontlines, basically modifying them as little as possible. I like to think of the normal/legacy AI frontlines as defensive lines whose goal is to cover the entire frontline so that the enemy can't just slip through, as opposed to the AIFC which is a concentrated offensive on a few important frontlines with the goal of punching through the enemy's defense.

Are there plans to add the ability to have a reserve as part of the frontline programming without drawing a separate fallback line? IE, a reserve system that the AI can use as well.
Let's just say that we have talked about this. I think something like this (improving defensive gameplay) would be a good addition both for the player and the AI in the future, but obviously I cannot promise anything.

Thanks for the update and give Plankie and the programmers a raise!
I will definitely forward this to my manager :p

Just to be clear, just the enemy AI will do this now? Or also your own army groups and frontlines when launching an offensive?
It's only for the AI players. There are essentially two types of "tactical" AI in the game:

  • The AI player - which divisions to assign to which armies etc etc, essentially the decisions that all human players also need to do
  • The unit controller - used by both the human player and the AI players, and what controls individual divisions assigned to orders
The AIFC is on an AI-player level.

Can the A.I. notice force concentrations and allocate more units to an area where it suspect an offensive might happen?
No, unfortunately not (yet). On a very high level, it takes enemy unit counts and so on into account, but not on a low tactical level.

Fun bit of trivia, we tried a very simple version of this during the NSB development, basically assigning more units to a frontline based on how many enemy units were on the other side of that frontline. It led to soooooo much unit shuffling, since two AI players would keep moving their units around to counter what the other did.

Does AI force Concentration only serve the AI to manage unit placements in offensive scenarios, or does it also understand and divert to protect it's own important positions? The AI In hoi4 notoriously, and since the start of the game, has often not known how to and where to position it's units defensively, often leaving supply hubs, railway junctions (since these were created and implemented), and even the Capital city undefended. It's rather common entering an undefended Berlin or Moscow, which truly is dissapointing at times, that the AI simply or semingly does not give importance to these positions.

So, the question is: will the new AIFC calculate strategic locations where the AI should prioritize it's defense and reinforcement?
Will you consider adding a defensive feature for battle planning meaning my/AI divisions will withdraw from exposed positions where they are likely to be cut off (this is my last big AI wish) just so I don’t have to micro defensive situations as much
AIFC is, in its current state, purely offensive. As mentioned in a previous reply, I think improving defensive gameplay could be good addition for the future but I cannot make any promises.

1. Does the force concentration work through assigning all those strong divisions to a separate general? If yes, are generals who have right traits for that are preferred? Or does the AI "micro" divisions from any of mixed armies to achieve those concentrations?

2. Can we maybe as players, in the future, get a button that selects divisions that are considered to be suitable for pushing to help players with force concentration as well? Some of the logic for that seems to already be in place.
1. AIFC is assigned to a separate army/general. It chooses the general based on the assigned divisions (like all other armies), so since AIFC tends to have a higher concentration of armor it should also tend to more often get a armor-focused general.
2. I do like this idea.

Arheo replies;
Is it possible to give modders access to this system?

Not really, no. Making things universally moddable comes at quite a performance cost, and the AI is already computationally expensive.
I don't mean complete universality - it's primarily about constants. Now some of them are available in defines, but the rest are hidden from modders. Why not give access to these constants? I don't think such a change will affect performance much.

Which constants do you mean? We generally make any potentially constant values available in defines - so if something isn't there, the chances are it isn't actually a constant.
 
  • 2Like
  • 1
Reactions:
I have some questions, but first I would like to apologize to everyone on the forum and especially to the developers. In the last dev diary, I asked if the developers could add Oskar Dirlewanger to the game. The reason I asked this question was to be a kind of prank to see the reaction of everyone who knows this war criminal and if Paradox would dare add someone so monstrous to the game (at least one more monster in the game, we already have several in hoi4, like the SS generals already present, some Japanese generals, some Hungarian generals and many others). But after a while, I realized how stupid I was in asking this question, I ended up contributing to a more toxic environment on the forum and I ended up challenging the devs who were so nice to me the last few days by answering some of my most important questions (Hitler in his form final, Ratte's projects before Friday's live and others) and possibly stained my name in the forum moderation. So I sincerely apologize to everyone who is reading my comment, I don't know what went through my head when I wrote this and I would like to announce that I will have a much better performance within the forum from today onwards.

Now the questions.

1- How many songs will come with Götterdammerung?

2- I saw that you will follow the community feedback and finally remove the knight's cross from Hitler's new portrait. But I would like to ask if you could add this same portrait to the game after we manage to achieve all of Hitler's goals in the game in the same way that Mussolini wins the laurel wreath when forming the Roman Empire. I know this isn't historical, but I think it's a huge waste to remove a portrait that is already ready to be added to the game.

3- Will the alt-historical German path continue to be a civil war that starts with just one focus?

4- Will Hitler get the quisling treatment when he starts losing the war?

5- Could you give us an image with Ratte's terrain multipliers?
 
  • 26Like
  • 10
  • 3Haha
  • 1
Reactions:
I truly hate doing this, but as I've previously opened two bug reports that got nowhere, and it's been almost one year since I first reported the issue, I'll give this just one more shot, even if all it does is spread awareness:

In the previous dev diary you showed a national idea that gives the kriegsmarine 10% screening bonus while a taskforce only has capital ships, which would be nice, if not for the fact that, right now, the screening bonus applied to ships is completely broken. (yes, I know there already is an idea naval spirit that does that, the point stands)

I'll be brief (though you can find more in-depth descriptions in my bug reports):

If a fleet has any amount of screening %, the bonus shown in the screening tooltip will be calculated correctly, but the bonus applied to the ships will always be the full 100% bonus. This means that, a fleet with any amount of light screens, will always apply full capital and full carrier screening bonuses to all capitals and carriers.



Other than that, really loving the DLC so far, can't wait for the raids dev diary!
 
  • 8
  • 3
Reactions:
This is a completely selfish ask, but would it be possible to add a toggle to switch between metric and imperial measurements. Might be too late for this DLC but possibly in the future. Love all the new features coming!
 
Last edited:
  • 20
  • 2
  • 2
  • 1Haha
Reactions:
Will the new Transport Planes be upgradable through the aircraft designer? E.g. adding additional fuel tanks but decreasing paratrooper carrying capacity.
 
  • 9Like
  • 2
  • 2
  • 1
Reactions:
I wonder if the event of Chiang Kai-shek blowing up the Yellow River dam will be expanded with the new dam function. For example, the Japanese army reaching the dam landmark will trigger this event.
 
  • 20Like
  • 2
Reactions: