AI Consumer Goods Deficits

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

mial42

Lt. General
21 Badges
Sep 28, 2020
1.409
2.910
  • Stellaris - Path to Destruction bundle
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Crusader Kings II
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: The Republic
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Charlemagne
I recently posted a thread in which I mentioned a bunch of the issues I noticed in an AI observe game, most notably crippling food deficits, but I recently noticed another one: the AI really can't handle CGs if it happens to designate a few planets as forge worlds. The reason for this is pretty simple. In the definition for industrial districts, the ai_resource_production block (which tells the AI what they can expect to get out of a construction) looks like this:
Code:
    ai_resource_production = {
        alloys = 1
        trigger = {
            always = yes
        }
    }
    ai_resource_production = {
        consumer_goods = 1
        trigger = {
            owner = {
                country_uses_consumer_goods = yes
            }
        }
    }

If you'll notice, the AI will always think that building an industrial district will give it CGs (if it uses CGs at all, so gestalts need not apply). The problem is that, if the planet happens to be a forge world, it will not provide the AI with CGs at all. The result is that the AI gets a CG deficit => spams industrial districts to compensate => these districts (on forge worlds) don't provide CGs but do increase the number of specialists, so the CG deficit gets worse (and, if there were farmers on the world, food production tanks, causing another issue) => the AI builds more industrial districts => the CG deficit gets worse => critical CG deficit, production tanks due to low happiness => the AI economy completely collapses.

In short, the AI really needs to evaluate whether or not a planet is a forge world (and ideally a factory world, since presumably the reverse occurs when the AI needs alloys, but this is less essential) when evaluating how many CGs it can expect to get from a district.
 
  • 4
Reactions:

Dragatus

Knight of the Toxic God
35 Badges
Jul 29, 2015
6.448
6.234
  • Crusader Kings III
  • Stellaris
  • Crusader Kings II
  • Age of Wonders III

I went ahead and submited the report and gave credit for discovering the bug to mial42.
 
  • 3Like
Reactions:

HugsAndSnuggles

General
86 Badges
Sep 3, 2016
2.331
2.710
And that is why code should be checking actual output value, instead of relying on human-made variables that are trying to imitate said value.
 
  • 1
Reactions: