AI and Workers

Joined
Jan 7, 2009
Messages
620
Hi all,

I get that AI preference for workers is driven in part by their Tile Improvement flavor, but are there any other variables that I can manipulate in order to make the AI more likely to build workers? Optimally, I want there to be three workers for every city. Thanks.
 
Workers are one of the few cases where Flavor isn't the primary driver. The AI examines how many workers he has and classifies it as "Needs", "Wants", or "has enough". Specifically, here are the important variables, in AI/GlobalAIDefines.xml:
Code:
<Defines>
  <Row Name="AI_CITYSTRATEGY_NEED_TILE_IMPROVERS_CITY_THRESHOLD">
    <Value>2</Value>
  </Row>
  <Row Name="AI_CITYSTRATEGY_NEED_TILE_IMPROVERS_WORKER_MOD">
    <Value>200</Value>
  </Row>
  <Row Name="AI_CITYSTRATEGY_NEED_TILE_IMPROVERS_DESPERATE_TURN">
    <Value>30</Value>
  </Row>
  <Row Name="AI_CITYSTRATEGY_WANT_TILE_IMPROVERS_MINIMUM_SIZE">
    <Value>2</Value>
  </Row>
</Defines>

Then, over in CIV5AICityStrategies.xml:
Code:
<AICityStrategies>
  <Row>
    <Type>AICITYSTRATEGY_NEED_TILE_IMPROVERS</Type>
    <CheckTriggerTurnCount>2</CheckTriggerTurnCount>
    <MinimumNumTurnsExecuted>2</MinimumNumTurnsExecuted>
    <WeightThreshold>67</WeightThreshold>
    <Advisor>ECONOMIC</Advisor>
    <AdvisorCounsel>TXT_KEY_AICITYSTRATEGY_NEED_TILE_IMPROVERS</AdvisorCounsel>
    <AdvisorCounselImportance>2</AdvisorCounselImportance>
  </Row>
  <Row>
    <Type>AICITYSTRATEGY_WANT_TILE_IMPROVERS</Type>
    <CheckTriggerTurnCount>2</CheckTriggerTurnCount>
    <MinimumNumTurnsExecuted>2</MinimumNumTurnsExecuted>
    <WeightThreshold>40</WeightThreshold>
    <Advisor>ECONOMIC</Advisor>
    <AdvisorCounsel>TXT_KEY_AICITYSTRATEGY_WANT_TILE_IMPROVERS</AdvisorCounsel>
  </Row>
</AICityStrategies>

Translation: every couple of turns, the AI will check to see if it needs more workers, and if so, how badly it needs them. If it thinks it has far too few, it'll override its normal strategy to make more workers, by drastically increasing the chances a worker gets produced.

Before the March patch, these strategy overrides went obsolete in the Industrial era. One consequence of this was that if you started a game in the later eras, city-states would almost never produce any workers, because their flavor ratings are so low compared to the military units. (Remember, military unit flavors keep increasing, but the Settler and Worker will stay the same...) This is why I've spent a bunch of time in these files; I had to actually fix that back before Firaxis did.

So to answer your original question, try changing the 200 for WORKER_MOD to a 300 and see what happens.
 
Back
Top Bottom