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.
Thank you :)

1: The AI is capable of micromanaging units beyond what the battle plan system does to take care of certain types of situations. Just as the player is expected to.

2: I will try to take the time to have a look at this!

3: Short answer: no. What makes it hard is that neither the player or the AI has access to info about what other countries are producing. Naval production also tends to be largely long term. But the balances are scriptable.

Cheers for the response and the extra info :). Really awesome to hear that the AI is "Battleplans plus", and can't wait to play it (T-38, and I'm definitely counting :)). #2 isn't a biggy for me, but is of interest, and I think could make a lot of modders quite happy. #3 is with an eye to the naval (and other) arms races going on, but particularly for naval because of the longer build times - there was a bit of an explosion in naval building in the second half of the 1930s (starting at around the time the game does), and it was driven in no small part by concurrent intel on what other nations' were building. I was a bit living in HoI3 (where you could get intel on what was being built) - if there's ever an espionage-related DLC where that becomes possible in HoI4, triggers based on what your opponents are producing (if you've/the AI has the intel) would be something I'd personally be very interested in, but you of course shouldn't just put stuff in because someone with a hammerhead alien avatar on the forums asks :).

Have been reading all your answers, and it really sounds like it's in great shape and streets ahead of HoIs past. Thanks be for the release of Stellaris in a week and a bit to make the wait more bearable :).
 
  • 1
Reactions:
Awesome DD, and one I have been waiting for for a long time!

Really interesting to see how everything is working behind the scene One question though, purely out of interest:

How did you start building up the AI? I mean, what part did you start with? Is there some base in the Clausewitz engine or did you have to start from scratch? If so, what part did you start with?

The base structure (parts of which are in the engine) was already done when I entered the project. I started out looking at diplomacy, as that is one of the most easily contained systems to code basic decision making for.
 
  • 8
Reactions:
Hi @SteelVolt and thank you for this good DD.

Can you tell us how the AI will set her priority and if those priority will be modable?
Exemple :
- the AI need tungsten, one of her neigbours had some, so she launch an invasion
- the AI can bomb two regions, but only one efficiently, one is full of factories, the other not, so she decide to bomb the factories ....

X.

Currently handled dynamically. So such specifics are not very modable atm.
 
  • 3
  • 1
Reactions:
Thanx,
hopefully AI at least checks units and decide which is better used for certain tasks.
Some routines for telling the AI which tasks they should prefer would be good.

Can we define generally which tasks a ship can use like for planes and tell the AI? I'm not sure

F.e.
Destroyer ={ patrol=yes; search&destroy=yes; convoy_Support=yes ...}
Escort ={ patrol=no; search&destroy=no; convoy_Support=yes ...}

As I am currently working with the system I cannot commit to an answer to this at this time.
 
  • 4
  • 3
Reactions:
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".

Yes I agree that with historical perspective it makes more sense to focus on carrier/naval bombers. However I think UK starts with the fleet in being doctrine (which gives some bonus to battleships) so early game is battleships could be more efficient for the UK.
I mainly chose this example because as far as I know the British build the King George and the Prince of Wales mainly to counter the threat of the "fast battleships" (i.e Bishmarck class) build by Germany. So I assume that had Germany build more "fast battleships" the UK might also build more Battleships to counter their threat
 
Last edited:
I am sorry if this has been asked and answered and if so if someone could be so kind as too show me the answer please do

Will the AI democracies focuses their ire on those countries doing the tension raising? Like if I play as Germany and Russia raises WT to a great degree will the AI focus on them or go about and make my life harder anyway?

By and large; yes, they will.
 
  • 6
Reactions:
You have the hardest & I think the most important job in the Development of HOI IV! I know you didn't work on HoI 3 and that is the most broken thing with that game. If the AI of HOI IV is bad no matter how good the rest of the game is it will be a bad game. So on your shoulders rest the fate of HOI IV!

The very best of wishes!

Thank you. I am most of all happy that I do not carry this burden alone. QA, Wiz, Groogy and betas are all pitching in with important work.
 
  • 8
  • 1
Reactions:
You mean what cheat/debug commands are available? Not something I am able to answer at this time, sorry.

No, I mean like how in Europa 4 a human player's country can never be inherited by an AI, but the AI suffers no naval attrition, and the AI gets an extra diplomatic relation it reserves for the use of the player.

One thing I saw in HoI4 was that there are some diplomatic options where you get a big bonus to the AI's chance to accept the deal because you're a human player.
 
Extra kudos goes out to Wiz as head AI honcho, who makes sure I don't fuck everything up, and Groogy, who has gotten to step in and help out when the work load has become too much for one person. I would also like to extend gratitude towards all the amazing beta testers, who have provided tons of valuable feedback and support!

THANK YOU: SteelVolt, Wiz, Al honcho, Groogy & the beta testers for all your hard work, long hours & devotion/dedication!!!
 
  • 6
Reactions:
Currently handled dynamically. So such specifics are not very modable atm.
Thank you for the answer.

A last question, in HOI3, the AI often do strange actions, as Germany sending all the troops build for barbarossa in Norway in case of stalemate. Or sending 40 divisions to hunt a single division behind the front-line. Does the new AI will be able to respond proportionately to the threats?

X.
 
Sorry just seeking clarification. Yes they will focuses on Russia? Or yes they will make life hard for Germany anyway?

Sorry for being to brief; the democracies will pick up on who generates threat and will generally work towards containing that threat and protecting smaller countries (primarily democracies.)
 
  • 8
  • 3
Reactions:
@SteelVolt
Jeez these are really good news! Good job :)
Just a question, how would you describe naval invasions ai? that is something that only allies (usa and gb) will do and only rarely everyone else or every nation will look for weak spots to perform an eventual naval invasion?
I mean how would you compare hoi 3 and hoi 4 naval invasions ai?

Thanks!!
 
Sorry for being to brief; the democracies will pick up on who generates threat and will generally work towards containing that threat and protecting smaller countries (primarily democracies.)

Thanks for your answers and thanks for the work you've done on the game. Can't wait to play it
 
  • 1
Reactions:
First, Thanks for your hard work on the AI.

You did not mention, for most guys, the most important feature of the AI for a player?
When the AI is attacking, will it surround enemy units and kill them. Guys really like to see this in Darkest Hour for instance.

Guys don't want a broad front of units all attacking at the same time. They want to see some units charging ahead, surrounding the enemy where possible, and then annihilating those units trapped in the "kessel".

Can your AI do this?
If not, do you think with some work (by modders maybe?) it could do this?

Thanks Again.
 
No, I mean like how in Europa 4 a human player's country can never be inherited by an AI, but the AI suffers no naval attrition, and the AI gets an extra diplomatic relation it reserves for the use of the player.

One thing I saw in HoI4 was that there are some diplomatic options where you get a big bonus to the AI's chance to accept the deal because you're a human player.

Ah. That bonus is for desire to join/create factions only, and is meant to aid in more sandbox style play. On higher difficulties the AI may be given some boosts to things like research times and production efficiency, but at base line all countries are equal in terms of game rules.
 
  • 5
  • 1
Reactions:
Thank you for the answer.

A last question, in HOI3, the AI often do strange actions, as Germany sending all the troops build for barbarossa in Norway in case of stalemate. Or sending 40 divisions to hunt a single division behind the front-line. Does the new AI will be able to respond proportionately to the threats?

X.

Determining what is proportional can be very difficult, and balancing stuff like this has been one of the greater challenges. I am not saying it is water tight, and some mistakes are sure to occur, but largely it does seem to be fairly good now.
 
  • 4
  • 1
Reactions:
@SteelVolt I would like to inquire again which aspects of the AI are open to (heavy) modding. I understand the dynamic AI underpinning the game can be tweaked via changing the factors. What else is possible? The game can be divided up into several areas very important to the AI.

Production - Can we script build orders to trigger dynamically (usually in response to certain dates date/war/victory conditions), especially implementing new units and triggers? This is different from changing the weights of equipment.
Research - Dynamic triggers to rush ahead of time tech in response to battlefield conditions or national foci would be great here
Land Combat - I'm not hopeful for this since I understand this is much valuable in terms of IP, but anyway to tweak the combat AI especially with regards to stance (seems to be gone now), and deployment orders?
Naval Combat - Are we free to define fleets types, patrol areas and/or missions for the AI to follow?
Air combat - Similar to naval combat, what's the potential for modding

Lastly since no one has asked yet, what language are we looking at when coding scripts for the AI to follow?

Generally speaking, I think the more exposed the AI logic is to tweaking especially the subroutines, the better the game will age with mods. If possible try to let us have access to the underlying logic rather than just the 200+ triggers/modifiers/factors involved!
 
Determining what is proportional can be very difficult, and balancing stuff like this has been one of the greater challenges. I am not saying it is water tight, and some mistakes are sure to occur, but largely it does seem to be fairly good now.
Thank you very much.
Nice to hear that, as it was one of the most common game breaker in hoi3 as non German axis :)