Settling cities - Infixo/Civ6-Real-Strategy GitHub Wiki

PlotEvaluations

This system is used to score plots for settlement purposes. It is possible the see the scoring (there is a Lua function for that) for 3 plots that the game "recommends". This allows for testing. Important. This system ignores Favored flag. I changed that flag for different params and the scoring was always the same. Also, fractions don't work. XML and SQL allows for fractions, but only integer is used for calculations.

Parameters (field Item)

  • Foreign Continent - adds Value to the scoring if the plot is on the foreign continent; Favored is ignored except for the 1st settler; for 1st settler it only adds when Favored=1 and for 1st settler the plot is always "foreign".
  • Coastal - adds Value to the scoring if the plot is on the coast; if a tile is both coastal and fresh water then probably coastal is ignored (?)
  • Fresh Water – adds Value when plot has a fresh water (river or lake).
  • Inner Ring Yield - adds Value * yield for a specified YieldType; Inner Ring is 6 tiles around the spot, the central plot is NOT counted.
  • Total Yield - adds Value * yield for a specified YieldType counting Rings 1-3; please note that it overlaps with Inner Ring!
  • Resource Class - adds Value for each Resource of the specified class within Rings 1-3. Important. AI doesn't cheat here - it counts only revealed resources. Also, each copy of the resource is counted separately.
  • New Resources - adds Value for each copy of the new resource in Ring 1. Important. Improved resources are not counted and the tech to improve the resource is not required. I.e. it will count Tea even if you don't have Irrigation.
  • Specific Resource - adds Value for each copy of the specific resource within Rings 1-3. No cheating, only revealed are counted.
  • Specific Feature - adds Value for each tile of the specified Feature within Rings 1-3. Please not the dev comment: HACK NOTE: If the specific feature is a natural wonder, that value will apply to all natural wonders. When we break them out individually, we'll fix this, but this is our starting point AWG; that is why only Dead Sea is defined - it serves for all Natural Wonders.
  • Nearest Friendly City - key parameter that controls how far away from our city a new one is settled. It adds Value * Distance to the score. Notice however that Value is negative (-10 by default), so it means that 1 tile is worth 10 points. Since there has to be at least 3 tiles, so by default the score gets a -30 hit. This explains (mostly) why most of the AI cities are 4 tiles away from each other.
  • Cultural Pressure - parameter added in Rise & Fall. See below for details. Favored=1 ⛔ doesn't work.
  • Nearest Enemy City - this parameter is ⚠️ not used, however it is defined in PlotEvalConditions table; it doesn't affect settle score - is detected as 0 (LOC_PLACEHOLDER_BAD appears in tooltips).

Additional info

  • The scoring is re-calculated at the beginning of the turn and only counts visible (revealed) tiles; when a new tile is revealed during a turn - it does NOT change the scoring.
  • The Value parameter is additive, from all active ai lists.
  • There is no support for Terrain. So, hills and mountains are ignored and hills influence settling only via production yield.

Existing generic AI Lists

  • StandardSettlePlot - TRAIT_LEADER_MAJOR_CIV
  • ExpansionSettlementPreferences - strategy rapid expansion
  • NavalSettlementPreferences - strategy naval

Cultural Pressure - test @ 27.01

  • Favored=0, Value<0 => adds to scoring (pressure * Value), e.g. Value = -3, Pressure = -2 -> it adds 6. ⛔ dangerous, goes into bad territories
  • Favored=0, Value>0 => adds to scoring (Value * 20) if there is no pressure, or (Value * pressure) if there is a negative pressure; 🆗 this is the only option that can be used to restrict settling in bad areas
  • Favored=1, Value<0 => pressure is ignored (nothing added) ⛔ dangerous, goes into bad territories
  • Favored=1, Value>0 => pressure is ignored (nothing added) ⛔ dangerous, goes into bad territories
  • If there are two entries with different Favored (just as in a vanilla game) then this param is ignored, as if Favored=1. probably it is enough just to remove the entry with Fav=1 to fix settling.

tl;dr the Favored param is still ignored :( ❗ use only combination Favored=0 and Value>0.

SettlementPreferences

Controls the dynamics of the settlement process in relation to the scoring done by PlotEvaluations. There are 6 values SETTLEMENT_* I am not certain how they work. Most likely, to settle a city, the scoring needs to have a minimum value MIN_VALUE_NEEDED. This is increased when a city is settled by CITY_MINIMUM_VALUE. Then this value decays over time, by DECAY_AMOUNT for every DECAY_TURNS.

  • ADDITIONAL_VALUE_PER_CITY - unclear if this affects min value needed or city value.
  • CITY_VALUE_MULTIPLIER - no idea what it does.

Example Trajan uses this system. MIN_VALUE_NEEDED is decreased to allow to crappy places. ADDITIONAL_VALUE_PER_CITY is decreased, so expectations for next cities aren't too high. Decay params are tweaked, so the value decays much faster - allows to find next settle spot faster. CITY_MINIMUM_VALUE is increased - and this one I cannot explain. Maybe to balance other params, so Trajan would not end with only crappy cities.

⚠️ **GitHub.com Fallback** ⚠️