I've spent some significant effort testing some of these for balance and/or troubleshooting. The bulk of these edits are just to allow the AI to get way ahead of you so you have to be more economical with your resources in general. They are all contained within editing the LUA or using IGE to add population.
*****************
***SECURITY NOTE*** - You should definitely have a backup of the R.E.D. file somewhere safe before editing this stuff. Editing it improperly can make the game crash or the engine to not function properly. I don't have any scripting experience to speak of, and these are the mild insights of a humble fan, not any authoritative hotfix.
******************
1. Pre-building good AI cities with bank/factory/<advanced factory>
In the default script, very few cities start with a full gambit of buildings ready to produce high quality units. Most don't even have Banks or Factories. An easy fix to this is editing in the DefinesEuro1940 or whichever map specific scenario you want to edit, the following:
Within the "Cities" section, it appears like this:
{X = 27, Y = 52, Key = true, Buildings = { FACTORY, HARBOR }, AIBuildings = {SHIPYARD}, }, -- LONDON
-- Within the curly brackets after AIBuildings =, you can add ", BANK, BASE, ARSENAL, ACADEMY"
The case sensitive seems to matter, as does a space between the first bracket and the last bracket and the contents of the brackets.
Furthermore, If you want the AI to focus more on Air or Naval, you can edit that in specifically by adding shipyards, medium/light air factories, or land factories. Generally speaking, England should be almost entirely Light Air or Shipyards.
2. Fixing the Hard-Cap of AI Units ratio.
Within the DefinesEuro1940, under the Units section, there is the "-- Combat type ratio restriction used by AI"
Messing with these numbers can dramatically alter the way the AI builds units. If your system can support a huge game with a ton of units, then i highly recommend doing the following, but only in conjunction with adding factory/bank/land factory to basically every Russian AI city:
Replace this: (The default)
[USSR] = {Air = 5, Sea = 7, Armor = 3, Artillery = 7.5,},
With this: (my own adjustment)
[USSR] = {Air = 8.5, Sea = 25, Armor = 5, Artillery = 4,},
This would be of some help by itself, but its really only effective if you also give the Russian AI a huge advantage in starting structures and by adding some population to basically every city with IGE. A few more manufactories by Leningrad, Moscow, Stalingrad, Novgorod, and basically 1 by every other city towards the East will guarantee that Russia has a huge number of Infantry, a good amount of artillery, and some decent armor. With the defensive bonuses that they receive from defending over Rivers, it is a serious challenge to properly invade Russia without beggaring yourself in a materials deficit from overuse of armor and airpower.
Other edits to be done in this section are important for Italy, which could afford to build less Navy and more land units, and England which should have navy and air power put at 2.
I wouldn't advise against putting anything at 1, because it makes the AI a little unreliable that it will only produce that type of unit, which would be a bad tactic for anything.
3. The reserves system.
I've only begun to tinker with this, and im honestly not sure exactly how it works or the tolerance with which it could be adjucted without causing crashes or some other kind of unforeseen problem.
It looks like the following:
-- unit type called when AI need reserve troops
g_Reserve_Unit = {
[FRANCE] = { {Prob = 50, ID = FR_INFANTRY}, {Prob = 10, ID = FR_AMR35}, {Prob = 10, ID = FR_FCM36}, {Prob = 5, ID = FR_AMC35}, {Prob = 5, ID = FR_CHAR_D1}, {Prob = 5, ID = FR_CHAR_D2}, },
[ENGLAND] = { {Prob = 50, ID = UK_INFANTRY}, {Prob = 20, ID = UK_VICKERS_MK6B}, {Prob = 10, ID = UK_MATILDA_II}, {Prob = 5, ID = UK_MATILDA_I}, },
[USSR] = { {Prob = 50, ID = RU_INFANTRY}, {Prob = 20, ID = RU_T26}, {Prob = 15, ID = RU_T28}, },
[GERMANY] = { {Prob = 50, ID = GE_INFANTRY}, {Prob = 20, ID = GE_PANZER_I}, {Prob = 15, ID = GE_PANZER_35}, },
[ITALY] = { {Prob = 50, ID = IT_INFANTRY}, {Prob = 20, ID = IT_L6_40}, {Prob = 15, ID = IT_M11_39}, },
}
-- Thresholds used to check if AI need to call reserve troops
g_Reserve_Data = {
-- UnitThreshold : minimum number of land units left
-- LandThreshold : minimum number of plot left
-- LandUnitRatio : ratio between lands and units, use higher ratio when the nation has lot of space between cities
[FRANCE] = { UnitThreshold = 8, LandThreshold = 108, LandUnitRatio = 10,
Condition = function() local savedData = Modding.OpenSaveData(); return savedData.GetValue("FranceHasFallen") ~= 1; end},
-- initial plots = 216. France won't get reinforcement once Paris is captured
[ENGLAND] = { UnitThreshold = 14, LandThreshold = 100, LandUnitRatio = 5,
}, -- no condition function means always true
-- initial plots = 111
[USSR] = { UnitThreshold = 20, LandThreshold = 2350, LandUnitRatio = 50,
},
-- initial plots = 2469
[GERMANY] = { UnitThreshold = 20, LandThreshold = 300, LandUnitRatio = 10,
Condition = function() local turn = Game.GetGameTurn(); return turn > 5; end},
-- initial plots = 204 : German AI get reinforcement almost immediatly (after 5 turns because LandThreshold > initial plots)
[ITALY] = { UnitThreshold = 12, LandThreshold = 90, LandUnitRatio = 5,
},
-- initial plots = 114
}
As i understand it (and Gede or anyone else, please correct me if i am not explaining this correctly), but by turning down the LandUnitRatio, especially for Russia, you can increase the frequency with which they spawn units.
I would be open to further explanation. I've turned down the USSR LandUnitThreshold = 20 from 50, but i haven't seen a single 'alert' that reserves have been called up. I suppose its possible that the system is not active on the Euro1940 map that I've been testing all of the other stuff on. Furthermore, i don't have the tolerance to play several hours testing each individual adjustment, so my adjustments have been fairly hyperbolic.
I know Gede has a new version in the pipeline, but if i stabilize my hotfix, I'll post a complete link to my version of the DefinesEuro1940 so people could just copy/paste it (which is a lot easier than editing all of this stuff individually).
Enjoy.
*****************
***SECURITY NOTE*** - You should definitely have a backup of the R.E.D. file somewhere safe before editing this stuff. Editing it improperly can make the game crash or the engine to not function properly. I don't have any scripting experience to speak of, and these are the mild insights of a humble fan, not any authoritative hotfix.
******************
1. Pre-building good AI cities with bank/factory/<advanced factory>
In the default script, very few cities start with a full gambit of buildings ready to produce high quality units. Most don't even have Banks or Factories. An easy fix to this is editing in the DefinesEuro1940 or whichever map specific scenario you want to edit, the following:
Within the "Cities" section, it appears like this:
{X = 27, Y = 52, Key = true, Buildings = { FACTORY, HARBOR }, AIBuildings = {SHIPYARD}, }, -- LONDON
-- Within the curly brackets after AIBuildings =, you can add ", BANK, BASE, ARSENAL, ACADEMY"
The case sensitive seems to matter, as does a space between the first bracket and the last bracket and the contents of the brackets.
Furthermore, If you want the AI to focus more on Air or Naval, you can edit that in specifically by adding shipyards, medium/light air factories, or land factories. Generally speaking, England should be almost entirely Light Air or Shipyards.
2. Fixing the Hard-Cap of AI Units ratio.
Within the DefinesEuro1940, under the Units section, there is the "-- Combat type ratio restriction used by AI"
Messing with these numbers can dramatically alter the way the AI builds units. If your system can support a huge game with a ton of units, then i highly recommend doing the following, but only in conjunction with adding factory/bank/land factory to basically every Russian AI city:
Replace this: (The default)
[USSR] = {Air = 5, Sea = 7, Armor = 3, Artillery = 7.5,},
With this: (my own adjustment)
[USSR] = {Air = 8.5, Sea = 25, Armor = 5, Artillery = 4,},
This would be of some help by itself, but its really only effective if you also give the Russian AI a huge advantage in starting structures and by adding some population to basically every city with IGE. A few more manufactories by Leningrad, Moscow, Stalingrad, Novgorod, and basically 1 by every other city towards the East will guarantee that Russia has a huge number of Infantry, a good amount of artillery, and some decent armor. With the defensive bonuses that they receive from defending over Rivers, it is a serious challenge to properly invade Russia without beggaring yourself in a materials deficit from overuse of armor and airpower.
Other edits to be done in this section are important for Italy, which could afford to build less Navy and more land units, and England which should have navy and air power put at 2.
I wouldn't advise against putting anything at 1, because it makes the AI a little unreliable that it will only produce that type of unit, which would be a bad tactic for anything.
3. The reserves system.
I've only begun to tinker with this, and im honestly not sure exactly how it works or the tolerance with which it could be adjucted without causing crashes or some other kind of unforeseen problem.
It looks like the following:
-- unit type called when AI need reserve troops
g_Reserve_Unit = {
[FRANCE] = { {Prob = 50, ID = FR_INFANTRY}, {Prob = 10, ID = FR_AMR35}, {Prob = 10, ID = FR_FCM36}, {Prob = 5, ID = FR_AMC35}, {Prob = 5, ID = FR_CHAR_D1}, {Prob = 5, ID = FR_CHAR_D2}, },
[ENGLAND] = { {Prob = 50, ID = UK_INFANTRY}, {Prob = 20, ID = UK_VICKERS_MK6B}, {Prob = 10, ID = UK_MATILDA_II}, {Prob = 5, ID = UK_MATILDA_I}, },
[USSR] = { {Prob = 50, ID = RU_INFANTRY}, {Prob = 20, ID = RU_T26}, {Prob = 15, ID = RU_T28}, },
[GERMANY] = { {Prob = 50, ID = GE_INFANTRY}, {Prob = 20, ID = GE_PANZER_I}, {Prob = 15, ID = GE_PANZER_35}, },
[ITALY] = { {Prob = 50, ID = IT_INFANTRY}, {Prob = 20, ID = IT_L6_40}, {Prob = 15, ID = IT_M11_39}, },
}
-- Thresholds used to check if AI need to call reserve troops
g_Reserve_Data = {
-- UnitThreshold : minimum number of land units left
-- LandThreshold : minimum number of plot left
-- LandUnitRatio : ratio between lands and units, use higher ratio when the nation has lot of space between cities
[FRANCE] = { UnitThreshold = 8, LandThreshold = 108, LandUnitRatio = 10,
Condition = function() local savedData = Modding.OpenSaveData(); return savedData.GetValue("FranceHasFallen") ~= 1; end},
-- initial plots = 216. France won't get reinforcement once Paris is captured
[ENGLAND] = { UnitThreshold = 14, LandThreshold = 100, LandUnitRatio = 5,
}, -- no condition function means always true
-- initial plots = 111
[USSR] = { UnitThreshold = 20, LandThreshold = 2350, LandUnitRatio = 50,
},
-- initial plots = 2469
[GERMANY] = { UnitThreshold = 20, LandThreshold = 300, LandUnitRatio = 10,
Condition = function() local turn = Game.GetGameTurn(); return turn > 5; end},
-- initial plots = 204 : German AI get reinforcement almost immediatly (after 5 turns because LandThreshold > initial plots)
[ITALY] = { UnitThreshold = 12, LandThreshold = 90, LandUnitRatio = 5,
},
-- initial plots = 114
}
As i understand it (and Gede or anyone else, please correct me if i am not explaining this correctly), but by turning down the LandUnitRatio, especially for Russia, you can increase the frequency with which they spawn units.
I would be open to further explanation. I've turned down the USSR LandUnitThreshold = 20 from 50, but i haven't seen a single 'alert' that reserves have been called up. I suppose its possible that the system is not active on the Euro1940 map that I've been testing all of the other stuff on. Furthermore, i don't have the tolerance to play several hours testing each individual adjustment, so my adjustments have been fairly hyperbolic.
I know Gede has a new version in the pipeline, but if i stabilize my hotfix, I'll post a complete link to my version of the DefinesEuro1940 so people could just copy/paste it (which is a lot easier than editing all of this stuff individually).
Enjoy.