Another close look at how the AI builds up its worlds: 1.6 edition

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

Ziggarius

Sergeant
56 Badges
Nov 17, 2016
65
43
  • Magicka
  • Sword of the Stars
  • Sword of the Stars II
  • Knights of Pen and Paper +1 Edition
  • Stellaris: Synthetic Dawn
  • Shadowrun Returns
  • Crusader Kings III: Royal Edition
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • Surviving Mars: First Colony Edition
  • BATTLETECH: Flashpoint
  • Hearts of Iron IV: By Blood Alone
  • Stellaris: Nemesis
  • Prison Architect
  • Surviving Mars: First Colony Edition
  • Stellaris: Necroids
  • BATTLETECH: Season pass
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Deluxe edition
  • Age of Wonders: Planetfall Premium edition
  • Age of Wonders: Planetfall Season pass
  • Stellaris: Lithoids
  • Battle for Bosporus
  • Hearts of Iron IV: La Resistance
  • Stellaris: Federations
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Stellaris: Leviathans Story Pack
  • Warlock: Master of the Arcane
  • Cities: Skylines
  • Magicka: Wizard Wars Founder Wizard
  • Pillars of Eternity
  • Cities: Skylines - After Dark
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Distant Stars
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: No Step Back
  • BATTLETECH
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Age of Wonders III
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Surviving Mars: Digital Deluxe Edition
This is why I always get driven away from Stellaris. I come back every few months to check but I always quit over the frustration of having to micro 5, 10, 15, 20, etc. worlds because there's no way I'm letting the past or current AI build my worlds. Once I get past about planet 5 in a game I'm done enjoying the micro. I want to move on to managing things on a more galactic level for conquest o liberation or whatever I'm up do. Instead I'm stuck constantly going from top to bottom on the outliner checking each planet to see what it needs built next.

Good news is since 1.5, you can easily play a tall game where you have 5-10 planets, and conquer the galaxy. No need to REX and micro every planet.
 

Vishaing

MM Prime Minister in Exile
12 Badges
Jan 25, 2008
1.420
723
  • Crusader Kings II
  • Europa Universalis III
  • Europa Universalis IV
  • Heir to the Throne
  • Europa Universalis III Complete
  • March of the Eagles
  • Europa Universalis III Complete
  • Victoria 2: A House Divided
  • Victoria 2
  • 500k Club
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis IV: Pre-order
Can you tell the specific value names or link the mod so i can figure out how to do something similar in my mod?
Unfortunately the thing I was referencing wasn't a Mod.

For Stellaris it would just use the has_building trigger, I think it is, with a small weight, probably like 0.05. I'm not sure how the ai_will_build part of the actual building entry works, it might be used to determine the weight of the building overall, or it might just be a 'if over 1, AI might build and the actual deciding logic is hidden in the engine' sort of thing.
 

GC13

The Last Emperor of Sol
90 Badges
Dec 30, 2010
3.181
3.060
  • Cities: Skylines - After Dark
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines Industries
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Campus
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines
  • Victoria 2
  • Europa Universalis IV
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Sengoku
  • Crusader Kings II: Sunset Invasion
  • Stellaris
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Apocalypse
  • Stellaris: Megacorp
  • Stellaris: Federations
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • Tyranny: Gold Edition
  • Tyranny - Bastards Wound
  • Pillars of Eternity
I don't know about anyone else, but my personal experience has been that Sectors are not -remotely- as stupid as this appears to be. I don't think I've ever found a sector in the process of replacing a building it built since 1.5 came out at least. Certainly not to the degree of building a building then immediately paving over it. It does frequently end up with more buildings than it has pops, and loves to dance pops between buildings constantly, and also is absolutely -awful- about managing its hunger early in colony development for some reason. But once it's got a steady supply of minerals to support it and your empire won't starve to death supporting the planets it's building it seems to do 'okay' at managing them. Not great, but a lot better than this appears to be.
If you set your sector to force respect of tile resources and ban it from redevelopment you should be okay; at that point there's little that the AI can do to mess things up. The problem comes when the unchained AI is allowed to build up its own worlds all by itself, when it really shows that it has a defective decision making process.
 

Astax

Lt. General
39 Badges
Jun 4, 2016
1.377
482
  • Crusader Kings II: Legacy of Rome
  • Stellaris: Synthetic Dawn
  • Stellaris: Apocalypse
  • Stellaris: Galaxy Edition
  • Crusader Kings II
  • Sword of the Stars
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Stellaris: Nemesis
  • Age of Wonders III
  • Stellaris: Humanoids Species Pack
  • Surviving Mars: Digital Deluxe Edition
  • Stellaris: Distant Stars
  • Surviving Mars: First Colony Edition
  • Stellaris: Megacorp
  • Surviving Mars: First Colony Edition
  • Age of Wonders: Planetfall
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Stellaris: Necroids
  • Surviving Mars
  • Knights of Honor
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris
  • Mount & Blade: Warband
  • Cities: Skylines
  • Warlock 2: The Exiled
  • Stellaris - Path to Destruction bundle
  • Stellaris: Distant Stars Pre-Order
  • Stellaris: Ancient Relics
I think sectors are flawed a bit. Sectors should combine multiple planets into single entity (like adding all the tiles together and adding a vertical scrollbar), accessible via single interface. Kinda like Planet++

This would allow a player to "micro" everything on a "macro" level. The sector would be able to build multiple buildings at once (or maybe one but couple of times faster), and have increased pop growth across the entire sector, but only would grow one pop at a time. The spaceport tab would have all the spaceports, not just one, for purpose of module upgrades, but it would have a singular queue out of which it would build.

This woudl eliminate need for sector AI, though one could still be provided via on/off interface plus some options.
 

OdinTGE

Colonel
64 Badges
Oct 29, 2011
983
550
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Holy Knight (pre-order)
  • Cities: Skylines Deluxe Edition
  • Stellaris: Synthetic Dawn
  • Tyranny - Tales from the Tiers
  • Warlock 2: Wrath of the Nagas
  • Europa Universalis IV: Res Publica
  • Magicka
  • Heir to the Throne
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Divine Wind
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Crusader Kings II
  • Stellaris: Humanoids Species Pack
  • Crusader Kings II: Reapers Due
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Crusader Kings Complete
  • Cities: Skylines - Green Cities
  • Tyranny - Bastards Wound
  • Age of Wonders III
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Conclave
  • Cities: Skylines - After Dark
  • Crusader Kings II: Horse Lords
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Pre-order
  • Stellaris: Nemesis
  • 500k Club
  • Warlock 2: The Exiled
  • Europa Universalis III Complete
  • Europa Universalis III Complete
This would allow a player to "micro" everything on a "macro" level.

The point is I don't want to micro all those tiles. Would a better interface help? Sure, but I still don't want to be microing every planet tile 100 years into the game.

You know what would actually help?

  • Allowing us to build the max available rank of a building from the start.
  • A small light/dot notification on a planet in the outliner if a pop is not "unemployed" but is only working a building-less tile bonus
Give me those two things and the game would be 50 times better.
 

Ilushia

Captain
May 10, 2017
411
0
If you set your sector to force respect of tile resources and ban it from redevelopment you should be okay; at that point there's little that the AI can do to mess things up. The problem comes when the unchained AI is allowed to build up its own worlds all by itself, when it really shows that it has a defective decision making process.

I usually leave redevelopment on, mostly because the AI used to build tons of farms at the start of colonization and then replace them during later stages. But that seems to no longer be the case. In fact, as of right now, my experience has been that sectors vastly under-value farms at initial colonization and build them as some of the last stuff they construct. So it's probably not necessary to enable any more, even if you're giving over the planet day zero of its colonization.

Edit: What I don't get is why they don't just force the normal AI to respect tile yields. Yes it'd be less efficient than a player can be, but it'd still be WAY better than the current mess. The Sectors can at least build planets that work, even if they're not idealized all-one-type-no-spare-food planets. The AI can't even seem to manage that much for itself at the moment.
 

Ilushia

Captain
May 10, 2017
411
0
You mention food/planet twice in your post so I'll just say: You know food is empire-wide now right?

I'm aware, yes. Which is the only reason my planets didn't end up starving in my last game. There were several points during my second wave of colonization where I was down to -5 food because the sector controlling the planets flatly would not build farms and I had to add some to my main sector planets to make up for that. Infact, I lost my first Fanatical Purifiers run due to colonizing five new planets and having the AI completely fall apart and ending up stuck at -13 food with no easy way to fix it because the sector refused to develop more food to feed the people living there.
 

Ilushia

Captain
May 10, 2017
411
0
Weird. I definitely haven't seen it do that, though it does always end up heavily positive on food eventually. My experience has thus far been that sectors seem to build farms last, like it has some kind of aversion to stabilizing its food costs before it goes on to building other things. It's not really a noticeable problem past the really early game, since even just three planets with a few tiles dedicated to farms can reach enough positive that it doesn't matter. But it's gotten me into serious trouble a couple of times when I tried to colonize a large number of planets at once in the later part of the early game, before all my core worlds were completely built up with surplus food.
 

GC13

The Last Emperor of Sol
90 Badges
Dec 30, 2010
3.181
3.060
  • Cities: Skylines - After Dark
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines Industries
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Campus
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines
  • Victoria 2
  • Europa Universalis IV
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Sengoku
  • Crusader Kings II: Sunset Invasion
  • Stellaris
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Apocalypse
  • Stellaris: Megacorp
  • Stellaris: Federations
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • Tyranny: Gold Edition
  • Tyranny - Bastards Wound
  • Pillars of Eternity
What sectors build is determined by the need of your empire, or at least that's what I saw. I was considering making a video showing what the sectors will build with given settings (balanced, etc...), so I set myself up with nothing but farms on the homeworld to maximize growth and let the sector get to work. Since I had a negative energy income, all the sector wanted to do was pump out power plant after power plant—on nineteen tiles it ended up with a planetary capital, a frontier hospital, three mineral buildings, and fourteen power buildings. Never mind that its tax rate was at zero, it wanted to help!

When I re-ran the test with a more balanced homeworld, I got the planetary capital, a frontier hospital, three farms, a mineral processing plant, a slave processing facility, a unity building, a lab, and ten power buildings. I was only getting +17 energy at that point, so maybe it still wanted to help boost that total... I ran that test after cheating to fully populate the world and giving the AI instant_build, so I'm not sure if that would have affected its final build or not.
 

Ilushia

Captain
May 10, 2017
411
0
Based on my experience, I would have guessed that it would build things to try and bring its sector energy/minerals into the positive, then focus on filling out extra stuff that helps your empire. At least that's been pretty consistent with my sectors. They focus on building buildings which increase their energy and minerals first, along with starports, then food and orbitals later on. But I'm not sure how accurate that is, as it's purely anecdotal evidence from a couple of games I've played recently.

But I'd totally believe that they have some system set up to check what your total resource production is and try to stabilize it all. It just seems to put that at a lower priority in my experience than starting its own economy rolling, which also makes sense from a practical standpoint.
 

Weedes

First Lieutenant
30 Badges
Feb 11, 2017
253
7
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Pre-order
  • Crusader Kings III: Royal Edition
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II
  • Europa Universalis IV: Rights of Man
  • Stellaris
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Mount & Blade: Warband
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV
I am still fairly certain something like this could fix the issue in the buildings file (pay attention to the AI weight section near the end of each building):

Code:
building_basic_mine = {
   tags = { mining_network }

   base_buildtime = @b0time
   potential = {
       planet = {
           NOT = { is_planet_class = pc_habitat }
       }
   }
   cost = {
       minerals = @b0cost
   }
   produced_resources = {
       minerals = @b0effect
   }
   planet_modifier  = {                   #SM Additions
       pop_happiness = -0.01               #Worst job ever
   }
   required_resources = {
       energy = @b0upkeep
   }
   upgrades = {
       building_mining_network_1
   }
   potential = {
       custom_tooltip = {
           text = "requires_shelter"
           planet = {
                   has_building = "building_colony_shelter"
           }
       }
       planet = {
           NOT = { is_planet_class = pc_habitat }
       }
   }
   ai_allow = {
       NOR = {
           has_resource = {
               type = sr_betharian
               amount > 0
           }
           has_resource = {
               type = sr_alien_pets
               amount > 0
           }   
       }
   }

   ai_weight = {       #<-------------------------------------------- THIS LOOKS IMPORTANT
       factor = 1           #<------------- ALL TIER 1 AND 2 BUILDINGS ARE WEIGHTED AT 1 AND THUS ARE EASILY INTERCHANGED VIA REDEVELOPMENT THEORETICALLY
         modifier = {
           factor = 2   #<----------------------------------- THIS WAS NEVER HERE SHOULD PRIORITIZE BUILDING ON TILES WITH UNEMPLOYED POPS
           has_grown_pop = yes
           has_building = no
       }
   }
}

building_mining_network_1 = {
   tags = { mining_network }

   base_buildtime = @b1time
   potential = {
       planet = {
           NOT = { is_planet_class = pc_habitat }
       }
   }
   cost = {
       minerals = @b1cost
   }
   produced_resources = {
       minerals = @b1effect
   }
   planet_modifier  = {                   #SM Additions
       pop_happiness = -0.02               #Worst job ever
   }
   required_resources = {
       energy = @b1upkeep
   }
   upgrades = {
       building_mining_network_2
   }
   prerequisites = {
       "tech_basic_industry"
   }
   allow = {
       custom_tooltip = {
           text = "requires_building_capital_1"
           planet = {
               OR = {
                   has_building = "building_capital_1"
                   has_building = "building_capital_2"
                   has_building = "building_capital_3"
               }
           }
       }
   }
   ai_allow = {
       NOR = {
           has_resource = {
               type = sr_betharian
               amount > 0
           }
           has_resource = {
               type = sr_alien_pets
               amount > 0
           }   
       }
   }

   ai_weight = {       #<---------------------------------------------------- THIS LOOKS IMPORTANT
       factor = 1       #<--------- CHANGE THIS TO 2 AND THEY SHOULD DEVELOP TIER 1 BUILDINGS LESS THEORETICALLY
         modifier = {  #<------------------- THIS MODIFIER SHOULD NOT BE NEEDED ON TIERS AFTER THIS ONE AS THIS IS THE FIRST TIER FOR COLONIES PAST SHIP SHELTER
           factor = 7   #<------------------- THIS SHOULD MATCH OR EXCEED END LEVEL BUILDING TIER FACTOR
           has_grown_pop = yes
           has_building = no
       }
   }
}

building_mining_network_2 = {
   tags = { mining_network }

   base_buildtime = @b2time
   is_listed = no
   potential = {
       planet = {
           NOT = { is_planet_class = pc_habitat }
       }
   }
   cost = {
       minerals = @b2cost
   }
   allow = {
       custom_tooltip = {
           text = "requires_building_capital_1"
           planet = {
               OR = {
                   has_building = "building_capital_1"
                   has_building = "building_capital_2"
                   has_building = "building_capital_3"
               }
           }
       }
   }
   produced_resources = {
       minerals = @b2effect
   }
   planet_modifier  = {                   #SM Additions
       pop_happiness = -0.03               #Worst job ever
   }
   required_resources = {
       energy = @b2upkeep
   }
   upgrades = {
       building_mining_network_3
   }
   prerequisites = {
       "tech_mining_network_2"
   }

   ai_weight = {       #<------------------------------------ THIS WAS NEVER HERE AT ALL FOR THIS TIER
       factor = 3       #<--- FACTOR SHOULD PROBABLY INCREASE WITH EACH TIER TO AVOID REDEVELOPMENT
   }
}

building_mining_network_3 = {
   tags = { mining_network }

   base_buildtime = @b3time
   is_listed = no
   potential = {
       planet = {
           NOT = { is_planet_class = pc_habitat }
       }
   }
   cost = {
       minerals = @b3cost
   }
   allow = {
       custom_tooltip = {
           text = "requires_building_capital_2"
           planet = {
               OR = {
                   has_building = "building_capital_2"
                   has_building = "building_capital_3"
               }
           }
       }
   }
   produced_resources = {
       minerals = @b3effect
   }
   planet_modifier  = {                   #SM Additions
       pop_happiness = -0.04               #Worst job ever
   }
   required_resources = {
       energy = @b3upkeep
   }
   upgrades = {
       building_mining_network_4
   }
   prerequisites = {
       "tech_mining_network_3"
   }
   ai_weight = {       #<--------------- THIS WAS NEVER HERE AT ALL FOR THIS TIER
       factor = 4       #<--- FACTOR SHOULD PROBABLY INCREASE WITH EACH TIER TO AVOID REDEVLOPMENT
   }
}

building_mining_network_4 = {
   tags = { mining_network }

   base_buildtime = @b4time
   is_listed = no
   potential = {
       planet = {
           NOT = { is_planet_class = pc_habitat }
       }
   }
   cost = {
       minerals = @b4cost
   }
   allow = {
       custom_tooltip = {
           text = "requires_building_capital_2"
           planet = {
               OR = {
                   has_building = "building_capital_2"
                   has_building = "building_capital_3"
               }
           }
       }
   }
   produced_resources = {
       minerals = @b4effect
   }
   planet_modifier  = {                   #SM Additions
       pop_happiness = -0.05               #Worst job ever
   }
   required_resources = {
       energy = @b4upkeep
   }
   upgrades = {
       building_mining_network_5
   }
   prerequisites = {
       "tech_mining_network_4"
   }
   ai_weight = {       #<------------------ THIS WAS NEVER HERE AT ALL FOR THIS TIER
       factor = 5       #<--------- FACTOR SHOULD PROBABLY INCREASE WITH EACH TIER TO AVOID REDEVLOPMENT
   }
}

building_mining_network_5 = {
   tags = { mining_network }

   base_buildtime = @b5time
   is_listed = no
   cost = {
       minerals = @b5cost
   }
   potential = {
       planet = {
           is_capital = yes
           NOT = { is_planet_class = pc_habitat }
       }
   }

   destroy_if = {
       planet = { is_capital = no }
   }
   allow = {
       custom_tooltip = {
           text = "requires_building_capital_3"
           planet = {
               has_building = "building_capital_3"
           }
       }
   }
   produced_resources = {
       minerals = @b5effect
   }
   planet_modifier  = {                   #SM Additions
       pop_happiness = -0.06               #Worst job ever
   }
   required_resources = {
       energy = @b5upkeep
   }
   prerequisites = {
       "tech_mining_network_4"
   }
   ai_weight = {       #<-------------------------------------- THIS WAS NEVER HERE AT ALL FOR THIS TIER
       factor = 6       #<------------------------------- FACTOR SHOULD PROBABLY INCREASE WITH EACH TIER TO AVOID REDEVLOPMENT
   }
}

This does not account for everything, as the decision is not entirely based on the weights in the building files alone, as can be seen with the factors in the defines file, but the ability to effect the issue here should be evident with the recent fix to Betharian and Xeno Pet tiles being fixed in these files by PDS themselves in 1.6

The amount of CPU strain this would cause is yet to be determined.
 
Last edited:

Person012345

Field Marshal
92 Badges
Jan 27, 2010
2.594
914
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Semper Fi
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Pre-order
  • Age of Wonders III
  • Stellaris: Synthetic Dawn
  • Cities in Motion 2
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Third Rome
  • Hearts of Iron III: Their Finest Hour
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Cities in Motion
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For the Motherland
  • Leviathan: Warships
  • Hearts of Iron III
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris: Necroids
  • Crusader Kings II: Conclave
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Victoria 2
This multiple times.

The AI just need to NOT do stupid things, like waste resources in redevelopment. In fact, just respecting tile resources and building whatever is less in the income would give a good AI build order.
This is what a lot of people aren't understanding. We're not asking for a perfect AI and in fact it might be because they tried to get too complicated that it went wrong. Right now, there are so many very basic ways, without getting too complicated, that the AI could improve on it's current performance. What it does right now is almost the worst things it could possibly do, in some cases it might even be better for it not to build at all than what it currently does, with all the resources it wastes. As you say, something as simple as just building the tile resource in the order of currently needed would be better than the current, and would be acceptable even if it isn't perfect.
 

Weedes

First Lieutenant
30 Badges
Feb 11, 2017
253
7
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Pre-order
  • Crusader Kings III: Royal Edition
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II
  • Europa Universalis IV: Rights of Man
  • Stellaris
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Mount & Blade: Warband
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV
Right now, there are so many very basic ways, without getting too complicated, that the AI could improve on it's current performance.
We talking ideas or actual implementation in terms of what would be complicated? If the latter, a sounding board on my idea would be nice. I do not have time to test it right now, but it might work. If not, we could re-think the implementation and maybe work with AI_ALLOW = instead... or both?

From what I can see in the building files there is a decent chance for there to be a relatively easy solution to this. How much CPU strain it will add however is yet to be determined.
 

Metztli

Major
66 Badges
Dec 13, 2010
762
545
  • Crusader Kings II
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings II: Jade Dragon
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Surviving Mars: Digital Deluxe Edition
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Surviving Mars: First Colony Edition
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Golden Century
  • Surviving Mars: First Colony Edition
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Lithoids
  • Age of Wonders: Planetfall - Revelations
  • Hearts of Iron IV: La Resistance
  • Stellaris: Federations
  • Crusader Kings III
  • Battle for Bosporus
  • Stellaris: Necroids
  • Europa Universalis IV
  • Stellaris: Nemesis
  • Age of Wonders: Planetfall Season pass
  • Age of Wonders: Planetfall Premium edition
  • Crusader Kings II: Reapers Due
  • Stellaris: Ancient Relics
  • Europa Universalis IV: El Dorado
  • Age of Wonders: Planetfall
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Age of Wonders: Planetfall Deluxe edition
  • Stellaris
Thx for the video but 1.6 broke the whole game so it's not surprising to see the same result. Keep making such videos for future patches please, there are really interesting to see !
 

Vishaing

MM Prime Minister in Exile
12 Badges
Jan 25, 2008
1.420
723
  • Crusader Kings II
  • Europa Universalis III
  • Europa Universalis IV
  • Heir to the Throne
  • Europa Universalis III Complete
  • March of the Eagles
  • Europa Universalis III Complete
  • Victoria 2: A House Divided
  • Victoria 2
  • 500k Club
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis IV: Pre-order
@Weedes; Your Code will probably help. There's a mod somewhere on Da Staem that implements some changes to that building file, and initial reports I've seen is that it does improve the AI's ability to construct the correct buildings. There's also the Shanty Town mod which helps by auto-placing 'shanty' versions of buildings which the AI will upgrade instead of redeveloping, usually.

The thing that may cause problems is that there's nothing in the buildings file which deals with priorities, indicating that some AI Logic is either in another file, or hard-coded into the Engine, probably the latter. That's something you might not be able to fix.

Now that I have some code to look at, the quick check to slightly increase weighting of an existing building should look like the following, replacing the has_building entry with the name of the building in question;

Code:
modifier = {
    factor = 1.1
    has_building = building_mining_network_1
}

You could probably just implement this for the first tier, since you've also got a scaling weight for later Tiers. The risk might be that your scaling weight might prevent the AI from ever re-developing, even when it should, and when it wants to. But in my personal experience I don't think I've ever actually changed a building once it was there except for gradually replacing existing buildings with newly-unlocked Empire-Wide Modifier Buildings and The Power Hub.

Speaking of the Power-Hub, it should probably have a blanket increase for any tile with power, combined with a factor = 0 modifier if the planet already has one, which should be the following code;

Code:
modifier = { factor = 2 has_resource = { type = energy amount > 0 } }
modifier = {
    factor = 0
    OR = {
        planet = { has_building = "power_hub_1" }
        planet = { has_building = "power_hub_2" }
    }
}

There are almost assuredly ways that you could make the AI smarter just by modifying this file.