Open baldamundo opened 2 years ago
Have also noticed the AI building what seems like way too many powerplants - although not as bad as the farm situation - but I'm finding the script for that even harder to understand, so I can't guess what the issue is
no matter what i do, the AI keeps on building farms.
have tried deiting various things into the parameter under #DO NOT BUILD MORE FARMS THAN YOU NEED. but it seems to make no difference. so either i'm not understanding how the script is meant to work at all (very likely) or it's broken at a deeper level than just that section
I noticed in my games, the major AI nations were consistently having strong GDP growth, but little or no growth in total factory numbers. Was curious what it was they were building instead, so I tag-switched to see, and they just keep on building agricultural complexes and water infrastructure.
In my latest game, by 1984, the USA has a surplus of over 2000 food, yet they still have another 12 farms currently building - more than half of their build queue!
So I decided to try and look into the code to work out why this was happening, and I think I might have found the problem:
The AI building strategy seems to be defined in common/scripted_effects/IncomeGenerator.txt https://github.com/swf541/ColdWarIronCurtain/blob/0.3-The-Crescent%2C-the-Chakra-and-the-Tiger/Cold%20War%20Iron%20Curtain/common/scripted_effects/IncomeGenerator.txt
This section seems to deal with when to build or not build farms:
Notice at the end, the section that's meant to stop it building too many farms, it checks a desired surplus number against a value called "foodCheck". I can't find this value defined anywhere. I've searched the files for it, and the only other reference I can see is in something in IC_Industrial_Pulse.txt, but that's been commented out https://github.com/swf541/ColdWarIronCurtain/blob/0.3-The-Crescent%2C-the-Chakra-and-the-Tiger/Cold%20War%20Iron%20Curtain/common/scripted_effects/IC_Industrial_Pulse.txt
Searching on the Github repository, there is a deprecated file in the backup folder which defines it:
https://github.com/swf541/ColdWarIronCurtain/blob/0cf8bbbf051af0f99e269871bfcf993994cbe0c6/CWIC%20Backup/Harain%20moved%20these/common/scripted_effects/wip/IC_Energy_Pulses.txt
Although even then, I'm not sure I understand how the script would work - it seems like it would be checking food consumption multiplied by negative 1 against food consumption multiplied by 1.1?? I guess that works to check whether the value is positive or negative, but shouldn't it be using FoodBalanceTotal ?
Probably I've misunderstood some of this, since the scripts are very complicated, but something's definitely not right because the AI is definitely building way too many farms in my games!