Hearts of Iron IV

Hearts of Iron IV

Expert AI 5.0
This topic has been locked
Kondi  [developer] 6 Mar, 2019 @ 10:25am
Patch notes (4.3)
Typically only major changes are listed here. For more details, check out https://github.com/Kondikka/expertai

4.3 Change Log:

-Major restructuring of mod files. Replaced some country flag based systems with variables. simplified/improved a ton of script spaghetti with the new meta script/loop scripts.

-Reworked the scripted variant AI. Mostly it's just a lot simpler to work with, although the cool unique names for each variant are gone so you can't tell the AI's progress from its variant names anymore. Making it work with the new ship design AI required some changes to how the AI uses its army/air xp. Tweaked a number of target variants and priorities for the AI to be more effective.

-Custom difficulty bonus: due to the lack of settings in this mod, I added another level of customisation to the dynamic/country difficulty bonus that lets you decide what modifiers it gives (there are some 20 modifiers open - more could be added) and the exact value. Want a real fight from Japan as USA? Try giving it as much dockyard production and naval fuel consumption reduction as you think you can handle.

-Performance Mode setting that replaces the "Limit S. America Production": production limits aren't only applied to SA, they apply to all less significant minors around the world (essentially everyone except minors that were in the war historically plus countries like Turkey, Portugal, Spain) . As before, they only start producing more divisions when they enter a war. Also, USA builds less divisions unless threatened at home. The mod's scripted AI is updated less frequently.

-Challenging mode reworked a bit. Previously the only difference from normal mode was basically some countries using 40w infantry. However now all AI's will use more min-max type of strategies (to be improved in the future). Countries prefer superior firepower and avoid building fun divisions like motorized that aren't really useful to the AI and instead focus their XP on useful templates and variants. Naval builds are more limited to fewer types. Research is more focused, medium armor preferred etc. This should be the go to mode if you want to squeeze everything out of the AI.

-Reinforcements mode change: spawned units use up the AI's manpower so it doesn't get units forever but the AI is able to spawn units as long as it doesn't exceed its scripted division cap so it can receive more reinforcements than before.

-Added "Puppet Egypt" option (OFF by default). UK puppets Egypt when it is enabled so that Egypt creates its own army and properly guards Cairo for UK. It is scripted to keep its divisions in Egypt as a garrison force and to transfer any conquered lands to UK. Not a great solution for many reasons but it the results look good. Without it, Axis seems to roll over Africa.

-Similarly to Egypt (except this is not optional), Malaysia has been changed to help the Allied AI guard its territories. If it is under AI ENG, its autonomy is raised one level at the start of the game because otherwise UK takes away all its divisions. It will also keep its divisions in its own territory.

-Italian East Africa is gone. The new avoidance zones should be sufficient to prevent the Italian exodus to Ethiopia.

--------AI research:

-Major research balancing to help the AI cope with the new techs.

-Made sure USA gets nukes.

-Overhauled the mod's previous AI logic for naval doctrine research. The AI should try to research doctrine techs that benefit the ships it has/produces. It should be more likely to research escort techs when the enemy has a lot of subs. Since there are a lot of these techs and they are expensive, I limited the AI's naval doctrine research amount to a number based on the current year. E.g if the year is 1940, the AI won't research more than 4-6 naval doctrines total.

-Overhauled the new naval tech tree AI logic to be in line with EAI systems. Goal as usual is to have the AI only research what is actually good, what it wants to use in its designs and what benefits the fleet it currently has (factoring in things like the number of various ship types it has etc). Probably needs tweaks depending on what turns out to be good. Made sure the AI isn't too slow researching new hulls and does produce them.

--------Scripted construction AI:

-Some majors build more dockyards.

-Silos: added scripted AI to handle their construction. Amount the AI builds depends on the number of military factories and oil owned. ITA/♥♥♥/ENG = more silos, SOV/USA = less silos, GER = a **** ton of silos. Made AI trade more for oil to fill up its silos.

-Refineries: AIs that need rubber will build a ton of refineries, such as Germany (obviously) and USA (historical reasons and in case Asia is lost). Fuel gain from these is so low I didn't set the AI to build them for fuel at all for now. Refinery fuel techs are only researched if the AI already happens to have a ton of refineries and it needs more fuel.

-AI can replace other factories with refineries when it can't get more slots and it needs more rubber.

--------Ship designs:

Rewrote all of the new vanilla ship design AI scripts to fit in with EAI systems similar to AI templates. I don't know what all the good designs and fleet compositions are going to be so these are my best guess for now. There's room for adding design variations and such if needed. Don't expect any more historical detail than with armies. AI can build these ship types:

-CV: fleet carrier and light carrier designs
-BB: super heavy and heavy designs
-BC, CA
-CL: surface combat and anti-sub hybrid (some depth charges added when the enemy has lots of subs)
-ASW CL: dedicated sub hunter with airplane launchers, sonar and depth charges
-DD: surface combat and anti-sub hybrid
-ASW DD: dedicated sub hunter with depth charges and sonar
-Mine layer DD: cheap design and low production prio
-Mine sweeper DD: cheap design and low production prio unless the enemy has mined its shores in which case it significantly ramps up the production (and if the enemy has tons of mines on its coasts it will rush degaussing tech as well)
-SS: torpedo types only (from what I've seen the AI doesn't use mine laying subs for mines)

Japan builds super heavies and I made sure it gets them out before the war. Since AI only convoy raids with subs from what I've seen, majors will build subs (and it's a low tech investment anyways). Countries with trade interdiction put a lot more emphasis on subs.

--------Naval Combat/Fleet AI:

Don't expect it to be much different from vanilla. I mean it. 95% of what the AI does is out of my hands. If something can't be fixed by adjusting naval research, production or designs, it may not even be worth bringing up. However...

-I added some scripts that may affect very specific cases such as making the Allies avoid assigning fleets to the Baltic sea.

-Naval strategies added for AI's naval avoidance zones to try to fix severe division loss issues with both Allies and Axis around the Atlantic and Mediterranean.

-Number of strategies added controlling which naval missions the AI uses based on fuel situation in order to conserve fuel.

--------Military Coordination Decisions:

-stockpile display and production coordination are now proper diplomacy actions instead of decisions. Couldn't resist as there are some useful new variables available so now you can see for each equipment type the fielded % str ratio (so you know what equipment the AI actually needs) as well as the exact stockpile.

-added diplomacy action for denying specific countries from your borders (a decision for denying all allies is still there)

--------Misc:

Tweaked government in exile decision logic for the AI to make sure it steals all sizable GIE fleets so on.

Made sure Japan and Italy abandon the naval treaty early on historical.

Made some war declarations more historically timed and added some others that I'll leave as a surprise.

Some tweaks to AIs admiral trait picks.

UK assigns more units to garrison (won't fix the core issues). However combined with the Puppet Egypt option and various naval avoidance zone strategies, it will be at least less likely
that it has no defenses in England.

Reworked USA and UK focus tree historical AI logic/order. Stopped Mexico from joining Allies through focuses on historical (Mexico may need more tweaks, let me know if it does something strange on historical, same with Netherlands).

AI is hopefully less suicidal when using the aggressive battleplan mode.

Armor templates: AI makes a basic armor template with just ARM/MOT for example if it doesn't have SPAA and SPART techs it wants to use so that it doesn't end up with strange widths in the early game.

--------Gameplay changes:

Added a new decision to handle the joint invasion of Iran (either UK or USSR) aka Operation Countenance.The reason is that their oil fields are far too important to be left open to trade with the Axis now and vanilla's focuses don't handle this as well as I'd like.

Combat bonus from entrenchment reduced to half. There's too much of it, it's easily abuseable against the AI's attacks while the AI makes poor use of it so I think it is only fair.

Added equipment variant creation for transport planes.

Moved from the Expanded Techs addon to the main mod: cavalry suppression value reduced to 1. Military police level 1 adds 100% suppression. You can make any units have 2 suppression by adding MP support.

Last stand/force attack nerf (CHI/♥♥♥ abilities excluded): org damage reduction from -100% to -80%.
Last edited by Kondi; 11 May, 2019 @ 12:35am
< >
Showing 1-15 of 33 comments
Kondi  [developer] 7 Mar, 2019 @ 8:49am 
v4.31

-Added fuel and convoy stats to stockpile display and updated the graphics a bit. You can now check the stockpiles of any country in a war together with you, such as USSR as UK.

-Blocked Germany from trading across the Atlantic while at war and the enemies have a big fleet so that it doesnt lose all its convoys.

-Removed the old area priority modifications (I doubt they had much effect anyway) and adjusted certain scripts in case they might somehow cause front abandonment issues for the AI. Doubt it but who knows.

-Mexico/South American countries may now join Allies towards the late war depending on circumstances. I made some adjustments that hopefully make them avoid flooding Europe/Asia with divisions.

-Increased GER prio on rubber tech so that it can better supply itself and the rest of Axis with rubber.
Kondi  [developer] 8 Mar, 2019 @ 11:45am 
v4.311

-previous change that blocked off the Atlantic trade routes caused serious issues for Germany's naval production so I removed it

-some adjustments to ship designs to try to avoid wasted XP or refits

-tried to fix non-MtG research a bit

-made AI a bit more logical about upgrading manpower laws

added:
-fixed a number of template script errors that caused some countries not to develop armor templates properly
Last edited by Kondi; 9 Mar, 2019 @ 12:09am
Kondi  [developer] 9 Mar, 2019 @ 1:48pm 
v4.312

-USA trains its fleets a lot more now so it should be able to actually create 1940 designs.
-fixed some ship design issues that could have caused the AI to build old ships
Kondi  [developer] 10 Mar, 2019 @ 12:10pm 
v4.313

-fixed GER strategy plan if you don't have WTT
-♥♥♥ builds a lot more silos so that it can last longer against USA
-♥♥♥ builds a less fuel intensive army so that it can keep its navy going
Kondi  [developer] 11 Mar, 2019 @ 12:18pm 
v4.314

-fixed SOV wasting its armor tech bonus again
-fixed AI not building AT divisions
-fixed AI not upgrading some motorized division types
-optimized some division production stuff
-removed armor unit files from the mod, hopefully they are not necessary anymore
-added equipment strategies that cancel the AI's infantry or artillery production when it has an absurt amount, because countries like ♥♥♥ desperately need the steel for their navies and the AI won't prioritise resources otherwise
-made sure Romania doesn't sometimes switch away from free trade while in faction with a major
-made sure other minors don't go for limited exports while in faction with a major
Kondi  [developer] 12 Mar, 2019 @ 11:14am 
v4.315

-Fixed Raj sometimes not getting Mass Assault and missing out on the manpower it needs.
-Adjusted AI PHI/INS balance vs AI ♥♥♥ so that ♥♥♥ can progress more historically.
-AI lend lease script will try to avoid lend leasing if the target is low on convoys and there is no land route.
-Made AI warlords join the united front asap again because AI ♥♥♥ seems to be able to deal with it.
-Fixed Allies declaring war on AI Japan over the naval treaty especially if you boosted Japan.
Kondi  [developer] 13 Mar, 2019 @ 12:14pm 
v4.316

-dynamic difficulty bonus is cleared from capitulated countries
-added an adjustable free convoys setting to custom bonus. It targets specific countries unlike the old Free AI Convoys setting that gives convoys to all AIs in the game
-Germany's war declaration on USSR is less likely to be delayed
-added russian localization by satyrion
Last edited by Kondi; 13 Mar, 2019 @ 12:14pm
Kondi  [developer] 14 Mar, 2019 @ 11:59am 
v4.317

-hopefully fixed the bug with task forces not reinforcing properly with early ship types
Last edited by Kondi; 14 Mar, 2019 @ 12:00pm
Kondi  [developer] 16 Mar, 2019 @ 9:17am 
v4.318

-fixed ship auto design not working sometimes
-made AI China less dumb when playing against AI Japan
-fixed some lend-lease script issues
Kondi  [developer] 21 Mar, 2019 @ 9:48am 
v4.319

-reworked south american nations joining factions: now all neutral countries may join either the Axis or the Allies, depending on how the war goes on historical mode (except the really very neutral ones, and only when it makes some sense). It's supposed to work out somewhat historically if the war goes historically.

-south american countries shouldnt send troops to defend ally borders in europe

-fixed GER not getting Himmler

-made AI upgrade its old divisions to new ones much faster. Won't fix every case but countries like SOV that had dozens of bad divisions even in 41 (if it had no bonuses) shouldn't have them anymore which should help it

-made GER/SOV/♥♥♥ use less divisions for garrisons when fighting FRA/GER/CHI

-made Siam turn fascist
Kondi  [developer] 25 Mar, 2019 @ 1:45pm 
v4.321

-fixed the vanilla difficulty bonus settings giving too much fuel consumption reduction to the AI and bugging out the AI
-added limits to the mod's custom bonuses so that someone doesn't accidentally bug out the AI the same way
Kondi  [developer] 26 Mar, 2019 @ 2:56pm 
v4.322

-changed the AI's suppression templates from cavalry to infantry
-cleaned up the custom bonus interface a bit
Kondi  [developer] 3 Apr, 2019 @ 1:05pm 
v4.33

-AI ♥♥♥ will focus its interservice rivalry decisions on boosting its navy production after it has built enough military factories
-AI ♥♥♥ will focus a lot more on screen/ASW destroyer production after it has finished its 2 super heavy battleships
-AI ♥♥♥ builds more dockyards and uses the naval continuous focus instead of getting less useful focuses
-countries outside Europe aren't willing to give Axis majors docking rights unless there are good reasons for it
-added a lot of naval avoidance strategies for the AI to manage the Pacific better
-a better fix to USA not training its navy enough, it should be able to upgrade to modern stuff in every game now
-made USA build a ton of garrison divisions pre-war
-made USA focus more on the pacific war
-AI prioritises getting a silent workhorse minister over everything else if it has one available
-AI will temporarily cancel its convoy raid missions if it takes too many sub losses too fast
-USA/♥♥♥ will prioritise building airbases on whatever pacific islands they have and GER/SOV on their shared border over anywhere else
-cleaned up the stockpile interface
-Iceland will join Allies instead of being invaded by UK so that it doesn't join Axis
-improved research especially towards the late game
-improved USA's national focus picks
-added Dan1109's suggestion to make troop transfer convoys harder to detect. Should reduce AI losses on the seas.
Last edited by Kondi; 4 Apr, 2019 @ 6:40am
Kondi  [developer] 5 Apr, 2019 @ 7:59am 
v4.331

Some desperation tweaks that should reduce USSR's shuffling issues -> in some cases -<:
-Finland no longer joins Axis
-When you or the AI GER declares war on USSR, all the Axis members that border USSR are immediately called to war

Improved how the AI attempts to get a piercing advantage over its enemies/potential enemies
-it keeps track of the max armor value it has seen as well as the piercing value it has achieved so that it doesn't switch back and forth between designs just because its intel fluctuates
-countries using specialized line AT infantry divisions will weigh anti tank research if its max piercing achieved is lower than max armor seen
Kondi  [developer] 6 Apr, 2019 @ 6:53am 
v4.332

-another workaround to the AI's front shuffling (from Stjern/Total War mod): field marshal army cap is now 15
Last edited by Kondi; 9 Apr, 2019 @ 8:49am
< >
Showing 1-15 of 33 comments
Per page: 1530 50