• 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:
Nice to see the AI concentrating forces. Does it consider what divisions to use as well? Just look at overall stats? It should prioritize using the best divisions on the most important front, instead of using tanks for garrison duty or something. Or making marines, then using something else for their amphibious assault..

I don't think the AI should use meta designs or anything, but needs to pay attention to terrain/width as well.
 
  • 3
Reactions:
Here's my questions:

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.

3. So now military staff increases CP cap instead of decreasing it. Do they still cost CP to hire? Does this change affect only the HQ, or chiefs of army, air force, and navy as well?

4. Are forts still about as strong per level as before, or was their effect buffed to counteract the lower cap? What if I get a fort of higher level than my tech normally allows (such as through focus or by capturing them). If their level can stay that high despite me lacking the tech, then what if they are then damaged. Can you repair those fully, or only up to the level that your tech allows?

5. Can we get a clarification on which of these features are a part of the DLC itself and which are included in the free patch? It seems like they would all be in the free patch, but I still wonder.
 
  • 4
Reactions:
Well, I'll definitely be running some AI tests on the day of release. Germany sending tank divisions to garrison the coast, or the border with Switzerland on the day of Barbarossa drives me crazy.

Hopefully the AI also designs, builds and deploys tank divisions more competently than it currently does, too. That might be hoping for too much though.
 
  • 3Like
  • 1
Reactions:
@Plankie, I cannot overemphasize how excited I am about AI Force Concentration!

This is not a small feature! It might be the biggest change to the combat AI since the game launched!!!

I think a lot of players assume that the AI is playing roughly as they would: targeted attacks driving towards particular goals by the easiest route. But @bitmode's series of posts on the AI show that it's not. It is a complex system that tries to consider a lot of factors in order to get the right units attacking in the right place. But at the end of the day, as you say
the AI always pushed along the entire front with equal effort.
To borrow an analogy from Bitmode, it was roughly like a First World War offensive. And it's adaptation to terrain features like rivers was very localized. An example of the kind of thing that it does (this is a crude summary, not a full case study) is that if half the border was a mountainous river and the other half was open plains, the AI divides its attacks roughly equally between the two, even though a human player would know to concentrate her offensive across the plains.

AI Force Concentration is exactly what I have been dreaming of the AI doing since we saw the Battleplanner maps before launch. I think other forumites are really underestimating how much this could change the feel of combat week-by-week during the game. Instead of imagining that the AI is launched concentrated attacks that could punch through your line, it might now actually happen.

Recovering slightly from my initial excitement, the sceptic in me notes that although it's great that the team are trying to implement this, we will have to wait and see how good the implementation is. I appreciate that this is not as easy as it looks. I am also conscious that its effectiveness will depend a lot on how much other parts of the existing code (i.e. front interpolation) are being re-used vs replaced. But this is potentially a very big change.

I hope that that you are getting some feedback from beta testers about how effectively this is working, and drawing lessons about the weights used for the path-of-least-resistance calculation. This seems like an algorithm where initial weights might be improved a lot by iterating based on observation of real games (and testing of hands-off games on specially created maps too).

Can I please ask for confirmation that AI Force Concentration will be part of the patch rather than the DLC? It should absolutely be a core part of the game; you shouldn't have to pay more to make a Second World War AI do blitzkriegs.

Also, this news links in to a topic discussed in the last Dev Diary thread:
the Blitzkrieg/Bewegungskrieg temporary bonuses should playing Germany feel quite different, both from other countries and from earlier patches. ...

However, I worry that AI Germany will be severely hampered by them. I don't think the AI has any way to be taught them because it doesn't really launch offensive campaigns; it just continually grinds forward. I'm pleased to see that an AI diary is promised. I wish that this would include news that the AI will actually use armoured spearhead armies to punch through enemy lines, but after 8 years, I am not optimistic.
Happily, my pessimism turned out to be misplaced. So it would be possible for the German AI to trigger the Blitzkrieg/Bewegungskrieg bonuses when it has an AI Force Concentration ready to begin an offensive. Has this been done?
It is great to hear that the frontline AI is getting some serious attention. Hopefully this will continue to be developed in further war efforts, with a focus on helping the AI turn a breakthrough into an envelopment or exploitation. The combat fundamentals are absolutely critical to gameplay and any work on them is more welcome to me than a dozen focus trees and new mechanics.
Yes, I agree. AI Force Concentrations have the potential to be excellent in themselves. But they also do some of the work necessary if the AI is ever going to carry out encirclements or follow on with a second Exploitation Concentration.
Thanks for the update and give Plankie and the programmers a raise!
Amen!
 
Last edited:
  • 8Like
  • 4
  • 1Love
  • 1
Reactions:
Kudos to the changes on high command, more accurate and intuitive than pay for good officers; maybe a higher pp cost for balance?
 
  • 1Like
  • 1
Reactions:
New transport planes too! The pdx team has thought of everything. Would this mean we can, through Experimental Facilities, research giant transports? Like the Me 322 gigant ect...
 
  • 4Like
  • 1Love
  • 1
Reactions:
How many other countries will receive special landmarks? For example, will Ottawa get Parliament Hill? Will Cairo get the Great Pyramids? Will Istanbul get the Haiga Sophia? Will Tokyo get the Imperial Palace? Will the Raj get the Taj Mahal and/or Red Fort of Delhi? Will Beijing get the Forbidden City?
 
  • 2Like
  • 1
Reactions:
A small QoL fix I’d ask for is to fix an inconsistency regarding South Tyrol‘s occupation status and make it releasable:

South Tyrol isn't correctly portrayed as an occupied territory/ colony affected by resistance but instead as core state for Italy despite the vast majority German population, the notable South Tyrolian resistance (which eventually forced Italy to grant South Tyrol autonomy) and Greater German stance of the population. In the latest pre-war census I could find the population was 75.9% German in 1921, that‘s an ethnic German population share even higher than current Germany(only 70,3% without migration background in 2023) !
The occupation system is already in place for the other Italian colonies, most notably Zadar/Zara despite more than 70% of the population there actually being Italian at the time, why not this one? For Zadar/Zara it could even be reasonable to set it as Italian core instead considering the Italian majority ?

For example in 1921, italian fascists attacked the traditional German Trachtenumzug procession with clubs, pistols and hand grenades, murdering 1 and injuring ~50 Germans, doesn't seem like you would treat your core population this way eh?

It's also not even shown in the occupied territories tab as returnable to Austria last time I checked, whereas the Dodecanese can be returned to Greece.
And neither Austria nor the German Reich have it even as their own core last time I checked, which consequently also should be fixed in Götterdämmerung!
Please consider fixing this.
Thank you.

I’d also suggest in the new focus trees for the German Reich and Austria to add focusses for regaining their core South Tyrol peacefully or militarily
 
Last edited:
  • 2Like
Reactions:
The landmarks seem more man-made things (and destructible) than natural wonders like mt. fuji or something, could be wrong.

Does remind me of the EU4 great projects which were innocent enough at first but are kind of a ridiculous power creep now. Even if the bonuses are minuscule I would also support a game rule disabling them but keeping the 3D models.
 
  • 4Like
Reactions:
It is great to hear that the frontline AI is getting some serious attention. Hopefully this will continue to be developed in further war efforts, with a focus on helping the AI turn a breakthrough into an envelopment or exploitation. The combat fundamentals are absolutely critical to gameplay and any work on them is more welcome to me than a dozen focus trees and new mechanics.
I could not agree more with that last sentence.
Loving the command power change and new area defense options!

Will there also be changes to how area defense works in general? Specifically about the automatic response to enemy divisions. In most cases (especially if the area includes islands), you want to set up the area defense order and wait until your units have moved into place, then delete the order again and set up small, individual fallback lines (which is very tedious). Otherwise your defending units will abandon all their posts if the enemy lands on a random coastal tile, which then often gives the enemy an uncontested landing on a port that should have been defended.
I agree that garrison units abandoning coastal provinces is a very serious and common flaw in the way that Garrison Orders currently work. E.g. playing as (both AI and human) China, every time the Japanese enter a new State by land invasion from the north, the units garrisoning that state's coast abandon it and move to the land-route frontline. That is bad for two reasons: the coast is undefended (and the Japanese AI is clever enough to regularly try coastal invasions) and you now have two unco-ordinated AI armies fighting on the same frontline, which is a Supply disaster. I really hope that AI units will only response to land-route attacks if, and only if, the Guard Borders option is selected.
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.
Hmm. You make a good point. But I can also see situations where you would want in-faction borders guarded, because they are often along geographically significant lines and the AI isn't great. E.g. as Germany (or for optimal play against AI Germany), I'd want to guard my border with puppet Denmark, because guarding the isthmus is easier than guarding the whole coast and I certainly don't trust the Danish AI to guard the coastline well. And historically there were incidents of faction members changing sides (cough, Italy). It doesn't happen a lot in-game but it is possible, and it would be a significant amount of work to make the AI change its behaviour baed on its strategic situation. So I think you can argue for either option here.
So now the AI will concentrate all their best units so we can ensercule them faster and easier than ever, nice!

Jokes asiede, I think this is a change in a good direction. Teaching the AI how to play the game is always good, but I hope you also teach the AI how to do proper tank divisions and tank disigns, because as long as they don't know, even if they consentrate their best divisions, the divisions themselves won't be substantially better than any other division, and they won't pose a real threat to any experienced player.
I agree, but this is a necessary first step.
Question on the Command Power rework: is there going to be a lowered cap for promoting new officers/generals in Command Power costs? I ask because I thiink it can become impossible to hire more generals at present if you already have a lot of them (IE: playing as Soviets or Finland)
You use Command Power for promotions, but you get that back over time. The CP is 'spent' rather than 'allocated', isn't it?
Just to be clear, just the enemy AI will do this now? Or also your own army groups and frontlines when launching an offensive?
I don't see how it's possible for the AI to do this for a human player. This feature affects how the AI players draw battleplanner arrows and what units they assign to certain Armies. I don't think human players would ever want the AI to take this over; it would be like going back to HoI3 where you could automate your entire armed forces.
Can the A.I. notice force concentrations and allocate more units to an area where it suspect an offensive might happen?
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?
I would also like the AI organize itself better defensively. However, I think it's important to be realistic about this. It is a significantly different problem to the one that the AI Force Concentrations feature announced today is trying to solve. The solution might look superficially similar (creating a specialized army with more armour) but I would guess that the algorithm and the weights would be very different. It's not just as simple as reversing the weights. In particular, you'd want a defensive Force Concentration to be able to do something like make a stand on a line of forts or a major river using Fallback Lines, which the AI can't do and which would require a whole separate set of maths.

I hope this comes in a future patch/DLC cycle because it would be a major improvement. If you want future AI features, please show some support for this feature! E.g. mention it as a positive if you buy the DLC (even if it's in the free patch, because Steam reviews notoriously mingle the two).
will the german generals get a portrait rework?
Seems like a very poor, even pointless, use of the team's artists to re-do things that are already in the game when there are still many countries that don't have any unique generals.
 
Last edited:
Nice dev dairy and looking forward to some of these changes also
Love that there is some QOL changes especially to area guard button.- but is there a plan to make this one QOL change - I really do miss something like division change for fleets so if you have an admiral with X fleets that you could assign the same template to all of them from your saved templated.

But looking forward to test the new AI and all the new features - looking to be a great patch and expansion.
 
It will be possible in special projects to investigate giant gliders such as the German 232 Gigant

The transport planes will have generic skins or some country's personal skins
 
  • 1
Reactions:
Being able to upgrade transport planes is a welcome addition.

Raising the Command Power cap as you HIRE advisors is also a welcome addition. Before, you had to decide between hiring advisor or having a higher CP cap, which would be a problem is you're starting to run out of Generals.

I'm not so sure I like the idea of Landmarks, because if they give a buff to the country that controls them, it's yet another advantage for larger countries and yet another disadvantage for smaller ones, unless you play on giving every single country in the game a landmark.

Anyway, what I'm REALLY hoping for is more formable nations and to able to use unit name mods in Ironman, but I'm sure those are coming later.
 
What about pacific islands? A lot of them are plains but some should be jungle. Will islands have a lower fort cap as getting material there is logistically harder?
 
  • 5Like
  • 1
Reactions:
Also, will division types look to use their terrain bonuses to their advantage? Mountaineers for hills and mountains and armored and motorized for plains for example.
 
  • 1
Reactions: