AI and Difficulty

The difficulty bonuses in the Community Patch are largely unchanged, but the rest of Vox Populi change difficulty bonuses greatly, as described below.

*The information listed below is accurate as of the 3.0.4 release version.*

## AI Periodic Yield Bonuses

When playing on difficulty levels higher than Warlord, the AI receives bonus yields periodically upon triggering certain events, in an effort to match increasingly skilled human players. These bonus yields scale exponentially with era, beginning in the Medieval Era, and are much higher in later eras. Successful AI players will tend to trigger yield bonuses more often and as a result become more difficult opponents for others to take on.

An AI civilization receives bonus yields when it achieves any of the following:

* Enters a new era **(3x normal bonus; Food, Gold, Golden Age Points, Science, Culture)**
* Founds its original capital **(Gold, Golden Age Points)**
* Founds a new city, other than its capital **(Food, Gold, Golden Age Points, Science, Culture)**
* Wins a war (warscore 25+) **(Food, Gold, Golden Age Points, Science, Culture)**
* Starts a Golden Age **(Food, Gold, Science, Culture)**
* Constructs a World Wonder **(Gold, Golden Age Points)**
* Generates a Great Person **(Gold, Golden Age Points)**
* Completes an antiquity site dig by building a Landmark or extracting an artifact **(Gold)**
* Completes a trade route to another civilization or City-State **(Gold)**

The types of yields received by the AI differ based on the trigger for the event, and are listed above. Bonus Gold, Golden Age Points, Science and Culture yields are applied once at the empire level, whereas bonus Food yields are divided equally between the cities in the AI's empire, with any remainder going to the capital.

The specific amount of yields received is based on the formula below, with the following outside variables:

* iEra is the *game (average)* era among all major civilizations. It is 1 in Ancient/Classical, 2 in Medieval, 3 in Renaissance and so on.
* iHandicapBase, iHandicapA, iHandicapB, and iHandicapC are defined in the DifficultyMod.xml file, and are listed above. iHandicapBase is effectively a multiplier on the total number of yields received.
* InstantYieldPercent is 50 on Quick speed, 100 on Standard, 150 on Epic, and 200 on Marathon.

Finally the formula:

```
void CvPlayer::DoDifficultyBonus(HistoricEventTypes eHistoricEvent)
{
 if (!isAlive() || !isMajorCiv())
 return;

 int iEra = GC.getGame().getCurrentEra();
 if (iEra <= 0)
 iEra = 1;

 // First do the human difficulty bonus
 // [...] omitted for this wiki excerpt

 if (isHuman())
 return;

 // Now do the AI difficulty bonus
 pHandicapInfo = GC.getHandicapInfo(GC.getGame().getHandicapType());
 if (pHandicapInfo)
 {
 int iHandicapBase = pHandicapInfo->getAIDifficultyBonusBase();
 int iHandicapA = pHandicapInfo->getAIDifficultyBonusEarly();
 int iHandicapB = pHandicapInfo->getAIDifficultyBonusMid();
 int iHandicapC = pHandicapInfo->getAIDifficultyBonusLate();
 int iYieldHandicap = iHandicapBase \* ((iHandicapC \* iEra \* iEra) + (iHandicapB \* iEra) + iHandicapA) / 100;
 int iUnscaledYieldHandicap = iYieldHandicap;
 iYieldHandicap \*= GC.getGame().getGameSpeedInfo().getInstantYieldPercent();
 iYieldHandicap /= 100;

 if (iYieldHandicap > 0)
 {
 CvString strLogString, strTemp;
 strLogString.Format("VP AI DIFFICULTY BONUS FROM ");

 switch (eHistoricEvent)
 {
 case HISTORIC\_EVENT\_ERA\_CHANGE:
 strTemp.Format("HISTORIC EVENT: ERA - Received Handicap Bonus");
 break;
 case HISTORIC\_EVENT\_WORLD\_WONDER:
 strTemp.Format("HISTORIC EVENT: WORLD WONDER - Received Handicap Bonus");
 break;
 case HISTORIC\_EVENT\_GREAT\_PERSON:
 strTemp.Format("HISTORIC EVENT: GREAT PERSON - Received Handicap Bonus");
 break;
 case HISTORIC\_EVENT\_WON\_WAR:
 strTemp.Format("HISTORIC EVENT: WAR - Received Handicap Bonus");
 break;
 case HISTORIC\_EVENT\_GOLDEN\_AGE:
 strTemp.Format("HISTORIC EVENT: GOLDEN AGE - Received Handicap Bonus");
 break;
 case HISTORIC\_EVENT\_DIG:
 strTemp.Format("HISTORIC EVENT: DIG - Received Handicap Bonus");
 break;
 case HISTORIC\_EVENT\_TRADE\_LAND:
 strTemp.Format("HISTORIC EVENT: TRADE ROUTE (LAND) - Received Handicap Bonus");
 break;
 case HISTORIC\_EVENT\_TRADE\_SEA:
 strTemp.Format("HISTORIC EVENT: TRADE ROUTE (SEA) - Received Handicap Bonus");
 break;
 case HISTORIC\_EVENT\_TRADE\_CS:
 strTemp.Format("HISTORIC EVENT: TRADE ROUTE (CITY-STATE) - Received Handicap Bonus");
 break;
 case HISTORIC\_EVENT\_CITY\_FOUND\_CAPITAL:
 strTemp.Format("HISTORIC EVENT: CAPITAL FOUNDING - Received Handicap Bonus");
 break;
 case HISTORIC\_EVENT\_CITY\_FOUND:
 strTemp.Format("HISTORIC EVENT: CITY FOUNDING - Received Handicap Bonus");
 break;
 case HISTORIC\_EVENT\_CITY\_CONQUEST:
 strTemp.Format("HISTORIC EVENT: CITY CONQUEST - Received Handicap Bonus");
 break;
 case HISTORIC\_EVENT\_PLAYER\_TURNS\_PASSED:
 strTemp.Format("HISTORIC EVENT: %d TURNS PASSED - Received Handicap Bonus", pHandicapInfo->getDifficultyBonusTurnInterval());
 break;
 case HISTORIC\_EVENT\_AI\_TURNS\_PASSED:
 strTemp.Format("HISTORIC EVENT: %d TURNS PASSED - Received Handicap Bonus", pHandicapInfo->getAIDifficultyBonusTurnInterval());
 break;
 default:
 return;
 }
 strLogString += strTemp;

 bool bSeparateYieldTypes = false;
 int iCommonMultiplier = -1;
 vector<YieldTypes> vYields;
 for (int iYieldLoop = 0; iYieldLoop < NUM\_YIELD\_TYPES; iYieldLoop++)
 {
 YieldTypes eYield = (YieldTypes)iYieldLoop;
 int iMultiplier = pHandicapInfo->getYieldMultiplierForAIDifficultyBonus(eHistoricEvent, eYield);
 if (iMultiplier <= 0)
 continue;
 else if (eYield == YIELD\_POPULATION) // Pop boosts use a different formula than other yields, so always show individual yield gains
 {
 bSeparateYieldTypes = true;
 }
 else if (!bSeparateYieldTypes && iMultiplier != iCommonMultiplier)
 {
 if (iCommonMultiplier == -1)
 iCommonMultiplier = iMultiplier;
 else
 bSeparateYieldTypes = true;
 }

 // Is this a supported yield type?
 switch (eYield)
 {
 vYields.push\_back(eYield);
 break;
 default:
 break;
 }
 }

 if (!vYields.empty())
 {
 bool bFirstYield = true;
 if (bSeparateYieldTypes)
 {
 strTemp.Format(": ");
 }
 else
 {
 strTemp.Format(" (%d in Yields): ", max(1, iYieldHandicap \* iCommonMultiplier / 100));
 }
 strLogString += strTemp;

 // Food
 int iMultiplier = bSeparateYieldTypes ? pHandicapInfo->getYieldMultiplierForAIDifficultyBonus(eHistoricEvent, YIELD\_FOOD) : iCommonMultiplier;
 if (std::find(vYields.begin(), vYields.end(), YIELD\_FOOD) != vYields.end())
 {
 int iFood = max(1, iYieldHandicap \* iMultiplier / 100);

 // How many valid cities can we divide this yield amongst?
 vector<int> vValidCities;
 int iLoop = 0;
 for (CvCity\* pLoopCity = firstCity(&iLoop); pLoopCity != NULL; pLoopCity = nextCity(&iLoop))
 {
 // Skip puppets, unless Venice.
 if (CityStrategyAIHelpers::IsTestCityStrategy\_IsPuppetAndAnnexable(pLoopCity))
 continue;

 // Skip resistance or razing cities.
 if (pLoopCity->IsResistance() || pLoopCity->IsRazing())
 continue;

 vValidCities.push\_back(pLoopCity->GetID());
 }
 if (vValidCities.size() > 0)
 {
 int iFoodPerCity = iFood / vValidCities.size();
 int iFoodRemainder = iFood - (iFoodPerCity \* vValidCities.size());
 if (iFoodPerCity <= 0)
 iFoodPerCity = 1;

 for (std::vector<int>::iterator it = vValidCities.begin(); it != vValidCities.end(); it++)
 {
 CvCity\* pCity = getCity(\*it);
 if (pCity->isCapital())
 pCity->changeFood(iFoodPerCity + iFoodRemainder);
 else
 pCity->changeFood(iFoodPerCity);
 }

 if (bSeparateYieldTypes)
 {
 strTemp.Format("FOOD (%d; %d cities, %d per city)", iFood, vValidCities.size(), iFoodPerCity);
 }
 else
 {
 strTemp.Format("FOOD (%d cities, %d per city)", vValidCities.size(), iFoodPerCity);
 }
 strLogString += strTemp;
 bFirstYield = false;
 }
 }

 // Production
 iMultiplier = bSeparateYieldTypes ? pHandicapInfo->getYieldMultiplierForAIDifficultyBonus(eHistoricEvent, YIELD\_PRODUCTION) : iCommonMultiplier;
 if (std::find(vYields.begin(), vYields.end(), YIELD\_PRODUCTION) != vYields.end())
 {
 int iProduction = max(1, iYieldHandicap \* iMultiplier / 100);

 // How many valid cities can we divide this yield amongst?
 vector<int> vValidCities;
 int iLoop = 0;
 for (CvCity\* pLoopCity = firstCity(&iLoop); pLoopCity != NULL; pLoopCity = nextCity(&iLoop))
 {
 // Skip puppets, unless Venice.
 if (CityStrategyAIHelpers::IsTestCityStrategy\_IsPuppetAndAnnexable(pLoopCity))
 continue;

 // Skip resistance or razing cities.
 if (pLoopCity->IsResistance() || pLoopCity->IsRazing())
 continue;

 vValidCities.push\_back(pLoopCity->GetID());
 }
 if (vValidCities.size() > 0)
 {
 int iProductionPerCity = iProduction / vValidCities.size();
 int iProductionRemainder = iProduction - (iProductionPerCity \* vValidCities.size());
 if (iProductionPerCity <= 0)
 iProductionPerCity = 1;

 for (std::vector<int>::iterator it = vValidCities.begin(); it != vValidCities.end(); it++)
 {
 CvCity\* pCity = getCity(\*it);
 if (pCity->isCapital())
 pCity->changeProduction(iProductionPerCity + iProductionRemainder);
 else
 pCity->changeProduction(iProductionPerCity);
 }

 if (!bFirstYield)
 {
 strTemp.Format(", ");
 strLogString += strTemp;
 }
 if (bSeparateYieldTypes)
 {
 strTemp.Format("PRODUCTION (%d; %d cities, %d per city)", iProduction, vValidCities.size(), iProductionPerCity);
 }
 else
 {
 strTemp.Format("PRODUCTION (%d cities, %d per city)", vValidCities.size(), iProductionPerCity);
 }
 strLogString += strTemp;
 bFirstYield = false;
 }
 }

 // Gold
 iMultiplier = bSeparateYieldTypes ? pHandicapInfo->getYieldMultiplierForAIDifficultyBonus(eHistoricEvent, YIELD\_GOLD) : iCommonMultiplier;
 if (std::find(vYields.begin(), vYields.end(), YIELD\_GOLD) != vYields.end())
 {
 int iGold = max(1, iYieldHandicap \* iMultiplier / 100);
 GetTreasury()->ChangeGold(iGold);

 if (!bFirstYield)
 {
 strTemp.Format(", ");
 strLogString += strTemp;
 }
 if (bSeparateYieldTypes)
 {
 strTemp.Format("GOLD (%d)", iGold);
 }
 else
 {
 strTemp.Format("GOLD");
 }
 strLogString += strTemp;
 bFirstYield = false;
 }

 // Golden Age Points
 iMultiplier = bSeparateYieldTypes ? pHandicapInfo->getYieldMultiplierForAIDifficultyBonus(eHistoricEvent, YIELD\_GOLDEN\_AGE\_POINTS) : iCommonMultiplier;
 if (std::find(vYields.begin(), vYields.end(), YIELD\_GOLDEN\_AGE\_POINTS) != vYields.end())
 {
 int iGAP = max(1, iYieldHandicap \* iMultiplier / 100);
 ChangeGoldenAgeProgressMeter(iGAP);

 if (!bFirstYield)
 {
 strTemp.Format(", ");
 strLogString += strTemp;
 }
 if (bSeparateYieldTypes)
 {
 strTemp.Format("GAP (%d)", iGAP);
 }
 else
 {
 strTemp.Format("GAP");
 }
 strLogString += strTemp;
 bFirstYield = false;
 }

 // Culture
 iMultiplier = bSeparateYieldTypes ? pHandicapInfo->getYieldMultiplierForAIDifficultyBonus(eHistoricEvent, YIELD\_CULTURE) : iCommonMultiplier;
 if (std::find(vYields.begin(), vYields.end(), YIELD\_CULTURE) != vYields.end())
 {
 int iCulture = max(1, iYieldHandicap \* iMultiplier / 100);
 changeJONSCulture(iCulture);

 if (!bFirstYield)
 {
 strTemp.Format(", ");
 strLogString += strTemp;
 }
 if (bSeparateYieldTypes)
 {
 strTemp.Format("CULTURE (%d)", iCulture);
 }
 else
 {
 strTemp.Format("CULTURE");
 }
 strLogString += strTemp;
 bFirstYield = false;
 }

 // Science
 iMultiplier = bSeparateYieldTypes ? pHandicapInfo->getYieldMultiplierForAIDifficultyBonus(eHistoricEvent, YIELD\_SCIENCE) : iCommonMultiplier;
 if (std::find(vYields.begin(), vYields.end(), YIELD\_SCIENCE) != vYields.end())
 {
 int iScience = max(1, iYieldHandicap \* iMultiplier / 100);
 TechTypes eCurrentTech = GetPlayerTechs()->GetCurrentResearch();
 if (eCurrentTech == NO\_TECH)
 {
 changeOverflowResearch(iScience);
 }
 else
 {
 GET\_TEAM(getTeam()).GetTeamTechs()->ChangeResearchProgress(eCurrentTech, iScience, GetID());
 }

 if (!bFirstYield)
 {
 strTemp.Format(", ");
 strLogString += strTemp;
 }
 if (bSeparateYieldTypes)
 {
 strTemp.Format("SCIENCE (%d)", iScience);
 }
 else
 {
 strTemp.Format("SCIENCE");
 }
 strLogString += strTemp;
 bFirstYield = false;
 }

 // Faith
 iMultiplier = bSeparateYieldTypes ? pHandicapInfo->getYieldMultiplierForAIDifficultyBonus(eHistoricEvent, YIELD\_FAITH) : iCommonMultiplier;
 if (std::find(vYields.begin(), vYields.end(), YIELD\_FAITH) != vYields.end())
 {
 int iFaith = max(1, iYieldHandicap \* iMultiplier / 100);
 ChangeFaith(iFaith);

 if (!bFirstYield)
 {
 strTemp.Format(", ");
 strLogString += strTemp;
 }
 if (bSeparateYieldTypes)
 {
 strTemp.Format("FAITH (%d)", iFaith);
 }
 else
 {
 strTemp.Format("FAITH");
 }
 strLogString += strTemp;
 bFirstYield = false;
 }

 // Tourism
 iMultiplier = bSeparateYieldTypes ? pHandicapInfo->getYieldMultiplierForAIDifficultyBonus(eHistoricEvent, YIELD\_TOURISM) : iCommonMultiplier;
 if (std::find(vYields.begin(), vYields.end(), YIELD\_TOURISM) != vYields.end())
 {
 int iTourism = max(1, iYieldHandicap \* iMultiplier / 100);
 GetCulture()->AddTourismAllKnownCivsWithModifiers(iTourism);

 if (!bFirstYield)
 {
 strTemp.Format(", ");
 strLogString += strTemp;
 }
 if (bSeparateYieldTypes)
 {
 strTemp.Format("TOURISM TO MET CIVS (%d; modifiers apply)", iTourism);
 }
 else
 {
 strTemp.Format("TOURISM TO MET CIVS (modifiers apply)");
 }
 strLogString += strTemp;
 bFirstYield = false;
 }

 // Great General Points
 iMultiplier = bSeparateYieldTypes ? pHandicapInfo->getYieldMultiplierForAIDifficultyBonus(eHistoricEvent, YIELD\_GREAT\_GENERAL\_POINTS) : iCommonMultiplier;
 if (std::find(vYields.begin(), vYields.end(), YIELD\_GREAT\_GENERAL\_POINTS) != vYields.end())
 {
 int iGGPoints = max(1, iYieldHandicap \* iMultiplier / 100);
 changeCombatExperienceTimes100(iGGPoints \* 100);

 if (!bFirstYield)
 {
 strTemp.Format(", ");
 strLogString += strTemp;
 }
 if (bSeparateYieldTypes)
 {
 strTemp.Format("G GENERAL POINTS (%d)", iGGPoints);
 }
 else
 {
 strTemp.Format("G GENERAL POINTS");
 }
 strLogString += strTemp;
 bFirstYield = false;
 }

 // Great Admiral Points
 iMultiplier = bSeparateYieldTypes ? pHandicapInfo->getYieldMultiplierForAIDifficultyBonus(eHistoricEvent, YIELD\_GREAT\_ADMIRAL\_POINTS) : iCommonMultiplier;
 if (std::find(vYields.begin(), vYields.end(), YIELD\_GREAT\_ADMIRAL\_POINTS) != vYields.end())
 {
 int iGAPoints = max(1, iYieldHandicap \* iMultiplier / 100);
 changeNavalCombatExperienceTimes100(iGAPoints \* 100);

 if (!bFirstYield)
 {
 strTemp.Format(", ");
 strLogString += strTemp;
 }
 if (bSeparateYieldTypes)
 {
 strTemp.Format("G ADMIRAL POINTS (%d)", iGAPoints);
 }
 else
 {
 strTemp.Format("G ADMIRAL POINTS");
 }
 strLogString += strTemp;
 bFirstYield = false;
 }

 // Population (does not scale with game speed!)
 // This one is divided by 100 for sanity. Each 100 points = +1 citizen. The minimum gain is +1 citizen.
 iMultiplier = bSeparateYieldTypes ? pHandicapInfo->getYieldMultiplierForAIDifficultyBonus(eHistoricEvent, YIELD\_POPULATION) : iCommonMultiplier;
 if (std::find(vYields.begin(), vYields.end(), YIELD\_POPULATION) != vYields.end())
 {
 int iPopulationBoost = max(1, iUnscaledYieldHandicap \* iMultiplier / 10000);

 // Distribute Population deck-of-cards style to cities in order of Local Happiness.
 CvWeightedVector<CvCity\*> CitiesSortedByLocalHappiness;
 int iLoop = 0;
 for (CvCity\* pLoopCity = firstCity(&iLoop); pLoopCity != NULL; pLoopCity = nextCity(&iLoop))
 {
 // Skip puppets, unless Venice.
 if (CityStrategyAIHelpers::IsTestCityStrategy\_IsPuppetAndAnnexable(pLoopCity))
 continue;

 // Do not distribute Population to razing or resistance cities
 if (pLoopCity->IsRazing() || pLoopCity->IsResistance())
 continue;

 int iLocalHappiness = pLoopCity->GetLocalHappiness(0, /\*bExcludeEmpireContributions\*/ false);
 CitiesSortedByLocalHappiness.push\_back(pLoopCity, iLocalHappiness);
 }
 if (CitiesSortedByLocalHappiness.size() > 0)
 {
 CitiesSortedByLocalHappiness.SortItems();
 int iPopToGive = iPopulationBoost;
 while (iPopToGive > 0)
 {
 for (int i = 0; i < CitiesSortedByLocalHappiness.size(); i++)
 {
 CvCity\* pCity = CitiesSortedByLocalHappiness.GetElement(i);
 pCity->changePopulation(1, true, true);
 iPopToGive--;

 if (iPopToGive == 0)
 break;
 }
 }

 if (!bFirstYield)
 {
 strTemp.Format(", ");
 strLogString += strTemp;
 }

 strTemp.Format("EMPIRE POPULATION (%d)", iPopulationBoost);
 strLogString += strTemp;
 bFirstYield = false;
 }
 }

 // Border Growth Points
 iMultiplier = bSeparateYieldTypes ? pHandicapInfo->getYieldMultiplierForAIDifficultyBonus(eHistoricEvent, YIELD\_CULTURE\_LOCAL) : iCommonMultiplier;
 if (std::find(vYields.begin(), vYields.end(), YIELD\_CULTURE\_LOCAL) != vYields.end())
 {
 int iBorderGrowthPoints = max(1, iYieldHandicap \* iMultiplier / 100);

 // How many valid cities can we divide this yield amongst?
 vector<int> vValidCities;
 int iLoop = 0;
 for (CvCity\* pLoopCity = firstCity(&iLoop); pLoopCity != NULL; pLoopCity = nextCity(&iLoop))
 {
 // Skip puppets, unless Venice.
 if (CityStrategyAIHelpers::IsTestCityStrategy\_IsPuppetAndAnnexable(pLoopCity))
 continue;

 // Skip resistance or razing cities.
 if (pLoopCity->IsResistance() || pLoopCity->IsRazing())
 continue;

 vValidCities.push\_back(pLoopCity->GetID());
 }
 if (vValidCities.size() > 0)
 {
 int iBGPPerCity = iBorderGrowthPoints / vValidCities.size();
 int iBGPRemainder = iBorderGrowthPoints - (iBGPPerCity \* vValidCities.size());
 if (iBGPPerCity <= 0)
 iBGPPerCity = 1;

 for (std::vector<int>::iterator it = vValidCities.begin(); it != vValidCities.end(); it++)
 {
 CvCity\* pCity = getCity(\*it);
 if (pCity->isCapital())
 pCity->ChangeJONSCultureStored(iBGPPerCity + iBGPRemainder);
 else
 pCity->ChangeJONSCultureStored(iBGPPerCity);
 }

 if (!bFirstYield)
 {
 strTemp.Format(", ");
 strLogString += strTemp;
 }
 if (bSeparateYieldTypes)
 {
 strTemp.Format("BORDER GROWTH POINTS (%d; %d cities, %d per city)", iBorderGrowthPoints, vValidCities.size(), iBGPPerCity);
 }
 else
 {
 strTemp.Format("BORDER GROWTH POINTS (%d cities, %d per city)", vValidCities.size(), iBGPPerCity);
 }
 strLogString += strTemp;
 bFirstYield = false;
 }
 }

 strTemp.Format(".");
 strLogString += strTemp;

 if (GC.getLogging() && GC.getAILogging())
 {
 CvString strBaseString;

 CvString strFileName = "DifficultyHandicapLog.csv";
 FILogFile\* pLog = NULL;
 pLog = LOGFILEMGR.GetLog(strFileName, FILogFile::kDontTimeStamp);

 CvString strPlayerName;
 strPlayerName = getCivilizationShortDescription();
 strBaseString += strPlayerName;
 strBaseString += ", ";

 CvString strTurn;

 strTurn.Format("%d, ", GC.getGame().getGameTurn()); // turn
 strBaseString += strTurn;

 strBaseString += strLogString;

 pLog->Msg(strBaseString);
 }
 }
 }
 }
}

```

## Notes

1. ↑ In **pregenerated maps only**, players with lower MapPlacementPriority values are placed on the map before players with higher values (somewhat increasing the odds of obtaining a favorable starting position). If two or more players have the same MapPlacementPriority value, the order of placement is determined randomly. Civilizations are always placed on the map before City-States, since the MapPlacementPriority value for City-States is multiplied by 10.
2. ↑ 2.0 2.1 If the game starts in a later era (e.g. Industrial rather than Ancient), an additional 2 base unit supply is added per era, beginning in the Classical Era.
3. ↑ 3.0 3.1 Puppet cities only contribute half of their total population towards this percentage, unless you're playing as Venice.
4. ↑ 4.0 4.1 This is the maximum bonus when fighting in the enemy's territory. In neutral territory, the maximum CS/RCS bonus is reduced by half (rounded down). In owned territory, the bonus does not apply. The bonus begins at 0, is raised by the player's warmongering behavior (declaring war, capturing cities and using nukes), and decays over time.
5. ↑ Unit upgrade costs are based on the unit's base Production cost (excluding any reductions from difficulty).
6. ↑ 6.0 6.1 6.2 6.3 6.4 6.5 Per era modifiers:

1) Use the *game* era - the average era among major civs, not the era this specific player is in.

2) Start applying in the Classical Era (a -4 modifier is 0 in Ancient, -4 in Classical, -8 in Medieval, and so on).

3) Are multiplicative with the base discount, if any. So a base discount of 70 with a -10 modifier results in 63% of the regular cost, not 60%.
7. ↑ A value of 110 means the AI must contribute 110 Production in order to be credited for 100 Production towards the project.
8. ↑ 8.0 8.1 The AI receives 33% less XP on Quick, 50% more XP on Epic, and 200% more XP on Marathon.
9. ↑ 9.0 9.1 AI units that gain XP from revealing tiles (i.e. scouts) do not receive the sight bonus.
10. ↑ There are no projects which City-States can build in Vox Populi, but other mods might add some.
11. ↑ This value is randomized in each game by +/- 2 turns.
12. ↑ 12.0 12.1 Songhai receives triple this amount.
13. ↑ 13.0 13.1 This is measured in approximate pathfinder turns (i.e. a range of 3 means a Barbarian unit will search for visible targets that it can reach within 3 turns of movement.)
14. ↑ 14.0 14.1 14.2 14.3 Scores are internal AI evaluations of how good each option is for its current situation. The AI will make a *weighted* randomized choice of each option that makes the cutoff. If the AI's highest scoring choice has 1000 weight and the second highest choice has 900, the AI will pick the first one 11.11% more often (1000:900 ratio). If there are three options of 1000, 950, and 900, the ratio of selecting them would be 1000:950:900. By default, these choices are not affected by difficulty level, but players can change this in the difficulty files.
15. ↑ The AI will not open another policy branch while one policy branch is unfinished.
16. ↑ This includes the penalty for "recklessly expanding" without building up a strong military.
17. ↑ 17.0 17.1 17.2 17.3 17.4 17.5 This means any opinion/approach penalties or bonuses received for competing or not competing with the AI. A value of 80 means 80% of the base penalty or bonus is applied.
18. ↑ 18.00 18.01 18.02 18.03 18.04 18.05 18.06 18.07 18.08 18.09 18.10 18.11 18.12 18.13 18.14 If a player is playing at a different difficulty level than the game difficulty level (possible in multiplayer), the AI will use this value when interacting with them. The AI will interact with other AI players using the value for the game difficulty level (which is the average difficulty level among human players, with Settler being 0, Chieftain being 1, etc. and any decimals being rounded down).
19. ↑ 19.0 19.1 This means any opinion/approach penalties received for competing with the AI. A value of 80 means 80% of the base penalty is applied. Only the highest out of the victory dispute and victory block penalties will be applied. Also, 10% of this value is added to the AI's weight to denounce a player who is close to victory.
20. ↑ 20.0 20.1 20.2 20.3 The higher this value, the more likely the AI is to consider a player a competitor for this category. Their dispute or block level (NONE, WEAK, STRONG, FIERCE) will be more likely to be higher, which affects diplomacy modifiers to approach and opinion.
21. ↑ During this time, the AI has WAR, HOSTILE and DECEPTIVE approach scores of 0 towards the player they made peace with, and is much less likely to enter wars with them.
22. ↑ This modifier might be reduced or negated if the AI believes the human player is performing poorly.
23. ↑ Negative values improve opinion, while positive values reduce it.
24. ↑ Calculated by adding the era number of each major civ team together, then dividing by the number of major civ teams and rounding down.