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

Modify Difficulty Parameters?

Discussion in 'Civ6 - Creation & Customization' started by Bleser, Apr 9, 2017.

  1. Bleser

    Bleser Prince

    Joined:
    Jun 23, 2002
    Messages:
    442
    Location:
    USA
    Hello!

    I think in previous versions of Civ there was an XML file that controlled all the various things that change for each difficulty level. You could modify how many settlers the AI gets, staring combat units, production costs, etc.

    Does anyone know where this is in Civ6? I've searched through the files but just find Difficulties.xml which doesn't seem to do much more than describe how many levels there are.

    Thanks!
     
  2. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,449
    Location:
    Illinois, USA
    It's in modifiers in the Leaders.xml files and in the <MajorStartingUnits> table in the Eras.xml

    Difficulty modifiers are applied to
    Code:
    	<TraitModifiers>
    		<!-- Major Civ Difficulty scaling-->
    		<Row TraitType="TRAIT_LEADER_MAJOR_CIV" ModifierId="HIGH_DIFFICULTY_SCIENCE_SCALING"/>
    		<Row TraitType="TRAIT_LEADER_MAJOR_CIV" ModifierId="HIGH_DIFFICULTY_CULTURE_SCALING"/>
    		<Row TraitType="TRAIT_LEADER_MAJOR_CIV" ModifierId="HIGH_DIFFICULTY_PRODUCTION_SCALING"/>
    		<Row TraitType="TRAIT_LEADER_MAJOR_CIV" ModifierId="HIGH_DIFFICULTY_GOLD_SCALING"/>
    		<Row TraitType="TRAIT_LEADER_MAJOR_CIV" ModifierId="HIGH_DIFFICULTY_FAITH_SCALING"/>
    		<Row TraitType="TRAIT_LEADER_MAJOR_CIV" ModifierId="BARBARIAN_CAMP_GOLD_SCALING"/>
    		<Row TraitType="TRAIT_LEADER_MAJOR_CIV" ModifierId="HIGH_DIFFICULTY_COMBAT_SCALING"/>
    		<Row TraitType="TRAIT_LEADER_MAJOR_CIV" ModifierId="LOW_DIFFICULTY_COMBAT_SCALING"/>
    		<Row TraitType="TRAIT_LEADER_MAJOR_CIV" ModifierId="HIGH_DIFFICULTY_UNIT_XP_SCALING"/>
    		<Row TraitType="TRAIT_LEADER_MAJOR_CIV" ModifierId="LOW_DIFFICULTY_UNIT_XP_SCALING"/>
    		<Row TraitType="TRAIT_LEADER_MAJOR_CIV" ModifierId="HIGH_DIFFICULTY_FREE_TECH_BOOSTS"/>
    		<Row TraitType="TRAIT_LEADER_MAJOR_CIV" ModifierId="HIGH_DIFFICULTY_FREE_CIVIC_BOOSTS"/>
    	</TraitModifiers>
    and then these modifiers are defined and "scaled" per-difficulty-level above Prince, so for the "HIGH_DIFFICULTY_SCIENCE_SCALING":
    Code:
    	<Modifiers>
    		<Row>
    			<ModifierId>HIGH_DIFFICULTY_SCIENCE_SCALING</ModifierId>
    			<ModifierType>MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_MODIFIER</ModifierType>
    			<OwnerRequirementSetId>PLAYER_IS_HIGH_DIFFICULTY_AI</OwnerRequirementSetId>
    		</Row>
    	</Modifiers>
    	<ModifierArguments>
    		<Row>
    			<ModifierId>HIGH_DIFFICULTY_SCIENCE_SCALING</ModifierId>
    			<Name>Amount</Name>
    			<Type>LinearScaleFromDefaultHandicap</Type>
    			<Value>0</Value>
    			<Extra>8</Extra>
    		</Row>
    		<Row>
    			<ModifierId>HIGH_DIFFICULTY_SCIENCE_SCALING</ModifierId>
    			<Name>YieldType</Name>
    			<Value>YIELD_SCIENCE</Value>
    		</Row>
    	</ModifierArguments>
    	<RequirementSets>
    		<Row>
    			<RequirementSetId>PLAYER_IS_HIGH_DIFFICULTY_AI</RequirementSetId>
    			<RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
    		</Row>
    	</RequirementSets>
    	<RequirementSetRequirements>
    		<Row>
    			<RequirementSetId>PLAYER_IS_HIGH_DIFFICULTY_AI</RequirementSetId>
    			<RequirementId>REQUIRES_PLAYER_IS_AI</RequirementId>
    		</Row>
    		<Row>
    			<RequirementSetId>PLAYER_IS_HIGH_DIFFICULTY_AI</RequirementSetId>
    			<RequirementId>REQUIRES_HIGH_DIFFICULTY</RequirementId>
    		</Row>
    	</RequirementSetRequirements>
    	<Requirements>
    		<Row>
    			<RequirementId>REQUIRES_PLAYER_IS_AI</RequirementId>
    			<RequirementType>REQUIREMENT_PLAYER_IS_HUMAN</RequirementType>
    			<Inverse>True</Inverse>
    		</Row>
    		<Row>
    			<RequirementId>REQUIRES_HIGH_DIFFICULTY</RequirementId>
    			<RequirementType>REQUIREMENT_PLAYER_HANDICAP_AT_OR_ABOVE</RequirementType>
    		</Row>
    	</Requirements>
    	<RequirementArguments>
    		<Row>
    			<RequirementId>REQUIRES_HIGH_DIFFICULTY</RequirementId>
    			<Name>Handicap</Name>
    			<Value>DIFFICULTY_PRINCE</Value>
    		</Row>
    	</RequirementArguments>
    
    REQUIREMENT_PLAYER_HANDICAP_AT_OR_ABOVE and REQUIREMENT_PLAYER_IS_HUMAN are registered into the game in file GameEffects.xml, but the actual definitions are not exposed anywhere we can see them.
     
    Last edited: Apr 9, 2017
  3. Bleser

    Bleser Prince

    Joined:
    Jun 23, 2002
    Messages:
    442
    Location:
    USA
    Thank you for your reply. Not as adjustable as I was hoping. What I'm ultimately looking for is a way for the production costs of units to be considerably lower for the AI only, especially on higher difficulty. I'm hoping that will lead to fewer late-game wars where the AI has only one or two units running around and the human player just steamrolls them.
     

Share This Page