Planet AI just... doesn't do what I want it to.

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

Ryika

Field Marshal
52 Badges
Apr 16, 2018
2.821
8.372
So, I've been playing around with the planet AI, but for some reason it just does whatever it feels like.

In my attempts to figure out what I'm doing wrong, I have simplified things by just allowing the AI to construct two buildings, and by reducing them down to the most necessary building blocks. I also gave them the same limitations, etc. - hoping that I would be able to figure out what I'm doing wrong, but...

...now I have these two buildings left, and they're basically the same thing, just with different ai_weights:

The factory:
Code:
building_factory_1 = {
   base_buildtime = 360

   category = manufacturing
  
   potential = {  
       NOT = { has_modifier = resort_colony }
       NOT = { has_modifier = slave_colony }
   }
   allow = {
       has_upgraded_capital = yes
   }
  
   resources = {
       category = planet_buildings
       cost = {
           minerals = 400
       }  
       upkeep = {
           energy = 2
       }
   }  
  
   prerequisites = {
       tech_basic_industry
   }
      
   ai_weight = {
       weight = 200
   }
}

And the Foundry:
Code:
building_foundry_1 = {
   base_buildtime = 360

   category = manufacturing
  
   potential = {
       NOT = { has_modifier = resort_colony }
       NOT = { has_modifier = slave_colony }
   }
   allow = {
       has_upgraded_capital = yes
   }
  
   resources = {
       category = planet_buildings
       cost = {
           minerals = 400
       }
       upkeep = {
           energy = 2
       }
   }

   prerequisites = {
       tech_basic_industry
   }

   ai_weight = {
       weight = 20
   }
}
Both buildings work, produce no log errors and show up properly (without the jobs they'd normally have, so they're loaded).

Now, the Factory has a weight of 200, and the Foundry has a weight of only 20, which in my understanding means that the AI should build Factories, and yet, the AI always, and only, constructs... Foundries. Doesn't matter what values I enter, the AI only constructs Foundries.

...so I... must be missing something very obvious...?
 

neptunehs

First Lieutenant
1 Badges
May 28, 2018
204
61
  • Stellaris
I'm... not entirely sure what you mean by that.

Well,because I don't know how AI works,so I don't know what I mean is right.
Maybe just try change something in sector_focuses and colony_automation may work...
 
  • 1Like
Reactions:

Ryika

Field Marshal
52 Badges
Apr 16, 2018
2.821
8.372
I deleted both of those folders earlier while I tested, and unfortunately, that had no effect (aside from producing some log errors).
I _think_ both of those are only used by the logic that determines how planet automation or sector automation work for human players.

I also referenced StarNet AI and Glavius's AI, and both of them do seem to work with the ai_weight part in the buildings (and districts) files when it comes to planet automation, so I do think I'm in the right place generally. I also do see that is some effect, some of the time: If I put the weights of those buildings to 0, the AI won't build them at all, but as soon as I add weights to those buildings, the AI just seems to spam the one that was loaded last, even if it has a much lower weight than the other ones.