Civ6 Modifiers - How do they work?

Lord Yanaek

Emperor
Joined
Aug 15, 2003
Messages
1,501
Hello. Did anybody mess with modifiers yet, and if so, did anybody understood how they work?

At first, when i had a look at buildings or policies inside the database and didn't have all the columns for various effects, i wondered where they went. Then i saw the modifiers and the global ModifierArguments table holding tons of variables for all the in-game modifiers, no matter where they came from and was like ... whaaaaat :think: ?
Then i considered the ability to attach modifiers to anything in game and define their effect in a unified table and hoped it would open plenty of possibilities for modding, thinking maybe this time they really built their game to be modable as they claimed.
However, upon closer inspection, i really fail to understand how this table actually defines any effect, and i fear they just hard-coded every single modifier by name making them essentially useless for mods [pissed]:trouble:
EDIT : Thanks gyogen2, the main effect of the modifiers is in the Modifiers table and not the ModifiersArguments table.

Examples taken from various policies.
God King adds 1 gold to the Palace only
Code:
"GOD_KING_GOLD"    "YieldType"    "ARGTYPE_IDENTITY"    "YIELD_GOLD"  
"GOD_KING_GOLD"    "Amount"    "ARGTYPE_IDENTITY"    "1"
Triangular Trade adds 4 gold to any trade route
Code:
"TRIANGULARTRADE_TRADEROUTEGOLD"    "YieldType"    "ARGTYPE_IDENTITY"    "YIELD_GOLD"  
"TRIANGULARTRADE_TRADEROUTEGOLD"    "Amount"    "ARGTYPE_IDENTITY"    "4"
Town Charters double the Commercial Hub adjacency bonus
Code:
"TOWNCHARTERS_DISTRICTGOLD"    "YieldType"    "ARGTYPE_IDENTITY"    "YIELD_GOLD"  
"TOWNCHARTERS_DISTRICTGOLD"    "Amount"    "ARGTYPE_IDENTITY"    "100"
Free Market doubles the Yield of the Commercial Hub buildings
Code:
"FREEMARKET_DOUBLEMARKET"    "BuildingType"    "ARGTYPE_IDENTITY"    "BUILDING_MARKET"  
"FREEMARKET_DOUBLEMARKET"    "YieldType"    "ARGTYPE_IDENTITY"    "YIELD_GOLD"  
"FREEMARKET_DOUBLEMARKET"    "Amount"    "ARGTYPE_IDENTITY"    "100"

As you can see, all of those use the same "YieldType" modifier with a type of "ARGTYPE_IDENTITY" and a value of "YIELD_GOLD". However, only the last example explicitly states what building is affected. The other building affecting policy (God King) doesn't even tell. Also every policy uses an "Amount" modifier whether they are a flat value (God King and Triangular Trade) or a % increase (Town Charters and Free Market) :dunno:

So, did anyone made any sense out of this mess, or is it all hard-coded and our hopes of moding any modifier, apart from simple number tweaking, gone?
 
Last edited:
Thanks.

So, half the modifier is defined by ModifierType in the Modifiers table and the other half (all details) is defined by the ModifierArguments entries. Makes sense, not sure why i missed the main Modifiers table this time.
This would give us those modifiers to play with :
Code:
MODIFIER_ADJUST_DIPLOMATIC_ACTION_PREFERENCE
MODIFIER_ADJUST_OPEN_BORDERS_FROM_INFLUENCE
MODIFIER_ALL_CITIES_ADJUST_BUILDING_PRODUCTION
MODIFIER_ALL_CITIES_ADJUST_CITY_GROWTH
MODIFIER_ALL_CITIES_ATTACH_MODIFIER
MODIFIER_ALL_CITIES_CULTURE_BORDER_EXPANSION
MODIFIER_ALL_CITIES_FEATURE_ADJACENCY
MODIFIER_ALL_CITIES_TERRAIN_ADJACENCY
MODIFIER_ALL_PLAYERS_ATTACH_MODIFIER
MODIFIER_ALL_UNITS_ADJUST_HEAL_PER_TURN
MODIFIER_ALL_UNITS_ATTACH_MODIFIER
MODIFIER_ALL_UNITS_GRANT_ABILITY
MODIFIER_BUILDING_YIELD_CHANGE
MODIFIER_CITY_CORPS_ARMY_ADJUST_DISCOUNT
MODIFIER_CITY_DISTRICTS_ADJUST_CITY_AMENITIES_FROM_RELIGION
MODIFIER_CITY_ENABLE_BUILDING_FAITH_PURCHASE
MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD
MODIFIER_CITY_TRAINED_UNITS_ADJUST_MOVEMENT
MODIFIER_CITY_TRAINED_UNITS_ADJUST_XP_BONUS
MODIFIER_FOLLOWER_YIELD_MODIFIER
MODIFIER_GAME_TRIGGER_MECHANIC
MODIFIER_PLAYER_ADD_DIPLO_VISIBILITY
MODIFIER_PLAYER_ADD_RELIGIOUS_BUILDING_MULTIPLIER
MODIFIER_PLAYER_ADJUST_ALLIED_WAR_DISCOUNT
MODIFIER_PLAYER_ADJUST_ALWAYS_FULL_RELIGIOUS_TOURISM
MODIFIER_PLAYER_ADJUST_AUTO_THEMED_BUILDING
MODIFIER_PLAYER_ADJUST_CITY_TILES
MODIFIER_PLAYER_ADJUST_CIVIC_BOOST
MODIFIER_PLAYER_ADJUST_DISTRICT_PILLAGE
MODIFIER_PLAYER_ADJUST_DUPLICATE_FIRST_INFLUENCE_TOKEN
MODIFIER_PLAYER_ADJUST_DUPLICATE_INFLUENCE_TOKEN_WHEN_RIVAL_GOVERNMENT
MODIFIER_PLAYER_ADJUST_EMBARKED_MOVEMENT
MODIFIER_PLAYER_ADJUST_ENFORCE_BORDERS
MODIFIER_PLAYER_ADJUST_FAITH_FROM_DISPERSAL
MODIFIER_PLAYER_ADJUST_FAITH_PEACEFUL_FOUNDERS
MODIFIER_PLAYER_ADJUST_FREE_GREAT_PERSON_POINTS
MODIFIER_PLAYER_ADJUST_FREE_RESOURCE_IMPORT
MODIFIER_PLAYER_ADJUST_FULL_ACCESS_ONE_STRATEGIC
MODIFIER_PLAYER_ADJUST_GOLD_DISPERSAL
MODIFIER_PLAYER_ADJUST_GREAT_PERSON_GUARANTEE
MODIFIER_PLAYER_ADJUST_GREAT_PERSON_PATRONAGE_DISCOUNT_PERCENT
MODIFIER_PLAYER_ADJUST_GREAT_PERSON_POINTS
MODIFIER_PLAYER_ADJUST_GREAT_PERSON_POINTS_PERCENT
MODIFIER_PLAYER_ADJUST_GREAT_PERSON_POINTS_REFUND_PERCENT
MODIFIER_PLAYER_ADJUST_IMPROVEMENT_GOODY_HUT
MODIFIER_PLAYER_ADJUST_IMPROVEMENT_PILLAGE
MODIFIER_PLAYER_ADJUST_INFLUENCE_POINTS_PER_TURN
MODIFIER_PLAYER_ADJUST_JOINTWAR_EXPERIENCE
MODIFIER_PLAYER_ADJUST_JOINTWAR_PLUNDER
MODIFIER_PLAYER_ADJUST_LEVY_DISCOUNT_PERCENT
MODIFIER_PLAYER_ADJUST_NATURAL_WONDER_RELIC
MODIFIER_PLAYER_ADJUST_PLOT_YIELD
MODIFIER_PLAYER_ADJUST_PROGRESS_DIFF_TRADE_BONUS
MODIFIER_PLAYER_ADJUST_RELIGION_BUILDING_DISCOUNT
MODIFIER_PLAYER_ADJUST_RELIGIOUS_TOURISM_REDUCTION
MODIFIER_PLAYER_ADJUST_SPY_BONUS
MODIFIER_PLAYER_ADJUST_STEAL_TECH_BOOSTS
MODIFIER_PLAYER_ADJUST_TECHNOLOGY_BOOST
MODIFIER_PLAYER_ADJUST_TOURISM
MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_CAPACITY
MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_DESTINATION_YIELD_FOR_ALLY_ROUTE
MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_ORIGIN_YIELD_FOR_ALLY_ROUTE
MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_TOURISM_MODIFIER
MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD
MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD_FOR_DOMESTIC
MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD_FOR_INTERNATIONAL
MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD_PER_POST_IN_FOREIGN_CITY
MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD_PER_POST_IN_OWN_CITY
MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD_PER_SPECIALTY_DISTRICT_FOR_DOMESTIC
MODIFIER_PLAYER_ADJUST_UNIT_DISTRICT_PERCENT
MODIFIER_PLAYER_ADJUST_UNIT_MAINTENANCE_DISCOUNT
MODIFIER_PLAYER_ADJUST_UNIT_UPGRADE_DISCOUNT_PERCENT
MODIFIER_PLAYER_ADJUST_UNIT_WONDER_PERCENT
MODIFIER_PLAYER_ADJUST_VALID_IMPROVEMENT
MODIFIER_PLAYER_ADJUST_WAR_WEARINESS
MODIFIER_PLAYER_ADJUST_WARMONGER_MULTIPLIER
MODIFIER_PLAYER_ADJUST_YIELD_CHANGE_PER_TRIBUTARY
MODIFIER_PLAYER_ADJUST_YIELD_CHANGE_PER_USED_INFLUENCE_TOKEN
MODIFIER_PLAYER_ADJUST_YIELD_MODIFIER_PER_TRIBUTARY
MODIFIER_PLAYER_ADOPT_ALLY_FOUNDED_RELIGIONS
MODIFIER_PLAYER_CAPITAL_CITY_ADJUST_BUILDING_PRODUCTION
MODIFIER_PLAYER_CAPITAL_CITY_ADJUST_CITY_YIELD_CHANGE
MODIFIER_PLAYER_CAPITAL_CITY_ADJUST_DISTRICT_PRODUCTION
MODIFIER_PLAYER_CAPITAL_CITY_ADJUST_UNIT_PRODUCTION
MODIFIER_PLAYER_CITIES_ADD_EXPENDED_GREAT_PERSON_TILES
MODIFIER_PLAYER_CITIES_ADJUST_ALL_PROJECTS_PRODUCTION
MODIFIER_PLAYER_CITIES_ADJUST_BUILDING_PRODUCTION
MODIFIER_PLAYER_CITIES_ADJUST_BUILDING_PURCHASE_COST
MODIFIER_PLAYER_CITIES_ADJUST_BUILDING_YIELD_CHANGE
MODIFIER_PLAYER_CITIES_ADJUST_BUILDING_YIELD_MODIFIER
MODIFIER_PLAYER_CITIES_ADJUST_CITY_APPEAL
MODIFIER_PLAYER_CITIES_ADJUST_CITY_GROWTH
MODIFIER_PLAYER_CITIES_ADJUST_CITY_STATE_TRADE_ROUTE_DISTRICT_YIELD
MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_CHANGE
MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_MODIFIER
MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_PER_DISTRICT
MODIFIER_PLAYER_CITIES_ADJUST_DISTRICT_PRODUCTION
MODIFIER_PLAYER_CITIES_ADJUST_EXTRA_GREAT_WORK_SLOTS
MODIFIER_PLAYER_CITIES_ADJUST_EXTRA_UNIT_COPY_TAG
MODIFIER_PLAYER_CITIES_ADJUST_FEATURE_APPEAL_MODIFIER
MODIFIER_PLAYER_CITIES_ADJUST_GREATWORK_YIELD
MODIFIER_PLAYER_CITIES_ADJUST_INNER_DEFENSE
MODIFIER_PLAYER_CITIES_ADJUST_MILITARY_UNITS_PRODUCTION
MODIFIER_PLAYER_CITIES_ADJUST_NUM_UNITS_SUPPORTED
MODIFIER_PLAYER_CITIES_ADJUST_OUTER_DEFENSE
MODIFIER_PLAYER_CITIES_ADJUST_PLOT_PURCHASE_COST
MODIFIER_PLAYER_CITIES_ADJUST_POLICY_AMENITY
MODIFIER_PLAYER_CITIES_ADJUST_POLICY_HOUSING
MODIFIER_PLAYER_CITIES_ADJUST_RANGED_STRIKE
MODIFIER_PLAYER_CITIES_ADJUST_RIVER_DISTRICT_PRODUCTION
MODIFIER_PLAYER_CITIES_ADJUST_RIVER_WONDER_PRODUCTION
MODIFIER_PLAYER_CITIES_ADJUST_SPACE_RACE_PROJECTS_PRODUCTION
MODIFIER_PLAYER_CITIES_ADJUST_TOURISM
MODIFIER_PLAYER_CITIES_ADJUST_TRADE_ROUTE_YIELD_FROM_OTHERS
MODIFIER_PLAYER_CITIES_ADJUST_TRADE_ROUTE_YIELD_PER_DESTINATION_LUXURY_FOR_INTERNATIONAL
MODIFIER_PLAYER_CITIES_ADJUST_TRADE_ROUTE_YIELD_PER_DESTINATION_STRATEGIC_FOR_DOMESTIC
MODIFIER_PLAYER_CITIES_ADJUST_TRADE_ROUTE_YIELD_PER_DESTINATION_STRATEGIC_FOR_INTERNATIONAL
MODIFIER_PLAYER_CITIES_ADJUST_TRADE_ROUTE_YIELD_TO_OTHERS
MODIFIER_PLAYER_CITIES_ADJUST_UNIT_PURCHASE_COST
MODIFIER_PLAYER_CITIES_ADJUST_UNIT_TAG_ERA_PRODUCTION
MODIFIER_PLAYER_CITIES_ADJUST_VALID_FEATURES_DISTRICTS
MODIFIER_PLAYER_CITIES_ADJUST_VALID_FEATURES_WONDERS
MODIFIER_PLAYER_CITIES_ADJUST_WONDER_PRODUCTION
MODIFIER_PLAYER_CITIES_ATTACH_MODIFIER
MODIFIER_PLAYER_CITIES_DISTRICT_ADJACENCY
MODIFIER_PLAYER_CITIES_ENABLE_BUILDING_FAITH_PURCHASE
MODIFIER_PLAYER_CITIES_ENABLE_UNIT_FAITH_PURCHASE
MODIFIER_PLAYER_CITIES_EXTRA_DISTRICT
MODIFIER_PLAYER_CITIES_FEATURE_ADJACENCY
MODIFIER_PLAYER_CITIES_GRANT_CHEAPEST_BUILDING_IN_CITY
MODIFIER_PLAYER_CITIES_GRANT_ROAD_TO_CAPITAL
MODIFIER_PLAYER_CITIES_GRANT_TRADING_POST
MODIFIER_PLAYER_CITIES_GRANT_UNIT_BY_CLASS
MODIFIER_PLAYER_CITY_TRADE_ROUTE_YIELD_PER_LOCAL_BONUS_RESOURCE_FOR_DOMESTIC
MODIFIER_PLAYER_CITY_TRADE_ROUTE_YIELD_PER_LOCAL_BONUS_RESOURCE_FOR_INTERNATIONAL
MODIFIER_PLAYER_CORPS_ARMY_PREREQ
MODIFIER_PLAYER_CREATE_WMD
MODIFIER_PLAYER_CULTURE_ADJUST_GOVERNMENT_SLOTS_MODIFIER
MODIFIER_PLAYER_DIPLOMACY_AGENDA_AYYUBID_DYNASTY
MODIFIER_PLAYER_DIPLOMACY_AGENDA_BLACK_QUEEN
MODIFIER_PLAYER_DIPLOMACY_AGENDA_BUSHIDO
MODIFIER_PLAYER_DIPLOMACY_AGENDA_ENVIRONMENT
MODIFIER_PLAYER_DIPLOMACY_AGENDA_EXPLOITATIVE
MODIFIER_PLAYER_DIPLOMACY_AGENDA_LAST_VIKING_KING
MODIFIER_PLAYER_DIPLOMACY_AGENDA_OPTIMUS_PRINCEPS
MODIFIER_PLAYER_DIPLOMACY_AGENDA_PARANOID
MODIFIER_PLAYER_DIPLOMACY_AGENDA_QUEEN_OF_NILE
MODIFIER_PLAYER_DIPLOMACY_AGENDA_WITH_SHIELD_OR_ON_IT
MODIFIER_PLAYER_DIPLOMACY_ARCHAEOLOGY
MODIFIER_PLAYER_DIPLOMACY_BROKEN_PROMISE
MODIFIER_PLAYER_DIPLOMACY_ESPIONAGE
MODIFIER_PLAYER_DIPLOMACY_GOVERNMENTS
MODIFIER_PLAYER_DIPLOMACY_INCURSION
MODIFIER_PLAYER_DIPLOMACY_KEPT_PROMISE
MODIFIER_PLAYER_DIPLOMACY_NO_PROMISE
MODIFIER_PLAYER_DIPLOMACY_ONE_SIDED_TRADES
MODIFIER_PLAYER_DIPLOMACY_PEACEFUL
MODIFIER_PLAYER_DIPLOMACY_RANDOM
MODIFIER_PLAYER_DIPLOMACY_SETTLED_CITIES
MODIFIER_PLAYER_DIPLOMACY_SIMPLE_MODIFIER
MODIFIER_PLAYER_DIPLOMACY_THIRD_PARTY_EFFECTS
MODIFIER_PLAYER_DIPLOMACY_TRADE_RELATIONS
MODIFIER_PLAYER_DIPLOMACY_WARMONGER
MODIFIER_PLAYER_DISTRICT_ADJUST_EXTRA_REGIONAL_ENTERTAINMENT
MODIFIER_PLAYER_DISTRICT_ADJUST_EXTRA_REGIONAL_RANGE
MODIFIER_PLAYER_DISTRICT_ADJUST_EXTRA_REGIONAL_YIELD
MODIFIER_PLAYER_DISTRICT_ADJUST_YIELD_BASED_ON_ADJACENCY_BONUS
MODIFIER_PLAYER_DISTRICT_ADJUST_YIELD_CHANGE
MODIFIER_PLAYER_DISTRICT_CREATE_UNIT
MODIFIER_PLAYER_DISTRICT_CREATE_YIELD
MODIFIER_PLAYER_DISTRICT_GRANT_AIR_SLOTS
MODIFIER_PLAYER_DISTRICTS_ADJUST_BUILDING_PRODUCTION
MODIFIER_PLAYER_DISTRICTS_ADJUST_DISTRICT_PRODUCTION
MODIFIER_PLAYER_DISTRICTS_ADJUST_EXTRA_REGIONAL_RANGE
MODIFIER_PLAYER_DISTRICTS_ADJUST_GREAT_PERSON_POINTS
MODIFIER_PLAYER_DISTRICTS_ADJUST_TOURISM_CHANGE
MODIFIER_PLAYER_DISTRICTS_ADJUST_TRADE_ROUTE_CAPACITY
MODIFIER_PLAYER_DISTRICTS_ADJUST_UNIT_PRODUCTION
MODIFIER_PLAYER_DISTRICTS_ADJUST_YIELD_CHANGE
MODIFIER_PLAYER_DISTRICTS_ADJUST_YIELD_MODIFIER
MODIFIER_PLAYER_EXPLORE_ENTIRE_MAP
MODIFIER_PLAYER_GAINS_ALL_FOLLOWER_BELIEFS
MODIFIER_PLAYER_GAINS_FOUNDER_BELIEF_MAJORITY_RELIGION
MODIFIER_PLAYER_GOVERNMENT_ACCUMULATING_BONUS
MODIFIER_PLAYER_GOVERNMENT_ADJUST_BONUS_RATE
MODIFIER_PLAYER_GOVERNMENT_ADJUST_OTHER_GOVERNMENT_INTOLERANCE
MODIFIER_PLAYER_GOVERNMENT_FLAT_BONUS
MODIFIER_PLAYER_GRANT_ALL_TECHNOLOGY_BOOST_BY_ERA
MODIFIER_PLAYER_GRANT_CITIES_FRESHWATER_HOUSING_BONUS
MODIFIER_PLAYER_GRANT_CITIES_URBAN_DEFENSES
MODIFIER_PLAYER_GRANT_COMBAT_ADJACENCY
MODIFIER_PLAYER_GRANT_FAITH_FROM_HARVEST
MODIFIER_PLAYER_GRANT_FAITH_FROM_REMOVE_FEATURE
MODIFIER_PLAYER_GRANT_FREE_RESOURCE_FROM_UNIT_PLOT
MODIFIER_PLAYER_GRANT_FREE_RESOURCE_VISIBILITY
MODIFIER_PLAYER_GRANT_INFLUENCE_TOKEN
MODIFIER_PLAYER_GRANT_RANDOM_CIVIC
MODIFIER_PLAYER_GRANT_RANDOM_CIVIC_BOOST_BY_ERA
MODIFIER_PLAYER_GRANT_RANDOM_CIVIC_BOOST_GOODY_HUT
MODIFIER_PLAYER_GRANT_RANDOM_CIVIC_BOOST_ON_NEW_ERA
MODIFIER_PLAYER_GRANT_RANDOM_TECHNOLOGY
MODIFIER_PLAYER_GRANT_RANDOM_TECHNOLOGY_BOOST_BY_ERA
MODIFIER_PLAYER_GRANT_RANDOM_TECHNOLOGY_BOOST_GOODY_HUT
MODIFIER_PLAYER_GRANT_RANDOM_TECHNOLOGY_BOOST_ON_NEW_ERA
MODIFIER_PLAYER_GRANT_RELIC
MODIFIER_PLAYER_GRANT_SPECIFIC_TECH_BOOST
MODIFIER_PLAYER_GRANT_SPY
MODIFIER_PLAYER_GRANT_YIELD
MODIFIER_PLAYER_GRANT_YIELD_BASED_ON_CURRENT_YIELD_RATE
MODIFIER_PLAYER_MULTIPLY_TREASURY
MODIFIER_PLAYER_NEAREST_CITY_ADD_POPULATION
MODIFIER_PLAYER_OWNED_BONUS_RESOURCE_EXTRA_AMENITIES
MODIFIER_PLAYER_OWNED_LUXURY_EXTRA_AMENITIES
MODIFIER_PLAYER_RELIGION_ADD_PLAYER_BELIEF_YIELD
MODIFIER_PLAYER_RELIGION_ADD_RELIGIOUS_BELIEF_YIELD
MODIFIER_PLAYER_RELIGION_ADD_RELIGIOUS_BUILDING
MODIFIER_PLAYER_RELIGION_ADJUST_COMBAT_LOSS
MODIFIER_PLAYER_RELIGION_ADJUST_RELIGIOUS_SPREAD_DISTANCE
MODIFIER_PLAYER_RELIGION_ADJUST_RELIGIOUS_SPREAD_STRENGTH
MODIFIER_PLAYER_TREAT_CAPITAL_AS_HOLY_CITY
MODIFIER_PLAYER_UNIT_ADJUST_ADVANCED_PILLAGING
MODIFIER_PLAYER_UNIT_ADJUST_ATTACK_AND_MOVE
MODIFIER_PLAYER_UNIT_ADJUST_BYPASS_COMBAT_UNIT
MODIFIER_PLAYER_UNIT_ADJUST_BYPASS_WALLS
MODIFIER_PLAYER_UNIT_ADJUST_CANNOT_ATTACK
MODIFIER_PLAYER_UNIT_ADJUST_CITY_ON_CAPTURE
MODIFIER_PLAYER_UNIT_ADJUST_CLEAR_TERRAIN_START_MOVEMENT
MODIFIER_PLAYER_UNIT_ADJUST_CONVERTS_BARBARIANS
MODIFIER_PLAYER_UNIT_ADJUST_ENABLE_WALL_ATTACK
MODIFIER_PLAYER_UNIT_ADJUST_ENTER_FOREIGN_LANDS
MODIFIER_PLAYER_UNIT_ADJUST_EVICT_PERCENT
MODIFIER_PLAYER_UNIT_ADJUST_EXERT_ZOC
MODIFIER_PLAYER_UNIT_ADJUST_EXTRACT_SEA_ARTIFACTS
MODIFIER_PLAYER_UNIT_ADJUST_FLANKING_BONUS_MODIFIER
MODIFIER_PLAYER_UNIT_ADJUST_FOREIGN_SPREAD_MODIFIER
MODIFIER_PLAYER_UNIT_ADJUST_FRIENDLY_TERRITORY_COMBAT
MODIFIER_PLAYER_UNIT_ADJUST_GRANT_EXPERIENCE
MODIFIER_PLAYER_UNIT_ADJUST_GREAT_PEOPLE_POINTS_PER_KILL
MODIFIER_PLAYER_UNIT_ADJUST_HEAL
MODIFIER_PLAYER_UNIT_ADJUST_HEAL_PER_TURN
MODIFIER_PLAYER_UNIT_ADJUST_HIDDEN_VISIBILITY
MODIFIER_PLAYER_UNIT_ADJUST_IGNORE_CLIFF_WALLS
MODIFIER_PLAYER_UNIT_ADJUST_IGNORE_RIVERS
MODIFIER_PLAYER_UNIT_ADJUST_IGNORE_SHORES
MODIFIER_PLAYER_UNIT_ADJUST_IGNORE_TERRAIN_COST
MODIFIER_PLAYER_UNIT_ADJUST_IGNORE_ZOC
MODIFIER_PLAYER_UNIT_ADJUST_INITIATION_GOLD
MODIFIER_PLAYER_UNIT_ADJUST_MILITARY_FORMATION
MODIFIER_PLAYER_UNIT_ADJUST_MOVE_AND_ATTACK
MODIFIER_PLAYER_UNIT_ADJUST_MOVEMENT
MODIFIER_PLAYER_UNIT_ADJUST_NATURAL_WONDER_DEFERRED_CHARGES
MODIFIER_PLAYER_UNIT_ADJUST_NO_FOREIGN_SPREAD
MODIFIER_PLAYER_UNIT_ADJUST_NO_REDUCTION_DAMAGE
MODIFIER_PLAYER_UNIT_ADJUST_RELIC_UPON_DEATH
MODIFIER_PLAYER_UNIT_ADJUST_SEA_MOVEMENT
MODIFIER_PLAYER_UNIT_ADJUST_SEE_HIDDEN
MODIFIER_PLAYER_UNIT_ADJUST_SEE_THROUGH_FEATURES
MODIFIER_PLAYER_UNIT_ADJUST_SIGHT
MODIFIER_PLAYER_UNIT_ADJUST_SPREAD_CHARGES
MODIFIER_PLAYER_UNIT_ADJUST_SPY_ESTABLISH_TIME
MODIFIER_PLAYER_UNIT_ADJUST_SPY_OPERATION_CHANCE
MODIFIER_PLAYER_UNIT_ADJUST_SPY_OPERATION_TIME
MODIFIER_PLAYER_UNIT_ADJUST_SUPPORT_BONUS_MODIFIER
MODIFIER_PLAYER_UNIT_ADJUST_TRADE_ROUTE_PLUNDER_IMMUNITY
MODIFIER_PLAYER_UNIT_ADJUST_UNIT_EXPERIENCE_MODIFIER
MODIFIER_PLAYER_UNIT_ADJUST_UPGRADE_GOODY_HUT
MODIFIER_PLAYER_UNIT_BOOST_ALL_SPIES
MODIFIER_PLAYER_UNIT_ESCAPE_BOOST
MODIFIER_PLAYER_UNIT_GRANT_ADJACENT_FEATURE_YIELD
MODIFIER_PLAYER_UNIT_GRANT_ADJACENT_TERRAIN_YIELD
MODIFIER_PLAYER_UNIT_GRANT_AIR_SLOTS
MODIFIER_PLAYER_UNIT_GRANT_HEAL_AFTER_ACTION
MODIFIER_PLAYER_UNIT_GRANT_UNIT_WITH_EXPERIENCE
MODIFIER_PLAYER_UNIT_GRANT_UNLIMITED_PROMOTION_CHOICES
MODIFIER_PLAYER_UNITS_ADJUST_ATTACK_RANGE
MODIFIER_PLAYER_UNITS_ADJUST_BARBARIAN_COMBAT
MODIFIER_PLAYER_UNITS_ADJUST_BUILDER_CHARGES
MODIFIER_PLAYER_UNITS_ADJUST_COMBAT_DIFFICULTY
MODIFIER_PLAYER_UNITS_ADJUST_COMBAT_STRENGTH
MODIFIER_PLAYER_UNITS_ADJUST_EXTRA_UNIT_COPY
MODIFIER_PLAYER_UNITS_ADJUST_EXTRA_UNIT_COPY_TAG
MODIFIER_PLAYER_UNITS_ADJUST_FLANKING_BONUS_MODIFIER
MODIFIER_PLAYER_UNITS_ADJUST_FRIENDLY_TERRITORY_START_MOVEMENT
MODIFIER_PLAYER_UNITS_ADJUST_GRANT_EXPERIENCE
MODIFIER_PLAYER_UNITS_ADJUST_HEAL_FROM_COMBAT
MODIFIER_PLAYER_UNITS_ADJUST_HEAL_PER_TURN
MODIFIER_PLAYER_UNITS_ADJUST_IGNORE_SHORES
MODIFIER_PLAYER_UNITS_ADJUST_OWNER
MODIFIER_PLAYER_UNITS_ADJUST_PER_LUXURY_ATTACK_MODIFIER
MODIFIER_PLAYER_UNITS_ADJUST_PLUNDER_YIELDS
MODIFIER_PLAYER_UNITS_ADJUST_POST_COMBAT_YIELD
MODIFIER_PLAYER_UNITS_ADJUST_SEA_MOVEMENT
MODIFIER_PLAYER_UNITS_ADJUST_SPREAD_CHARGES
MODIFIER_PLAYER_UNITS_ADJUST_SPY_OPERATION_TIME
MODIFIER_PLAYER_UNITS_ADJUST_STRENGTH_REDUCTION_FOR_DAMAGE_MODIFIER
MODIFIER_PLAYER_UNITS_ADJUST_UNIT_ATTACK_EXPERIENCE_MODIFIER
MODIFIER_PLAYER_UNITS_ADJUST_UNIT_EXPERIENCE_MODIFIER
MODIFIER_PLAYER_UNITS_ADJUST_UNIT_PRODUCTION
MODIFIER_PLAYER_UNITS_ADJUST_VALID_TERRAIN
MODIFIER_PLAYER_UNITS_ATTACH_MODIFIER
MODIFIER_PLAYER_UNITS_GRANT_ABILITY
MODIFIER_PLAYER_UNITS_GRANT_PROMOTION
MODIFIER_SINGLE_CITY_ADJUST_BUILDING_HOUSING
MODIFIER_SINGLE_CITY_ADJUST_CITY_AMENITIES_FROM_GREAT_PEOPLE
MODIFIER_SINGLE_CITY_ADJUST_CITY_AMENITIES_FROM_RELIGION
MODIFIER_SINGLE_CITY_ADJUST_CITY_APPEAL
MODIFIER_SINGLE_CITY_ADJUST_CITY_HOUSING_FROM_GREAT_PEOPLE
MODIFIER_SINGLE_CITY_ADJUST_CITY_YIELD_MODIFIER
MODIFIER_SINGLE_CITY_ADJUST_EXTRA_GREAT_WORK_SLOTS
MODIFIER_SINGLE_CITY_ADJUST_GREATWORK_YIELD
MODIFIER_SINGLE_CITY_ADJUST_IMPROVEMENT_HOUSING
MODIFIER_SINGLE_CITY_ADJUST_LAKE_ENTERTAINMENT
MODIFIER_SINGLE_CITY_ADJUST_TOURISM
MODIFIER_SINGLE_CITY_ADJUST_TOURISM_LATE_ERAS
MODIFIER_SINGLE_CITY_ADJUST_TRADE_ROUTE_YIELD_FROM_OTHERS
MODIFIER_SINGLE_CITY_ADJUST_TRADE_ROUTE_YIELD_TO_OTHERS
MODIFIER_SINGLE_CITY_ADJUST_WONDER_YIELD_CHANGE
MODIFIER_SINGLE_CITY_BUILDER_CHARGES
MODIFIER_SINGLE_CITY_DISTRICTS_ADJUST_GREAT_PERSON_POINTS
MODIFIER_SINGLE_CITY_EXTRA_DISTRICT
MODIFIER_SINGLE_CITY_FEATURE_ADJACENCY
MODIFIER_SINGLE_CITY_GRANT_BUILDING_IN_CITY_IGNORE
MODIFIER_SINGLE_CITY_GRANT_GREAT_PERSON_CLASS_IN_CITY
MODIFIER_SINGLE_CITY_GRANT_PRODUCTION_IN_CITY
MODIFIER_SINGLE_CITY_GRANT_RESOURCE_IN_CITY
MODIFIER_SINGLE_CITY_GRANT_UNIT_BY_CLASS_IN_NEAREST_CITY
MODIFIER_SINGLE_CITY_GRANT_UNIT_IN_CITY
MODIFIER_SINGLE_CITY_GRANT_UNIT_IN_NEAREST_CITY
MODIFIER_SINGLE_CITY_GRANT_YIELD_PER_GREAT_WORK
MODIFIER_SINGLE_CITY_RELIGIOUS_SPREADS
MODIFIER_SINGLE_PLOT_ADJUST_PLOT_YIELDS
MODIFIER_UNIT_ADJUST_ATTACK_RANGE
MODIFIER_UNIT_ADJUST_COMBAT_CAPTURE
MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH
MODIFIER_UNIT_ADJUST_ESCORT_MOBILITY
MODIFIER_UNIT_ADJUST_NUM_ATTACKS
MODIFIER_UNIT_ADJUST_POST_COMBAT_YIELD
MODIFIER_UNIT_ADJUST_RAIDING
MODIFIER_UNIT_GRANT_PLOT
Many of those having additional settings in ModifierArguments.
Nice list (that's 339 modifiers)
 
Something I've noticed or am doing wrong (hopefully the latter) is that you can't add requirement sets to just any modifier/modifier argument. Some modifiertypes have "legal" requirements coded to them.
Take the code for the Unit Ability: Anti-Cavalry Combat Bonus
Code:
<Types>
       <Row Type="ABILITY_ANTI_CAVALRY" Kind="KIND_ABILITY"/>
</Types>
<TypeTags>
       <Row Type="ABILITY_ANTI_CAVALRY" Tag="CLASS_ANTI_CAVALRY"/>
</TypeTags>
<UnitAbilities>
       <Row UnitAbilityType="ABILITY_ANTI_CAVALRY" Name="LOC_ABILITY_ANTI_CAVALRY_NAME" Description="LOC_ABILITY_ANTI_CAVALRY_DESCRIPTION"/>
</UnitAbilities>
<UnitAbilityModifiers>
       <Row>
           <UnitAbilityType>ABILITY_ANTI_CAVALRY</UnitAbilityType>
           <ModifierId>ANTI_CAVALRY_COMBAT_BONUS</ModifierId>
       </Row>
</UnitAbilityModifiers>
]<Modifiers>
        <Row>
            <ModifierId>ANTI_CAVALRY_COMBAT_BONUS</ModifierId>
            <ModifierType>MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH</ModifierType>
            <SubjectRequirementSetId>ANTI_CAVALRY_OPPONENT_REQUIREMENTS</SubjectRequirementSetId>
        </Row>
</Modifiers>
<ModifierArguments>
       <Row>
           <ModifierId>ANTI_CAVALRY_COMBAT_BONUS</ModifierId>
           <Name>Amount</Name>
           <Value>10</Value>
       </Row>
<ModifierArguments>
<RequirementSets>
       <Row>
           <RequirementSetId>ANTI_CAVALRY_OPPONENT_REQUIREMENTS</RequirementSetId>
           <RequirementSetType>REQUIREMENTSET_TEST_ANY</RequirementSetType>
       </Row>
</RequirementSets>
<RequirementSetRequirements>
       <Row>
           <RequirementSetId>ANTI_CAVALRY_OPPONENT_REQUIREMENTS</RequirementSetId>
           <RequirementId>ANTI_CAVALRY_OPPONENT_REQUIREMENT_LC</RequirementId>
       </Row>
       <Row>
           <RequirementSetId>ANTI_CAVALRY_OPPONENT_REQUIREMENTS</RequirementSetId>
           <RequirementId>ANTI_CAVALRY_OPPONENT_REQUIREMENT_HC</RequirementId>
       </Row>
</RequirementSetRequirements>
<Requirements>
       <Row>
           <RequirementId>ANTI_CAVALRY_OPPONENT_REQUIREMENT_LC</RequirementId>
           <RequirementType>REQUIREMENT_OPPONENT_UNIT_TAG_MATCHES</RequirementType>
       </Row>
       <Row>
           <RequirementId>ANTI_CAVALRY_OPPONENT_REQUIREMENT_HC</RequirementId>
           <RequirementType>REQUIREMENT_OPPONENT_UNIT_TAG_MATCHES</RequirementType>
       </Row>
</Requirements>
<RequirementArguments>
       <Row>
           <RequirementId>ANTI_CAVALRY_OPPONENT_REQUIREMENT_LC</RequirementId>
           <Name>Tag</Name>
           <Value>CLASS_LIGHT_CAVALRY</Value>
       </Row>
       <Row>
           <RequirementId>ANTI_CAVALRY_OPPONENT_REQUIREMENT_HC</RequirementId>
           <Name>Tag</Name>
           <Value>CLASS_HEAVY_CAVALRY</Value>
       </Row>
</RequirementArguments>
<ModifierStrings>
       <Row ModifierId="ANTI_CAVALRY_COMBAT_BONUS" Context="Preview" Text="LOC_ABILITY_ANTI_CAVALRY_MODIFIER_DESCRIPTION"/>
</ModifierStrings>
This is everything it takes to give Anti-Cav units their bonuses against Light and Heavy Cavalry. You replace the requirements on MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH by searching through promotions and unit abilities. For example, let's say I wanted anti-cav units to do bonus damage to wounded units. It doesn't make sense but illustrates the options. I can rename the ability to ABILITY_ANTI_CAVALRY_VULTURE in all the places that it currently states ABILITY_ANTI_CAVALRY, and change ANTI_CAVALRY_COMBAT_BONUS to ANTI_CAVALRY_VULTURE_BONUS but there will just now be two of the same exact ability in the game, but that's not exactly what I want. No thanks, so I change the modifiertype and its requirements, right? The promotion Rout, which give bonus damage to wounded units also uses MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH, but it's requirements are different. Its requirementsetid is VULTURE_REQUIREMENTS. Replace the requirements and all that, then change the modifierarguments with
Code:
<Row>
           <ModifierId>VULTURE_BONUS_VS_DAMAGED</ModifierId>
           <Name>Amount</Name>
           <Value>5</Value>
       </Row>
and voila, you have a new-ish ability for anti-cav.
Perhaps we should document all the known requirementsetids, and which modifiertypes they're connected to.

On the flipside I tried to make the game give me envoys when I capture or liberate a city, and it did not seem to like that at all.
I took from the code for diplomatic actions:
Code:
<Row>
           <ModifierId>STANDARD_DIPLOMATIC_LIBERATED_CITY</ModifierId>
           <ModifierType>MODIFIER_PLAYER_DIPLOMACY_SIMPLE_MODIFIER</ModifierType>
           <SubjectRequirementSetId>PLAYER_CITY_LIBERATED</SubjectRequirementSetId>
       </Row>
which I tried to turn into
Code:
<Row>
           <ModifierId>TRAIT_PERSIAN_LIBERATION</ModifierId>
           <ModifierType>MODIFIER_PLAYER_GRANT_INFLUENCE_TOKEN</ModifierType>
           <SubjectRequirementSetId>PLAYER_CITY_LIBERATED</SubjectRequirementSetId>
       </Row>
At present, this with everything spelled out in the code will not work, or I don't know what I'm doing.
 
Some modifiertypes have "legal" requirements coded to them... <snip> ...
On the flipside I tried to make the game give me envoys when I capture or liberate a city, and it did not seem to like that at all.
It would make sense that you can't assign any requirement to any modifier considering the vast number of game mechanisms covered by modifiers. Imagine you try to assign "DISTRICT_IS_CAMPUS" instead of vulture as
SubjectRequirementSetId for your new combat promotion. You would end up with a unit that's stronger when it attacks ... a Campus :rolleyes: That simply wouldn't make sense!
So probably requirements are only accepted if they make sense for the modifier. Of course your example does make sense but if the developers didn't consider this situation, there might not be any code to handle it and so from a programming PoV, it still doesn't make sense. (I hope what i just wrote makes sense :crazyeye:)
 
The whole way modifiers are handled is a nightmare. Some modifiers having several different entries in the modifier arguments table is simply terrible practice.
 
. Imagine you try to assign "DISTRICT_IS_CAMPUS" instead of vulture as
SubjectRequirementSetId for your new combat promotion. You would end up with a unit that's stronger when it attacks ... a Campus :rolleyes: That simply wouldn't make sense!
Whether it makes sense or not shouldn't really be an issue. It should work with computer logic and produce no result in game because you don't attack campuses. Let's say you want to make a unit called the Tenured Professor who does more theological damage when occupying a campus district! I can understand it not being able to read a newly crafted requirement, but mixing and matching requirements should be rather easy. Maybe when we have the sdk. I've noticed a lot of notes in the code such as "We need a better way of doing x" or "Redo this" Who knows!
 
Let's say you want to make a unit called the Tenured Professor who does more theological damage when occupying a campus district!
Well, that wouldn't work with "DISTRICT_IS_CAMPUS" anyway because it would need a requirement like "IS_ON_DISTRICT_TILE" or something that doesn't exist in the code. For the code, there is a world of a difference between being a campus and being on a campus. Even if for our mind those seem like very similar requirements, for the code it's an "apple to Sunday" comparison.
The whole way modifiers are handled is a nightmare. Some modifiers having several different entries in the modifier arguments table is simply terrible practice.
It's a nightmare but it also makes them very flexible. You would need 6 different trade route modifier types instead of just "MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD" if you wanted to only set a single value in ModifierArguments (and the entire table would be useless then, because a single value could be just another column in Modifiers). Here we have a single modifier type that works for every existing and future yield. Pretty powerful and flexible. Actually it doesn't look like terrible practice to me (thought i'm not a professional coder) but rather a very powerful tool which, like every powerful tool, requires a learning curve.
 
Well, that wouldn't work with "DISTRICT_IS_CAMPUS" anyway because it would need a requirement like "IS_ON_DISTRICT_TILE" or something that doesn't exist in the code. For the code, there is a world of a difference between being a campus and being on a campus. Even if for our mind those seem like very similar requirements, for the code it's an "apple to Sunday" comparison.

Okay I know we just said the game would have a hard time with this, but fate is cruel:
Code:
<Row>
           <RequirementSetId>GARRISON_PLOT_REQUIREMENTS</RequirementSetId>
           <RequirementId>ATTACKER_IS_OCCUPYING_DISTRICT_REQUIREMENT</RequirementId>
       </Row>
<Row>
           <RequirementId>ATTACKER_IS_OCCUPYING_DISTRICT_REQUIREMENT</RequirementId>
           <RequirementType>REQUIREMENT_ATTACKER_PLOT_HAS_ANY_DISTRICT</RequirementType>
       </Row>
<Row>
           <RequirementSetId>URBAN_WARFARE_REQUIREMENTS</RequirementSetId>
           <RequirementId>DEFENDER_IS_OCCUPYING_DISTRICT_REQUIREMENT</RequirementId>
       </Row>
<Row>
           <RequirementSetId>URBAN_RAIDER_REQUIREMENTS</RequirementSetId>
           <RequirementId>DEFENDER_IS_OCCUPYING_DISTRICT_REQUIREMENT</RequirementId>
       </Row>
       <Row>
           <RequirementId>DEFENDER_IS_OCCUPYING_DISTRICT_REQUIREMENT</RequirementId>
           <RequirementType>REQUIREMENT_PLOT_HAS_ANY_DISTRICT</RequirementType>
       </Row>

These all modify MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH

There's even this!
Code:
<Row>
           <RequirementSetId>SHELLS_REQUIREMENTS</RequirementSetId>
           <RequirementId>OPPONENT_IS_DISTRICT</RequirementId>
       </Row>
It's hard to specify what you get bonuses in. There's one that specifies the CITY-CENTER, but without test I can't tell if it would accept anything else.
Code:
<Row>
           <RequirementId>OPPONENT_PLOT_IS_CITY_CENTER_REQUIREMENT</RequirementId>
           <Name>DistrictType</Name>
           <Value>DISTRICT_CITY_CENTER</Value>
       </Row>
As long as you're modifying unit combat strength, you're largely covered.
I tried to get faith from garrisoned units, by using the garrison requirements to adjust the yield change of a city. That doesn't work.


MAJOR EDIT:
User @Mav12 created a civ that incorporates unique subjectrequirementsetid and RequirementID. You can check it out here: http://forums.civfanatics.com/threads/new-york-state-civ.604486/#post-14554806
It takes just naming both of them as unique, mixing and matching becomes doable. Wow wow wow, amazing.
 
Last edited:
These all modify MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH
Of course there are promotions that modify strength based on districts, the melee line has at least one. I never told it was impossible to have a promotion based on a district, in my example i told there is no requirement that checks whether a unit is on a Campus. Good luck using those together with DISTRICT_IS_CAMPUS to create your grumpy professor unique unit.
There's even this!
Code:
<Row>
           <RequirementSetId>SHELLS_REQUIREMENTS</RequirementSetId>
           <RequirementId>OPPONENT_IS_DISTRICT</RequirementId>
       </Row>
Siege line promotion that (in game) states +10 str against district defenses (so i guess when you are bombarding an Encampment). Again, it's a totally different code.

Everything is possible as long as you have a piece of code to handle your requirements, but if you try to use a requirement for something it's not supposed to handle (like using DISTRICT_IS_CAMPUS to check whether a unit is on campus rather than check whether a given district is a campus), it's bound to fail.
I tried to get faith from garrisoned units, by using the garrison requirements to adjust the yield change of a city. That doesn't work.
How? Did you try using the policy req (from the +1 amenity card) on a custom policy card that gives faith? That's something i would think should work.
MAJOR EDIT:
User @Mav12 created a civ that incorporates unique subjectrequirementsetid and RequirementID. You can check it out here: http://forums.civfanatics.com/threads/new-york-state-civ.604486/#post-14554806
It takes just naming both of them as unique, mixing and matching becomes doable. Wow wow wow, amazing.
Will have to look at this.
 
Yeah I think Mav12's code enables what we've been trying to sort out. We could probably create the requirement DISTRICT_IS_CAMPUS which would ultimately denote, as with the city-center requirement that we could use the District.

I think we're in agreement about the possibilities, although it may have sounded like I was in disagreement with you. That's my mistake, sorry!

Yeah I tried using the policy req from the amenity card to give a leader a unique ability but I didn't know you could create unique requirements, up to a point.
 
I'm struggling as well with the modifiers, but bit by bit I'm starting to learn the 'maze' that is can be at first glance.
Perhaps my journey could help others, so here is what I wanted and how I accomplished this.

Goal: Create a civil-war/unrest mechanic, when a certain tech is researched, lower the amenities of all cities.

I looked through the code and found an interesting modifier and placed all related stuff in a seperate file and placed them in an order that I could read and understand, this is what I got:
Code:
 <GovernmentModifiers>
  <Row GovernmentType="GOVERNMENT_CLASSICAL_REPUBLIC">
   <ModifierId>CLASSICAL_REPUBLIC_AMENITY</ModifierId>
  </Row>
 </GovernmentModifiers>
 <Modifiers>
  <Row>
   <ModifierId>CLASSICAL_REPUBLIC_AMENITY</ModifierId>
   <ModifierType>MODIFIER_PLAYER_CITIES_ADJUST_POLICY_AMENITY</ModifierType>
   <SubjectRequirementSetId>CITY_HAS_1_SPECIALTY_DISTRICT</SubjectRequirementSetId>
  </Row>
 </Modifiers>
 <DynamicModifiers>
  <Row>
   <ModifierType>MODIFIER_PLAYER_CITIES_ADJUST_POLICY_AMENITY</ModifierType>
   <CollectionType>COLLECTION_PLAYER_CITIES</CollectionType>
   <EffectType>EFFECT_ADJUST_POLICY_AMENITY</EffectType>
  </Row>
 </DynamicModifiers>
 <ModifierArguments>
  <Row>
   <ModifierId>CLASSICAL_REPUBLIC_AMENITY</ModifierId>
   <Name>Amount</Name>
   <Value>1</Value>
  </Row>
 </ModifierArguments>
I then changed it for my own purposes to this in my mod:
Code:
 <TechnologyModifiers>
  <Row>
   <TechnologyType>TECH_START_CIVIL_WAR</TechnologyType>
   <ModifierId>START_CIVIL_WAR</ModifierId>
  </Row>
 </TechnologyModifiers>
 <Modifiers>
  <Row>
   <ModifierId>START_CIVIL_WAR</ModifierId>
   <ModifierType>MODIFIER_PLAYER_CITIES_ADJUST_POLICY_AMENITY</ModifierType>
   <OwnerRequirementSetId>PLAYER_IS_HUMAN</OwnerRequirementSetId>
  </Row>
 </Modifiers>
 <ModifierArguments>
  <Row>
   <ModifierId>START_CIVIL_WAR</ModifierId>
   <Name>Amount</Name>
   <Value>-10</Value>
  </Row>
 </ModifierArguments>

And it worked nicely (although, -10 amenities might need a bit of tweaking. ;)).
The real difficulty is ploughing through the maze, by placing interesting modifiers in a seperate file I managed to accomplish most of my needs so far.
 

Attachments

  • 1.jpg
    1.jpg
    1.5 MB · Views: 303
  • 2.jpg
    2.jpg
    1.5 MB · Views: 213
  • 3.jpg
    3.jpg
    1.5 MB · Views: 196
That's my mistake, sorry!
No need to be sorry. I wasn't sure you understood me, but i didn't know how to better explain it, english is a foreign language and i'm no coder so i probably used half appropriate words.

Creating new requirements would of course be great. Being able to do it without access to the code would be quite formidable, and as it occurs, it looks like there are tables for that in the database! :woohoo:
Requirements, RequirementArguments and a few others seem to control how individual requirements work. Even this doesn't seem to be hard coded so the possibilities could endless.
 
Check out Game Effects.xml! If you cross reference this with the modifiers table, you'll be able to create pretty much anything, so long as it is a preexisting effect, it seems.
 
It's a nightmare but it also makes them very flexible. You would need 6 different trade route modifier types instead of just "MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD" if you wanted to only set a single value in ModifierArguments (and the entire table would be useless then, because a single value could be just another column in Modifiers). Here we have a single modifier type that works for every existing and future yield. Pretty powerful and flexible. Actually it doesn't look like terrible practice to me (thought i'm not a professional coder) but rather a very powerful tool which, like every powerful tool, requires a learning curve.

I understand what you mean and, although I do a substantial amount of code for my job, I wouldn't call myself a programmer by any stretch. But code like this is mind numbingly hard to understand
Code:
        <Row>
            <UnitPromotionType>PROMOTION_CHOKE_POINTS</UnitPromotionType>
            <ModifierId>CHOKE_POINTS_BONUS</ModifierId>
        </Row>
...
        <Row>
            <ModifierId>CHOKE_POINTS_BONUS</ModifierId>
            <ModifierType>MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH</ModifierType>
            <SubjectRequirementSetId>CHOKE_POINTS_REQUIREMENTS</SubjectRequirementSetId>
        </Row>
...
        <Row>
            <RequirementSetId>CHOKE_POINTS_REQUIREMENTS</RequirementSetId>
            <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
        </Row>
        <Row>
            <RequirementSetId>CHOKE_POINTS_PLOT_REQUIREMENTS</RequirementSetId>
            <RequirementSetType>REQUIREMENTSET_TEST_ANY</RequirementSetType>
        </Row>
...
        <Row>
            <RequirementId>CHOKE_POINTS_PLOT_REQUIREMENTS_MET_REQUIREMENT</RequirementId>
            <Name>RequirementSetId</Name>
            <Value>CHOKE_POINTS_PLOT_REQUIREMENTS</Value>
        </Row>
...
        <Row>
            <RequirementSetId>CHOKE_POINTS_REQUIREMENTS</RequirementSetId>
            <RequirementId>CHOKE_POINTS_PLOT_REQUIREMENTS_MET_REQUIREMENT</RequirementId>
        </Row>
...
        <Row>
            <RequirementId>CHOKE_POINTS_PLOT_REQUIREMENTS_MET_REQUIREMENT</RequirementId>
            <RequirementType>REQUIREMENT_REQUIREMENTSET_IS_MET</RequirementType>
        </Row>

That's all for a single promotion, and only about half the code. The fact there is an entire table called <RequirementSetRequirements> is madness!
 
I created this diagram to represent the different relationships between the tables relating to modifiers:



Here's my basic rundown of modifiers:

XModifiers (TraitModifiers, BuildingModifiers, BeliefModifiers, etc.): Attaches a modifier to a particular entity.

Modifiers: Specifies a ModifierType and RequirementSets (see below). SubjectRequirementSetId specifies a requirement set for the entity that the modifier is applied to. OwnerRequirementSetId specifies a requirement set for the entity that the modifier is attached to. In the vast majority of cases you'll want to use the former.

DynamicModifiers: The table that stores the modifier types. Specifies an EffectType and CollectionType. The EffectType is the hard-coded effect that is applied when the modifier is active and the requirements are met. The CollectionType (again hard-coded) is what the modifier applies to, i.e. its subjects. The separation of this table from the Modifiers table enables modifier types to be reused and refashioned.

ModifierArguments: Specifies the arguments for a particular Modifier. The valid arguments depend on the EffectType, not the Modifier or ModifierType. The valid arguments and their meaning can mostly be discerned from the XML files in Base/Assets/Gameplay/Data.

RequirementSets: Stores lists of requirements. The RequirementSetType column can either be REQUIREMENTSET_TEST_ALL or REQUIREMENTSET_TEST_ANY. The former specifies that the modifier will only apply if all of the requirements in the requirement set are met. The latter specifies that it will apply if any of the requirements listed are met.

RequirementSetRequirements: Not as redundant as it sounds. This is an associative table that assigns requirements to requirement sets.

Requirements: Specifies requirements, assigning a hard-coded RequirementType to the requirement. This table has an Inverse column that negates the requirement, i.e. the requirement is 'met' when the RequirementType isn't.

RequirementArguments: Akin to ModifierArguments, specifying arguments for a requirement. The valid arguments depend on the RequirementType.

There's a few columns I've neglected to mention, but I just wanted to give a basic rundown of the different tables. I'm working on a modifier tutorial and reference on my website that I hope to complete soon.
 
Last edited:
code like this is mind numbingly hard to understand
Not trying to argue because yes, it's much more complicated when you see it than the Civ5 one row, many columns system (but again,that's probably the price to pay for being able to add many different modifiers without touching the c++ code)
Did you try looking at the actual sqlite database rather than the individual lines of xml. Personally i find it much easier to understand the structure of the database when seeing it like a spreadsheet in an application like sqliteSpy than try to figure things out of the xml in a text editor. It might help you get the "big picture" and understand how it's built.
I created this diagram to represent the different relationships between the tables relating to modifiers:
That's incredibly useful. Thanks for this.
 
Thanks NycholusV, that sounds very helpful. Do let me know when you're guide is completed!

I did eventually understand what was going on. Going in the sql helped considerably. I am split between the added power and flexibility of such an approach, and the inherent complexity of it. To be fair, the criticism I feel about the system now is mostly aimed at the names they used for things. They have 6 different tables (lefthand side of that diagram) with only 4 different words in their name! It's hard not to be reminded of this old gem
 
Top Bottom