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.

Qatlas

Second Lieutenant
16 Badges
Apr 1, 2015
100
89
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: La Resistance
  • Crusader Kings III
  • Battle for Bosporus
  • Victoria 3 Sign Up
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron IV: No Step Back
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Crusader Kings II
  • Crusader Kings II: The Old Gods
  • Stellaris Sign-up
It has been known to happen, but typically it is due to the AI taking advantage of situations that happen to occur. Give it an opening and the AI will use it.
Specific unit movements will unfortunately not be moddable, but I am continuously thinking about how I can improve on things like this to make the AI more effecient.
Maybe my question and sugestion is too late, but, can AI make battleplan according to composition of the divisions and use it correctly?
If the Army for example has armored division, infantry and mountain infantry division can AI set priorities on which terrain should go with which division. So Armoured Division has a high priority in the plains and less forest and at least a mountain. Mountain Division has a high priority in the mountain and hills and less on the plains and so on. Thus AI could apply an be successful in using blitzkrieg and spearhead strategy somewhere!!
I would be very pleased if it is implemented in the game!:)

Very good job for all the rest
 
  • 1
Reactions:

blackninja9939

Experienced Programmer - Crusader Kings 3
Paradox Staff
78 Badges
Aug 28, 2013
2.401
7.847
  • Crusader Kings III
  • Stellaris: Federations
  • Battle for Bosporus
  • Stellaris: Nemesis
  • Hearts of Iron IV: No Step Back
  • Europa Universalis IV
  • Crusader Kings III: Royal Edition
  • Europa Universalis 4: Emperor
  • Stellaris: Necroids
  • Crusader Kings II
  • Crusader Kings II: Holy Fury
  • Imperator: Rome - Magna Graecia
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Synthetic Dawn
  • Surviving Mars
  • BATTLETECH
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Monks and Mystics
  • Tyranny: Archon Edition
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Colonel
  • Stellaris Sign-up
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Apocalypse
  • Stellaris: Lithoids
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Shadowrun Returns
  • Imperator: Rome Deluxe Edition
  • Prison Architect
  • Imperator: Rome Sign Up
  • Stellaris: Ancient Relics
  • Age of Wonders: Planetfall
  • Crusader Kings II: Conclave
  • Crusader Kings II: The Republic
  • Victoria 2
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Stellaris
  • Mount & Blade: Warband
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Sunset Invasion
So below is a small piece of code I wrote as part of my technology script, and this doesn't even get into iterating through containers holding variable data. We are not in the same ball park here...

*snip
I am not saying that normal coding languages are worse, I am simply saying that the paradox coding language is nowhere near as bad as you made it out to be
 
  • 2
  • 1
Reactions:

adil3tr

Commissar
53 Badges
Aug 4, 2011
623
698
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Imperator: Rome Deluxe Edition
  • Cities: Skylines - Natural Disasters
  • Steel Division: Normandy 44
  • Cities: Skylines - Mass Transit
  • BATTLETECH
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Cities: Skylines - Green Cities
  • Hearts of Iron IV: Expansion Pass
  • Surviving Mars: Digital Deluxe Edition
  • Cities: Skylines - Parklife
  • Surviving Mars: First Colony Edition
  • Cities: Skylines Industries
  • Tyranny: Archon Edition
  • Imperator: Rome
  • Hearts of Iron IV: Expansion Pass
  • Surviving Mars: First Colony Edition
  • Imperator: Rome Sign Up
  • Cities: Skylines - Campus
  • Hearts of Iron IV: La Resistance
  • Crusader Kings III
  • Battle for Bosporus
  • Victoria 3 Sign Up
  • Tyranny: Gold Edition
  • Europa Universalis IV
  • Supreme Ruler: Cold War
  • Teleglitch: Die More Edition
  • Victoria 2
  • War of the Roses
  • Cities: Skylines
  • Mount & Blade: With Fire and Sword
  • Cities: Skylines - After Dark
  • Knights of Pen and Paper 2
  • Cities: Skylines - Snowfall
  • Stellaris
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
  • Tyranny: Archon Edition
  • Hearts of Iron III
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: The Old Gods
Please tell me that there will be an option to turn off AI control and controlling your units manually without losing any bonuses that come from planning.
I think you can just micromanage the plan when its executed until the bonus runs out, and then not make any lines/dissolve groups.
 
  • 1
Reactions:

HeilLoki

Major
94 Badges
Nov 30, 2010
788
1.435
  • Cities: Skylines Deluxe Edition
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Impire
  • Europa Universalis IV: Res Publica
  • Semper Fi
  • Crusader Kings II: Reapers Due
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Europa Universalis IV: Third Rome
  • Heir to the Throne
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Galaxy Edition
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Stellaris
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Sword of Islam
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • For the Motherland
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Divine Wind
  • Cities in Motion
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV Sign-up
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Hearts of Iron IV: No Step Back
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Victoria 2
I think you can just micromanage the plan when its executed until the bonus runs out, and then not make any lines/dissolve groups.

Yeah, that's a good idea. Still not fond of babysitting my units (stop them from doing something stupid) until then.
 
  • 1
Reactions:

joeenochs

Colonel
21 Badges
Apr 10, 2009
869
205
  • Hearts of Iron II: Armageddon
  • Europa Universalis III: Chronicles
  • Arsenal of Democracy
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Semper Fi
  • Hearts of Iron IV: La Resistance
  • Imperator: Rome Sign Up
  • Hearts of Iron IV: Expansion Pass
  • Imperator: Rome
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: Cadet
  • Stellaris
  • 500k Club
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Europa Universalis IV
Hi Steelvolt,
thank you for the interesting and informative dev diary.
1. One question: Given that imho there can be no such thing as a too strong AI, why not somewhat resort on cheating to let the AI peek what the player is building or where his units are going (beyond the intel level)? Within some reasonable limits it will probably feel much more fair and fun than having to resort on the higher difficulty level with insane production bonuses for the AI or having to take on the US as Albania to get a challenge.
See also this very informative talk on game AI from the father of the CIV4 AI:
(minute 22+ is specifically on AI cheating and 49+ a question specifically on intelligence cheating)
2. It is a bit disappointing that the AI will not on its own try to create any kind of breakthrough with its tank and motorized units. When the AI feels comfortable to hold the line with its infantry units, maybe it could use the battleplan system to try to create a breakthrough with its fast units? Yes, it could be exploited by the human perhaps but so could he try to exploit the current system by offering weaker points in the front and then counter attack (something an actual WWII general could have done).
 
Last edited:
  • 2
  • 1
Reactions:

Jolt

General
17 Badges
May 29, 2005
1.838
343
  • Europa Universalis IV
  • Imperator: Rome Sign Up
  • Age of Wonders III
  • Stellaris Sign-up
  • Stellaris
  • 500k Club
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Heir to the Throne
  • Crusader Kings II
  • Divine Wind
  • Europa Universalis III Complete
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Old Gods
@SteelVolt

But how does the AI pick focuses? This can either be strictly scripted on a per country basis and activated by playing the game in 'historical focus mode'. While it is fully moddable a historical setup for this is included. When that mode is NOT active, the AI picks foci using a combination of scripted weights and dynamic underlying systems that look at the situation of the country.

Suggestion: Make another "Fully Dynamic" mode where there are no scripted weights and the AI and every AI has the same chance to pick different focuses.

Code:
    # Modification if strategy is enabled
    ai_strategy = {
        type = antagonize
        id = "AUS"         
        value = 300
    }     
}

What does "antagonize" makes the AI do, exactly?



Who is SPR and shouldn't Germany also be trying to befriend Hungary?
 

Bhaal

Admiral of Lake Superior
30 Badges
Jun 18, 2005
1.251
205
  • Pride of Nations
  • Crusader Kings III
  • Stellaris: Federations
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Death or Dishonor
  • Steel Division: Normand 44 Sign-up
  • Steel Division: Normandy 44
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Hearts of Iron IV Sign-up
  • Stellaris
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Crusader Kings II
  • Europa Universalis IV: Pre-order
  • 500k Club
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Supreme Ruler: Cold War
  • Europa Universalis: Rome
  • Magicka
  • Hearts of Iron III
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Darkest Hour
  • Crusader Kings II: The Republic
Great DD, so happy to hear the AI no longer cheats or has nofog!
 

Bap

Uberstacker
34 Badges
Oct 27, 2009
183
312
  • Crusader Kings II: Charlemagne
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Semper Fi
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Crusader Kings II
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Europa Universalis III Complete
  • Darkest Hour
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Colonel
  • Stellaris
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Victoria 2
  • Europa Universalis III Complete
  • Europa Universalis III Complete
Given that imho there can be no such thing as a too strong AI, why not somewhat resort on cheating to let the AI peek what the player is building or where his units are going (beyond the intel level)?
I second this. It is the kind of cheating I wouldn`t mind the AI doing at all, having a bit more intelligence over the battlefield, no need to make the job even harder for the AI in a area where it always loses to a human player. Anyway the human player can easily figure out the AI force disposition...
Also, would you consider having the AI always keep a unit garrisoning its capital at all times - and the capitals of countries it`s trying to conquer? The behaviour we saw in the last WWW where Berlin is taken because it`s not defended could be very frustrating.
Cheers.
 
Last edited:

Axe99

Ships for Victory
127 Badges
Feb 13, 2003
15.951
13.022
  • Europa Universalis IV
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Battle for Bosporus
  • Europa Universalis 4: Emperor
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Victoria 3 Sign Up
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron IV: No Step Back
  • Crusader Kings II: The Republic
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Europa Universalis III Complete
  • Lead and Gold
  • The Kings Crusade
  • Magicka
  • Majesty 2
  • Majesty 2 Collection
  • March of the Eagles
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Ship Simulator Extremes
  • Sword of the Stars
  • Supreme Ruler 2020
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • 500k Club
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Pride of Nations
  • Rise of Prussia
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
Thanks everyone for a fine day! Great questions and reactions, and hope you all enjoy the game at release (if, of course, you chose to get it.)

The time at PDX is beer-o-clock now, so I am off for the weekend :)

Thank you very much for the DD and all of the extra info - have enjoyed reading all of it, and appreciated the time you've taken to share info with us :). Hope you had a very well-deserved beer or three, best of luck with the work between now and release and very much looking forward to locking horns with your AI in a dash over a months' time :D.
 

Beagá

Banned
74 Badges
May 27, 2007
13.783
4.044
  • Hearts of Iron IV: Colonel
  • 500k Club
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Victoria 2: Heart of Darkness
  • Hearts of Iron IV: Field Marshal
  • Europa Universalis IV: Rights of Man
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings Complete
  • Europa Universalis IV: Third Rome
  • BATTLETECH
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: No Step Back
  • For The Glory
  • Crusader Kings II
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Darkest Hour
  • Europa Universalis III
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Arsenal of Democracy
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Semper Fi
  • Victoria 2
What does "antagonize" makes the AI do, exactly?

Who is SPR and shouldn't Germany also be trying to befriend Hungary?

Spanish Republic tag most likely. Weird if civil war happened.

Antagonize is probably the same as its EU4 counterpart - want to annex, take land or vassalize.
 

Truth

Corporal
32 Badges
Apr 25, 2012
37
32
  • Crusader Kings II
  • Magicka
  • Steel Division: Normandy 44
  • Pillars of Eternity
  • Magicka 2
  • Crusader Kings II: Horse Lords
  • Stellaris
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • War of the Vikings
  • BATTLETECH
  • Age of Wonders III
  • Imperator: Rome
  • Imperator: Rome Sign Up
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Deluxe edition
  • Crusader Kings III
  • Magicka: Wizard Wars Founder Wizard
  • Warlock: Master of the Arcane
  • The Showdown Effect
  • Lead and Gold
  • Europa Universalis IV
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Dungeonland
  • Crusader Kings II: The Old Gods
  • Heir to the Throne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Divine Wind
This makes me feel a little better about the macro-AI, but what about the micro?

It never seems to react to Daniel's micro. It doesn't come to meet his units that just shifted to a new position, or counter a heavy push, or do its own flanking to force Daniel to have to shift his own units around. I don't think I've ever seen the AI surround his units, either, even when he's totally ignoring them like in his Germany WWW.
 
  • 1
Reactions:

BurdenedWarrior

Major
54 Badges
Nov 14, 2013
606
260
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Wealth of Nations
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Europa Universalis IV: Res Publica
  • Semper Fi
  • Stellaris: Leviathans Story Pack
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Dharma
  • Imperator: Rome Sign Up
  • Steel Division: Normandy 44 -  Back to Hell
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Apocalypse
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis 4: Emperor
  • Stellaris: Synthetic Dawn
  • Shadowrun Returns
  • Stellaris: Megacorp
  • Europa Universalis IV: Golden Century
  • Imperator: Rome
  • Hearts of Iron IV: Expansion Pass
  • Battle for Bosporus
  • Stellaris: Ancient Relics
  • Hearts of Iron IV: La Resistance
  • Stellaris: Federations
  • Crusader Kings III
  • Hearts of Iron IV: No Step Back
  • Steel Division: Normand 44 Sign-up
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • Victoria 2
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
  • Europa Universalis IV: Rights of Man
  • Steel Division: Normandy 44
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron IV: Death or Dishonor
Sweet looking great!! really looking forward to getting my hands on it