Skip to content

modifiers Requirement Types

ghost-ng edited this page Jan 29, 2026 · 3 revisions

Requirement Types Reference

Requirements are conditions that control when modifiers activate. They check game state and return true or false.

How Requirements Work

Requirements are combined into RequirementSets which define how the conditions combine:

RequirementSet Type Logic
REQUIREMENTSET_TEST_ALL All requirements must pass (AND)
REQUIREMENTSET_TEST_ANY Any requirement can pass (OR)

Inverting Requirements

Any requirement can be inverted with Inverse="true":

<Requirement type="REQUIREMENT_PLAYER_IS_HUMAN" Inverse="true"/>
<!-- Returns true when player is AI -->

Owner vs Subject Requirements

Modifiers have two requirement contexts:

Context Checks Against Use For
OwnerRequirements The modifier's owner Activation conditions (player has tech, trait, etc.)
SubjectRequirements Each subject in collection Filtering subjects (specific cities, units, plots)

City Requirements

REQUIREMENT_CITY_HAS_BUILDING

Checks if city has a specific building.

Argument Type Description
BuildingType TEXT Building type to check for
<Requirement type="REQUIREMENT_CITY_HAS_BUILDING">
    <Argument name="BuildingType">BUILDING_GRANARY</Argument>
</Requirement>

REQUIREMENT_CITY_HAS_BUILD_QUEUE

Checks if city has a build queue (is a full city, not a town).

<Requirement type="REQUIREMENT_CITY_HAS_BUILD_QUEUE"/>
<!-- Use Inverse="true" to check for towns -->

REQUIREMENT_CITY_IS_CITY

Checks if settlement is a city (not town).

<Requirement type="REQUIREMENT_CITY_IS_CITY"/>

REQUIREMENT_CITY_FOLLOWS_RELIGION

Checks if city follows a specific religion.

Argument Type Description
ReligionType TEXT Religion type to check
<Requirement type="REQUIREMENT_CITY_FOLLOWS_RELIGION">
    <Argument name="ReligionType">RELIGION_BUDDHISM</Argument>
</Requirement>

REQUIREMENT_CITY_FOUNDED_WITH_X_BIOME_TILES

Checks biome tiles at city founding location.

Argument Type Description
BiomeType TEXT Biome type
Amount INTEGER Minimum tiles

Plot Requirements

REQUIREMENT_PLOT_TERRAIN_TYPE_MATCHES

Checks plot terrain type.

Argument Type Description
TerrainType TEXT Terrain type

Terrain Types:

  • TERRAIN_GRASS, TERRAIN_PLAINS, TERRAIN_DESERT
  • TERRAIN_TUNDRA, TERRAIN_SNOW, TERRAIN_COAST
  • TERRAIN_OCEAN, TERRAIN_HILL, TERRAIN_MOUNTAIN
<Requirement type="REQUIREMENT_PLOT_TERRAIN_TYPE_MATCHES">
    <Argument name="TerrainType">TERRAIN_HILL</Argument>
</Requirement>

REQUIREMENT_PLOT_BIOME_TYPE_MATCHES

Checks plot biome.

Argument Type Description
BiomeType TEXT Biome type

Biome Types:

  • BIOME_GRASSLANDS, BIOME_PLAINS, BIOME_DESERT
  • BIOME_TUNDRA, BIOME_TROPICAL, BIOME_MARINE
<Requirement type="REQUIREMENT_PLOT_BIOME_TYPE_MATCHES">
    <Argument name="BiomeType">BIOME_DESERT</Argument>
</Requirement>

REQUIREMENT_PLOT_FEATURE_TYPE_MATCHES

Checks for a specific feature on the plot.

Argument Type Description
FeatureType TEXT Feature type

Common Features:

  • FEATURE_FOREST, FEATURE_JUNGLE, FEATURE_MARSH
  • FEATURE_OASIS, FEATURE_FLOODPLAINS, FEATURE_REEF
  • FEATURE_NAVIGABLE_RIVER, FEATURE_MOUNTAIN_PASSABLE

REQUIREMENT_PLOT_DISTRICT_CLASS

Checks district class on the plot.

Argument Type Description
DistrictClass TEXT District class(es)

District Classes:

  • CITYCENTER, URBAN, RURAL, WONDER
<Requirement type="REQUIREMENT_PLOT_DISTRICT_CLASS">
    <Argument name="DistrictClass">RURAL, URBAN, CITYCENTER</Argument>
</Requirement>

REQUIREMENT_PLOT_HAS_CONSTRUCTIBLE

Checks if plot has a specific constructible (building/improvement).

Argument Type Description
ConstructibleType TEXT Constructible type
<Requirement type="REQUIREMENT_PLOT_HAS_CONSTRUCTIBLE">
    <Argument name="ConstructibleType">IMPROVEMENT_FARM</Argument>
</Requirement>

REQUIREMENT_PLOT_ADJACENT_CONSTRUCTIBLE_TYPE_MATCHES

Checks if plot is adjacent to a constructible of a specific type.

Argument Type Description
ConstructibleType TEXT Constructible type
<Requirement type="REQUIREMENT_PLOT_ADJACENT_CONSTRUCTIBLE_TYPE_MATCHES">
    <Argument name="ConstructibleType">BUILDING_LIBRARY</Argument>
</Requirement>

REQUIREMENT_PLOT_IS_RIVER

Checks if plot is on a river.

Argument Type Description
Navigable BOOLEAN Require navigable river

REQUIREMENT_PLOT_IS_LAKE

Checks if plot is a lake.

REQUIREMENT_PLOT_ADJACENT_TO_COAST

Checks if plot is adjacent to coast.

REQUIREMENT_PLOT_ADJACENT_TO_LAKE

Checks if plot is adjacent to a lake.

REQUIREMENT_PLOT_ADJACENT_TO_RIVER

Checks if plot is adjacent to a river.

Argument Type Description
Navigable BOOLEAN Require navigable river
<Requirement type="REQUIREMENT_PLOT_ADJACENT_TO_RIVER">
    <Argument name="Navigable">true</Argument>
</Requirement>

REQUIREMENT_PLOT_RESOURCE_VISIBLE

Checks if plot has a visible (revealed) resource.

REQUIREMENT_PLOT_IS_HOMELANDS

Checks if plot is in player's homelands (near starting location).

REQUIREMENT_PLOT_ADJACENT_TO_OWNER

Checks if plot is adjacent to owner's territory.


Unit Requirements

REQUIREMENT_UNIT_TAG_MATCHES

Checks if unit has a specific tag.

Argument Type Description
Tag TEXT Unit class tag

Common Unit Tags:

  • UNIT_CLASS_COMBAT, UNIT_CLASS_NON_COMBAT
  • UNIT_CLASS_MELEE, UNIT_CLASS_RANGED, UNIT_CLASS_SIEGE
  • UNIT_CLASS_INFANTRY, UNIT_CLASS_CAVALRY, UNIT_CLASS_MOUNTED
  • UNIT_CLASS_NAVAL, UNIT_CLASS_AIRCRAFT
  • UNIT_CLASS_HEAVY, UNIT_CLASS_LIGHT, UNIT_CLASS_COMMAND
<Requirement type="REQUIREMENT_UNIT_TAG_MATCHES">
    <Argument name="Tag">UNIT_CLASS_INFANTRY</Argument>
</Requirement>

REQUIREMENT_OPPONENT_UNIT_TAG_MATCHES

Checks if opponent unit in combat has a specific tag.

Argument Type Description
Tag TEXT Unit class tag
<Requirement type="REQUIREMENT_OPPONENT_UNIT_TAG_MATCHES">
    <Argument name="Tag">UNIT_CLASS_MELEE</Argument>
</Requirement>

REQUIREMENT_UNIT_DOMAIN_MATCHES

Checks unit domain.

Argument Type Description
UnitDomain TEXT Domain type

Domain Types:

  • DOMAIN_LAND, DOMAIN_SEA, DOMAIN_AIR
<Requirement type="REQUIREMENT_UNIT_DOMAIN_MATCHES">
    <Argument name="UnitDomain">DOMAIN_SEA</Argument>
</Requirement>

REQUIREMENT_UNIT_TYPE_MATCHES

Checks for a specific unit type.

Argument Type Description
UnitType TEXT Specific unit type
<Requirement type="REQUIREMENT_UNIT_TYPE_MATCHES">
    <Argument name="UnitType">UNIT_MISSIONARY</Argument>
</Requirement>

REQUIREMENT_UNIT_CLASS_MATCHES

Checks unit class.

Argument Type Description
UnitClass TEXT Unit class

Player Requirements

REQUIREMENT_PLAYER_IS_HUMAN

Checks if player is human (not AI).

<Requirement type="REQUIREMENT_PLAYER_IS_HUMAN"/>
<!-- Use Inverse="true" to check for AI -->

REQUIREMENT_PLAYER_IS_MAJOR

Checks if player is a major civilization.

REQUIREMENT_PLAYER_IS_MINOR

Checks if player is a minor civilization (city-state).

REQUIREMENT_PLAYER_IS_ATTACKING

Checks if player is the attacker in combat.

REQUIREMENT_PLAYER_CIVILIZATION_TYPE_MATCHES

Checks if player is a specific civilization.

Argument Type Description
CivilizationType TEXT Civilization type
<Requirement type="REQUIREMENT_PLAYER_CIVILIZATION_TYPE_MATCHES">
    <Argument name="CivilizationType">CIVILIZATION_ROME</Argument>
</Requirement>

REQUIREMENT_PLAYER_LEADER_TYPE_MATCHES

Checks if player has a specific leader.

Argument Type Description
LeaderType TEXT Leader type
<Requirement type="REQUIREMENT_PLAYER_LEADER_TYPE_MATCHES">
    <Argument name="LeaderType">LEADER_AUGUSTUS</Argument>
</Requirement>

REQUIREMENT_PLAYER_HAS_CIVILIZATION_OR_LEADER_TRAIT

Checks if player has a specific trait (from civ or leader).

Argument Type Description
TraitType TEXT Trait type
<Requirement type="REQUIREMENT_PLAYER_HAS_CIVILIZATION_OR_LEADER_TRAIT">
    <Argument name="TraitType">TRAIT_ROME_ABILITY</Argument>
</Requirement>

REQUIREMENT_PLAYER_HAS_COMPLETED_PROGRESSION_TREE_NODE

Checks if player has researched a tech/civic.

Argument Type Description
ProgressionTreeNodeType TEXT Tech/civic node
MinDepth INTEGER Required completion depth
<Requirement type="REQUIREMENT_PLAYER_HAS_COMPLETED_PROGRESSION_TREE_NODE">
    <Argument name="ProgressionTreeNodeType">NODE_TECH_AQ_MASONRY</Argument>
    <Argument name="MinDepth">1</Argument>
</Requirement>

REQUIREMENT_PLAYER_HAS_UNLOCK

Checks if player has a specific unlock.

Argument Type Description
UnlockType TEXT Unlock type

REQUIREMENT_PLAYER_HAS_AT_LEAST_NUM_BUILDINGS

Checks if player has built at least X of a building type.

Argument Type Description
BuildingType TEXT Building type
Amount INTEGER Minimum count
<Requirement type="REQUIREMENT_PLAYER_HAS_AT_LEAST_NUM_BUILDINGS">
    <Argument name="BuildingType">BUILDING_TEMPLE</Argument>
    <Argument name="Amount">4</Argument>
</Requirement>

REQUIREMENT_PLAYER_HAS_AT_LEAST_NUM_UNIT_TYPE

Checks if player has at least X units of a type.

Argument Type Description
UnitTag TEXT Unit tag to count
Amount INTEGER Minimum count
<Requirement type="REQUIREMENT_PLAYER_HAS_AT_LEAST_NUM_UNIT_TYPE">
    <Argument name="UnitTag">UNIT_CLASS_SIEGE</Argument>
    <Argument name="Amount">3</Argument>
</Requirement>

REQUIREMENT_PLAYER_HAS_FOUNDED_X_CITIES

Checks if player has founded at least X cities.

Argument Type Description
Amount INTEGER Minimum cities

REQUIREMENT_PLAYER_HAS_AT_LEAST_NUM_CITIES_WITH_CONSTRUCTIBLE

Checks cities with a specific building.

Argument Type Description
ConstructibleType TEXT Building type
Amount INTEGER Minimum cities

REQUIREMENT_PLAYER_HAS_X_SETTLEMENTS_AT

Checks settlements at specific location types.

Argument Type Description
LocationType TEXT Location type (COAST, ISLAND, MOUNTAIN, etc.)
Amount INTEGER Minimum count

REQUIREMENT_PLAYER_HAS_X_SETTLEMENTS_IN_BIOME

Checks settlements in specific biomes.

Argument Type Description
BiomeType TEXT Biome type
Amount INTEGER Minimum count

REQUIREMENT_PLAYER_HAS_X_WONDERS

Checks if player has built at least X wonders.

Argument Type Description
Amount INTEGER Minimum wonders

REQUIREMENT_PLAYER_HAS_X_RESOURCES_IN_ONE_CITY

Checks resources in a single city.

Argument Type Description
Amount INTEGER Minimum resources

REQUIREMENT_PLAYER_TOTAL_IMPROVED_RESOURCES

Checks total improved resources of a type.

Argument Type Description
ResourceType TEXT Resource type
Amount INTEGER Minimum count

REQUIREMENT_PLAYER_CONQUERED_X_CITIES

Checks conquered cities.

Argument Type Description
Amount INTEGER Minimum conquered
IsCapital BOOLEAN Count only capitals

REQUIREMENT_PLAYER_RAZED_X_CITIES

Checks razed cities.

Argument Type Description
Amount INTEGER Minimum razed

REQUIREMENT_PLAYER_RECONQUERED_X_CITIES

Checks reconquered (liberated) cities.

Argument Type Description
Amount INTEGER Minimum reconquered

REQUIREMENT_PLAYER_TRADES_WITH_X_PLAYERS

Checks trade route diversity.

Argument Type Description
Amount INTEGER Minimum trade partners

REQUIREMENT_PLAYER_HAS_X_TRADE_ROUTES_WITH_PLAYER

Checks trade routes count.

Argument Type Description
Amount INTEGER Minimum routes
TradeRouteType TEXT Route type (NAVAL, LAND)

REQUIREMENT_PLAYER_HAS_X_VICTORY_POINTS

Checks victory points.

Argument Type Description
VictoryPointType TEXT VP category
Amount INTEGER Minimum points

REQUIREMENT_PLAYER_ELIGIBLE_CS_BONUS

Checks if player is eligible for city-state bonuses (has appropriate relationship level).


Religion Requirements

REQUIREMENT_PLAYER_IS_RELIGION_FOUNDER

Checks if player founded their religion.

REQUIREMENT_PLAYER_FOUNDED_RELIGION_WITH_BELIEF

Checks if player's religion has a specific belief.

Argument Type Description
BeliefType TEXT Belief type

Game State Requirements

REQUIREMENT_GAME_AGE_TYPE_MATCH

Checks current game age.

Argument Type Description
AgeType TEXT Age type

Age Types:

  • AGE_ANTIQUITY, AGE_EXPLORATION, AGE_MODERN
<Requirement type="REQUIREMENT_GAME_AGE_TYPE_MATCH">
    <Argument name="AgeType">AGE_ANTIQUITY</Argument>
</Requirement>

REQUIREMENT_PLAYER_DARK_AGE

Checks if player is in a dark age.


Meta Requirements

REQUIREMENT_REQUIREMENTSET_IS_MET

Checks if another requirement set is met. Useful for reusing requirement logic.

Argument Type Description
RequirementSetId TEXT RequirementSet to check
<Requirement type="REQUIREMENT_REQUIREMENTSET_IS_MET">
    <Argument name="RequirementSetId">REQSET_UNIT_CLASS_INFANTRY</Argument>
</Requirement>

The GOSSIP Requirement (Flexible)

REQUIREMENT_PLAYER_HAS_AT_LEAST_NUM_GOSSIPS

A very flexible requirement type used primarily with Narrative Events. It checks for "gossip" events that have occurred in the game.

Argument Type Description
GossipTypes TEXT Comma-separated gossip types
Additional arguments TEXT Parameters for specific gossips

Common Gossip Types:

  • GOSSIP_FOUNDED_CITY - Player founded a city
  • GOSSIP_CONSTRUCTED_BUILDING - Built a building
  • GOSSIP_RESEARCHED_TECH - Completed a technology
  • GOSSIP_DISCOVERED_WONDER - Built a wonder
  • GOSSIP_TRAINED_UNIT - Trained a unit
  • GOSSIP_WON_BATTLE - Won a combat
  • GOSSIP_FOUNDED_RELIGION - Founded a religion
<Requirement type="REQUIREMENT_PLAYER_HAS_AT_LEAST_NUM_GOSSIPS">
    <Argument name="GossipTypes">GOSSIP_FOUNDED_CITY</Argument>
    <Argument name="Amount">3</Argument>
</Requirement>

With Location Parameter:

<Requirement type="REQUIREMENT_PLAYER_HAS_AT_LEAST_NUM_GOSSIPS">
    <Argument name="GossipTypes">GOSSIP_CONSTRUCTED_BUILDING</Argument>
    <Argument name="ConstructibleType">BUILDING_MARKET</Argument>
</Requirement>

This requirement is often easier to set up than complex RequirementSets for Narrative Events.


Common Predefined RequirementSets

The game includes many pre-built RequirementSets you can reference:

RequirementSetId Description
Met Always passes (for LINKED events)
REQSET_URBAN_PLOTS Urban or city center plots
REQSET_RURAL_PLOTS Rural plots
REQSET_ONLY_CITIES Full cities only
REQSET_ONLY_TOWNS Towns only
REQSET_BIOME_TUNDRA Tundra biome plots
REQSET_BIOME_DESERT Desert biome plots
REQSET_UNIT_CLASS_INFANTRY Infantry units
REQSET_UNIT_CLASS_MOUNTED Mounted units
REQSET_UNIT_CLASS_NAVAL Naval units
REQSET_PLAYER_IS_AI AI players
REQSET_PLAYER_IS_MAJOR Major civilizations

Database Format

Traditional database format for requirements:

<Database>
    <!-- Define the requirement set -->
    <RequirementSets>
        <Row RequirementSetId="MY_REQUIREMENTS" RequirementSetType="REQUIREMENTSET_TEST_ALL"/>
    </RequirementSets>

    <!-- Define individual requirements -->
    <Requirements>
        <Row RequirementId="REQ_HAS_GRANARY" RequirementType="REQUIREMENT_CITY_HAS_BUILDING"/>
        <Row RequirementId="REQ_HAS_LIBRARY" RequirementType="REQUIREMENT_CITY_HAS_BUILDING"/>
    </Requirements>

    <!-- Add arguments -->
    <RequirementArguments>
        <Row RequirementId="REQ_HAS_GRANARY" Name="BuildingType" Value="BUILDING_GRANARY"/>
        <Row RequirementId="REQ_HAS_LIBRARY" Name="BuildingType" Value="BUILDING_LIBRARY"/>
    </RequirementArguments>

    <!-- Link requirements to set -->
    <RequirementSetRequirements>
        <Row RequirementSetId="MY_REQUIREMENTS" RequirementId="REQ_HAS_GRANARY"/>
        <Row RequirementSetId="MY_REQUIREMENTS" RequirementId="REQ_HAS_LIBRARY"/>
    </RequirementSetRequirements>
</Database>

GameEffects XML Format

Simplified format in GameEffects XML:

<GameEffects xmlns="GameEffects">
    <!-- Standalone RequirementSet -->
    <RequirementSet id="REQSET_MY_CONDITIONS" type="REQUIREMENTSET_TEST_ALL">
        <Requirement type="REQUIREMENT_PLAYER_HAS_COMPLETED_PROGRESSION_TREE_NODE">
            <Argument name="ProgressionTreeNodeType">NODE_TECH_AQ_MASONRY</Argument>
        </Requirement>
    </RequirementSet>

    <!-- Requirements inside a Modifier -->
    <Modifier id="MY_MODIFIER" collection="COLLECTION_PLAYER_CITIES" effect="EFFECT_CITY_ADJUST_YIELD">
        <OwnerRequirements type="REQUIREMENTSET_TEST_ALL">
            <Requirement type="REQUIREMENT_PLAYER_IS_HUMAN"/>
        </OwnerRequirements>
        <SubjectRequirements type="REQUIREMENTSET_TEST_ANY">
            <Requirement type="REQUIREMENT_CITY_HAS_BUILDING">
                <Argument name="BuildingType">BUILDING_GRANARY</Argument>
            </Requirement>
            <Requirement type="REQUIREMENT_CITY_HAS_BUILDING">
                <Argument name="BuildingType">BUILDING_WAREHOUSE</Argument>
            </Requirement>
        </SubjectRequirements>
        <Argument name="YieldType">YIELD_FOOD</Argument>
        <Argument name="Amount">2</Argument>
    </Modifier>
</GameEffects>

See Also

Clone this wiki locally