I observe there's been some confusion about DifficultyMod.xml (the file containing all of the CBP's difficulty changes) as well as Civ5HandicapInfos.xml, the file that it modifies.
I've read up on the difficulty files and also had some fun playing with settings (like seeing how fast the AI develops if they only pay 1% of growth and production costs).
There's some clarifications posted on this page, but I'm still confused about a few values myself, and I'll try to give a detailed explanation of every value in this thread, and ask questions about the ones that confuse me.
There's a very long list of questions at the end that I'd like help answering.
If anyone could help me with the values I don't understand, it'd be much appreciated. And if I've made any mistakes in this or there's other factors I'm not aware of, please tell me!
I'm looking to have as accurate a view of the difficulty handicaps as possible; basically, a page on difficulty that is as comprehensive as the one created for Minecraft.
Values in DifficultyMod.xml
Player Bonuses
StartingLocPercent - ???
AdvancedStartPointsMod - ??? (according to the wiki, used in map generation, but it's unclear how)
HappinessDefault - 8 on Settler, 4 on Deity. The base Happiness that the player has at the start of the game.
NumCitiesUnhappinessMod - 100% on all difficulties. Modifying this increases or reduces the amount of Unhappiness players receive due to number of cities in Vanilla Civ V.
PopulationUnhappinessMod - 100% on all difficulties. Modifying this increases or reduces the amount of Unhappiness players receive due to population in Vanilla Civ V.
Gold - 0 on all difficulties. Extra Gold the player begins the game with.
GoldFreeUnits - 0 on all difficulties. The number of the player's units that are maintenance-free. While the maintenance cost per unit changes over time, it doesn't differ by unit type, so unit maintenance is calculated as follows: (Total Units - Gold Free Units) x (Current Maintenance Cost Per Unit).
ProductionFreeUnits - 9 on Settler, 6 on Deity. The amount of base Unit Supply the player has at the beginning of the game. For every 1 Unit Supply, the player can field one combat unit without incurring penalties. In Vanilla Civ V, exceeding the supply cap results in -10% Production in all cities per unit, up to a maximum of -70% for 7+ units. In VP, exceeding the supply cap results in -5% Production and Growth in all cities per unit, up to a maximum of -70% Production and Growth for 14+ units. In VP, the unit supply cap decreases by 1 per era and decreases due to War Weariness as well. It can be increased through several means. Note also that in vanilla Civ V, certain non-combat units count against the unit supply cap (e.g. Work Boats).
ProductionFreeUnitsPopulationPercent - 35% on Settler, 20% on Deity. A percentage of the player's total empire population that is added to the Unit Supply cap.
ProductionFreeUnitsPerCity - 1 on all difficulties. Each city owned by the player (including Puppet/Occupied cities) adds this amount to the Unit Supply cap.
RouteCostPercent - 75% on Settler, 100% on all other difficulties. The % maintenance cost that the player must pay for roads and railroads.
UnitCostPercent - 90% on Settler, 100% on all other difficulties. The % maintenance cost that the player must pay for unit maintenance.
BuildingCostPercent - 100% on all difficulties. The % maintenance cost that the player must pay for buildings.
ResearchPercent - 100% on all difficulties. The % beakers cost that the player must invest towards a tech before unlocking it.
PolicyPercent - 90% on Settler, 100% on all other difficulties. The % culture cost of new Social Policies.
ImprovementCostPercent - 100% on all difficulties. The % of turns that must be spent for a Worker to create a new tile improvement (such as a farm, mine, or road).
InflationPercent - 100% on all difficulties. Inflation determines by how much the base cost of unit maintenance increases over time. If set to 0, it will never increase; if set to 50%, it will increase half as much; 150%, 50% more than usual; etc.
AttitudeChange - 1 on Settler, -1 on other difficulties. Unused value.
BarbCampGold - 30 on Settler, 15 on Deity. The amount of Gold received when capturing a Barbarian encampment.
BarbSpawnMod - 0 on all difficulties. Unused in VP, but used in vanilla Civ V.
BarbarianBonus - 50% on Settler, 0% on Deity. Extra combat strength/ranged combat strength when the player fights Barbarians.
EarliestBarbarianReleaseTurn - 30 on Settler, 5 on Deity. The turn # that must be reached before Barbarians can willingly enter city borders owned by the player.
AI Bonuses
(it should be noted that DifficultyMod.sql seems to delete the free AI Techs section from Civ5HandicapInfos.xml)
CityProductionNumOptionsConsidered - 3 on Settler-Warlord, 2 on Prince-Emperor, 1 on Immortal-Deity. Every time it makes a decision about what to produce in a city, the AI will pick what it thinks are the 3/2/1 best choices and choose between them randomly. This makes the AI smarter at higher difficulties.
TechNumOptionsConsidered - Same as above, but for Tech research.
PolicyNumOptionsConsidered - Same as above, but for Social Policy selection.
NoTechTradeModifier - 50% on Settler, 1% on Deity. According to the wiki, "no longer" used, and it is fully unused in the base game.
StartingMinorDefenseUnits - 0 on Settler, 3 on Deity. The number of Warriors (or equivalent unit, if starting at a later era) each City-State begins with at the start of the game.
AIBarbarianBonus - 0% on Settler, 25% on Deity. Extra combat strength/ranged combat strength when the AI fights Barbarians.
BarbarianLandTargetRange - 5 on Settler, 12 on Deity. I presume this is the distance in tiles a land-based Barbarian unit can travel from any encampment.
BarbarianSeaTargetRange - 14 on Settler, 28 on Deity. I presume this is the distance in tiles a sea-based Barbarian unit can travel for any encampment.
AIStartingDefenseUnits - 1 on Settler-Emperor, 2 on Immortal-Deity. The number of Warriors (or equivalent unit, if starting at a later era) each major AI civilization begins with at the start of the game.
AIStartingWorkerUnits - Value omitted for Settler-King; 1 on Emperor-Deity. The number of Workers each major AI civilization begins with at the start of the game.
AIStartingExploreUnits - Value omitted for Settler-Prince; 1 on King-Deity. The number of extra Pathfinders (or equivalent unit, if starting at a later era) each major AI civilization begins with at the start of the game. Remember, they already begin with 1 Pathfinder, like all civs.
AIDeclareWarProb - Extra % desire for AIs to go to war with the player. 50% on Settler, 225% on Deity. The wiki notes this as "mostly irrelevant".
AIWorkRateModifier - 0% on Settler, 70% on Deity. % increase in Worker tile improvement speed; essentially like 'ImprovementCostPercent', but instead of decreasing the base cost of the improvement; it increases the speed of the Workers at constructing them.
AIUnhappinessPercent - 100% on Settler, 65% on Deity. % amount of Unhappiness the AI receives from all sources.
AIGrowthPercent - 110% on Settler, 70% on Deity. Base % of Food requirement to grow in city Population that the AI must meet. Reduced by AIPerEraModifier every era.
AITrainPercent - Same as above, but for % unit Production cost.
AIConstructPercent - Same as above, but for % building Production cost.
AICreatePercent - Same as above, but for % national project Production cost (e.g. Manhattan Project).
AIWorldTrainPercent - 110% on Settler, 100% on all other difficulties. Seems to be unused.
AIWorldConstructPercent - 110% on Settler, 100% on all other difficulties. % Production cost required to create a World Wonder.
AIWorldCreatePercent - 110% on Settler, 100% on all other difficulties. The % amount of Production that must be contributed to complete World Congress projects, such as the World's Fair.
AIBuildingCostPercent - 100% on Settler, 70% on Deity. The % amount of the maintenance cost for buildings that the AI must pay.
AIUnitCostPercent - 100% on Settler, 70% on Deity. The % amount of the maintenance cost for units that the AI must pay.
AIUnitSupplyPercent - 0% on Settler, 35% on Deity. % bonus to the AI's total unit supply cap. Increased by AIPerEraModifier every era.
AIUnitUpgradePercent - 100% on Settler, 65% on Deity. The % Gold cost that the AI must pay to upgrade its units.
AIInflationPercent - 80% on all difficulties. Functions identically to 'InflationPercent' above, but for the AI.
AIPerEraModifier - 0% on Settler, 10% on Deity. Every era, AIGrowthPercent, AITrainPercent, AIConstructPercent, and AICreatePercent are reduced by this value (additive, not multiplicative), and AIUnitSupplyPercent is increased by this value.
AIAdvancedStartPercent - 100% on Settler, 230% on Deity. According to the wiki, used in map generation.
AIFreeXP - 0 on Settler, 30 on Deity; bonus XP given to all new AI units, allowing them to gain one or more promotions sooner or even immediately.
AIFreeXPPercent - Value omitted on Settler; 10% on Chieftain, 100% on Deity. A % bonus to experience AI units gain from combat, allowing them to gain promotions sooner.
DifficultyBonusBase - 0 on Settler; 7 on Deity. Multiplies the amount of bonus instant yields periodically given to major AI civilizations. On Settler, they receive no bonuses; on Deity, they receive 7 times as many as on Chieftain.
DifficultyBonusA - 80 on all difficulties. "Late game bonus"
DifficultyBonusB - 150 on all difficulties. "Mid game bonus"
DifficultyBonusC - 300 on all difficulties. "Early game bonus"
The formula these values are plugged into is found on this page.
Other Factors Influenced by Difficulty
The 'Anti-Warmonger Fervor' defense bonus against warmongers caps at the square of the handicap #. On Settler, 0^2 = 0%, on Deity, 7^2 = 49% (if I have this correctly).
When a human player kills an AI unit, the AI city where that unit originated from gets a flat Production bonus equal to (Unit Combat Strength * DifficultyBonusBase) / 25.
Other AI Bonuses Not Affected by Difficulty
The AI gets a "certain special sense" about how many other players are currently building a Wonder.
The AI gets a "certain special sense" about where Barbarian encampments are.
The AI will wait longer before agreeing to make peace with a human player than with another AI.
The AI will be more willing to offer a favorable deal with another AI than with a human player (unsure)
Values Unique to Civ5HandicapInfos.xml
Player Bonuses
StartingPolicyPoints - Unused in all difficulties, but if included, gives extra Culture to the player at game start.
ExtraHappinessPerLuxury - 1 on Settler and Chieftain; 0 on all other difficulties. Gives a Happiness bonus for every unique Luxury. Unused in VP.
FreeCulturePerTurn - Unused in all difficulties, but if included, gives free Culture to the player every turn.
TechTradeKnownModifier - See 'NoTechTradeModifier', above. Unused in vanilla Civ V and in VP.
StartingDefenseUnits - Unused in all difficulties, but if included, gives extra Warriors (or equivalent unit, if starting in a later era) to the player at game start.
StartingWorkerUnits - Unused in all difficulties, but if included, gives extra Workers to the player at game start.
StartingExploreUnits - Unused in all difficulties, but if included, gives extra Scouts (in VP, Pathfinders, presumably) to the player at game start.
AI Bonuses
AIStartingUnitMultiplier - Adds (does not multiply) a number of Settlers to the AI at game start. 1 on Deity; 0 on all other difficulties. No human equivalent.
The difficulty settings also have a section for 'Free Techs' and 'AI Free Techs' (the latter of which seems to be removed in VP) which can be customized to give specific techs to the human or AI at game start at various difficulties.
They also specify which goody huts (Ancient Ruins) players can encounter. This is modified in VP, though I'm not sure exactly how.
List of Questions
There are numerous things I'm unclear about in these difficulty settings. If anyone could help me with these, it would be much appreciated.
1. What does StartingLocPercent do? If changed, does it have any effect, or is it unused? If unused, can optional code be implemented so it does something, or can it be omitted as a useless setting?
2. Same as #1, but for AdvancedStartPointsMod.
3. Same as #1, but for AIAdvancedStartPercent.
4. Would changing NumCitiesUnhappinessMod have any effect in VP? Reduce local Unhappiness in every city, or global unhappiness?
5. Would changing PopulationUnhappinessMod have any effect in VP? Reduce Unhappiness from needs, for example?
6. In Vanilla Civ V, the values for 'Gold' and 'BarbCampGold' are not actually what is specified in the setting. Only a fraction of the listed gold is actually given to the player. Is this still the case in VP? Was this a fixed bug? Is it affected by AdvancedStartPointsMod? If it is, does that also affect StartingPolicyPoints or any other values?
7. ANSWERED: -5% Production and Growth per unit (maximum 70%) in all cities in VP, and -10% Production per unit (maximum 70%) in the base game.
8. ANSWERED: Puppet/Occupied cities do count towards ProductionFreeUnitsPerCity.
9. Are there any other tile improvements that cost Gold per turn to maintain (other than Roads/Railroads), can modders create tile improvements that cost GPT to maintain, and if so, are they affected by RouteCostPercent?
10. Are InflationPercent and AIInflationPercent unused?
11. AttitudeChange is unused - but does anyone know what it was intended to do, and can that functionality be added and optionally enabled by editing difficulty settings, or can it be omitted as a useless setting?
12. What does BarbSpawnMod do? Does it change Barb spawn times, locations or quantities? Is there code elsewhere that edits the amount of Barbarian spawns by difficulty setting (I remember seeing this)? The player and default AI handicaps both contain settings for this, what happens if they're set to different values?
13. Barbarians can enter city borders before EarliestBarbarianReleaseTurn if the player's city borders expand to include a Barbarian encampment or other tile Barbarians are on. If this happens and EarliestBarbarianReleaseTurn is still not reached, how does this affect the Barbarian AI?
14. 'NoTechTradeModifier' according to the wiki is "no longer used". Was it used in the past of VP? Was it originally intended to do something in vanilla Civ V? Can optional code be implemented so it does something, or can it be omitted as a useless setting?
15. Same as above but for "TechTradeKnownModifier".
16. StartingMinorDefenseUnits - do newly-revolutionized "free City-States" gain these when they revolt, and should they? Should they regain the units every time they revolt? Also, what is the unit cap for City-States, and is it affected by this setting at all? (inconclusive due to bug)
17. BarbarianLandTargetRange and SeaTargetRange - what do these do? Are they the distance a Barbarian unit can travel from any encampment, or are they tied to a given encampment? Is it a distance in tiles Barbarian units can see enemy units? If the former, can they exceed this limit if pathfinding requires them to or they try to attack/capture enemy units? Does this relate to "Barbarian cities" at all (I believe there's a CS quest about this)? And lastly, the player and default AI handicaps both contain settings for this, what happens if they're set to different values?
18. For #17, additional question: is any of this used at all? Was it originally intended to do something in vanilla Civ V? Can optional code be implemented so it does something, or can it be omitted as a useless setting?
19. AIDeclareWarProb is listed as "Extra % desire for AIs to go to war with the player" and the wiki notes this as "mostly irrelevant". How does this mechanic work? Does setting this to 0 (Vanilla Civ V Settler) make the AI unable to declare war on humans?
20. Do AITrainPercent and AIConstructPercent also apply to the Gold and Faith cost of Units/Buildings, and if so, are those also reduced by AIPerEraModifier?
21. AICreatePercent - if affected by AIPerEraModifier as the wiki claims it is, wouldn't this make the Apollo/Manhattan Project negligible in cost at higher difficulties? Hopefully not to the Utopia Project, if that's implemented.
22. Is AIWorldTrainPercent unused? Was it originally intended to do something in vanilla Civ V? Can optional code be implemented so it does something, or can it be omitted as a useless setting?
23. ANSWERED: DifficultyBonusBase is indeed a multiplier to the total yields given.
24. ANSWERED: DifficultyBonus A/B/C - which eras do they apply to? Or are they always used in the formula regardless of era, and iEra the only important factor? A/B/C are used at every era, iEra is the factor that changes (Ancient/Classical are both 1)
25. ANSWERED: How much does DifficultyBonusBase affect the flat Production bonus given to the origin city of an AI unit that is killed by a human player? (Unit Combat Strength * DifficultyBonusBase) / 25
26. The AI gets a "certain special sense" about how many other players are currently building a Wonder. Is this unique to VP, and how does it work?
27. The AI gets a "certain special sense" about where Barbarian encampments are. Is this unique to VP, and how does it work?
28. If I'm reading the Deal AI correctly, the AI is more likely to offer a favorable deal with another AI than with a human player. Is this correct, is this unique to VP and how does it work?
29. According to the wiki, the AI will wait longer before agreeing to make peace with a human player than with an AI player? What is the difference?
30. Is it possible to add mechanics similar to StartingPolicyPoints and FreeCulturePerTurn for other yields as well? Might be useful for modders.
31. Does StartingExploreUnits correctly give a Pathfinder and not a Scout, if specified?
32. Is it possible to rename AIStartingUnitMultiplier to AIStartingSettlerUnits, and/or to create an equivalent for human players? The latter might be useful for modders.
33. Does DifficultyMod.sql delete the entire section on AI Free Techs? If so, why, shouldn't this be customizable?
34. What changes are made in VP to the goody huts/Ancient Ruins, and does it change based on difficulty?
35. The position of StartingMinorDefenseUnits changes several times across the different difficulty settings. This leads me to believe it's possible to rewrite DifficultyMod.xml so that it omits unused settings and changes the order in which each setting is listed to a more intuitive order (currently I find it rather unintuitive). Is all of this correct, and can it be done? I think it would be a minor QoL improvement for modders.
If you actually answer all of the questions (not expecting that from anyone), please, have a cookie. You deserve one!

Thanks for any help you guys can give!
EDIT: Noted down answered questions and tweaked descriptions above to match them. Also, I forgot AIBarbarianBonus in the list, silly me
Recursive
I've read up on the difficulty files and also had some fun playing with settings (like seeing how fast the AI develops if they only pay 1% of growth and production costs).
There's some clarifications posted on this page, but I'm still confused about a few values myself, and I'll try to give a detailed explanation of every value in this thread, and ask questions about the ones that confuse me.
There's a very long list of questions at the end that I'd like help answering.
If anyone could help me with the values I don't understand, it'd be much appreciated. And if I've made any mistakes in this or there's other factors I'm not aware of, please tell me!
I'm looking to have as accurate a view of the difficulty handicaps as possible; basically, a page on difficulty that is as comprehensive as the one created for Minecraft.
Values in DifficultyMod.xml
Player Bonuses
StartingLocPercent - ???
AdvancedStartPointsMod - ??? (according to the wiki, used in map generation, but it's unclear how)
HappinessDefault - 8 on Settler, 4 on Deity. The base Happiness that the player has at the start of the game.
NumCitiesUnhappinessMod - 100% on all difficulties. Modifying this increases or reduces the amount of Unhappiness players receive due to number of cities in Vanilla Civ V.
PopulationUnhappinessMod - 100% on all difficulties. Modifying this increases or reduces the amount of Unhappiness players receive due to population in Vanilla Civ V.
Gold - 0 on all difficulties. Extra Gold the player begins the game with.
GoldFreeUnits - 0 on all difficulties. The number of the player's units that are maintenance-free. While the maintenance cost per unit changes over time, it doesn't differ by unit type, so unit maintenance is calculated as follows: (Total Units - Gold Free Units) x (Current Maintenance Cost Per Unit).
ProductionFreeUnits - 9 on Settler, 6 on Deity. The amount of base Unit Supply the player has at the beginning of the game. For every 1 Unit Supply, the player can field one combat unit without incurring penalties. In Vanilla Civ V, exceeding the supply cap results in -10% Production in all cities per unit, up to a maximum of -70% for 7+ units. In VP, exceeding the supply cap results in -5% Production and Growth in all cities per unit, up to a maximum of -70% Production and Growth for 14+ units. In VP, the unit supply cap decreases by 1 per era and decreases due to War Weariness as well. It can be increased through several means. Note also that in vanilla Civ V, certain non-combat units count against the unit supply cap (e.g. Work Boats).
ProductionFreeUnitsPopulationPercent - 35% on Settler, 20% on Deity. A percentage of the player's total empire population that is added to the Unit Supply cap.
ProductionFreeUnitsPerCity - 1 on all difficulties. Each city owned by the player (including Puppet/Occupied cities) adds this amount to the Unit Supply cap.
RouteCostPercent - 75% on Settler, 100% on all other difficulties. The % maintenance cost that the player must pay for roads and railroads.
UnitCostPercent - 90% on Settler, 100% on all other difficulties. The % maintenance cost that the player must pay for unit maintenance.
BuildingCostPercent - 100% on all difficulties. The % maintenance cost that the player must pay for buildings.
ResearchPercent - 100% on all difficulties. The % beakers cost that the player must invest towards a tech before unlocking it.
PolicyPercent - 90% on Settler, 100% on all other difficulties. The % culture cost of new Social Policies.
ImprovementCostPercent - 100% on all difficulties. The % of turns that must be spent for a Worker to create a new tile improvement (such as a farm, mine, or road).
InflationPercent - 100% on all difficulties. Inflation determines by how much the base cost of unit maintenance increases over time. If set to 0, it will never increase; if set to 50%, it will increase half as much; 150%, 50% more than usual; etc.
AttitudeChange - 1 on Settler, -1 on other difficulties. Unused value.
BarbCampGold - 30 on Settler, 15 on Deity. The amount of Gold received when capturing a Barbarian encampment.
BarbSpawnMod - 0 on all difficulties. Unused in VP, but used in vanilla Civ V.
BarbarianBonus - 50% on Settler, 0% on Deity. Extra combat strength/ranged combat strength when the player fights Barbarians.
EarliestBarbarianReleaseTurn - 30 on Settler, 5 on Deity. The turn # that must be reached before Barbarians can willingly enter city borders owned by the player.
AI Bonuses
(it should be noted that DifficultyMod.sql seems to delete the free AI Techs section from Civ5HandicapInfos.xml)
CityProductionNumOptionsConsidered - 3 on Settler-Warlord, 2 on Prince-Emperor, 1 on Immortal-Deity. Every time it makes a decision about what to produce in a city, the AI will pick what it thinks are the 3/2/1 best choices and choose between them randomly. This makes the AI smarter at higher difficulties.
TechNumOptionsConsidered - Same as above, but for Tech research.
PolicyNumOptionsConsidered - Same as above, but for Social Policy selection.
NoTechTradeModifier - 50% on Settler, 1% on Deity. According to the wiki, "no longer" used, and it is fully unused in the base game.
StartingMinorDefenseUnits - 0 on Settler, 3 on Deity. The number of Warriors (or equivalent unit, if starting at a later era) each City-State begins with at the start of the game.
AIBarbarianBonus - 0% on Settler, 25% on Deity. Extra combat strength/ranged combat strength when the AI fights Barbarians.
BarbarianLandTargetRange - 5 on Settler, 12 on Deity. I presume this is the distance in tiles a land-based Barbarian unit can travel from any encampment.
BarbarianSeaTargetRange - 14 on Settler, 28 on Deity. I presume this is the distance in tiles a sea-based Barbarian unit can travel for any encampment.
AIStartingDefenseUnits - 1 on Settler-Emperor, 2 on Immortal-Deity. The number of Warriors (or equivalent unit, if starting at a later era) each major AI civilization begins with at the start of the game.
AIStartingWorkerUnits - Value omitted for Settler-King; 1 on Emperor-Deity. The number of Workers each major AI civilization begins with at the start of the game.
AIStartingExploreUnits - Value omitted for Settler-Prince; 1 on King-Deity. The number of extra Pathfinders (or equivalent unit, if starting at a later era) each major AI civilization begins with at the start of the game. Remember, they already begin with 1 Pathfinder, like all civs.
AIDeclareWarProb - Extra % desire for AIs to go to war with the player. 50% on Settler, 225% on Deity. The wiki notes this as "mostly irrelevant".
AIWorkRateModifier - 0% on Settler, 70% on Deity. % increase in Worker tile improvement speed; essentially like 'ImprovementCostPercent', but instead of decreasing the base cost of the improvement; it increases the speed of the Workers at constructing them.
AIUnhappinessPercent - 100% on Settler, 65% on Deity. % amount of Unhappiness the AI receives from all sources.
AIGrowthPercent - 110% on Settler, 70% on Deity. Base % of Food requirement to grow in city Population that the AI must meet. Reduced by AIPerEraModifier every era.
AITrainPercent - Same as above, but for % unit Production cost.
AIConstructPercent - Same as above, but for % building Production cost.
AICreatePercent - Same as above, but for % national project Production cost (e.g. Manhattan Project).
AIWorldTrainPercent - 110% on Settler, 100% on all other difficulties. Seems to be unused.
AIWorldConstructPercent - 110% on Settler, 100% on all other difficulties. % Production cost required to create a World Wonder.
AIWorldCreatePercent - 110% on Settler, 100% on all other difficulties. The % amount of Production that must be contributed to complete World Congress projects, such as the World's Fair.
AIBuildingCostPercent - 100% on Settler, 70% on Deity. The % amount of the maintenance cost for buildings that the AI must pay.
AIUnitCostPercent - 100% on Settler, 70% on Deity. The % amount of the maintenance cost for units that the AI must pay.
AIUnitSupplyPercent - 0% on Settler, 35% on Deity. % bonus to the AI's total unit supply cap. Increased by AIPerEraModifier every era.
AIUnitUpgradePercent - 100% on Settler, 65% on Deity. The % Gold cost that the AI must pay to upgrade its units.
AIInflationPercent - 80% on all difficulties. Functions identically to 'InflationPercent' above, but for the AI.
AIPerEraModifier - 0% on Settler, 10% on Deity. Every era, AIGrowthPercent, AITrainPercent, AIConstructPercent, and AICreatePercent are reduced by this value (additive, not multiplicative), and AIUnitSupplyPercent is increased by this value.
AIAdvancedStartPercent - 100% on Settler, 230% on Deity. According to the wiki, used in map generation.
AIFreeXP - 0 on Settler, 30 on Deity; bonus XP given to all new AI units, allowing them to gain one or more promotions sooner or even immediately.
AIFreeXPPercent - Value omitted on Settler; 10% on Chieftain, 100% on Deity. A % bonus to experience AI units gain from combat, allowing them to gain promotions sooner.
DifficultyBonusBase - 0 on Settler; 7 on Deity. Multiplies the amount of bonus instant yields periodically given to major AI civilizations. On Settler, they receive no bonuses; on Deity, they receive 7 times as many as on Chieftain.
DifficultyBonusA - 80 on all difficulties. "Late game bonus"
DifficultyBonusB - 150 on all difficulties. "Mid game bonus"
DifficultyBonusC - 300 on all difficulties. "Early game bonus"
The formula these values are plugged into is found on this page.
Other Factors Influenced by Difficulty
The 'Anti-Warmonger Fervor' defense bonus against warmongers caps at the square of the handicap #. On Settler, 0^2 = 0%, on Deity, 7^2 = 49% (if I have this correctly).
When a human player kills an AI unit, the AI city where that unit originated from gets a flat Production bonus equal to (Unit Combat Strength * DifficultyBonusBase) / 25.
Other AI Bonuses Not Affected by Difficulty
The AI gets a "certain special sense" about how many other players are currently building a Wonder.
The AI gets a "certain special sense" about where Barbarian encampments are.
The AI will wait longer before agreeing to make peace with a human player than with another AI.
The AI will be more willing to offer a favorable deal with another AI than with a human player (unsure)
Values Unique to Civ5HandicapInfos.xml
Player Bonuses
StartingPolicyPoints - Unused in all difficulties, but if included, gives extra Culture to the player at game start.
ExtraHappinessPerLuxury - 1 on Settler and Chieftain; 0 on all other difficulties. Gives a Happiness bonus for every unique Luxury. Unused in VP.
FreeCulturePerTurn - Unused in all difficulties, but if included, gives free Culture to the player every turn.
TechTradeKnownModifier - See 'NoTechTradeModifier', above. Unused in vanilla Civ V and in VP.
StartingDefenseUnits - Unused in all difficulties, but if included, gives extra Warriors (or equivalent unit, if starting in a later era) to the player at game start.
StartingWorkerUnits - Unused in all difficulties, but if included, gives extra Workers to the player at game start.
StartingExploreUnits - Unused in all difficulties, but if included, gives extra Scouts (in VP, Pathfinders, presumably) to the player at game start.
AI Bonuses
AIStartingUnitMultiplier - Adds (does not multiply) a number of Settlers to the AI at game start. 1 on Deity; 0 on all other difficulties. No human equivalent.
The difficulty settings also have a section for 'Free Techs' and 'AI Free Techs' (the latter of which seems to be removed in VP) which can be customized to give specific techs to the human or AI at game start at various difficulties.
They also specify which goody huts (Ancient Ruins) players can encounter. This is modified in VP, though I'm not sure exactly how.
List of Questions
There are numerous things I'm unclear about in these difficulty settings. If anyone could help me with these, it would be much appreciated.
1. What does StartingLocPercent do? If changed, does it have any effect, or is it unused? If unused, can optional code be implemented so it does something, or can it be omitted as a useless setting?
2. Same as #1, but for AdvancedStartPointsMod.
3. Same as #1, but for AIAdvancedStartPercent.
4. Would changing NumCitiesUnhappinessMod have any effect in VP? Reduce local Unhappiness in every city, or global unhappiness?
5. Would changing PopulationUnhappinessMod have any effect in VP? Reduce Unhappiness from needs, for example?
6. In Vanilla Civ V, the values for 'Gold' and 'BarbCampGold' are not actually what is specified in the setting. Only a fraction of the listed gold is actually given to the player. Is this still the case in VP? Was this a fixed bug? Is it affected by AdvancedStartPointsMod? If it is, does that also affect StartingPolicyPoints or any other values?
7. ANSWERED: -5% Production and Growth per unit (maximum 70%) in all cities in VP, and -10% Production per unit (maximum 70%) in the base game.
8. ANSWERED: Puppet/Occupied cities do count towards ProductionFreeUnitsPerCity.
9. Are there any other tile improvements that cost Gold per turn to maintain (other than Roads/Railroads), can modders create tile improvements that cost GPT to maintain, and if so, are they affected by RouteCostPercent?
10. Are InflationPercent and AIInflationPercent unused?
11. AttitudeChange is unused - but does anyone know what it was intended to do, and can that functionality be added and optionally enabled by editing difficulty settings, or can it be omitted as a useless setting?
12. What does BarbSpawnMod do? Does it change Barb spawn times, locations or quantities? Is there code elsewhere that edits the amount of Barbarian spawns by difficulty setting (I remember seeing this)? The player and default AI handicaps both contain settings for this, what happens if they're set to different values?
13. Barbarians can enter city borders before EarliestBarbarianReleaseTurn if the player's city borders expand to include a Barbarian encampment or other tile Barbarians are on. If this happens and EarliestBarbarianReleaseTurn is still not reached, how does this affect the Barbarian AI?
14. 'NoTechTradeModifier' according to the wiki is "no longer used". Was it used in the past of VP? Was it originally intended to do something in vanilla Civ V? Can optional code be implemented so it does something, or can it be omitted as a useless setting?
15. Same as above but for "TechTradeKnownModifier".
16. StartingMinorDefenseUnits - do newly-revolutionized "free City-States" gain these when they revolt, and should they? Should they regain the units every time they revolt? Also, what is the unit cap for City-States, and is it affected by this setting at all? (inconclusive due to bug)
17. BarbarianLandTargetRange and SeaTargetRange - what do these do? Are they the distance a Barbarian unit can travel from any encampment, or are they tied to a given encampment? Is it a distance in tiles Barbarian units can see enemy units? If the former, can they exceed this limit if pathfinding requires them to or they try to attack/capture enemy units? Does this relate to "Barbarian cities" at all (I believe there's a CS quest about this)? And lastly, the player and default AI handicaps both contain settings for this, what happens if they're set to different values?
18. For #17, additional question: is any of this used at all? Was it originally intended to do something in vanilla Civ V? Can optional code be implemented so it does something, or can it be omitted as a useless setting?
19. AIDeclareWarProb is listed as "Extra % desire for AIs to go to war with the player" and the wiki notes this as "mostly irrelevant". How does this mechanic work? Does setting this to 0 (Vanilla Civ V Settler) make the AI unable to declare war on humans?
20. Do AITrainPercent and AIConstructPercent also apply to the Gold and Faith cost of Units/Buildings, and if so, are those also reduced by AIPerEraModifier?
21. AICreatePercent - if affected by AIPerEraModifier as the wiki claims it is, wouldn't this make the Apollo/Manhattan Project negligible in cost at higher difficulties? Hopefully not to the Utopia Project, if that's implemented.
22. Is AIWorldTrainPercent unused? Was it originally intended to do something in vanilla Civ V? Can optional code be implemented so it does something, or can it be omitted as a useless setting?
23. ANSWERED: DifficultyBonusBase is indeed a multiplier to the total yields given.
24. ANSWERED: DifficultyBonus A/B/C - which eras do they apply to? Or are they always used in the formula regardless of era, and iEra the only important factor? A/B/C are used at every era, iEra is the factor that changes (Ancient/Classical are both 1)
25. ANSWERED: How much does DifficultyBonusBase affect the flat Production bonus given to the origin city of an AI unit that is killed by a human player? (Unit Combat Strength * DifficultyBonusBase) / 25
26. The AI gets a "certain special sense" about how many other players are currently building a Wonder. Is this unique to VP, and how does it work?
27. The AI gets a "certain special sense" about where Barbarian encampments are. Is this unique to VP, and how does it work?
28. If I'm reading the Deal AI correctly, the AI is more likely to offer a favorable deal with another AI than with a human player. Is this correct, is this unique to VP and how does it work?
29. According to the wiki, the AI will wait longer before agreeing to make peace with a human player than with an AI player? What is the difference?
30. Is it possible to add mechanics similar to StartingPolicyPoints and FreeCulturePerTurn for other yields as well? Might be useful for modders.
31. Does StartingExploreUnits correctly give a Pathfinder and not a Scout, if specified?
32. Is it possible to rename AIStartingUnitMultiplier to AIStartingSettlerUnits, and/or to create an equivalent for human players? The latter might be useful for modders.
33. Does DifficultyMod.sql delete the entire section on AI Free Techs? If so, why, shouldn't this be customizable?
34. What changes are made in VP to the goody huts/Ancient Ruins, and does it change based on difficulty?
35. The position of StartingMinorDefenseUnits changes several times across the different difficulty settings. This leads me to believe it's possible to rewrite DifficultyMod.xml so that it omits unused settings and changes the order in which each setting is listed to a more intuitive order (currently I find it rather unintuitive). Is all of this correct, and can it be done? I think it would be a minor QoL improvement for modders.
If you actually answer all of the questions (not expecting that from anyone), please, have a cookie. You deserve one!


Thanks for any help you guys can give!
EDIT: Noted down answered questions and tweaked descriptions above to match them. Also, I forgot AIBarbarianBonus in the list, silly me

Recursive
Last edited: