Description of issue
AI still misjudges effect of AOT bonus
Game Version
1.8.2
Enabled DLC
Do you have mods enabled?
No
Description
Previous version of this bug before research speed got reworked
Somehow this bug managed to survive through a complete overhaul of the surrounding code. With the reworked research speed, NAI.MAX_AHEAD_RESEARCH_PENALTY now presumably refers to the maximum speed penalty the AI is willing to accept, i.e. +200% or one year ahead under normal circumstances.
But in CTechnology::GetAIWeight, TotalAhead (i.e. the available AOT bonus in number of years) gets simply added with the result of CalcCurrentAheadPenalty. That's despite the latter already including the effect of the former.
So if a country has a 2 years AOT bonus available and a tech is 2.75 years ahead, the player will correctly see a penalty of +150%:
while the AI simply slaps the AOT bonus on top of that (150% + 2 years = 3.5). The sum is greater than NAI.MAX_AHEAD_RESEARCH_PENALTY, so the AI weight becomes 0:
While they don't exist in vanilla, this is especially bad for AOT bonuses greater than 2 years because the AI will be unable to fully utilize them.
The workaround is to set NAI.MAX_AHEAD_RESEARCH_PENALTY to something very high.
Steps to Reproduce
Upload Attachment
AI still misjudges effect of AOT bonus
Game Version
1.8.2
Enabled DLC
Do you have mods enabled?
No
Description
Previous version of this bug before research speed got reworked
Somehow this bug managed to survive through a complete overhaul of the surrounding code. With the reworked research speed, NAI.MAX_AHEAD_RESEARCH_PENALTY now presumably refers to the maximum speed penalty the AI is willing to accept, i.e. +200% or one year ahead under normal circumstances.
But in CTechnology::GetAIWeight, TotalAhead (i.e. the available AOT bonus in number of years) gets simply added with the result of CalcCurrentAheadPenalty. That's despite the latter already including the effect of the former.
So if a country has a 2 years AOT bonus available and a tech is 2.75 years ahead, the player will correctly see a penalty of +150%:
while the AI simply slaps the AOT bonus on top of that (150% + 2 years = 3.5). The sum is greater than NAI.MAX_AHEAD_RESEARCH_PENALTY, so the AI weight becomes 0:
While they don't exist in vanilla, this is especially bad for AOT bonuses greater than 2 years because the AI will be unable to fully utilize them.
The workaround is to set NAI.MAX_AHEAD_RESEARCH_PENALTY to something very high.
Steps to Reproduce
- start as GER
- human_ai
- event germany.76 to get the Panzer III bonus from German-Soviet treaty
- let the game run and observe when Germany starts researching Panzer III
- expected: German AI starts researching Panzer III somewhen during 1936 or at least starts valuing the technology ever higher as the year progresses
- actual: it starts researching it no earlier than 1937, the AI weight remains 0 right up until 1937-1-1
Upload Attachment
Last edited:
Upvote
0