We need help deciphering the HandicapInfos.xml

The_J

Say No 2 Net Validations
Administrator
Supporter
Joined
Oct 22, 2008
Messages
39,547
Location
DE/NL/FR
Hi @all :),

we need some help deciphering the HandicapInfos.xml.
We (mainly Poaukai and vexing) are currently setting up the Civ5InfoCenter, and one part there are the bonuses for the AI per difficulty level.
vexing created a nice table here, but we're not really sure what some of the values mean.

Help would be required for e.g.
AdvancedStartPointsMod
CityProductionNumOptionsConsidered
TechNumOptionsConsidered
PolicyNumOptionsConsidered
AttitudeChange
NoTechTradeModifier
TechTradeKnownModifier
AIDeclareWarProb
AITrainPercent
AIWorldTrainPercent
AIConstructPercent
AIWorldConstructPercent
AICreatePercent
AIWorldCreatePercent
AIPerEraModifier
AIAdvancedStartPercent

Some of the values make only isolated sense (e.g. AITrainPercent), but not in connection with others (AIWorldTrainPercent).
Could someone help us to make it clear what these tags mean :)?

Thanks in advance :).
 
AdvancedStartPointsMod
CityProductionNumOptionsConsidered
TechNumOptionsConsidered
PolicyNumOptionsConsidered
AttitudeChange
NoTechTradeModifier
TechTradeKnownModifier
AIDeclareWarProb
AITrainPercent
AIWorldTrainPercent
AIConstructPercent
AIWorldConstructPercent
AICreatePercent
AIWorldCreatePercent
AIPerEraModifier
AIAdvancedStartPercent

I think that AdvancedStartPointsMod is a left over from a civ 4 which multiplies advanced starting money by this number. :)
can't say anything else about others :(
 
Tech Trade stuff is from Civ IV and currently has no coding behind it in V.

AI DW Prob is how likely the AI is to declare on the player. I believe its set to 0 for Settler.
 
Hmm ok. I know barbs cannot enter player lands on settler and assumed the same for ai
 
I think that AdvancedStartPointsMod is a left over from a civ 4 which multiplies advanced starting money by this number. :)
can't say anything else about others :(

Tech Trade stuff is from Civ IV and currently has no coding behind it in V.

Both leftovers...not nice :/.

Does really nobody have an idea for the rest?
Would already be very helpful if somebody could set AITrainPercent and AIWorldTrainPercent into some relation, because it would also explain construct + create.
 
Not sure if this is the right thread, but even on prince it seems the AI get's more of a bonus then what the table suggests.

Seeing as how this is an old thread, as any new info been found?
 
Not sure if this is the right thread, but even on prince it seems the AI get's more of a bonus then what the table suggests.

Seeing as how this is an old thread, as any new info been found?

The AI receives all bonuses listed.

The AI also always has Chieftain-level happiness.

Nothing else could possibly be given to them.
 
I think it also gets some other Chieftain bonuses (for example technology and policy cost discounts), not only happiness.
 
I think it also gets some other Chieftain bonuses (for example technology and policy cost discounts), not only happiness.

I've never heard of that before. I'll have to check out the file again and confirm; I thought there was a column which asked for "PolicyCostDiscount" (which would mean they don't only use Chieftain levels).
 
I think it also gets some other Chieftain bonuses (for example technology and policy cost discounts), not only happiness.

Correct. The AI doesn't get some special happiness bonus; the AI is simply playing on Chieftain, with all of the benefits that implies. It gets ALL of the bonuses for that handicap; most of those are just fairly minor, with Happiness being the only really noticeable difference.

If you change the AI's default handicap, then all of those go away. In my own mods, for instance, the AI played on Prince, but I'd altered quite a bit of the game balance in ways that'd reduce the gap between the human and an AI.
 
Does it mean that the AI gets some bonuses twice? (For Chieftain difficulty and for the "AI something" columns.) I mean unhappiness reduction, but also things like bonus vs barbarians, and unit/building maintenance costs...
 
Yes, I believe the AI plays as if it was at Chieftan difficulty and also receives the AI modifiers from the Player's chosen difficulty.

Also, starting at King, I believe the AI receives an additional bonus per era on top of everything else.

So, at King, during the ancient era, the AI would receive an additional -2 to many of its discounts; by the industrial era, it would receive -10 (-2 * 5 eras).
 
I also would like to add that AI receives combat bonuses in immortal and Deity difficulties such as increased exp by double(triple?) (without the needed policy) coupled with enemy soldiers ending combat with 1 hp where they should have been dead (especially on ranged attacks) when that is coupled with exp boost, it is only possible to kill an enemy with minimum 3 attacks (assuming the units are the same) making it one of the biggest parts adding to difficulty which would have helped if it was on the list
 
Ill go through the source at some point and translate
 
All AIWorld___Percent rows: Appear to be left over from Civ IV; their current values (100 even at Deity) have no effect and I suspect even if you changed them they'd still have no effect.
(World Wonders were rolled into buildings; e.g. the AIConstructPercent bonus applies to world & national wonders in addition to buildings.)
AITrainPercent should be unit production.
I'm not sure what AICreatePercent is but it's the same value as Train & Construct anyway. (On Deity the AI builds everything 2X as fast and only needs to fill the food bucket 60%.

Note that this file interacts with GlobalAIDefines.xml. That file contains a section defining the AI handicap level. (By default Chieftain.) AI gets both bonuses; by default if your on Emperor AI has 90% of the Chieftain level unhappiness.

In addition this file interacts with the game speed xml (all players) for scaling.

And this file even interacts with the world size xml (all players) in which playing on a bigger map than "Small" slows downs science; but in addition on the large & huge map sizes all players get some city happiness bonuses.
 
AITrainPercent: Unit cost. 70% means a unit costs 70% of its original value. Affects price of Great Prophets and faith purchases.
AIConstructPercent: Building Cost. 70% means a building costs 70% of its original value.
AIWorldConstructPercent: Wonder Cost. 70% means a wonder costs 70% of its original value.
AIWorldTrainPercent: Affects world unit class cost. You'll only see this if a unit has MaxGlobalInstances != -1.
AICreatePercent: For Projects (e.g. Manhattan Project).
AIWorldCreatePercent: For World Projects (not sure if there's an in-game example).
AIPerEraModifier: Judging by the code, modify the cost ((modifier*currentera) + 100) / 100. So if it's 100, by era it's cost*2, cost*3, cost*4, cost*5...I'm not really sure what this is supposed to do, because it seems to make the cost go up based on the era???
AIAdvancedStartPercent: Has no meaning, because it's never used in the code.
AIDeclareWarProb: Affects how likely the AI is to declare war on human.
AdvancedStartPointsMod - Never used.
CityProductionNumOptionsConsidered - AI will consider more building choices when evaluating which city production to choose next.
TechNumOptionsConsidered - AI will consider more tech choices when evaluating which technology to choose next.
PolicyNumOptionsConsidered - AI will consider more policy choices when evaluating which policy to choose next.
AttitudeChange - Never used.
NoTechTradeModifier - Never used.
TechTradeKnownModifier - Never used.

An example of AIPerEraModifier:
Spoiler :
Code:
//	--------------------------------------------------------------------------------
int CvPlayer::getProductionNeeded(UnitTypes eUnit) const
{
	CvUnitEntry* pkUnitEntry = GC.getUnitInfo(eUnit);

	CvAssertMsg(pkUnitEntry, "This should never be hit");
	if(pkUnitEntry == NULL)
		return 0;

	UnitClassTypes eUnitClass = (UnitClassTypes)pkUnitEntry->GetUnitClassType();
	CvAssert(NO_UNITCLASS != eUnitClass);

	CvUnitClassInfo* pkUnitClassInfo = GC.getUnitClassInfo(eUnitClass);
	CvAssert(pkUnitClassInfo);
	if(pkUnitClassInfo == NULL)
		return 0;

	int iProductionNeeded = pkUnitEntry->GetProductionCost();
	iProductionNeeded *= 100 + getUnitClassCount(eUnitClass) * pkUnitClassInfo->getInstanceCostModifier();
	iProductionNeeded /= 100;

	if(isMinorCiv())
	{
		iProductionNeeded *= GC.getMINOR_CIV_PRODUCTION_PERCENT();
		iProductionNeeded /= 100;
	}

	iProductionNeeded *= GC.getUNIT_PRODUCTION_PERCENT();
	iProductionNeeded /= 100;

	iProductionNeeded *= GC.getGame().getGameSpeedInfo().getTrainPercent();
	iProductionNeeded /= 100;

	iProductionNeeded *= GC.getGame().getStartEraInfo().getTrainPercent();
	iProductionNeeded /= 100;

	if(!isHuman() && !IsAITeammateOfHuman() && !isBarbarian())
	{
		if(isWorldUnitClass(eUnitClass))
		{
			iProductionNeeded *= GC.getGame().getHandicapInfo().getAIWorldTrainPercent();
			iProductionNeeded /= 100;
		}
		else
		{
			iProductionNeeded *= GC.getGame().getHandicapInfo().getAITrainPercent();
			iProductionNeeded /= 100;
		}

		iProductionNeeded *= std::max(0, ((GC.getGame().getHandicapInfo().getAIPerEraModifier() * GetCurrentEra()) + 100));
		iProductionNeeded /= 100;
	}

	iProductionNeeded += getUnitExtraCost(eUnitClass);

	return std::max(1, iProductionNeeded);
}
 
Top Bottom