1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

We need help deciphering the HandicapInfos.xml

Discussion in 'Civ5 - Creation & Customization' started by The_J, Dec 22, 2011.

  1. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,622
    Location:
    Germany / Netherlands
    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 :).
     
  2. magzhi

    magzhi Chieftain

    Joined:
    May 23, 2010
    Messages:
    197
    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 :(
     
  3. Sneaks

    Sneaks Brooklyn Bum

    Joined:
    Oct 15, 2010
    Messages:
    1,877
    Location:
    NYC
    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.
     
  4. vexing

    vexing knows

    Joined:
    Dec 24, 2010
    Messages:
    2,668
    the AI can declare war on the player on settler difficulty
     
  5. Sneaks

    Sneaks Brooklyn Bum

    Joined:
    Oct 15, 2010
    Messages:
    1,877
    Location:
    NYC
    Hmm ok. I know barbs cannot enter player lands on settler and assumed the same for ai
     
  6. deanej

    deanej Chieftain

    Joined:
    Apr 8, 2006
    Messages:
    4,859
    Location:
    New York State
    It might be a "base" setting that can be modified by other factors.
     
  7. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,622
    Location:
    Germany / Netherlands
    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.
     
  8. Jabberwockxeno

    Jabberwockxeno Chieftain

    Joined:
    Jul 10, 2012
    Messages:
    487
    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?
     
  9. Putmalk

    Putmalk Chieftain

    Joined:
    Sep 26, 2010
    Messages:
    2,623
    Location:
    New York
    The AI receives all bonuses listed.

    The AI also always has Chieftain-level happiness.

    Nothing else could possibly be given to them.
     
  10. Jabberwockxeno

    Jabberwockxeno Chieftain

    Joined:
    Jul 10, 2012
    Messages:
    487
    Hmm...

    Maybe i'm just worse of a player than I thought :p
     
  11. PawelS

    PawelS Ancient Druid

    Joined:
    Dec 11, 2003
    Messages:
    2,803
    Location:
    Poland
    I think it also gets some other Chieftain bonuses (for example technology and policy cost discounts), not only happiness.
     
  12. Putmalk

    Putmalk Chieftain

    Joined:
    Sep 26, 2010
    Messages:
    2,623
    Location:
    New York
    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).
     
  13. Spatzimaus

    Spatzimaus Mad Scientist

    Joined:
    Sep 21, 2005
    Messages:
    3,063
    Location:
    Los Angeles, CA
    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.
     
  14. PawelS

    PawelS Ancient Druid

    Joined:
    Dec 11, 2003
    Messages:
    2,803
    Location:
    Poland
    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...
     
  15. Barathor

    Barathor Chieftain

    Joined:
    May 7, 2011
    Messages:
    1,202
    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).
     
  16. Kristal

    Kristal Chieftain

    Joined:
    Sep 13, 2012
    Messages:
    10
    Location:
    Quebec
    Has a comprehensive list ever been made? It seems like this thread died on the table :/
     
  17. Anonimoustester

    Anonimoustester Chieftain

    Joined:
    May 7, 2013
    Messages:
    2
    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
     
  18. Putmalk

    Putmalk Chieftain

    Joined:
    Sep 26, 2010
    Messages:
    2,623
    Location:
    New York
    Ill go through the source at some point and translate
     
  19. joncnunn

    joncnunn Senior Java Wizard Moderator

    Joined:
    Mar 17, 2008
    Messages:
    8,621
    Location:
    Missouri
    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.
     
  20. Putmalk

    Putmalk Chieftain

    Joined:
    Sep 26, 2010
    Messages:
    2,623
    Location:
    New York
    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);
    }
    
    
     

Share This Page