An argument in favor of certain scripted tendencies.

  • 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.

redrum68

First Lieutenant
19 Badges
Feb 20, 2011
264
55
  • Crusader Kings II: Sword of Islam
  • Deus Vult
  • Europa Universalis III Complete
  • Divine Wind
  • Crusader Kings II
  • Heir to the Throne
  • Imperator: Rome
  • Age of Wonders III
  • Hearts of Iron IV: Cadet
  • Stellaris
  • Pride of Nations
  • 500k Club
  • Warlock 2: Wrath of the Nagas
  • Warlock 2: The Exiled
  • Warlock: Master of the Arcane
  • Victoria 2
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV
By the time you are doing "different weights per country," You are already on board with what I am seeking. The important part is not the semantics of how the pieces are labeled. Nor is it one of the degree of separation between the pieces when it comes to different nations. The main point, in my eyes, is that they need to recognize from day one that the different nations should be taking different approaches to strengthening their positions and achieving their goals. Just the simple tendency at the moment of every AI driven nation from Germany to France to China to Peru to strive for nearly identical 7+2 infantry templates even if producing those is unrealistic for many nations, points to the serious need for more customization.

Alright, it wasn't clear exactly what you were thinking of in terms of 'scripting'. I usually take that to mean a pretty static sort of orders along the lines of how major nations NFs are 'scripted' in historical currently (literally a list of this is the order of NFs for a given nation). That approach for research/production, I don't think would be very successful but having some different weights for various things for at least the major nations such as land vs naval factor, infantry vs tanks factor, offense vs defense factor, etc would be helpful. This would just make the algorithms needed for research and production simpler and quicker to initially implement since they wouldn't need to spend as much effort calculating these types of factors based on its current situation (not that it couldn't be done).

I don't know precisely how the AI works, but I'd suggest instead of scripting, a 'strategic level AI' is added. That is, an AI that recognizes what position it is in and what long term goals it needs to accomplish to do well. The added benefit to this approach is that the AI will still work with total-conversion mods, while scripting pretty much breaks the AI for them.

Yes, the AI needs a strategic level and I'm sure this exists in some form already (though most would probably agree its not very effective). Also, limiting 'hard coded' factors for specific nations does make things easier for mods and smaller nations that won't get as much love (that being said if you expose different AI values to modders they could adjust the AI per nation as well). The challenge is that this type of strategic AI tends to be one of the more difficult pieces to code. While some of the goals and factors are pretty straightforward, many are extremely complex and the number of possibilities is huge.

One example is the UK which itself has land all over the place and then if you consider its puppets as well then it gets even crazier. Its very difficult to figure out as the UK AI to determine what your goals should be and how you should distribute troops and focus production. The allies historically after the fall of France had a similar problem of not knowing where to best focus their resources (North Africa vs North France vs South France vs Pacific, etc). Should the UK try to only focus on Europe and try to reinforce France before it falls? Should it focus on navy and try to rule the seas by eliminating German/Italian fleets? Should it mass an airforce to provide air superiority in as many fronts as possible? Should it try to defend all its colonies? Which goals it chooses would then influence what unit templates it focuses on which in turn influence what production/research it would go for.

To some extent the comment about choosing something and going for it is better than ending up not doing anything well is true.
 

Dalwin

Field Marshal
48 Badges
Aug 11, 2003
11.303
6.150
Visit site
  • Hearts of Iron IV: Expansion Pass
  • Stellaris
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Cadet
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Stellaris - Path to Destruction bundle
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Hearts of Iron IV: Expansion Pass
  • Shadowrun Returns
  • Knights of Pen and Paper 2
  • Stellaris: Ancient Relics
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Sign Up
  • Stellaris: Lithoids
  • Age of Wonders: Planetfall - Revelations
  • Stellaris: Federations
  • Battle for Bosporus
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron IV: No Step Back
  • Magicka
  • Commander: Conquest of the Americas
  • Darkest Hour
  • Diplomacy
  • Europa Universalis III
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • For the Motherland
  • Hearts of Iron III
  • Knights of Pen and Paper +1 Edition
  • Leviathan: Warships
  • Lost Empire - Immortals
  • Crusader Kings II
  • March of the Eagles
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Supreme Ruler 2020
  • Victoria 2
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • Warlock 2: The Exiled
  • 500k Club
  • Pride of Nations
Alright, it wasn't clear exactly what you were thinking of in terms of 'scripting'. I usually take that to mean a pretty static sort of orders along the lines of how major nations NFs are 'scripted' in historical currently (literally a list of this is the order of NFs for a given nation). That approach for research/production, I don't think would be very successful but having some different weights for various things for at least the major nations such as land vs naval factor, infantry vs tanks factor, offense vs defense factor, etc would be helpful. This would just make the algorithms needed for research and production simpler and quicker to initially implement since they wouldn't need to spend as much effort calculating these types of factors based on its current situation (not that it couldn't be done).
I think we are on the same page here. Maybe scripting was not the most accurate term for me to use, but I know that a lot of this is done using a scripting language. I am looking for weighted preferences for each major. This is actually a very simple thing in terms of programming compared to a lot of the other things that need to be done in game. I still think that there could be multiple sets of these preferences for each major to avoid predictability.

To say it another way. I am not looking to predetermine Germany's targets (though NFs already do so). Instead, I want Germany to realize with no uncertainty that tank research is more important to its future than cruiser research.
 

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
By the time you are doing "different weights per country," You are already on board with what I am seeking. The important part is not the semantics of how the pieces are labeled. Nor is it one of the degree of separation between the pieces when it comes to different nations. The main point, in my eyes, is that they need to recognize from day one that the different nations should be taking different approaches to strengthening their positions and achieving their goals. Just the simple tendency at the moment of every AI driven nation from Germany to France to China to Peru to strive for nearly identical 7+2 infantry templates even if producing those is unrealistic for many nations, points to the serious need for more customization.

At one point, I recall Steelvolt mentioning that they hoped to have more nation-specific templates over time, but that it was a WIP. That only does half the job, of course (for what you're suggesting, which I think is a good idea, there'd need to be some variety in template choices within a nation as well). That said - one step at a time and all that.

In terms of research priorities, individual nations do have individual settings in their AI focus files (/common/ai_focus/[tag]].txt - although many smaller nations still have generic foci), and there are nation-specific entries in the individual technology files as well - for example, from the early_destroyer technology, in /common/technologies/naval.txt:

Code:
        ai_will_do = {
            factor = 1
        
            modifier = {
                factor = 2
                tag = ENG
            }
        }
(note that this is an odd example, as ENG starts in 1936 with this tech - but the point is they're in there - I just opened up the naval techs and grabbed the first I saw :)).

It's still relatively limited at the moment (ie, the focuses didn't differ a heap from each other last time I looked, and Germany had far more attention given to its focuses than other nations) but there's definitely room to extend it with time. Just mentioning it, as you'd mentioned it in recent posts. From what I can see, the scope for individualisation is there, it's likely in no small part a matter of resources.
 

Dalwin

Field Marshal
48 Badges
Aug 11, 2003
11.303
6.150
Visit site
  • Hearts of Iron IV: Expansion Pass
  • Stellaris
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Cadet
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Stellaris - Path to Destruction bundle
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Hearts of Iron IV: Expansion Pass
  • Shadowrun Returns
  • Knights of Pen and Paper 2
  • Stellaris: Ancient Relics
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Sign Up
  • Stellaris: Lithoids
  • Age of Wonders: Planetfall - Revelations
  • Stellaris: Federations
  • Battle for Bosporus
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron IV: No Step Back
  • Magicka
  • Commander: Conquest of the Americas
  • Darkest Hour
  • Diplomacy
  • Europa Universalis III
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • For the Motherland
  • Hearts of Iron III
  • Knights of Pen and Paper +1 Edition
  • Leviathan: Warships
  • Lost Empire - Immortals
  • Crusader Kings II
  • March of the Eagles
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Supreme Ruler 2020
  • Victoria 2
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • Warlock 2: The Exiled
  • 500k Club
  • Pride of Nations
Thank you for the supporting details. I had gotten the impression from Steelvolt's comments a couple of months ago that this was something they might get around to doing eventually.

Perhaps it is merely a matter of me wanting more emphasis upon it than what they are placing. Or perhaps I see it being done in more depth. I also fear that this is something for which the framework exists, but I get the feeling that it is not an approach which Podcat favors. If I am correct in this speculation, it could mean that the framework though already present may never get filled in.
 

Alex_brunius

Field Marshal
68 Badges
Mar 24, 2006
22.404
5.017
  • Hearts of Iron IV Sign-up
  • Victoria 2: A House Divided
  • War of the Roses
  • 200k Club
  • 500k Club
  • Cities: Skylines
  • Crusader Kings II: Holy Knight (pre-order)
  • Pride of Nations
  • Magicka 2
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Achtung Panzer
  • Stellaris
  • Victoria 2
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Stellaris - Path to Destruction bundle
  • Steel Division: Normandy 44
  • Cities: Skylines - Mass Transit
  • PDXCON 2017 Gold Ticket holder
  • Surviving Mars
  • Battle for Bosporus
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron II: Armageddon
  • Cities in Motion
  • Cities in Motion 2
  • Crusader Kings II
  • Deus Vult
  • Dungeonland
  • Europa Universalis III Complete
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • For the Motherland
  • Hearts of Iron III
  • Arsenal of Democracy
  • Heir to the Throne
  • Europa Universalis III Complete
  • Magicka
  • Majesty 2
  • Europa Universalis III Complete
  • Naval War: Arctic Circle
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Sword of the Stars
Thank you for the supporting details. I had gotten the impression from Steelvolt's comments a couple of months ago that this was something they might get around to doing eventually.

Perhaps it is merely a matter of me wanting more emphasis upon it than what they are placing. Or perhaps I see it being done in more depth.

I think the comment was more in regards to bigger AI strategy things, not specific isolated AI weights ( which already exists for research, division design, and production, although the latter two have some limitations are not really working all that well in my experience ).

I also fear that this is something for which the framework exists, but I get the feeling that it is not an approach which Podcat favors. If I am correct in this speculation, it could mean that the framework though already present may never get filled in.

If you check the research files from release and compare them to the most recent 1.3.3 ones you'll see that they actually have been filled in with quite a few AI weights, including ones which does give Germany a bigger weight of researching tanks IIRC.

From what I have seen when poking around in the files Paradox have added mainly 3 things to the research scripting:
  • Scripting specifying how far ahead of time certain techs can be rushed ( for example resulting in the AI rushing some key industry techs now ).
  • Scripting specifying nation specific weights ( Tanks for Germany, Carriers and Strategic bombers for USA ).
  • Scripting general importance for all nations, including increased importance if techs have not been research by specific dates ( Industry have high weight, things like increase prio of 1939 artillery if it have not been researched yet by 1939 )
If you want to check this out in action open up the console and write "aiview" + "human_ai" which hands over control of your active country to the AI and displays tooltip information for exactly which priority weight the AI has to pick all techs.


My main issue is that these things exist in isolation. There is nothing connecting the strategy together into forming a coherent long term plan.

The research weights can tell Germany to rush tanks ahead of time and unlock them even before a player will...

...but since the construction AI don't build enough synthetic plants to support the oil need for this
... since the division designer don't make proper templates for tank divisions early enough...
... since there are no divisions in recruitment there in no demand for the tanks being sent to production AI until very late...
... since fluctuating resources/trade imports and other changes to AI needs make the production AI switch around production lines factories too often screwing up their efficiency...
... since the few divisions the AI deploy take attrition losses in unnecessary attacks / terrain /efforts or transported through the English channel and sunk...

The end result still can be for example a German AI having ready for their 1941 Barbarossa just 7 half-optimal 20 width medium tank divisions all lacking half their SPG ( and the AI end up using maybe 4 of them in the actual attack, 2 of which are of zero impact due to trying to advance through the marshes across rivers).

So even if the AI is scripted to heavily rush tank research as Germany, it ends up massively failing compared to a player which made a long term plan to have 30 tank divisions ready for 1941 and deployed all of them on the Soviet border in the attack in coordinated spearheads.
 
Last edited:

bitmode

1st Reverse Engineer Battalion
Nov 10, 2016
3.813
6.995
@Dalwin some examples from common/ai_strategy/GER.txt:
  • prefer building, tanks, fighters and submarines
  • bump up the ratio of tanks beyond 110 MIC
  • save up XP for building the MARM template once they are researched
  • ignore Switzerland while France exists
  • de-emphasize navy
  • this gem:
    Code:
        ai_strategy = {
            type = area_priority
            id = europe
            value = 110 #more focus here
        }
    
        ai_strategy = {
            type = area_priority
            id = pacific
            value = 120 #less focus here
        }
...but since the construction AI don't build enough synthetic plants to support the oil need for this
... since the division designer don't make proper templates for tank divisions early enough...
... since there are no divisions in recruitment there in no demand for the tanks being sent to production AI until very late...
... since fluctuating resources/trade imports and other changes to AI needs make the production AI switch around production lines factories too often screwing up their efficiency...
... since the few divisions the AI deploy take attrition losses in unnecessary attacks / terrain /efforts or transported through the English channel and sunk...

The first point is something that could/should be easily added because Germany's situation warrants a general preference for synth oil.
The points 2/3 should™ already be covered by the ai_strategy mentioned above.
Points 4/5 are (lack of) short term planning.

So I'd argue those are problems of the AI but they don't necessarily require long term planning (beyond "Germany will want big tanks").

"aiview" + "human_ai"
That sounds intriguing :)
 

Krafty

Lt. General
7 Badges
Aug 15, 2006
1.269
2.112
  • Crusader Kings II
  • Europa Universalis IV
  • Supreme Ruler: Cold War
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: Death or Dishonor
Though you dont want Germany building tanks until almost 39 if not later, seemingly from the MP meta. I dont play Germany so Ive done absolutely zero research into that being beneficial, like I have with dispersed vs concentrated, a more obvious choice to figure out ones self instead of relying on the hearsay of the meta or forum poster's math, since it applies to every nation instead of a specific nation, so maybe thats not the most efficient thing to do with Germany, as an example. We cant just rely on what "appears" to be the best strategies.

So you need some "by year" and "on this year" as well as "until this year" and "not before this year" commands in the mix.

Theres a perfect build for Germany if it wants to play historically. I have no idea what that is, but with math, unless PDX changes industry again, it should be only moderately difficult to figure out if you want take what Germany wanted in real life, and win the war, thus play historically, when and what should you research and build. Thats a limited set of goals and has a quantifiable answer.

Tell the AI to do that. At least for historical mode. I dont think every nation needs something like this, but at least the majors. Maybe not Italy, or China, but the rest of them. Thats extremely time consuming, but imho, that will lead to faster and more qualitative results than hammering away at the general AI and praying it "gits good". Since we know the AI cant and never will plan ahead or react to what the player does directly or intelligently, but rather in steps of degrees of interest so to speak in changing what its already doing, I propose what Dalwin said, that major important nations, at least in historic, should have their own AI files that more "railroads" what these major nations do.

Lets get down to brass tax here, thats what people really are worrying about or lamenting when someone says "lets script the AI", theyre worried its going to suddenly make the game a "world war two simulator" and simply watch the game unfold, or figure out how to beat it once and then never play again. Id say thats ridiculous, the AI in HOI3 was badly scripted, even more so in mods like Black ICE which was super popular, and people played hundreds of games of the same nation over and over again. The AI being able to perform at the top of its ability, has nothing to do with railroading the game. You can still do whatever you want. It just means that Germany builds tanks, and doesnt research strat bombers. Which they already do. Even with the AI as we have it now. So wouldnt it be better if theyre were considerably more efficient at building tanks and choosing their research to optimize their strategy?
 

Dalwin

Field Marshal
48 Badges
Aug 11, 2003
11.303
6.150
Visit site
  • Hearts of Iron IV: Expansion Pass
  • Stellaris
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Cadet
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Stellaris - Path to Destruction bundle
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Hearts of Iron IV: Expansion Pass
  • Shadowrun Returns
  • Knights of Pen and Paper 2
  • Stellaris: Ancient Relics
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Sign Up
  • Stellaris: Lithoids
  • Age of Wonders: Planetfall - Revelations
  • Stellaris: Federations
  • Battle for Bosporus
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron IV: No Step Back
  • Magicka
  • Commander: Conquest of the Americas
  • Darkest Hour
  • Diplomacy
  • Europa Universalis III
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • For the Motherland
  • Hearts of Iron III
  • Knights of Pen and Paper +1 Edition
  • Leviathan: Warships
  • Lost Empire - Immortals
  • Crusader Kings II
  • March of the Eagles
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Supreme Ruler 2020
  • Victoria 2
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • Warlock 2: The Exiled
  • 500k Club
  • Pride of Nations
It is not necessary to find the "best" strategies or get the AI to follow them. What would be a big improvement would be to get it to consistently follow any reasonable strategy. Its current lack of focus and willy nilly shifting from one production item to another hurts it much more than the difference between a good template and an "optimal" one.
 

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
Though you dont want Germany building tanks until almost 39 if not later, seemingly from the MP meta. I dont play Germany so Ive done absolutely zero research into that being beneficial, like I have with dispersed vs concentrated, a more obvious choice to figure out ones self instead of relying on the hearsay of the meta or forum poster's math, since it applies to every nation instead of a specific nation, so maybe thats not the most efficient thing to do with Germany, as an example. We cant just rely on what "appears" to be the best strategies.

So you need some "by year" and "on this year" as well as "until this year" and "not before this year" commands in the mix.

Theres a perfect build for Germany if it wants to play historically. I have no idea what that is, but with math, unless PDX changes industry again, it should be only moderately difficult to figure out if you want take what Germany wanted in real life, and win the war, thus play historically, when and what should you research and build. Thats a limited set of goals and has a quantifiable answer.

Tell the AI to do that. At least for historical mode. I dont think every nation needs something like this, but at least the majors. Maybe not Italy, or China, but the rest of them. Thats extremely time consuming, but imho, that will lead to faster and more qualitative results than hammering away at the general AI and praying it "gits good". Since we know the AI cant and never will plan ahead or react to what the player does directly or intelligently, but rather in steps of degrees of interest so to speak in changing what its already doing, I propose what Dalwin said, that major important nations, at least in historic, should have their own AI files that more "railroads" what these major nations do.

Lets get down to brass tax here, thats what people really are worrying about or lamenting when someone says "lets script the AI", theyre worried its going to suddenly make the game a "world war two simulator" and simply watch the game unfold, or figure out how to beat it once and then never play again. Id say thats ridiculous, the AI in HOI3 was badly scripted, even more so in mods like Black ICE which was super popular, and people played hundreds of games of the same nation over and over again. The AI being able to perform at the top of its ability, has nothing to do with railroading the game. You can still do whatever you want. It just means that Germany builds tanks, and doesnt research strat bombers. Which they already do. Even with the AI as we have it now. So wouldnt it be better if theyre were considerably more efficient at building tanks and choosing their research to optimize their strategy?

This is a bit dangerous as it's fairly open to exploits. It wouldn't take long to find out for a British player, say, that X factories on fighters is enough to overpower the German fighter build. While everything is scripted, from a certain perspective, dynamic, adaptive scripts are far more likely to provide a long-term challenge than a railroaded 'best build'. The AI performing at the best of its ability requires it having the capacity to respond to player (and other AI) action. At least imo - I could well be wrong, that's just my take at the moment :). Apologies if I've misunderstood, and I hope your brass taxes aren't too high this year :).
 

Krafty

Lt. General
7 Badges
Aug 15, 2006
1.269
2.112
  • Crusader Kings II
  • Europa Universalis IV
  • Supreme Ruler: Cold War
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: Death or Dishonor
It is not necessary to find the "best" strategies or get the AI to follow them. What would be a big improvement would be to get it to consistently follow any reasonable strategy. Its current lack of focus and willy nilly shifting from one production item to another hurts it much more than the difference between a good template and an "optimal" one.


True, its optimal, but far from necessary.

Though I would argue that industrially speaking, it should pursue the most efficient method of producing equipment FOR the consistent strategy it is employing, regardless of what that is. That takes no more or less time that making an AI that does a bad job of producing equipment for a specific strategy.

It adapting to player actions...probably not going to get alot in that department that we already dont have. As said the AI moves from "im doing this because its what im supposed to" to "im going to divert some attention, maybe, to this thing im told to divert some attention to, a degree/chance based amount". There arent currently AI functions for "The brits have more planes, we need more planes". Theres "We dont have enough planes to fill a quota, and based on fundamentally a dice roll, we'll attempt to fill that quota".

While long term I agree with you, dynamic can be "emulated" by having a number of AI files.

HOI3 did this.

1939 Germany and 1944 Germany didnt use the same variables or have the same focuses on production or operations.

I think we can polish brass all day about the AIs ability, or inability, to move its troops efficiently, and I dont really expect fantastic functionality there, as even HOI3 didnt have that.

But on the backend, production, research, that kind of thing, specific guiding is needed. Historical guides focuses, but ministers, tech and production while weighted, is woefully inadequate in its current state...
 
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
There arent currently AI functions for "The brits have more planes, we need more planes". Theres "We dont have enough planes to fill a quota, and based on fundamentally a dice roll, we'll attempt to fill that quota".

It's possible to have some fairly detailed triggers in AI strategies. The below in the spoiler is a bit clunky (it's just a rough and ready 'first cut' - and AI naval build priorities set in the AI strategies are fighting against some very strong hardcoded factors, or were last time I played with this), but it's an example where particular strategies are enabled or aborted based on how many ships of a certain type GER and ENG have. We can't directly compare numbers of aircraft (or ships), but it would be possible to have some iterative combinations that achieved much the same goal, albeit roughly.

Edit: It needn't be this prescriptive either - instead of GER or ENG, we may well be able to have have any_enemy_country or the like.

Code:
defend_against_german_submarines = { #DNM - UK strategy in response to German u-boat strategy
    enable = {
        tag = ENG
        ENG = { has_war_with = GER }
        OR = {
            ENG = {
                has_navy_size = { type = convoy size < 600 } #Use has_equipment = {convoy = 0}
                }
            GER = {
                has_navy_size = { type = submarine size > 60 }
                }
        }
    }
    abort = {
        OR = {
        NOT = {
            ENG = { has_war_with = GER }
            }
            ENG = {
            has_navy_size = { type = convoy size > 1000} #Use has_equipment = {convoy > 100}
            }
            GER = {
                has_navy_size = { type = submarine size < 10 }
            }
        }
    }
    ai_strategy = {
        type = unit_ratio
        id = screen_ship
        value = 25
    }[/quote][/spoiler]
 

Dalwin

Field Marshal
48 Badges
Aug 11, 2003
11.303
6.150
Visit site
  • Hearts of Iron IV: Expansion Pass
  • Stellaris
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Cadet
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Stellaris - Path to Destruction bundle
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Hearts of Iron IV: Expansion Pass
  • Shadowrun Returns
  • Knights of Pen and Paper 2
  • Stellaris: Ancient Relics
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Sign Up
  • Stellaris: Lithoids
  • Age of Wonders: Planetfall - Revelations
  • Stellaris: Federations
  • Battle for Bosporus
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron IV: No Step Back
  • Magicka
  • Commander: Conquest of the Americas
  • Darkest Hour
  • Diplomacy
  • Europa Universalis III
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • For the Motherland
  • Hearts of Iron III
  • Knights of Pen and Paper +1 Edition
  • Leviathan: Warships
  • Lost Empire - Immortals
  • Crusader Kings II
  • March of the Eagles
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Supreme Ruler 2020
  • Victoria 2
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • Warlock 2: The Exiled
  • 500k Club
  • Pride of Nations
If you look closely at production efficiency for AI countries versus human controlled, the AI is usually getting less than half of the output it should, often less than a third. If it would simply learn to plan ahead better on production, to pick a scheme and then stick to it, the AI would be so much stronger than it is now. This better production would then allow it to safely keep more units in the field which would in turn help with its problems on assigning units to fronts and avoiding gaps in those fronts.

Many historians have posited that WWII was won in the factories. There is no reason to think that is not equally true in HOI. It is the battle of the factory that the AI is losing most spectacularly.
 

Secret Master

Covert Mastermind
Moderator
95 Badges
Jul 9, 2001
36.645
20.053
www.youtube.com
  • 200k Club
  • Europa Universalis III Complete
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • Semper Fi
  • Sengoku
  • Ship Simulator Extremes
  • Sword of the Stars II
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • March of the Eagles
  • 500k Club
  • Cities: Skylines
  • Crusader Kings II: Holy Knight (pre-order)
  • Pride of Nations
  • Mount & Blade: Warband
  • Mount & Blade: With Fire and Sword
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Limited Collectors Edition
  • Crusader Kings II: Conclave
  • Hearts of Iron IV: No Step Back
  • Europa Universalis III: Chronicles
  • 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
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Commander: Conquest of the Americas
  • Deus Vult
  • Europa Universalis III
  • A Game of Dwarves
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III Collection
  • Heir to the Throne
  • Europa Universalis III Complete
  • King Arthur II
  • The Kings Crusade
Many historians have posited that WWII was won in the factories. There is no reason to think that is not equally true in HOI. It is the battle of the factory that the AI is losing most spectacularly.

This is why I was thinking that certain absolute minimums might be useful for certain major powers. There won't be a time that AI Germany can't use 5 MIC on infantry kits. If Germany keeps 5 MIC on infantry kits forever, it should keep production up better than swapping factories around willy nilly. And certain equipment (infantry kits, artillery) is so vital in all build schemes a major would have that there's no reason not to just tell the AI to build some permanently.

I know a human might reach a point where they don't need infantry kits or artillery (usually by seizing other country's stockpiles), but think about how badly equipped AI forces are after three months of Barbarossa. AI divisions would be better if they had enough infantry kits and artillery.

You could probably make a case that Germany and the Soviet Union AIs should be told to allocate 30-40% of their IC permanently to certain production lines. Can you imagine an AI Soviet Union that doesn't need 10-15 MIC on infantry kits for years on end? Or a Germany that doesn't need 15 MIC applied permanently to some kind of medium armor?

I know resource losses might make some of these schemes impractical, but you could probably tell the AI to reduce factories on certain projects if the resources are not available. And for the most basic equipment (infantry kits, artillery, support equipment), the minimum MIC you'd tell the AI to apply would probably be below the import threshold for that country anyway.

(I realize as I write this that Japan is currently screwed in resources. So, I don't know how to resolve this issue for Japan.)

EDIT: My larger point is that keeping 5 MIC on infantry kits for 4 years will make far more equipment than swapping from 1 MIC to 15 MIC randomly over 4 years. Especially for major powers with decent IC techs.
 

redrum68

First Lieutenant
19 Badges
Feb 20, 2011
264
55
  • Crusader Kings II: Sword of Islam
  • Deus Vult
  • Europa Universalis III Complete
  • Divine Wind
  • Crusader Kings II
  • Heir to the Throne
  • Imperator: Rome
  • Age of Wonders III
  • Hearts of Iron IV: Cadet
  • Stellaris
  • Pride of Nations
  • 500k Club
  • Warlock 2: Wrath of the Nagas
  • Warlock 2: The Exiled
  • Warlock: Master of the Arcane
  • Victoria 2
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV
If you look closely at production efficiency for AI countries versus human controlled, the AI is usually getting less than half of the output it should, often less than a third. If it would simply learn to plan ahead better on production, to pick a scheme and then stick to it, the AI would be so much stronger than it is now. This better production would then allow it to safely keep more units in the field which would in turn help with its problems on assigning units to fronts and avoiding gaps in those fronts.

Yeah, this seems to be a problem. I'd almost say not letting the AI move factories at all after it assigns them to production lines might be better than what we have currently. I think just making the AI change its production lines much less often would definitely make a difference.