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

bitmode

1st Reverse Engineer Battalion
Nov 10, 2016
4.085
8.014
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%:
Screenshot from 2020-02-20 07-54-56.png
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:
Screenshot from 2020-02-20 08-02-41.png

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