Systems - Infixo/Civ6-Real-Strategy GitHub Wiki

AI Systems

There are currently 27 systems in use that control the AI and game behavior. They are used by creating AiLists that contain Items stored in AiFavoredItems table. In general, one can say which Item is favored or not, and through the Value also by how much. Value is usually a percentage. This information is then used by e.g. scoring systems to evaluate various options and choose the best one. Not all columns in the table are used by each system - it all depends on the system.

AiBuildSpecializations Pre-configured system (DefaultCitySpecialization). Value here most likely is Priority (so, Defenses are the highest). Notice that Traders are lowest and this could be the reason of Gold problems for AI in late game. RST boosts Traders, so AI fully utilizes TR capacity.

AiOperationTypes Controls the number of operations that can be run simultaneously.

AiScoutUses Controls the number of exploring units and their purpose (e.g. land scouting, naval scouting). There are 5 default types available. Values used here are in percentages (confirmed by a dev comment in Vikings Scenario).

Alliances - added in R&F System to manage favored alliances.

Buildings One of simple systems; setting a building as Favored boosts its valuation significantly; it is used usually for Wonders. For normal buildings the result will be that the building will virtually appear everywhere. Opposite option also works - setting Favored to "0" gives the opposite effect. Civ most likely never build it.

CityEvents System that controls type of operation triggered by various types of city events. There is a default list (DefaultCityBuilds) that contains all of them. Theoretically it is possible to trigger multiple ops with single event (PK is made of 2 columns), but I couldn't do it.

Civics One of simple systems; tells which Civics are preferred. The civ will usually go for them as first. It can be used to influence which government a civ should choose as the first. There is no "preferred gov" system, so forcing a civ to go for a civic will eventually make it change the gov because the new one has more slots (bigger scoring). Edit. I found out by testing that Favored=0 doesn't do anything. Shame.

Commemorations - added in R&F Favored dedications (internally they are called commemorations).

DiplomaticActions System to manage favored diplomatic actions. Also allows for setting "disfavored" ones.

Discussions - added in GS World Congress support. Allows to define which disussions are favored and which are not.

Districts System to manage favored Districts. It boosts valuation for a District quite high. Please be aware that setting a District as Favored will result in building it in virtually every city.

Homeland Available Homeland actions. Seems to be pre-configured.

PerWarOperationTypes Controls the number of operations per started war.

PlotEvaluations - see here

Projects Favored Projects.

PseudoYields - see here

Resolutions - added in GS World Congress support. Allows to define which resolutions are favored and which are not.

SavingTypes Seems to set priorities for the usage of Gold. There is a very strange order however: Plots & Great People / Slush Fund / Units. Unclear if lower number means higher priority or lower priority. AI for certain does upgrade units however this process is only run when civic or tech has been researched. If it lacks gold to upgrade them all, it seems to stuck however.

SettlementPreferences - see here

Tactics Available Tactical actions. Seems to be pre-configured.

TechBoosts This system controls AI behavior when pursuing Eurekas and Inspirations. As for now, it is pre-configured with a set of various triggers. Checking out the logs, it seems that AI is actively trying to pursue every boost for which a trigger exists. It doesn't mean that it gets every boost, because it depends on the timing also (e.g. if a unit or building is built on time).

Technologies One of simple systems; tells whch Techs are preferred. The civ will usually go for them as first. I discovered that the reason why so many civs were building Holy Sites very early were because they had Astrology as preferred tech. After the tech was discovered, HS was the district the civ could buld atm and Districts have high valuation just by themselves. Enough to force the civ to build HS. Edit. I found out by testing that Favored=1 doesn't work here (BUG).

TriggeredTrees System to control AI reaction to various events. List of events is pre-configured.

UnitPromotionClasses This system allows to influence the valuation of units that have a specific Promotion Class.

Units This system allows to influence the valuation of a singular unit. For units in general, I believe that Combat Strength is a base for valuation. No idea what is used for Civilian units.

YieldSensitivities - added in Rise & Fall Unclear. It is either redundant to Yields or controls a different, unknown, aspect of the valuation.

Yields One of the most important systems. Affects all valuations that are related to yields: policies, civics, techs, buildings. Default value for each yield is stored in Yields table. It is 1.0, except for Gold which is 0.5. Bias value from AiFavoredItems is a percentage. It is not capped at the bottom, so putting -100 basically sets the yield value to 0. Valuation assumes 30-35 turns of a yield generation.