PseudoYields - Infixo/Civ6-Real-Strategy GitHub Wiki

PseudoYields

This system contains many various parameters. Important info on usage. In all the parameters I have tested, Value in AiFavoredItems was a percentage (increase or decrease). In some cases it was capped at the bottom to -95, but in some not, allowing to zero the value by using -100.

PSEUDOYIELD_CITY_* - City Valuation. Used in evaluation the operations. Details are here

The below text is for archiving purposes.

I determined that:

  • Bias value is always a percentage and it is bottom-capped at -95%.
  • BASE and ORIGINAL_CAPITAL - just plainly add the value modified by bias_percentage
  • POPULATION formula: Value += floor(CityPop/5) * (base * (1+bias_percentage)) - notice that it changes every 5 pop
  • DEFENSES - it subtracts the value depending on city's Defense Strength, Value -= base * (city_defense+11)/37 * (1+bias_percentage)
  • also, this applies only when city_def >25 if city has walls, and >20 if city has no walls;
  • if def is less than that, a standard factor is applied which is not affected by pseudo value at all
  • DEFENDING_UNITS - it subtracts the value depending on how many units are defending the city; I couldn't determined an exact formula for that, just hints:
  • it seems to account for units within Range 3, garrisoned unit is treated differently
  • the stronger the units, the more is subtracted
  • basically 2-3 units around decrease the valuation quite signifcantly, 4-5 almost make it 0 I noticed that in later eras, due to huge increase in City's Defense, many cities have value simply 0. This could be one of reasons why wars disappear in time.

PSEUDOYIELD_CIVIC & PSEUDOYIELD_TECHNOLOGY These Pseudos affect the valuation of Civics and Technologies However, each is applied to a separate tree respectively, and since the trees are separate they don't clash Tweaking these probably would result in a bit different order of selecting civics and techs, but without the details of the algorithm it is hard to predict results. I determined only that:

  1. Each civic and tech has a residual valuation that can be seen when setting those Pseudos to 0.
  2. The pseudo default value is multiplied by a factor of 30..100 and added to the valuation; this factor is different for each civic / tech, and that is why it could affect the order.
  3. The bias value (from AiFavoredItems) affects this factor even further, so formula is: factor * def_value * ( 1 + bias_percentage )
  • PSEUDOYIELD_GPP_* valuation of Great People and means to get them. Affects District valuation for sure. Does not affect policies (BUG). Edit. I found out by accident that GP policies are affected by YIELD_GOLD (BUG).
  • PSEUDOYIELD_UNIT_* units valuation. Unit's pseudoyield is defined in Units table. There is a default PSEUDOYIELD_UNIT_COMBAT which is for all combat units that don't have a PseudoYield in the Units table.
  • PSEUDOYIELD_GREATWORK_* valuation of Great Works. Details unknown (e.g. does it affect also trading?)
  • PSEUDOYIELD_CLEAR_BANDIT_CAMPS - probably for evaluating the need to fight barbs, details unknown.
  • PSEUDOYIELD_ENVIRONMENT - national parks, new forests, not-chopping, etc.
  • PSEUDOYIELD_IMPROVEMENT - valuations of improvements. Please note that increasing the valuation of UNIT_BUILDER does not mean that more improvements will be built. Builders are contracted for building improvements. Once contracted, the valuation will affect how quickly they are build.
  • PSEUDOYIELD_INFLUENCE - envoys
  • PSEUDOYIELD_DISTRICT - districts
  • PSEUDOYIELD_WONDER - wonders. I assume that this is an additional parameter applied on top of normal building valuation.
  • PSEUDOYIELD_DIPLOMATIC_BONUS - probably evaluation of diplomatic actions, unclear what exactly does it affect (worth? cost? modifier value?) Lower values make civs don't care about the relation. Appears also in relation to warmongering.
  • PSEUDOYIELD_NUCLEAR_WEAPON - WMDs, details unknown.
  • PSEUDOYIELD_SPACE_RACE - valuation of Space Race projects. Details unknown.
  • PSEUDOYIELD_TOURISM - tourism yield - crucial for Cultural Victory.
  • PSEUDOYIELD_HAPPINESS - amenities.
  • PSEUDOYIELD_GOLDENAGE_POINT - as commented by devs: Note: Dark Age point is the value of avoiding getting that point. We assume no AI's will be deliberately seeking a dark age
  • PSEUDOYIELD_GOVERNOR - governors, but details unknown. Since this applies to all of them and we get them by going through Civics, it is really unclear what this could influence. Could be GovernorType, but there is no usage at all.
  • PSEUDOYIELD_DIPLOMATIC_FAVOR - diplo favor valuation (added in GS),
  • PSEUDOYIELD_DIPLOMATIC_GRIEVANCE - grievence valuation, it has a negative value so it actually decreases chances of a diplo action (added in GS),
  • PSEUDOYIELD_RELIGIOUS_CONVERT_EMPIRE - from devs: Religious Convert is a value intended to help AI pursuing a religious victory to choose targets in other empires. It is used only in ReligiousVictoryPseudoYields. (added in GS)
  • PSEUDOYIELD_STANDING_ARMY_NUMBER and PSEUDOYIELD_STANDING_ARMY_VALUE - size of the military that AI builds