Hearts of Iron IV - Development Diary 54 - AI

  • 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.
One of the biggest focuses when designing and working on the "unitcontroller", as we call it internally, is that it should not get in the way of the player, and a player given order must always have priority.

We have been experimenting lately with a system of "stickiness"; if you give a unit a manual order it will stick to that location until front has moved on.

All in all, a combination of using battle plans and giving some detailed orders in critical situations seems to be working very well :)


Thanks for your quick reply! :)

It would be great, if you could consider giving us a "do not move" button for battleplans so AI does not move units at all. That would be awesome!
 
  • 6
  • 1
Reactions:
We have been experimenting lately with a system of "stickiness"; if you give a unit a manual order it will stick to that location until front has moved on.
That seems a bit... unwieldy. Perhaps it will work better than it sounds, but nevertheless, could we additionally have a simple on/off switch for AI's assistance, both on unit level, and separately on army level?
 
  • 3
  • 2
Reactions:
@SteelVolt
How complicated can AI scripts be?
Like can we actually use the intelligence available to AI in decision script?
Can we check what kind of army/resources/factories does AI have?

Have you tought AI to use combined arms mobile warfare? Does AI plays around capability to surround enemy troops? Will we see AI being able to execute Blitzkrieg with massive encirclements at least against other AIs?
 
  • 2
Reactions:
Lets say I want to delegate as much as I can to the AI. Can I just tell it "wage war for me" and have automatically produce equipment, supply it to units, assign units to fight on different fronts and fight hostile armies? What is absolute minimum for player to do for his country to semi-effectively wage war?
 
Sounds great! Looking forward to seeing your creation!
You didn`t mention the tactical AI. Will we be able to tweak unit behaviour and battleplan writing for the AI?
 
  • 1
Reactions:
How do you feel about the AI's performance in defending from naval invasions? Can you lure the whole British navy away from the channel with your two German battleships as long as your invasion needs preparation, sneak one division into a port and transport the rest over, and then you basically won? Or do you feel like that will be no longer possible?
 
  • 1
Reactions:
Some question about AI that come to my mind :

- Did it uses xp to make variants ?
- How it handles research to make new division template ? Is there any "pre-made" template with latest tank/infantry equipment researched, or did the AI make his own according to some algorithm ?
- Last but most important : are the naval invasion by AI in HoI 3 corrected ? I saw Australia launch an invasion of Yugoslavia with one division like a suicide in the last WWW, it remember me the AI of HoI3 when USA send 2 infantry division in Murmansk or 6 armored division in Holland without support... It's my greatest fear, as without a proper uses of naval invasion by the AI, USA and Japan are doomed to make nothing...
 
  • 1
Reactions:
@SteelVolt
How complicated can AI scripts be?
Like can we actually use the intelligence available to AI in decision script?
Can we check what kind of army/resources/factories does AI have?

Have you tought AI to use combined arms mobile warfare? Does AI plays around capability to surround enemy troops? Will we see AI being able to execute Blitzkrieg with massive encirclements at least against other AIs?

You cannot script actual algorithms, but determining weights can be as complex as the triggers allow.

Not sure what you mean by this. By tweaking various values you can significantly alter the behavior of countries, but the underlying algorithms are C++, and as such not changeable through scripts.

In script? There are triggers for things like that, yes.
In the game, as a player vs AI? To the same extent as is allowed against human players.

I cannot say either yes or no with any conviction here. The AI does know things like taking advantaage of weak spots etc, and the multiple systems that touch movements and priority can certainly give rise to such behaviour. But planning large complicated operations in advance is tricky. Something I want to look more at in the future.

Also keep in mind that the AI is still in deveoplment, and will continue to be improved even beyond release :)
 
Last edited:
  • 19
  • 2
Reactions:
Good Read. Intresting stuff. Most of the time AI countries getting cought unprepared is there are going to be "helping" feature to make sure they are ready for war?
Also Is there going to be second AI diary for Battle AI? Thats the other half of the gameplay.
 
Lets say I want to delegate as much as I can to the AI. Can I just tell it "wage war for me" and have automatically produce equipment, supply it to units, assign units to fight on different fronts and fight hostile armies? What is absolute minimum for player to do for his country to semi-effectively wage war?

In short: no. You would need to draw the plans and then set them to execute. There is no thing as "manage this entire theatre for me" or "conquer country X", but when facing an inferior enemy, just setting your plan to cover their territory is usually enough.
 
  • 20
  • 1
Reactions:
@SteelVolt
Important things for modders:

1) How hard/easy is it to implement new unit types and tell the AI how to use it and how much to produce (balancing production numbers)?
1a) F.e example I want to add escort ships. So they have Special Tasks:
- Do not mix with fleets
- Just go for submarine hunting
- go mostly on convoy escort duty

2) Can we tell the AI some Kind of production Ratio, or at least how does AI handle and itself produce and develop the techs of them?
- So AI sees the use of it
- AI decides how much are usefull of them (because of the missiontypes it has)

In Hoi3 I find it very complicated because of lacking programming/Scripting skills
 
  • 3
Reactions:
Cheers for the DD Steelvolt , and to you, Wiz and Groogy for all your work :D. Really looking forward to HoI4, and for me the AI is the most important part, and it looks like it's in a good pair of hands :). So much coolness in the various scriptable features - specific behaviours for different leaders is brilliant (and will be a boon to modders), as is the peace deal side of things and being able to push the AI towards specific templates (presumably altering this based on whatever triggers we roll with?) Debug view also all kinds of awesome :).

The solution to this is mainly design; the system is not intended or built to be a magical "win war" button, but rather a tool to organize large numbers of units when every single detail is not critical. Both the AI and the player is expected to oversee critical operations, but they will not have to think about no-brainer situations, and is thus free to handle much much bigger armies and operations than if they had to micromanage them.

Does this mean the AI has both the Battleplan AI (shared with player) and it's own "tweak things to deal with situations as they arise" AI? Very cool if so :).

* The dynamic AI systems does not cheat. They use the same information as is available to the player, including estimating enemy forces based on intel numbers.
* Save for boosting party popularity, there is no feature in the game that the AI is completely barred from using. It being intended more as a sandbox feature for players. We have also had to limit it a lot when it comes to staging coups.

On the first - big props, non-cheating AI is always my preference :). On the second, will it still be possible to mod in a bit more coup and influence party popularity-friendliness for crazy sandbox games?

To a degree. As the player, it does not have access to what other countries are building, but to what it encounters in the field.

Only answer if easy, but are there triggers for intelligence (ie, is it possible for an AI UK to focus production more on battleships if its intelligence sees nations its threatened by (or GER/JAP specifically, however it's best to set it up) building BBs, and similarly if instead it sees Germany building a stack of u-boats, to focus on destroyers instead?
 
Sounds great! Looking forward to seeing your creation!
You didn`t mention the tactical AI. Will we be able to tweak unit behaviour and battleplan writing for the AI?

Good catch! Sorry about that!

The AI uses the battle plan system under the exact same rules as the player. There are some defines that effect parts of it, but almost all of it is a dynamic system in C++, by necessity. It is quite a hard problem to tackle :)
 
  • 18
Reactions:
Will the AI adapt its production or division templates based on what they know their enemy is building/using?

For instance if as Germany I focus on battleships instead of submarines will UK AI give more weight to producing battleships or carriers?

Likewise, if as Germany I have an infantry only army will Russia AI be more likely to add artillery on their divisions than to add anti tank?

Battleships are weaker to airplanes(Relies more on heavier guns rather than AA), so in this case it would better to invest in Naval bombers and carriers. If you invested in Cruisers or Destroyers, then it would be easier to invest in Battleships. Naval battle is more of "what counters what".
 
How do you feel about the AI's performance in defending from naval invasions? Can you lure the whole British navy away from the channel with your two German battleships as long as your invasion needs preparation, sneak one division into a port and transport the rest over, and then you basically won? Or do you feel like that will be no longer possible?

I am actually working on improving the naval AI right now, but I can't say I have seen that specifically be an issue in HoI4.
 
  • 17
Reactions: