Skip to content

modifiers Collection Types

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

Collection Types Reference

Collections determine which subjects a modifier affects. The modifier system gathers subjects through collections and then applies effects to matching subjects.

How Collections Work

  1. Modifier activates (owner meets requirements)
  2. Collection gathers potential subjects
  3. Subject requirements filter subjects
  4. Effect applies to remaining subjects

All Collection Types

Owner Collections

COLLECTION_OWNER

The owner of the modifier itself. Use for effects that apply to the modifier's owner directly.

<Modifier id="EXAMPLE" collection="COLLECTION_OWNER" effect="EFFECT_PLAYER_GRANT_YIELD">
    <Argument name="YieldType">YIELD_GOLD</Argument>
    <Argument name="Amount">100</Argument>
</Modifier>

Player Collections

COLLECTION_ALL_PLAYERS

All players in the game.

COLLECTION_MAJOR_PLAYERS

All major civilization players.

COLLECTION_INDEPENDENT_PLAYERS

All independent (city-state/tribe) players.


City Collections

COLLECTION_PLAYER_CITIES

All cities belonging to the player.

<Modifier id="EXAMPLE" collection="COLLECTION_PLAYER_CITIES" effect="EFFECT_CITY_ADJUST_YIELD">
    <Argument name="YieldType">YIELD_FOOD</Argument>
    <Argument name="Amount">2</Argument>
</Modifier>

COLLECTION_ALL_CITIES

All cities in the game (all players).

COLLECTION_ALL_CAPITAL_CITIES

All capital cities in the game.

COLLECTION_PLAYER_CAPITAL_CITY

The player's capital city only.

<Modifier id="EXAMPLE" collection="COLLECTION_PLAYER_CAPITAL_CITY" effect="EFFECT_CITY_ADJUST_YIELD">
    <Argument name="YieldType">YIELD_PRODUCTION</Argument>
    <Argument name="Amount">5</Argument>
</Modifier>

COLLECTION_OWNER_CITY

The city that owns the modifier (for building/improvement modifiers).

<Modifier id="EXAMPLE" collection="COLLECTION_OWNER_CITY" effect="EFFECT_CITY_GRANT_UNIT">
    <Argument name="UnitType">UNIT_WARRIOR</Argument>
</Modifier>

COLLECTION_OWNER_CITY_NEAREST_STORY

The owner's city nearest to a narrative story location.

COLLECTION_CITIES_FOLLOWING_OWNER_RELIGION

Cities that follow the owner's religion.

COLLECTION_PLAYER_INFECTED_CITIES

Player's cities affected by plague/infection.

COLLECTION_ANY_CITY_AT_STORY

Any city at the narrative story location.


District Collections

COLLECTION_ALL_DISTRICTS

All districts in the game.

COLLECTION_PLAYER_DISTRICTS

All districts belonging to the player.

COLLECTION_CITY_DISTRICTS

Districts in a specific city.

COLLECTION_PLAYER_CAPITAL_CITY_DISTRICTS

Districts in the player's capital city.


Unit Collections

COLLECTION_PLAYER_UNITS

All units belonging to the player.

<Modifier id="EXAMPLE" collection="COLLECTION_PLAYER_UNITS" effect="EFFECT_UNIT_ADJUST_ABILITY">
    <SubjectRequirements>
        <Requirement type="REQUIREMENT_UNIT_TAG_MATCHES">
            <Argument name="Tag">UNIT_CLASS_INFANTRY</Argument>
        </Requirement>
    </SubjectRequirements>
    <Argument name="AbilityType">ABILITY_FIRST_STRIKE</Argument>
</Modifier>

COLLECTION_ALL_UNITS

All units in the game.

COLLECTION_CITY_TRAINED_UNITS

Units trained in a specific city.

COLLECTION_COMMANDER_PACKED_UNITS

Units currently attached to a commander.

COLLECTION_OWNER_UNIT_NEAREST_STORY

Owner's unit nearest to narrative story location.


Combat Collections

COLLECTION_PLAYER_COMBAT

Player's combat units during combat resolution.

<Modifier id="EXAMPLE" collection="COLLECTION_PLAYER_COMBAT" effect="EFFECT_ADJUST_UNIT_STRENGTH_MODIFIER">
    <Argument name="Amount">5</Argument>
</Modifier>

COLLECTION_UNIT_COMBAT

The specific unit in combat context.

<Modifier id="FLANKING_BONUS" collection="COLLECTION_UNIT_COMBAT" effect="EFFECT_ADJUST_UNIT_STRENGTH_MODIFIER">
    <OwnerRequirements>
        <Requirement type="REQUIREMENT_UNIT_FLANKING"/>
    </OwnerRequirements>
    <Argument name="Amount">3</Argument>
</Modifier>

Plot/Yield Collections

COLLECTION_PLAYER_PLOT_YIELDS

Plots that provide yields to the player. Used for plot-based yield bonuses.

<Modifier id="EXAMPLE" collection="COLLECTION_PLAYER_PLOT_YIELDS" effect="EFFECT_PLOT_ADJUST_YIELD">
    <SubjectRequirements>
        <Requirement type="REQUIREMENT_PLOT_RESOURCE_VISIBLE"/>
    </SubjectRequirements>
    <Argument name="YieldType">YIELD_GOLD</Argument>
    <Argument name="Amount">1</Argument>
</Modifier>

COLLECTION_ALL_PLOT_YIELDS

All plots providing yields (all players).

COLLECTION_CITY_PLOT_YIELDS

Plots providing yields to a specific city.

COLLECTION_SINGLE_PLOT_YIELDS

A single specific plot's yields.


Constructible Collections

COLLECTION_PLAYER_CONSTRUCTIBLES

All constructibles (buildings/improvements) belonging to the player.


Narrative/Story Collections

These collections are used with the Narrative Events system.

COLLECTION_NARRATIVE_STORY

The narrative story trigger location.

COLLECTION_INDEPENDENT_NEAREST_STORY

Nearest independent player to the story location.

COLLECTION_HOMELANDS_INDEPENDENT_NEAREST_STORY

Nearest independent player in homelands to story location.

COLLECTION_OWNER_COMMANDER_NEAREST_STORY

Owner's commander nearest to story location.

COLLECTION_OWNER_COMMANDER_HIGHEST_LEVEL

Owner's highest level commander.


Unit Location Collections

COLLECTION_UNIT_NEAREST_OWNER_CITY

The city nearest to the unit.

COLLECTION_UNIT_OCCUPIED_CITY

The city a unit is currently occupying.

COLLECTION_UNIT_OCCUPIED_DISTRICT

The district a unit is currently occupying.


Collection + Effect Combinations

Not all collections work with all effects. Common combinations:

Collection Common Effects
COLLECTION_OWNER EFFECT_PLAYER_GRANT_YIELD, EFFECT_PLAYER_ADJUST_*, Scoring effects
COLLECTION_PLAYER_CITIES EFFECT_CITY_ADJUST_YIELD, EFFECT_CITY_GRANT_UNIT, Production effects
COLLECTION_PLAYER_CAPITAL_CITY EFFECT_CITY_* effects for capital-specific bonuses
COLLECTION_OWNER_CITY EFFECT_CITY_* effects for building modifiers
COLLECTION_PLAYER_UNITS EFFECT_UNIT_*, EFFECT_ARMY_* effects
COLLECTION_PLAYER_COMBAT EFFECT_ADJUST_UNIT_STRENGTH_MODIFIER
COLLECTION_UNIT_COMBAT EFFECT_ADJUST_UNIT_STRENGTH_MODIFIER (combat-specific)
COLLECTION_PLAYER_PLOT_YIELDS EFFECT_PLOT_ADJUST_YIELD
COLLECTION_PLAYER_DISTRICTS EFFECT_DISTRICT_* effects

Using Collections with Requirements

Collections gather all potential subjects, then SubjectRequirements filter them:

<Modifier id="COASTAL_CITY_BONUS" collection="COLLECTION_PLAYER_CITIES" effect="EFFECT_CITY_ADJUST_YIELD">
    <SubjectRequirements>
        <Requirement type="REQUIREMENT_PLOT_ADJACENT_TO_COAST"/>
        <Requirement type="REQUIREMENT_CITY_IS_CITY"/>
    </SubjectRequirements>
    <Argument name="YieldType">YIELD_GOLD</Argument>
    <Argument name="Amount">3</Argument>
</Modifier>

This applies +3 gold only to coastal cities (filtering out inland cities and towns).


Examples from Game Files

Trade Route Culture Bonus (Aksum)

<Modifier id="PORT_OF_NATIONS_MOD_TRADE_ROUTE_CULTURE" collection="COLLECTION_OWNER" effect="EFFECT_PLAYER_ADJUST_YIELD_PER_NUM_TRADE_ROUTES">
    <Argument name="YieldType">YIELD_CULTURE</Argument>
    <Argument name="Amount">2</Argument>
</Modifier>

Commander XP Bonus (Greece)

<Modifier id="STRATEGOI_MOD_COMMANDER_XP" collection="COLLECTION_PLAYER_UNITS" effect="EFFECT_ARMY_ADJUST_EXPERIENCE_RATE">
    <SubjectRequirements>
        <Requirement type="REQUIREMENT_UNIT_TAG_MATCHES">
            <Argument name="Tag">UNIT_CLASS_COMMAND</Argument>
        </Requirement>
    </SubjectRequirements>
    <Argument name="Percent">25</Argument>
</Modifier>

Navigable River Food Bonus (Egypt)

<Modifier id="AKHET_MOD_NAVIGABLE_RIVER_FOOD" collection="COLLECTION_PLAYER_PLOT_YIELDS" effect="EFFECT_PLOT_ADJUST_YIELD">
    <SubjectRequirements>
        <Requirement type="REQUIREMENT_PLOT_IS_RIVER">
            <Argument name="Navigable">true</Argument>
        </Requirement>
        <Requirement type="REQUIREMENT_PLOT_DISTRICT_CLASS">
            <Argument name="DistrictClass">RURAL, URBAN, CITYCENTER</Argument>
        </Requirement>
    </SubjectRequirements>
    <Argument name="YieldType">YIELD_FOOD</Argument>
    <Argument name="Amount">2</Argument>
</Modifier>

Capital-Only Production Bonus

<Modifier id="CAPITAL_PRODUCTION_BONUS" collection="COLLECTION_PLAYER_CAPITAL_CITY" effect="EFFECT_CITY_ADJUST_YIELD">
    <Argument name="YieldType">YIELD_PRODUCTION</Argument>
    <Argument name="Amount">4</Argument>
</Modifier>

Religious City Bonus

<Modifier id="HOLY_CITY_BONUS" collection="COLLECTION_CITIES_FOLLOWING_OWNER_RELIGION" effect="EFFECT_CITY_ADJUST_YIELD">
    <Argument name="YieldType">YIELD_FAITH</Argument>
    <Argument name="Amount">3</Argument>
</Modifier>

Database Definition

In traditional database format, collections are defined in DynamicModifiers:

<DynamicModifiers>
    <Row
        ModifierType="MY_MODIFIER_TYPE"
        CollectionType="COLLECTION_PLAYER_CITIES"
        EffectType="EFFECT_CITY_ADJUST_YIELD"
    />
</DynamicModifiers>

See Also

Clone this wiki locally