Developer Diary | Small Features

Hearts of Iron IV

Victory is at your fingertips! Your ability to lead your nation is your supreme weapon, the strategy game Hearts of Iron IV lets you take command of any nation in World War II; the most engaging conflict in world history.

Hey everyone! I'm [b][i]Plankie[/i][/b], 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 [url=https://store.steampowered.com/app/3152780/Expansion__Hearts_of_Iron_IV_Gtterdmmerung/][i][b]Götterdämmerung[/b][/i][/url] expansion, we had the perfect opportunity. We call this feature [b]AI Force Concentration[/b], or [b]AIFC[/b] for short (an acronym which has caused many football-related jokes in the team). [h2]AI Force Concentration[/h2] [h3]So [b]WHY[/b] did we want to focus on this?[/h3] 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? [img]{STEAM_CLAN_IMAGE}/9948323/ee1a623fa3b733df894d2b65d54b4b05112bda77.png[/img] [i]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.[/i] [h3]Cool! How does it actually work then?[/h3] 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. [img]{STEAM_CLAN_IMAGE}/9948323/dc8faf9940510ecbd3ff324a4c9cc7fb8ef0fa2b.png[/img] [i]The paths evaluated by Germany before Barbarossa.[/i] The [b]AIFC[/b] 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 neighboring provinces. But as they say, "[i]a plan never survives contact with the enemy[/i]". This can be true for the AI as well. Because of this, it keeps track of how well an [b]AIFC[/b] 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 [b]AIFC[/b] behavior 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 [b]AIFC[/b] to a higher degree (fully scriptable of course, so all our wonderful mod creators can play around with it). [img]{STEAM_CLAN_IMAGE}/9948323/22d7b665eb02a74cbae13d386736e00564df1ef2.png[/img] [i]On the receiving end of an AIFC offensive.[/i] [h2]More new things[/h2] [i][b]Thomas[/b][/i] 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 [i][b]Götterdämmerung[/b][/i]. So let’s take a quick look at some of the other smaller features and changes we have done: [h3]New Technologies[/h3] The tech tree has as mentioned in the [url=https://store.steampowered.com/news/app/394360/view/4704662071969444827?l=english]Special Projects Developer Diary[/url] 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. [img]{STEAM_CLAN_IMAGE}/9948323/9c072b556f88d104aba8afc796806e4925aac2b5.png[/img] [i]One cannot have too many Junkers, right?[/i] The other, slightly bigger change we have made is to [b]Forts[/b]. 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 [b]Land Forts[/b] and [b]Coastal Forts[/b]. 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: [i]Plains[/i]: 5 [i]Hills[/i]: 5 [i]Urban[/i]: 5 [i]Forest[/i]: 4 [i]Mountain[/i]: 4 [i]Desert[/i]: 4 [i]Jungle[/i]: 3 [i]Marsh[/i]: 3 [i](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 :) ) [/i] [img]{STEAM_CLAN_IMAGE}/9948323/3b251ccb25bd300b988b6f1f36098fd934a88dde.png[/img] [i]The new fortification techs, [/i] [img]{STEAM_CLAN_IMAGE}/9948323/bc440005125b55192acad3779742c0ceb5197bcc.png[/img] [i]Here we have upped our fortification capabilities a bit, just need to construct the actual forts[/i] [h3]Command Power Cap[/h3] We have also slightly changed how the [b]Command Power Cap[/b] works. Now your High Command will actually increase the [b]Command Power Cap[/b], so that with a good set of military commanders, you will have more [b]Command Power[/b] at your disposal. This should make it less punishing to build up your high command, rewarding you for having a competent staff. [img]{STEAM_CLAN_IMAGE}/9948323/bf50c7ee4b6ac6ba18bbfb0acfcc827cf0075930.png[/img] [i]By adding von Rundstedt to our staff, we increase the Max Command Power by 20[/i] [h3]Dams[/h3] As Mentioned in other dev diaries, there are now [b]Dams[/b] in the game. They can be targeted by [i][b]Raids[/b][/i] 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. [h3]Landmarks[/h3] 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 [b]Landmarks[/b]. 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 [b]Landmark[/b], so by capturing for example the Statue of Liberty, you can deny the USA their bonuses, but you won’t get them yourself. [img]{STEAM_CLAN_IMAGE}/9948323/214d0b1496b91a0f1ee397d676c1eada3776cbda.png[/img] [i]A landmark in the UK[/i] [h3]State and Province UI - minor QoL changes[/h3] 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. [img]{STEAM_CLAN_IMAGE}/9948323/2738c1f15fbf26f3d1cfc848fce601394a95c6ea.png[/img] [i]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.[/i] [h3]Area Defense QoL[/h3] 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 behavior 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. [img]{STEAM_CLAN_IMAGE}/9948323/8316006785c2d55578e3b4dc78b3471acb526b7e.png[/img] 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. [img]{STEAM_CLAN_IMAGE}/9948323/d948fe17f1f11b71a236f8c8041c21479e0c612b.png[/img] [i]The new Area Defense setting for guarding borders[/i] [h3]Horsies with different colours[/h3] 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. [img]{STEAM_CLAN_IMAGE}/9948323/705fb3f2bbd49fce42d25f9f28fb5dcad38380d6.png[/img] [i]I assume these would be Hanoverians…[/i] [h3]There’s always more… [/h3] 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. [url=https://store.steampowered.com/app/3152810/Hearts_of_Iron_IV_Expansion_Pass_1] Make sure to check out the Expansion Pass Here[/url]: https://store.steampowered.com/app/3152810/Hearts_of_Iron_IV_Expansion_Pass_1