Entity component documentation

In 0 A.D., entities (units and buildings and other world objects) consist of a collection of components, each of which determines part of the entity's behaviour. Entity template XML files specify the list of components that are loaded for each entity type, plus initialisation data for the components.

This page lists the components that can be added to entities and the XML syntax for their initialisation data.

Available components:

Display RELAX NG grammar fragments

AIProxy

RELAX NG Grammar

<element name="AIProxy">
  <interleave>
    <empty/>
  </interleave>
</element>

AlertRaiser

List

Classes of entities which are affected by this alert raiser.

Value type: text.

datatype

Required value: tokens

RaiseAlertRange

Value type: integer.

EndOfAlertRange

Value type: integer.

SearchRange

Value type: integer.

RELAX NG Grammar

<element name="AlertRaiser">
  <interleave>
    <element name="List">
      <attribute name="datatype">
        <value>tokens</value>
      </attribute>
      <text/>
    </element>
    <element name="RaiseAlertRange">
      <data type="integer"/>
    </element>
    <element name="EndOfAlertRange">
      <data type="integer"/>
    </element>
    <element name="SearchRange">
      <data type="integer"/>
    </element>
  </interleave>
</element>

Attack

Controls the attack abilities and strengths of the unit.

Example

<Attack>
  <Melee>
    <AttackName>Spear</AttackName>
    <Damage>
      <Hack>10.0</Hack>
      <Pierce>0.0</Pierce>
      <Crush>5.0</Crush>
    </Damage>
    <MaxRange>4.0</MaxRange>
    <RepeatTime>1000</RepeatTime>
    <Bonuses>
      <Bonus1>
        <Civ>pers</Civ>
        <Classes>Infantry</Classes>
        <Multiplier>1.5</Multiplier>
      </Bonus1>
      <BonusCavMelee>
        <Classes>Cavalry Melee</Classes>
        <Multiplier>1.5</Multiplier>
      </BonusCavMelee>
    </Bonuses>
    <RestrictedClasses datatype="tokens">Champion</RestrictedClasses>
    <PreferredClasses datatype="tokens">Cavalry Infantry</PreferredClasses>
  </Melee>
  <Ranged>
    <AttackName>Bow</AttackName>
    <Damage>
      <Hack>0.0</Hack>
      <Pierce>10.0</Pierce>
      <Crush>0.0</Crush>
    </Damage>
    <MaxRange>44.0</MaxRange>
    <MinRange>20.0</MinRange>
    <Origin>
      <X>0</X>
      <Y>10.0</Y>
      <Z>0</Z>
    </Origin>
    <PrepareTime>800</PrepareTime>
    <RepeatTime>1600</RepeatTime>
    <EffectDelay>1000</EffectDelay>
    <Bonuses>
      <Bonus1>
        <Classes>Cavalry</Classes>
        <Multiplier>2</Multiplier>
      </Bonus1>
    </Bonuses>
    <Projectile>
      <Speed>50.0</Speed>
      <Spread>2.5</Spread>
      <ActorName>props/units/weapons/rock_flaming.xml</ActorName>
      <ImpactActorName>props/units/weapons/rock_explosion.xml</ImpactActorName>
      <ImpactAnimationLifetime>0.1</ImpactAnimationLifetime>
      <FriendlyFire>false</FriendlyFire>
    </Projectile>
    <RestrictedClasses datatype="tokens">Champion</RestrictedClasses>
    <Splash>
      <Shape>Circular</Shape>
      <Range>20</Range>
      <FriendlyFire>false</FriendlyFire>
      <Damage>
        <Hack>0.0</Hack>
        <Pierce>10.0</Pierce>
        <Crush>0.0</Crush>
      </Damage>
    </Splash>
  </Ranged>
  <Slaughter>
    <Damage>
      <Hack>1000.0</Hack>
      <Pierce>0.0</Pierce>
      <Crush>0.0</Crush>
    </Damage>
    <RepeatTime>1000</RepeatTime>
    <MaxRange>4.0</MaxRange>
  </Slaughter>
</Attack>

AttackName

Name of the attack, to be displayed in the GUI. Optionally includes a translate context attribute..

Value type: text.

context

Value type: text.

Damage

Capture

Capture points value.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

ApplyStatus

Effects like poisoning or burning a unit..

Duration

Optional.

The duration of the status while the effect occurs..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Interval

Interval between the occurances of the effect..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Damage

Capture

Capture points value.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Modifiers

Optional.

List of modifiers..

Paths

Space separated value paths to modify..

Value type: text.

datatype

Required value: tokens

Affects

An array of classes to affect..

Value type: text.

datatype

Required value: tokens

Add

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

Multiply

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

Replace

Value type: text.

Stackability

Defines how this status effect stacks, i.e. how subsequent status effects of the same kind are handled. Choices are: “Ignore”, which means a new one is ignored, “Extend”, which means the duration of a new one is added to the already active status effect, “Replace”, which means the currently active status effect is removed and the new one is put in place and “Stack”, which means that the status effect can be added multiple times..

Value is one of:

Ignore
Extend
Replace
Stack

Bonuses

Optional.

Civ

Optional.

If an entity has this civ then the bonus is applied.

Value type: text.

Classes

If an entity has all these classes then the bonus is applied.

Value type: text.

Multiplier

The effect strength is multiplied by this.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

MaxRange

Maximum attack range (in metres).

Value type: non-negative decimal (e.g. 0.0 or 2.5).

MinRange

Optional.

Minimum attack range (in metres). Defaults to 0..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Origin

Optional.

The offset from which the attack occurs, relative to the entity position. Defaults to {0,0,0}..

X

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Y

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Z

Value type: non-negative decimal (e.g. 0.0 or 2.5).

RangeOverlay

Optional.

LineTexture

Value type: text.

LineTextureMask

Value type: text.

LineThickness

Value type: non-negative decimal (e.g. 0.0 or 2.5).

PrepareTime

Optional.

Time from the start of the attack command until the attack actually occurs (in milliseconds). This value relative to RepeatTime should closely match the "event" point in the actor's attack animation. Defaults to 0..

Value type: non-negative integer (e.g. 0 or 5).

RepeatTime

Time between attacks (in milliseconds). The attack animation will be stretched to match this time.

Value type: positive integer (e.g. 1 or 5).

EffectDelay

Optional.

Delay of applying the effects, in milliseconds after the attack has landed. Defaults to 0..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Splash

Optional.

Shape

Shape of the splash damage, can be circular or linear.

Value type: text.

Range

Size of the area affected by the splash.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

FriendlyFire

Whether the splash damage can hurt non enemy units.

Value type: boolean (true or false).

Damage

Capture

Capture points value.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

ApplyStatus

Effects like poisoning or burning a unit..

Duration

Optional.

The duration of the status while the effect occurs..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Interval

Interval between the occurances of the effect..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Damage

Capture

Capture points value.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Modifiers

Optional.

List of modifiers..

Paths

Space separated value paths to modify..

Value type: text.

datatype

Required value: tokens

Affects

An array of classes to affect..

Value type: text.

datatype

Required value: tokens

Add

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

Multiply

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

Replace

Value type: text.

Stackability

Defines how this status effect stacks, i.e. how subsequent status effects of the same kind are handled. Choices are: “Ignore”, which means a new one is ignored, “Extend”, which means the duration of a new one is added to the already active status effect, “Replace”, which means the currently active status effect is removed and the new one is put in place and “Stack”, which means that the status effect can be added multiple times..

Value is one of:

Ignore
Extend
Replace
Stack

Bonuses

Optional.

Civ

Optional.

If an entity has this civ then the bonus is applied.

Value type: text.

Classes

If an entity has all these classes then the bonus is applied.

Value type: text.

Multiplier

The effect strength is multiplied by this.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Projectile

Optional.

Speed

Speed of projectiles (in meters per second)..

Value type: positive decimal (e.g. 1.0 or 2.5).

Spread

Standard deviation of the bivariate normal distribution of hits at 100 meters. A disk at 100 meters from the attacker with this radius (2x this radius, 3x this radius) is expected to include the landing points of 39.3% (86.5%, 98.9%) of the rounds..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Gravity

The gravity affecting the projectile. This affects the shape of the flight curve..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

FriendlyFire

Whether stray missiles can hurt non enemy units..

Value type: boolean (true or false).

LaunchPoint

Optional.

Delta from the unit position where to launch the projectile..

y

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

ActorName

Optional.

actor of the projectile animation..

Value type: text.

ImpactActorName

Optional.

actor of the projectile impact animation.

Value type: text.

ImpactAnimationLifetime

Optional.

length of the projectile impact animation..

Value type: positive decimal (e.g. 1.0 or 2.5).

PreferredClasses

Optional.

Space delimited list of classes preferred for attacking. If an entity has any of theses classes, it is preferred. The classes are in decending order of preference.

Value type: text.

datatype

Required value: tokens

RestrictedClasses

Optional.

Space delimited list of classes that cannot be attacked by this entity. If target entity has any of these classes, it cannot be attacked.

Value type: text.

datatype

Required value: tokens

RELAX NG Grammar

<element name="Attack">
  <interleave>
    <oneOrMore>
      <element>
        <anyName/>
        <interleave>
          <element name="AttackName">
            <optional>
              <attribute name="context">
                <text/>
              </attribute>
            </optional>
            <text/>
          </element>
          <oneOrMore>
            <choice>
              <element name="Damage">
                <oneOrMore>
                  <element>
                    <anyName/>
                    <ref name="nonNegativeDecimal"/>
                  </element>
                </oneOrMore>
              </element>
              <element name="Capture">
                <ref name="nonNegativeDecimal"/>
              </element>
              <element name="ApplyStatus">
                <oneOrMore>
                  <element>
                    <anyName/>
                    <interleave>
                      <optional>
                        <element name="Duration">
                          <ref name="nonNegativeDecimal"/>
                        </element>
                      </optional>
                      <optional>
                        <interleave>
                          <element name="Interval">
                            <ref name="nonNegativeDecimal"/>
                          </element>
                          <oneOrMore>
                            <choice>
                              <element name="Damage">
                                <oneOrMore>
                                  <element>
                                    <anyName/>
                                    <ref name="nonNegativeDecimal"/>
                                  </element>
                                </oneOrMore>
                              </element>
                              <element name="Capture">
                                <ref name="nonNegativeDecimal"/>
                              </element>
                            </choice>
                          </oneOrMore>
                        </interleave>
                      </optional>
                      <optional>
                        <element name="Modifiers">
                          <oneOrMore>
                            <element>
                              <anyName/>
                              <interleave>
                                <element name="Paths">
                                  <attribute name="datatype">
                                    <value>tokens</value>
                                  </attribute>
                                  <text/>
                                </element>
                                <element name="Affects">
                                  <attribute name="datatype">
                                    <value>tokens</value>
                                  </attribute>
                                  <text/>
                                </element>
                                <choice>
                                  <element name="Add">
                                    <data type="decimal"/>
                                  </element>
                                  <element name="Multiply">
                                    <data type="decimal"/>
                                  </element>
                                  <element name="Replace">
                                    <text/>
                                  </element>
                                </choice>
                              </interleave>
                            </element>
                          </oneOrMore>
                        </element>
                      </optional>
                      <element name="Stackability">
                        <choice>
                          <value>Ignore</value>
                          <value>Extend</value>
                          <value>Replace</value>
                          <value>Stack</value>
                        </choice>
                      </element>
                    </interleave>
                  </element>
                </oneOrMore>
              </element>
            </choice>
          </oneOrMore>
          <optional>
            <element name="Bonuses">
              <zeroOrMore>
                <element>
                  <anyName/>
                  <interleave>
                    <optional>
                      <element name="Civ">
                        <text/>
                      </element>
                    </optional>
                    <element name="Classes">
                      <text/>
                    </element>
                    <element name="Multiplier">
                      <ref name="nonNegativeDecimal"/>
                    </element>
                  </interleave>
                </element>
              </zeroOrMore>
            </element>
          </optional>
          <element name="MaxRange">
            <ref name="nonNegativeDecimal"/>
          </element>
          <optional>
            <element name="MinRange">
              <ref name="nonNegativeDecimal"/>
            </element>
          </optional>
          <optional>
            <element name="Origin">
              <interleave>
                <element name="X">
                  <ref name="nonNegativeDecimal"/>
                </element>
                <element name="Y">
                  <ref name="nonNegativeDecimal"/>
                </element>
                <element name="Z">
                  <ref name="nonNegativeDecimal"/>
                </element>
              </interleave>
            </element>
          </optional>
          <optional>
            <element name="RangeOverlay">
              <interleave>
                <element name="LineTexture">
                  <text/>
                </element>
                <element name="LineTextureMask">
                  <text/>
                </element>
                <element name="LineThickness">
                  <ref name="nonNegativeDecimal"/>
                </element>
              </interleave>
            </element>
          </optional>
          <optional>
            <element name="PrepareTime">
              <data type="nonNegativeInteger"/>
            </element>
          </optional>
          <element name="RepeatTime">
            <data type="positiveInteger"/>
          </element>
          <optional>
            <element name="EffectDelay">
              <ref name="nonNegativeDecimal"/>
            </element>
          </optional>
          <optional>
            <element name="Splash">
              <interleave>
                <element name="Shape">
                  <text/>
                </element>
                <element name="Range">
                  <ref name="nonNegativeDecimal"/>
                </element>
                <element name="FriendlyFire">
                  <data type="boolean"/>
                </element>
                <oneOrMore>
                  <choice>
                    <element name="Damage">
                      <oneOrMore>
                        <element>
                          <anyName/>
                          <ref name="nonNegativeDecimal"/>
                        </element>
                      </oneOrMore>
                    </element>
                    <element name="Capture">
                      <ref name="nonNegativeDecimal"/>
                    </element>
                    <element name="ApplyStatus">
                      <oneOrMore>
                        <element>
                          <anyName/>
                          <interleave>
                            <optional>
                              <element name="Duration">
                                <ref name="nonNegativeDecimal"/>
                              </element>
                            </optional>
                            <optional>
                              <interleave>
                                <element name="Interval">
                                  <ref name="nonNegativeDecimal"/>
                                </element>
                                <oneOrMore>
                                  <choice>
                                    <element name="Damage">
                                      <oneOrMore>
                                        <element>
                                          <anyName/>
                                          <ref name="nonNegativeDecimal"/>
                                        </element>
                                      </oneOrMore>
                                    </element>
                                    <element name="Capture">
                                      <ref name="nonNegativeDecimal"/>
                                    </element>
                                  </choice>
                                </oneOrMore>
                              </interleave>
                            </optional>
                            <optional>
                              <element name="Modifiers">
                                <oneOrMore>
                                  <element>
                                    <anyName/>
                                    <interleave>
                                      <element name="Paths">
                                        <attribute name="datatype">
                                          <value>tokens</value>
                                        </attribute>
                                        <text/>
                                      </element>
                                      <element name="Affects">
                                        <attribute name="datatype">
                                          <value>tokens</value>
                                        </attribute>
                                        <text/>
                                      </element>
                                      <choice>
                                        <element name="Add">
                                          <data type="decimal"/>
                                        </element>
                                        <element name="Multiply">
                                          <data type="decimal"/>
                                        </element>
                                        <element name="Replace">
                                          <text/>
                                        </element>
                                      </choice>
                                    </interleave>
                                  </element>
                                </oneOrMore>
                              </element>
                            </optional>
                            <element name="Stackability">
                              <choice>
                                <value>Ignore</value>
                                <value>Extend</value>
                                <value>Replace</value>
                                <value>Stack</value>
                              </choice>
                            </element>
                          </interleave>
                        </element>
                      </oneOrMore>
                    </element>
                  </choice>
                </oneOrMore>
                <optional>
                  <element name="Bonuses">
                    <zeroOrMore>
                      <element>
                        <anyName/>
                        <interleave>
                          <optional>
                            <element name="Civ">
                              <text/>
                            </element>
                          </optional>
                          <element name="Classes">
                            <text/>
                          </element>
                          <element name="Multiplier">
                            <ref name="nonNegativeDecimal"/>
                          </element>
                        </interleave>
                      </element>
                    </zeroOrMore>
                  </element>
                </optional>
              </interleave>
            </element>
          </optional>
          <optional>
            <element name="Projectile">
              <interleave>
                <element name="Speed">
                  <ref name="positiveDecimal"/>
                </element>
                <element name="Spread">
                  <ref name="nonNegativeDecimal"/>
                </element>
                <element name="Gravity">
                  <ref name="nonNegativeDecimal"/>
                </element>
                <element name="FriendlyFire">
                  <data type="boolean"/>
                </element>
                <optional>
                  <element name="LaunchPoint">
                    <attribute name="y">
                      <data type="decimal"/>
                    </attribute>
                  </element>
                </optional>
                <optional>
                  <element name="ActorName">
                    <text/>
                  </element>
                </optional>
                <optional>
                  <element name="ImpactActorName">
                    <text/>
                  </element>
                  <element name="ImpactAnimationLifetime">
                    <ref name="positiveDecimal"/>
                  </element>
                </optional>
              </interleave>
            </element>
          </optional>
          <optional>
            <element name="PreferredClasses">
              <attribute name="datatype">
                <value>tokens</value>
              </attribute>
              <text/>
            </element>
          </optional>
          <optional>
            <element name="RestrictedClasses">
              <attribute name="datatype">
                <value>tokens</value>
              </attribute>
              <text/>
            </element>
          </optional>
        </interleave>
      </element>
    </oneOrMore>
  </interleave>
</element>

AttackDetection

Detects incoming attacks.

Example

<AttackDetection/>

SuppressionTransferRange

Any attacks within this range in meters will replace the previous attack suppression.

Value type: positive decimal (e.g. 1.0 or 2.5).

SuppressionRange

Other attacks within this range in meters will not be registered.

Value type: positive decimal (e.g. 1.0 or 2.5).

SuppressionTime

Other attacks within this time in milliseconds will not be registered.

Value type: positive integer (e.g. 1 or 5).

RELAX NG Grammar

<element name="AttackDetection">
  <interleave>
    <element name="SuppressionTransferRange">
      <ref name="positiveDecimal"/>
    </element>
    <element name="SuppressionRange">
      <ref name="positiveDecimal"/>
    </element>
    <element name="SuppressionTime">
      <data type="positiveInteger"/>
    </element>
  </interleave>
</element>

Auras

datatype

Required value: tokens

RELAX NG Grammar

<element name="Auras">
  <interleave>
    <attribute name="datatype">
      <value>tokens</value>
    </attribute>
    <text/>
  </interleave>
</element>

AutoBuildable

Defines whether the entity can be built by itself.

Example

<AutoBuildable>
  <Rate>1.0</Rate>
</AutoBuildable>

Rate

The rate at which the building autobuilds..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

RELAX NG Grammar

<element name="AutoBuildable">
  <interleave>
    <element name="Rate">
      <ref name="nonNegativeDecimal"/>
    </element>
  </interleave>
</element>

BattleDetection

Detects the occurence of battles.

Example

<BattleDetection/>

TimerInterval

Duration of one timer period. Interval over which damage should be recorded in milliseconds.

Value type: positive integer (e.g. 1 or 5).

RecordLength

Record length. Number of timer cycles over which damage rate should be calculated.

Value type: positive integer (e.g. 1 or 5).

DamageRateThreshold

Damage rate at which alertness is increased.

Value type: positive decimal (e.g. 1.0 or 2.5).

AlertnessBattleThreshold

Alertness at which the player is considered in battle.

Value type: positive decimal (e.g. 1.0 or 2.5).

AlertnessPeaceThreshold

Alertness at which the player is considered at peace.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

AlertnessMax

Maximum alertness level.

Value type: positive decimal (e.g. 1.0 or 2.5).

RELAX NG Grammar

<element name="BattleDetection">
  <interleave>
    <element name="TimerInterval">
      <data type="positiveInteger"/>
    </element>
    <element name="RecordLength">
      <data type="positiveInteger"/>
    </element>
    <element name="DamageRateThreshold">
      <ref name="positiveDecimal"/>
    </element>
    <element name="AlertnessBattleThreshold">
      <ref name="positiveDecimal"/>
    </element>
    <element name="AlertnessPeaceThreshold">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="AlertnessMax">
      <ref name="positiveDecimal"/>
    </element>
  </interleave>
</element>

BuildRestrictions

Specifies building placement restrictions as they relate to terrain, territories, and distance.

Example

<BuildRestrictions>
  <BuildRestrictions>
    <PlacementType>land</PlacementType>
    <Territory>own</Territory>
    <Category>Structure</Category>
    <Distance>
      <FromClass>CivilCentre</FromClass>
      <MaxDistance>40</MaxDistance>
    </Distance>
  </BuildRestrictions>
</BuildRestrictions>

PlacementType

Specifies the terrain type restriction for this building..

Value is one of:

land
shore
land-shore

Territory

Specifies territory type restrictions for this building..

Category

Specifies the category of this building, for satisfying special constraints. Choices include: Apadana, CivilCentre, Council, Embassy, Fortress, Gladiator, Hall, Hero, Juggernaut, Library, Lighthouse, Monument, Pillar, PyramidLarge, PyramidSmall, Stoa, TempleOfAmun, Theater, Tower, UniqueBuilding, WarDog, Wonder.

Value type: text.

MatchLimit

Optional.

Specifies how many times this entity can be created during a match..

Value type: positive integer (e.g. 1 or 5).

Distance

Optional.

Specifies distance restrictions on this building, relative to buildings from the given category..

FromClass

Value type: text.

MinDistance

Optional.

Value type: positive integer (e.g. 1 or 5).

MaxDistance

Optional.

Value type: positive integer (e.g. 1 or 5).

RELAX NG Grammar

<element name="BuildRestrictions">
  <interleave>
    <element name="PlacementType">
      <choice>
        <value>land</value>
        <value>shore</value>
        <value>land-shore</value>
      </choice>
    </element>
    <element name="Territory">
      <list>
        <oneOrMore>
          <choice>
            <value>own</value>
            <value>ally</value>
            <value>neutral</value>
            <value>enemy</value>
          </choice>
        </oneOrMore>
      </list>
    </element>
    <element name="Category">
      <text/>
    </element>
    <optional>
      <element name="MatchLimit">
        <data type="positiveInteger"/>
      </element>
    </optional>
    <optional>
      <element name="Distance">
        <interleave>
          <element name="FromClass">
            <text/>
          </element>
          <optional>
            <element name="MinDistance">
              <data type="positiveInteger"/>
            </element>
          </optional>
          <optional>
            <element name="MaxDistance">
              <data type="positiveInteger"/>
            </element>
          </optional>
        </interleave>
      </element>
    </optional>
  </interleave>
</element>

Builder

Allows the unit to construct and repair buildings.

Example

<Builder>
  <Rate>1.0</Rate>
  <Entities datatype="tokens">
    structures/{civ}/barracks
    structures/{native}/civil_centre
    structures/pers/apadana
  </Entities>
</Builder>

Rate

Construction speed multiplier (1.0 is normal speed, higher values are faster)..

Value type: positive decimal (e.g. 1.0 or 2.5).

Entities

Space-separated list of entity template names that this unit can build. The special string "{civ}" will be automatically replaced by the civ code of the unit's owner, while the string "{native}" will be automatically replaced by the unit's civ code. This element can also be empty, in which case no new foundations may be placed by the unit, but they can still repair existing buildings..

Value type: text.

datatype

Required value: tokens

RELAX NG Grammar

<element name="Builder">
  <interleave>
    <element name="Rate">
      <ref name="positiveDecimal"/>
    </element>
    <element name="Entities">
      <attribute name="datatype">
        <value>tokens</value>
      </attribute>
      <text/>
    </element>
  </interleave>
</element>

BuildingAI

DefaultArrowCount

Value type: non-negative integer (e.g. 0 or 5).

MaxArrowCount

Optional.

Limit the number of arrows to a certain amount.

Value type: non-negative integer (e.g. 0 or 5).

GarrisonArrowMultiplier

Value type: non-negative decimal (e.g. 0.0 or 2.5).

GarrisonArrowClasses

Add extra arrows for this class list.

Value type: text.

RELAX NG Grammar

<element name="BuildingAI">
  <interleave>
    <element name="DefaultArrowCount">
      <data type="nonNegativeInteger"/>
    </element>
    <optional>
      <element name="MaxArrowCount">
        <data type="nonNegativeInteger"/>
      </element>
    </optional>
    <element name="GarrisonArrowMultiplier">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="GarrisonArrowClasses">
      <text/>
    </element>
  </interleave>
</element>

Capturable

CapturePoints

Maximum capture points..

Value type: positive decimal (e.g. 1.0 or 2.5).

RegenRate

Number of capture points that are regenerated per second in favour of the owner..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

GarrisonRegenRate

Number of capture points that are regenerated per second and per garrisoned unit in favour of the owner..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

RELAX NG Grammar

<element name="Capturable">
  <interleave>
    <element name="CapturePoints">
      <ref name="positiveDecimal"/>
    </element>
    <element name="RegenRate">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="GarrisonRegenRate">
      <ref name="nonNegativeDecimal"/>
    </element>
  </interleave>
</element>

Cost

Specifies the construction/training costs of this entity.

Example

<Cost>
  <Population>1</Population>
  <BuildTime>20.0</BuildTime>
  <Resources>
    <food>50</food>
    <wood>0</wood>
    <stone>0</stone>
    <metal>25</metal>
  </Resources>
</Cost>

Population

Population cost.

Value type: non-negative integer (e.g. 0 or 5).

BuildTime

Time taken to construct/train this entity (in seconds).

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Resources

Resource costs to construct/train this entity.

food

Optional.

Value type: non-negative integer (e.g. 0 or 5).

wood

Optional.

Value type: non-negative integer (e.g. 0 or 5).

stone

Optional.

Value type: non-negative integer (e.g. 0 or 5).

metal

Optional.

Value type: non-negative integer (e.g. 0 or 5).

RELAX NG Grammar

<element name="Cost">
  <interleave>
    <element name="Population">
      <data type="nonNegativeInteger"/>
    </element>
    <element name="BuildTime">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="Resources">
      <interleave>
        <optional>
          <element name="food">
            <data type="nonNegativeInteger"/>
          </element>
        </optional>
        <optional>
          <element name="wood">
            <data type="nonNegativeInteger"/>
          </element>
        </optional>
        <optional>
          <element name="stone">
            <data type="nonNegativeInteger"/>
          </element>
        </optional>
        <optional>
          <element name="metal">
            <data type="nonNegativeInteger"/>
          </element>
        </optional>
      </interleave>
    </element>
  </interleave>
</element>

DeathDamage

When a unit or building is destroyed, it inflicts damage to nearby units.

Example

<DeathDamage>
  <Shape>Circular</Shape>
  <Range>20</Range>
  <FriendlyFire>false</FriendlyFire>
  <Damage>
    <Hack>0.0</Hack>
    <Pierce>10.0</Pierce>
    <Crush>50.0</Crush>
  </Damage>
</DeathDamage>

Shape

Shape of the splash damage, can be circular..

Value type: text.

Range

Size of the area affected by the splash..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

FriendlyFire

Whether the splash damage can hurt non enemy units..

Value type: boolean (true or false).

Damage

Capture

Capture points value.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

ApplyStatus

Effects like poisoning or burning a unit..

Duration

Optional.

The duration of the status while the effect occurs..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Interval

Interval between the occurances of the effect..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Damage

Capture

Capture points value.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Modifiers

Optional.

List of modifiers..

Paths

Space separated value paths to modify..

Value type: text.

datatype

Required value: tokens

Affects

An array of classes to affect..

Value type: text.

datatype

Required value: tokens

Add

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

Multiply

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

Replace

Value type: text.

Stackability

Defines how this status effect stacks, i.e. how subsequent status effects of the same kind are handled. Choices are: “Ignore”, which means a new one is ignored, “Extend”, which means the duration of a new one is added to the already active status effect, “Replace”, which means the currently active status effect is removed and the new one is put in place and “Stack”, which means that the status effect can be added multiple times..

Value is one of:

Ignore
Extend
Replace
Stack

Bonuses

Optional.

Civ

Optional.

If an entity has this civ then the bonus is applied.

Value type: text.

Classes

If an entity has all these classes then the bonus is applied.

Value type: text.

Multiplier

The effect strength is multiplied by this.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

RELAX NG Grammar

<element name="DeathDamage">
  <interleave>
    <element name="Shape">
      <text/>
    </element>
    <element name="Range">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="FriendlyFire">
      <data type="boolean"/>
    </element>
    <oneOrMore>
      <choice>
        <element name="Damage">
          <oneOrMore>
            <element>
              <anyName/>
              <ref name="nonNegativeDecimal"/>
            </element>
          </oneOrMore>
        </element>
        <element name="Capture">
          <ref name="nonNegativeDecimal"/>
        </element>
        <element name="ApplyStatus">
          <oneOrMore>
            <element>
              <anyName/>
              <interleave>
                <optional>
                  <element name="Duration">
                    <ref name="nonNegativeDecimal"/>
                  </element>
                </optional>
                <optional>
                  <interleave>
                    <element name="Interval">
                      <ref name="nonNegativeDecimal"/>
                    </element>
                    <oneOrMore>
                      <choice>
                        <element name="Damage">
                          <oneOrMore>
                            <element>
                              <anyName/>
                              <ref name="nonNegativeDecimal"/>
                            </element>
                          </oneOrMore>
                        </element>
                        <element name="Capture">
                          <ref name="nonNegativeDecimal"/>
                        </element>
                      </choice>
                    </oneOrMore>
                  </interleave>
                </optional>
                <optional>
                  <element name="Modifiers">
                    <oneOrMore>
                      <element>
                        <anyName/>
                        <interleave>
                          <element name="Paths">
                            <attribute name="datatype">
                              <value>tokens</value>
                            </attribute>
                            <text/>
                          </element>
                          <element name="Affects">
                            <attribute name="datatype">
                              <value>tokens</value>
                            </attribute>
                            <text/>
                          </element>
                          <choice>
                            <element name="Add">
                              <data type="decimal"/>
                            </element>
                            <element name="Multiply">
                              <data type="decimal"/>
                            </element>
                            <element name="Replace">
                              <text/>
                            </element>
                          </choice>
                        </interleave>
                      </element>
                    </oneOrMore>
                  </element>
                </optional>
                <element name="Stackability">
                  <choice>
                    <value>Ignore</value>
                    <value>Extend</value>
                    <value>Replace</value>
                    <value>Stack</value>
                  </choice>
                </element>
              </interleave>
            </element>
          </oneOrMore>
        </element>
      </choice>
    </oneOrMore>
    <optional>
      <element name="Bonuses">
        <zeroOrMore>
          <element>
            <anyName/>
            <interleave>
              <optional>
                <element name="Civ">
                  <text/>
                </element>
              </optional>
              <element name="Classes">
                <text/>
              </element>
              <element name="Multiplier">
                <ref name="nonNegativeDecimal"/>
              </element>
            </interleave>
          </element>
        </zeroOrMore>
      </element>
    </optional>
  </interleave>
</element>

Decay

Active

If false, the entity will not do any decaying.

Value type: boolean (true or false).

SinkingAnim

If true, the entity will decay in a ship-like manner.

Value type: boolean (true or false).

DelayTime

Time to wait before starting to sink, in seconds.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

SinkRate

Initial rate of sinking, in metres per second.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

SinkAccel

Acceleration rate of sinking, in metres per second per second.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

RELAX NG Grammar

<element name="Decay">
  <interleave>
    <element name="Active">
      <data type="boolean"/>
    </element>
    <element name="SinkingAnim">
      <data type="boolean"/>
    </element>
    <element name="DelayTime">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="SinkRate">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="SinkAccel">
      <ref name="nonNegativeDecimal"/>
    </element>
  </interleave>
</element>

EntityLimits

Specifies per category limits on number of entities (buildings or units) that can be created for each player

Example

<EntityLimits>
  <Limits>
    <Apadana>1</Apadana>
    <Fortress>10</Fortress>
    <Hero>1</Hero>
    <Monument>5</Monument>
    <Tower>25</Tower>
    <Wonder>1</Wonder>
  </Limits>
  <LimitChangers>
    <Monument>
      <CivilCentre>2</CivilCentre>
    </Monument>
  </LimitChangers>
  <LimitRemovers>
    <CivilCentre>
      <RequiredTechs datatype="tokens">town_phase</RequiredTechs>
    </CivilCentre>
  </LimitRemovers>
</EntityLimits>

Limits

LimitChangers

LimitRemovers

datatype

Required value: tokens

RELAX NG Grammar

<element name="EntityLimits">
  <interleave>
    <element name="Limits">
      <zeroOrMore>
        <element>
          <anyName/>
          <data type="integer"/>
        </element>
      </zeroOrMore>
    </element>
    <element name="LimitChangers">
      <zeroOrMore>
        <element>
          <anyName/>
          <zeroOrMore>
            <element>
              <anyName/>
              <data type="integer"/>
            </element>
          </zeroOrMore>
        </element>
      </zeroOrMore>
    </element>
    <element name="LimitRemovers">
      <zeroOrMore>
        <element>
          <anyName/>
          <oneOrMore>
            <element>
              <anyName/>
              <attribute name="datatype">
                <value>tokens</value>
              </attribute>
              <text/>
            </element>
          </oneOrMore>
        </element>
      </zeroOrMore>
    </element>
  </interleave>
</element>

Fogging

Allows this entity to be replaced by mirage entities in the fog-of-war.

RELAX NG Grammar

<element name="Fogging">
  <interleave>
    <empty/>
  </interleave>
</element>

Footprint

Approximation of the entity's shape, for collision detection and may be used for outline rendering or to determine selectable bounding box. Shapes are flat horizontal squares or circles, extended vertically to a given height.

Examples

<Footprint>
  <Square width="3.0" height="3.0"/>
  <Height>0.0</Height>
  <MaxSpawnDistance>8</MaxSpawnDistance>
</Footprint>
<Footprint>
  <Circle radius="0.5"/>
  <Height>0.0</Height>
  <MaxSpawnDistance>8</MaxSpawnDistance>
</Footprint>

Square

Set the footprint to a square of the given size.

width

Size of the footprint along the left/right direction (in metres).

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

depth

Size of the footprint along the front/back direction (in metres).

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

Circle

Set the footprint to a circle of the given size.

radius

Radius of the footprint (in metres).

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

Height

Vertical extent of the footprint (in metres).

Value type: non-negative decimal (e.g. 0.0 or 2.5).

MaxSpawnDistance

Optional.

Farthest distance units can spawn away from the edge of this entity.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

RELAX NG Grammar

<element name="Footprint">
  <interleave>
    <choice>
      <element name="Square">
        <attribute name="width">
          <data type="decimal">
            <param name="minExclusive">0.0</param>
          </data>
        </attribute>
        <attribute name="depth">
          <data type="decimal">
            <param name="minExclusive">0.0</param>
          </data>
        </attribute>
      </element>
      <element name="Circle">
        <attribute name="radius">
          <data type="decimal">
            <param name="minExclusive">0.0</param>
          </data>
        </attribute>
      </element>
    </choice>
    <element name="Height">
      <ref name="nonNegativeDecimal"/>
    </element>
    <optional>
      <element name="MaxSpawnDistance">
        <ref name="nonNegativeDecimal"/>
      </element>
    </optional>
  </interleave>
</element>

Formation

RequiredMemberCount

Minimum number of entities the formation should contain (at least 2)..

Value type: integer.

DisabledTooltip

Tooltip shown when the formation is disabled..

Value type: text.

SpeedMultiplier

The speed of the formation is determined by the minimum speed of all members, multiplied with this number..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

FormationShape

Formation shape, currently supported are square, triangle and special, where special will be defined in the source code..

Value type: text.

MaxTurningAngle

The turning angle in radian under which the formation attempts to turn and over which the formation positions are recomputed..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

ShiftRows

Set the value to true to shift subsequent rows..

Value type: text.

SortingClasses

Classes will be added to the formation in this order. Where the classes will be added first depends on the formation..

Value type: text.

SortingOrder

Optional.

The order of sorting. This defaults to an order where the formation is filled from the first row to the last, and each row from the center to the sides. Other possible sort orders are “fillFromTheSides”, where the most important units are on the sides of each row, and “fillToTheCenter”, where the most vulnerable units are in the center of the formation..

Value type: text.

WidthDepthRatio

Average width-to-depth ratio, counted in number of units..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Sloppiness

The maximum difference between the actual and the perfectly aligned formation position, in meters..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

MinColumns

Optional.

When possible, this number of colums will be created. Overriding the wanted width-to-depth ratio..

Value type: non-negative integer (e.g. 0 or 5).

MaxColumns

Optional.

When possible within the number of units, and the maximum number of rows, this will be the maximum number of columns..

Value type: non-negative integer (e.g. 0 or 5).

MaxRows

Optional.

The maximum number of rows in the formation..

Value type: non-negative integer (e.g. 0 or 5).

CenterGap

Optional.

The size of the central gap, expressed in number of units wide..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

UnitSeparationWidthMultiplier

Place the units in the formation closer or further to each other. The standard separation is the footprint size..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

UnitSeparationDepthMultiplier

Place the units in the formation closer or further to each other. The standard separation is the footprint size..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

AnimationVariants

Give a list of animation variants to use for the particular formation members, based on their positions..

Value type: text.

RELAX NG Grammar

<element name="Formation">
  <interleave>
    <element name="RequiredMemberCount">
      <data type="integer">
        <param name="minInclusive">2</param>
      </data>
    </element>
    <element name="DisabledTooltip">
      <text/>
    </element>
    <element name="SpeedMultiplier">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="FormationShape">
      <text/>
    </element>
    <element name="MaxTurningAngle">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="ShiftRows">
      <text/>
    </element>
    <element name="SortingClasses">
      <text/>
    </element>
    <optional>
      <element name="SortingOrder">
        <text/>
      </element>
    </optional>
    <element name="WidthDepthRatio">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="Sloppiness">
      <ref name="nonNegativeDecimal"/>
    </element>
    <optional>
      <element name="MinColumns">
        <data type="nonNegativeInteger"/>
      </element>
    </optional>
    <optional>
      <element name="MaxColumns">
        <data type="nonNegativeInteger"/>
      </element>
    </optional>
    <optional>
      <element name="MaxRows">
        <data type="nonNegativeInteger"/>
      </element>
    </optional>
    <optional>
      <element name="CenterGap">
        <ref name="nonNegativeDecimal"/>
      </element>
    </optional>
    <element name="UnitSeparationWidthMultiplier">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="UnitSeparationDepthMultiplier">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="AnimationVariants">
      <text/>
    </element>
  </interleave>
</element>

FormationAttack

CanAttackAsFormation

Value type: text.

RELAX NG Grammar

<element name="FormationAttack">
  <interleave>
    <element name="CanAttackAsFormation">
      <text/>
    </element>
  </interleave>
</element>

Foundation

BuildTimeModifier

Effect for having multiple builders..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

RELAX NG Grammar

<element name="Foundation">
  <interleave>
    <element name="BuildTimeModifier">
      <ref name="nonNegativeDecimal"/>
    </element>
  </interleave>
</element>

GarrisonHolder

Max

Maximum number of entities which can be garrisoned in this holder.

Value type: positive integer (e.g. 1 or 5).

List

Classes of entities which are allowed to garrison in this holder (from Identity).

Value type: text.

datatype

Required value: tokens

EjectClassesOnDestroy

Classes of entities to be ejected on destroy. Others are killed.

Value type: text.

datatype

Required value: tokens

BuffHeal

Number of hitpoints that will be restored to this holder's garrisoned units each second.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

LoadingRange

The maximum distance from this holder at which entities are allowed to garrison. Should be about 2.0 for land entities and preferably greater for ships.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

EjectHealth

Optional.

Percentage of maximum health below which this holder no longer allows garrisoning.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Pickup

Optional.

This garrisonHolder will move to pick up units to be garrisoned.

Value type: boolean (true or false).

RELAX NG Grammar

<element name="GarrisonHolder">
  <interleave>
    <element name="Max">
      <data type="positiveInteger"/>
    </element>
    <element name="List">
      <attribute name="datatype">
        <value>tokens</value>
      </attribute>
      <text/>
    </element>
    <element name="EjectClassesOnDestroy">
      <attribute name="datatype">
        <value>tokens</value>
      </attribute>
      <text/>
    </element>
    <element name="BuffHeal">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="LoadingRange">
      <ref name="nonNegativeDecimal"/>
    </element>
    <optional>
      <element name="EjectHealth">
        <ref name="nonNegativeDecimal"/>
      </element>
    </optional>
    <optional>
      <element name="Pickup">
        <data type="boolean"/>
      </element>
    </optional>
  </interleave>
</element>

Garrisonable

Controls the garrisonability of an entity.

Example

<Garrisonable>
  <Size>10</Size>
</Garrisonable>

Size

Number of garrison slots the entity occupies..

Value type: non-negative integer (e.g. 0 or 5).

RELAX NG Grammar

<element name="Garrisonable">
  <interleave>
    <element name="Size">
      <data type="nonNegativeInteger"/>
    </element>
  </interleave>
</element>

Gate

Controls behavior of wall gates

Example

<Gate>
  <PassRange>20</PassRange>
</Gate>

PassRange

Units must be within this distance (in meters) of the gate for it to open.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

RELAX NG Grammar

<element name="Gate">
  <interleave>
    <element name="PassRange">
      <ref name="nonNegativeDecimal"/>
    </element>
  </interleave>
</element>

Guard

RELAX NG Grammar

<element name="Guard">
  <interleave>
    <empty/>
  </interleave>
</element>

Heal

Controls the healing abilities of the unit.

Example

<Heal>
  <Range>20</Range>
  <RangeOverlay>
    <LineTexture>heal_overlay_range.png</LineTexture>
    <LineTextureMask>heal_overlay_range_mask.png</LineTextureMask>
    <LineThickness>0.35</LineThickness>
  </RangeOverlay>
  <Health>5</Health>
  <Interval>2000</Interval>
  <UnhealableClasses datatype="tokens">Cavalry</UnhealableClasses>
  <HealableClasses datatype="tokens">Support Infantry</HealableClasses>
</Heal>

Range

Range (in metres) where healing is possible..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

RangeOverlay

Optional.

LineTexture

Value type: text.

LineTextureMask

Value type: text.

LineThickness

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Health

Health healed per Interval..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Interval

A heal is performed every Interval ms..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

UnhealableClasses

If the target has any of these classes it can not be healed (even if it has a class from HealableClasses)..

Value type: text.

datatype

Required value: tokens

HealableClasses

The target must have one of these classes to be healable..

Value type: text.

datatype

Required value: tokens

RELAX NG Grammar

<element name="Heal">
  <interleave>
    <element name="Range">
      <ref name="nonNegativeDecimal"/>
    </element>
    <optional>
      <element name="RangeOverlay">
        <interleave>
          <element name="LineTexture">
            <text/>
          </element>
          <element name="LineTextureMask">
            <text/>
          </element>
          <element name="LineThickness">
            <ref name="nonNegativeDecimal"/>
          </element>
        </interleave>
      </element>
    </optional>
    <element name="Health">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="Interval">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="UnhealableClasses">
      <attribute name="datatype">
        <value>tokens</value>
      </attribute>
      <text/>
    </element>
    <element name="HealableClasses">
      <attribute name="datatype">
        <value>tokens</value>
      </attribute>
      <text/>
    </element>
  </interleave>
</element>

Health

Deals with hitpoints and death.

Example

<Health>
  <Max>100</Max>
  <RegenRate>1.0</RegenRate>
  <IdleRegenRate>0</IdleRegenRate>
  <DeathType>corpse</DeathType>
</Health>

Max

Maximum hitpoints.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Initial

Optional.

Initial hitpoints. Default if unspecified is equal to Max.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

DamageVariants

Optional.

RegenRate

Hitpoint regeneration rate per second..

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

IdleRegenRate

Hitpoint regeneration rate per second when idle or garrisoned..

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

DeathType

Behaviour when the unit dies.

Value is one of:

vanish
Disappear instantly.
corpse
Turn into a corpse.
remain
Remain in the world with 0 health.

SpawnEntityOnDeath

Optional.

Entity template to spawn when this entity dies. Note: this is different than the corpse, which retains the original entity's appearance.

Value type: text.

Unhealable

Indicates that the entity can not be healed by healer units.

Value type: boolean (true or false).

RELAX NG Grammar

<element name="Health">
  <interleave>
    <element name="Max">
      <ref name="nonNegativeDecimal"/>
    </element>
    <optional>
      <element name="Initial">
        <ref name="nonNegativeDecimal"/>
      </element>
    </optional>
    <optional>
      <element name="DamageVariants">
        <oneOrMore>
          <element>
            <anyName/>
            <data type="decimal">
              <param name="minInclusive">0</param>
              <param name="maxInclusive">1</param>
            </data>
          </element>
        </oneOrMore>
      </element>
    </optional>
    <element name="RegenRate">
      <data type="decimal"/>
    </element>
    <element name="IdleRegenRate">
      <data type="decimal"/>
    </element>
    <element name="DeathType">
      <choice>
        <value>vanish</value>
        <value>corpse</value>
        <value>remain</value>
      </choice>
    </element>
    <optional>
      <element name="SpawnEntityOnDeath">
        <text/>
      </element>
    </optional>
    <element name="Unhealable">
      <data type="boolean"/>
    </element>
  </interleave>
</element>

Identity

Specifies various names and values associated with the entity, typically for GUI display to users.

Example

<Identity>
  <Civ>athen</Civ>
  <GenericName>Athenian Hoplite</GenericName>
  <SpecificName>Hoplī́tēs Athēnaïkós</SpecificName>
  <Icon>units/athen_infantry_spearman.png</Icon>
</Identity>

Civ

Civilization that this unit is primarily associated with, typically a 4-letter code. Choices include: gaia (world objects), skirm (skirmish map placeholders), athen (Athenians), brit (Britons), cart (Carthaginians), gaul (Gauls), iber (Iberians), kush (Kushites), mace (Macedonians), maur (Mauryas), pers (Persians), ptol (Ptolemies), rome (Romans), sele (Seleucids), spart (Spartans)..

Value type: text.

Lang

Optional.

Unit language for voices..

Value type: text.

Phenotype

Optional.

Unit phenotype for voices and visual. If more than one is specified a random one will be chosen..

Value type: text.

datatype

Required value: tokens

GenericName

Generic English-language name for this entity..

Value type: text.

SpecificName

Optional.

Specific native-language name for this entity..

Value type: text.

SelectionGroupName

Optional.

Name used to group ranked entities..

Value type: text.

Tooltip

Optional.

Value type: text.

History

Optional.

Value type: text.

Rank

Optional.

Value is one of:

Basic
Advanced
Elite

Classes

Optional.

Optional list of space-separated classes applying to this entity. Choices include: AfricanElephant, AmunGuard, Animal, ApedemakGuard, Ashoka, Barter, CitizenSoldier, CivCentre, CivSpecific, ConquestCritical, Domestic, DropsiteFood, DropsiteMetal, DropsiteStone, DropsiteWood, FastMoving, FemaleCitizen, Foundation, GarrisonFortress, Human, IndianElephant, Juggernaut, KushTrireme, MercenaryCamp, Organic, Player, PtolemyIV, SeaCreature, Spy, Structure, Unit, WallLong, WallMedium, WallShort, WallTower..

Value type: text.

datatype

Required value: tokens

VisibleClasses

Optional.

Optional list of space-separated classes applying to this entity. These classes will also be visible in various GUI elements. If the classes need spaces, underscores will be replaced with spaces. Choices include: Amphitheater, Archer, ArmyCamp, Arsenal, ArtilleryTower, Axeman, Barracks, Bireme, BoltShooter, BoltTower, Bribable, Builder, Camel, Cavalry, Champion, Chariot, Citizen, City, Civic, CivilCentre, Colony, Corral, Council, Crossbowman, Defensive, Dock, Dog, Economic, Elephant, ElephantStable, Embassy, Farmstead, Field, Fireship, FishingBoat, Forge, Fortress, Gate, Gladiator, Gymnasium, Hall, Healer, Hero, House, Immortal, Infantry, Javelineer, Library, Lighthouse, Maceman, Melee, Market, Mercenary, Military, Monument, Naval, Outpost, Palace, Palisade, Pikeman, Pillar, Pyramid, Quinquereme, Ram, Range, Ranged, Relic, Resource, RotaryMill, SentryTower, Ship, Shipyard, Siege, SiegeTower, SiegeWall, Slave, Slinger, Soldier, Spearman, Stable, Stoa, StoneThrower, StoneTower, Storehouse, Support, Swordsman, Syssiton, Temple, TempleOfAmun, TempleOfApedemak, TempleOfMars, TempleOfVesta, Theater, Tower, Town, Trade, Trader, Trireme, TriumphalArch, Village, Wall, Warship, Wonder, Worker..

Value type: text.

datatype

Required value: tokens

Icon

Value type: text.

RequiredTechnology

Optional.

Optional name of a technology which must be researched before the entity can be produced..

Value type: text.

Controllable

Optional.

Whether players can control this entity. Defaults to true..

Value type: boolean (true or false).

Undeletable

Prevent players from deleting this entity..

Value type: boolean (true or false).

RELAX NG Grammar

<element name="Identity">
  <interleave>
    <element name="Civ">
      <text/>
    </element>
    <optional>
      <element name="Lang">
        <text/>
      </element>
    </optional>
    <optional>
      <element name="Phenotype">
        <attribute name="datatype">
          <value>tokens</value>
        </attribute>
        <text/>
      </element>
    </optional>
    <element name="GenericName">
      <text/>
    </element>
    <optional>
      <element name="SpecificName">
        <text/>
      </element>
    </optional>
    <optional>
      <element name="SelectionGroupName">
        <text/>
      </element>
    </optional>
    <optional>
      <element name="Tooltip">
        <text/>
      </element>
    </optional>
    <optional>
      <element name="History">
        <text/>
      </element>
    </optional>
    <optional>
      <element name="Rank">
        <choice>
          <value>Basic</value>
          <value>Advanced</value>
          <value>Elite</value>
        </choice>
      </element>
    </optional>
    <optional>
      <element name="Classes">
        <attribute name="datatype">
          <value>tokens</value>
        </attribute>
        <text/>
      </element>
    </optional>
    <optional>
      <element name="VisibleClasses">
        <attribute name="datatype">
          <value>tokens</value>
        </attribute>
        <text/>
      </element>
    </optional>
    <element name="Icon">
      <text/>
    </element>
    <optional>
      <element name="RequiredTechnology">
        <text/>
      </element>
    </optional>
    <optional>
      <element name="Controllable">
        <data type="boolean"/>
      </element>
    </optional>
    <element name="Undeletable">
      <data type="boolean"/>
    </element>
  </interleave>
</element>

Loot

Specifies the loot credited when this entity is killed.

Example

<Loot>
  <xp>35</xp>
  <metal>10</metal>
</Loot>

food

Optional.

Value type: non-negative integer (e.g. 0 or 5).

wood

Optional.

Value type: non-negative integer (e.g. 0 or 5).

stone

Optional.

Value type: non-negative integer (e.g. 0 or 5).

metal

Optional.

Value type: non-negative integer (e.g. 0 or 5).

xp

Optional.

Value type: non-negative integer (e.g. 0 or 5).

RELAX NG Grammar

<element name="Loot">
  <interleave>
    <interleave>
      <optional>
        <element name="food">
          <data type="nonNegativeInteger"/>
        </element>
      </optional>
      <optional>
        <element name="wood">
          <data type="nonNegativeInteger"/>
        </element>
      </optional>
      <optional>
        <element name="stone">
          <data type="nonNegativeInteger"/>
        </element>
      </optional>
      <optional>
        <element name="metal">
          <data type="nonNegativeInteger"/>
        </element>
      </optional>
      <optional>
        <element name="xp">
          <data type="nonNegativeInteger"/>
        </element>
      </optional>
    </interleave>
  </interleave>
</element>

Looter

RELAX NG Grammar

<element name="Looter">
  <interleave>
    <empty/>
  </interleave>
</element>

Market

TradeType

Specifies the type of possible trade route (land or naval)..

InternationalBonus

Additional part of the gain donated when two different players trade.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

RELAX NG Grammar

<element name="Market">
  <interleave>
    <element name="TradeType">
      <list>
        <oneOrMore>
          <choice>
            <value>land</value>
            <value>naval</value>
          </choice>
        </oneOrMore>
      </list>
    </element>
    <element name="InternationalBonus">
      <ref name="nonNegativeDecimal"/>
    </element>
  </interleave>
</element>

Minimap

Type

Value is one of:

food
wood
stone
metal
structure
unit
support
hero

Color

Optional.

r

Value type: integer.

g

Value type: integer.

b

Value type: integer.

Icon

Optional.

Icon texture that should be displayed on a minimap. Filepath relative to art/textures/ui/session/icons/minimap/..

Value type: text.

size

Value type: float.

RELAX NG Grammar

<element name="Minimap">
  <interleave>
    <element name="Type">
      <choice>
        <value>food</value>
        <value>wood</value>
        <value>stone</value>
        <value>metal</value>
        <value>structure</value>
        <value>unit</value>
        <value>support</value>
        <value>hero</value>
      </choice>
    </element>
    <optional>
      <element name="Color">
        <attribute name="r">
          <data type="integer">
            <param name="minInclusive">0</param>
            <param name="maxInclusive">255</param>
          </data>
        </attribute>
        <attribute name="g">
          <data type="integer">
            <param name="minInclusive">0</param>
            <param name="maxInclusive">255</param>
          </data>
        </attribute>
        <attribute name="b">
          <data type="integer">
            <param name="minInclusive">0</param>
            <param name="maxInclusive">255</param>
          </data>
        </attribute>
      </element>
    </optional>
    <optional>
      <element name="Icon">
        <attribute name="size">
          <data type="float">
            <param name="minExclusive">0</param>
          </data>
        </attribute>
        <text/>
      </element>
    </optional>
  </interleave>
</element>

Mirage

Mirage entities replace real entities in the fog-of-war.

RELAX NG Grammar

<element name="Mirage">
  <interleave>
    <empty/>
  </interleave>
</element>

ModifiersManager

RELAX NG Grammar

<element name="ModifiersManager">
  <interleave>
    <empty/>
  </interleave>
</element>

Obstruction

Causes this entity to obstruct the motion of other units.

Example

<Obstruction/>

Static

width

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

depth

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

Unit

Obstructions

x

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

z

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

width

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

depth

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

Active

If false, this entity will be ignored in collision tests by other units but can still perform its own collision tests.

Value type: boolean (true or false).

BlockMovement

Whether units should be allowed to walk through this entity.

Value type: boolean (true or false).

BlockPathfinding

Whether the long-distance pathfinder should avoid paths through this entity. This should only be set for large stationary obstructions.

Value type: boolean (true or false).

BlockFoundation

Whether players should be unable to place building foundations on top of this entity. If true, BlockConstruction should be true too.

Value type: boolean (true or false).

BlockConstruction

Whether players should be unable to begin constructing buildings placed on top of this entity.

Value type: boolean (true or false).

DeleteUponConstruction

Whether this entity should be deleted when construction on a buildings placed on top of this entity is started..

Value type: boolean (true or false).

DisableBlockMovement

If true, BlockMovement will be overridden and treated as false. (This is a special case to handle foundations).

Value type: boolean (true or false).

DisableBlockPathfinding

If true, BlockPathfinding will be overridden and treated as false. (This is a special case to handle foundations).

Value type: boolean (true or false).

ControlPersist

Optional.

If present, the control group of this entity will be given to entities that are colliding with it..

RELAX NG Grammar

<element name="Obstruction">
  <interleave>
    <choice>
      <element name="Static">
        <attribute name="width">
          <data type="decimal">
            <param name="minInclusive">1.5</param>
          </data>
        </attribute>
        <attribute name="depth">
          <data type="decimal">
            <param name="minInclusive">1.5</param>
          </data>
        </attribute>
      </element>
      <element name="Unit">
        <empty/>
      </element>
      <element name="Obstructions">
        <zeroOrMore>
          <element>
            <anyName/>
            <optional>
              <attribute name="x">
                <data type="decimal"/>
              </attribute>
            </optional>
            <optional>
              <attribute name="z">
                <data type="decimal"/>
              </attribute>
            </optional>
            <attribute name="width">
              <data type="decimal">
                <param name="minInclusive">1.5</param>
              </data>
            </attribute>
            <attribute name="depth">
              <data type="decimal">
                <param name="minInclusive">1.5</param>
              </data>
            </attribute>
          </element>
        </zeroOrMore>
      </element>
    </choice>
    <element name="Active">
      <data type="boolean"/>
    </element>
    <element name="BlockMovement">
      <data type="boolean"/>
    </element>
    <element name="BlockPathfinding">
      <data type="boolean"/>
    </element>
    <element name="BlockFoundation">
      <data type="boolean"/>
    </element>
    <element name="BlockConstruction">
      <data type="boolean"/>
    </element>
    <element name="DeleteUponConstruction">
      <data type="boolean"/>
    </element>
    <element name="DisableBlockMovement">
      <data type="boolean"/>
    </element>
    <element name="DisableBlockPathfinding">
      <data type="boolean"/>
    </element>
    <optional>
      <element name="ControlPersist">
        <empty/>
      </element>
    </optional>
  </interleave>
</element>

OverlayRenderer

RELAX NG Grammar

<element name="OverlayRenderer">
  <interleave>
    <empty/>
  </interleave>
</element>

Ownership

Allows this entity to be owned by players.

Example

<Ownership/>

RELAX NG Grammar

<element name="Ownership">
  <interleave>
    <empty/>
  </interleave>
</element>

Pack

Entity

Entity to transform into.

Value type: text.

Time

Time required to transform this entity, in milliseconds.

Value type: non-negative integer (e.g. 0 or 5).

State

Whether this entity is packed or unpacked.

Value is one of:

packed
unpacked

RELAX NG Grammar

<element name="Pack">
  <interleave>
    <element name="Entity">
      <text/>
    </element>
    <element name="Time">
      <data type="nonNegativeInteger"/>
    </element>
    <element name="State">
      <choice>
        <value>packed</value>
        <value>unpacked</value>
      </choice>
    </element>
  </interleave>
</element>

Player

BarterMultiplier

Multipliers for barter prices..

Buy

Multipliers for the buy prices..

food

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

wood

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

stone

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

metal

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

Sell

Multipliers for the sell prices..

food

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

wood

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

stone

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

metal

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

Formations

Space-separated list of formations this player can use..

Value type: text.

datatype

Required value: tokens

SharedLosTech

Allies will share los when this technology is researched. Leave empty to never share LOS..

Value type: text.

SharedDropsitesTech

Allies will share dropsites when this technology is researched. Leave empty to never share dropsites..

Value type: text.

SpyCostMultiplier

Value type: non-negative decimal (e.g. 0.0 or 2.5).

RELAX NG Grammar

<element name="Player">
  <interleave>
    <element name="BarterMultiplier">
      <interleave>
        <element name="Buy">
          <interleave>
            <optional>
              <element name="food">
                <ref name="positiveDecimal"/>
              </element>
            </optional>
            <optional>
              <element name="wood">
                <ref name="positiveDecimal"/>
              </element>
            </optional>
            <optional>
              <element name="stone">
                <ref name="positiveDecimal"/>
              </element>
            </optional>
            <optional>
              <element name="metal">
                <ref name="positiveDecimal"/>
              </element>
            </optional>
          </interleave>
        </element>
        <element name="Sell">
          <interleave>
            <optional>
              <element name="food">
                <ref name="positiveDecimal"/>
              </element>
            </optional>
            <optional>
              <element name="wood">
                <ref name="positiveDecimal"/>
              </element>
            </optional>
            <optional>
              <element name="stone">
                <ref name="positiveDecimal"/>
              </element>
            </optional>
            <optional>
              <element name="metal">
                <ref name="positiveDecimal"/>
              </element>
            </optional>
          </interleave>
        </element>
      </interleave>
    </element>
    <element name="Formations">
      <attribute name="datatype">
        <value>tokens</value>
      </attribute>
      <text/>
    </element>
    <element name="SharedLosTech">
      <text/>
    </element>
    <element name="SharedDropsitesTech">
      <text/>
    </element>
    <element name="SpyCostMultiplier">
      <ref name="nonNegativeDecimal"/>
    </element>
  </interleave>
</element>

Population

Specifies the Population cap increase generated by this entity.

Example

<Population>
  <Bonus>15</Bonus>
</Population>

Bonus

Population cap increase while this entity exists..

Value type: non-negative integer (e.g. 0 or 5).

RELAX NG Grammar

<element name="Population">
  <interleave>
    <element name="Bonus">
      <data type="nonNegativeInteger"/>
    </element>
  </interleave>
</element>

Position

Allows this entity to exist at a location (and orientation) in the world, and defines some details of the positioning.

Example

<Position>
  <Anchor>upright</Anchor>
  <Altitude>0.0</Altitude>
  <Floating>false</Floating>
  <FloatDepth>0.0</FloatDepth>
  <TurnRate>6.0</TurnRate>
</Position>

Anchor

Automatic rotation to follow the slope of terrain.

Value is one of:

upright
Always stand straight up (e.g. humans).
pitch
Rotate backwards and forwards to follow the terrain (e.g. animals).
roll
Rotate sideways to follow the terrain.
pitch-roll
Rotate in all directions to follow the terrain (e.g. carts).

Altitude

Height above terrain in metres.

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

Floating

Whether the entity floats on water.

Value type: boolean (true or false).

FloatDepth

The depth at which an entity floats on water (needs Floating to be true).

Value type: non-negative decimal (e.g. 0.0 or 2.5).

TurnRate

Maximum rotation speed around Y axis, in radians per second. Used for all graphical rotations and some real unitMotion driven rotations..

Value type: positive decimal (e.g. 1.0 or 2.5).

RELAX NG Grammar

<element name="Position">
  <interleave>
    <element name="Anchor">
      <choice>
        <value>upright</value>
        <value>pitch</value>
        <value>roll</value>
        <value>pitch-roll</value>
      </choice>
    </element>
    <element name="Altitude">
      <data type="decimal"/>
    </element>
    <element name="Floating">
      <data type="boolean"/>
    </element>
    <element name="FloatDepth">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="TurnRate">
      <ref name="positiveDecimal"/>
    </element>
  </interleave>
</element>

ProductionQueue

Helps the building to train new units and research technologies.

RELAX NG Grammar

<element name="ProductionQueue">
  <interleave>
    <empty/>
  </interleave>
</element>

Promotion

Entity

Value type: text.

TrickleRate

Optional.

Trickle of XP gained each second..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

RequiredXp

Value type: positive integer (e.g. 1 or 5).

RELAX NG Grammar

<element name="Promotion">
  <interleave>
    <element name="Entity">
      <text/>
    </element>
    <optional>
      <element name="TrickleRate">
        <ref name="nonNegativeDecimal"/>
      </element>
    </optional>
    <element name="RequiredXp">
      <data type="positiveInteger"/>
    </element>
  </interleave>
</element>

RallyPoint

RELAX NG Grammar

<element name="RallyPoint">
  <interleave>
    <empty/>
  </interleave>
</element>

RallyPointRenderer

Displays a rally point marker where created units will gather when spawned

Example

<RallyPointRenderer>
  <MarkerTemplate>special/rallypoint</MarkerTemplate>
  <LineThickness>0.75</LineThickness>
  <LineStartCap>round</LineStartCap>
  <LineEndCap>square</LineEndCap>
  <LineDashColor r="158" g="11" b="15"/>
  <LinePassabilityClass>default</LinePassabilityClass>
</RallyPointRenderer>

MarkerTemplate

Template name for the rally point marker entity (typically a waypoint flag actor).

Value type: text.

LineTexture

Texture file to use for the rally point line.

Value type: text.

LineTextureMask

Texture mask to indicate where overlay colors are to be applied (see LineColor and LineDashColor).

Value type: text.

LineThickness

Thickness of the marker line connecting the entity to the rally point marker.

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

LineDashColor

r

Value type: integer.

g

Value type: integer.

b

Value type: integer.

LineStartCap

Value is one of:

flat
Abrupt line ending; line endings are not closed.
round
Semi-circular line end cap.
sharp
Sharp, pointy line end cap.
square
Square line end cap.

LineEndCap

Value is one of:

flat
Abrupt line ending; line endings are not closed.
round
Semi-circular line end cap.
sharp
Sharp, pointy line end cap.
square
Square line end cap.

LinePassabilityClass

The pathfinder passability class to use for computing the rally point marker line path.

Value type: text.

RELAX NG Grammar

<element name="RallyPointRenderer">
  <interleave>
    <element name="MarkerTemplate">
      <text/>
    </element>
    <element name="LineTexture">
      <text/>
    </element>
    <element name="LineTextureMask">
      <text/>
    </element>
    <element name="LineThickness">
      <data type="decimal"/>
    </element>
    <element name="LineDashColor">
      <attribute name="r">
        <data type="integer">
          <param name="minInclusive">0</param>
          <param name="maxInclusive">255</param>
        </data>
      </attribute>
      <attribute name="g">
        <data type="integer">
          <param name="minInclusive">0</param>
          <param name="maxInclusive">255</param>
        </data>
      </attribute>
      <attribute name="b">
        <data type="integer">
          <param name="minInclusive">0</param>
          <param name="maxInclusive">255</param>
        </data>
      </attribute>
    </element>
    <element name="LineStartCap">
      <choice>
        <value>flat</value>
        <value>round</value>
        <value>sharp</value>
        <value>square</value>
      </choice>
    </element>
    <element name="LineEndCap">
      <choice>
        <value>flat</value>
        <value>round</value>
        <value>sharp</value>
        <value>square</value>
      </choice>
    </element>
    <element name="LinePassabilityClass">
      <text/>
    </element>
  </interleave>
</element>

RangeOverlayManager

RELAX NG Grammar

<element name="RangeOverlayManager">
  <interleave>
    <empty/>
  </interleave>
</element>

Repairable

Deals with repairable structures and units.

Example

<Repairable>
  <RepairTimeRatio>2.0</RepairTimeRatio>
</Repairable>

RepairTimeRatio

repair time ratio relative to building (or production) time..

Value type: positive decimal (e.g. 1.0 or 2.5).

RELAX NG Grammar

<element name="Repairable">
  <interleave>
    <element name="RepairTimeRatio">
      <ref name="positiveDecimal"/>
    </element>
  </interleave>
</element>

Researcher

Allows the entity to research technologies.

Example

<Researcher>
  <TechCostMultiplier>
    <food>0.5</food>
    <wood>0.1</wood>
    <stone>0</stone>
    <metal>2</metal>
    <time>0.9</time>
  </TechCostMultiplier>
  <Technologies datatype="tokens">
    phase_town_{civ}
    phase_metropolis_ptol
    unlock_shared_los
    wonder_population_cap
  </Technologies>
</Researcher>

Technologies

Optional.

Space-separated list of technology names that this building can research. When present, the special string "{civ}" will be automatically replaced either by the civ code of the building's owner if such a tech exists, or by "generic"..

Value type: text.

datatype

Required value: tokens

TechCostMultiplier

Optional.

Multiplier to modify resources cost and research time of technologies researched in this building..

food

Optional.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

wood

Optional.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

stone

Optional.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

metal

Optional.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

time

Optional.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

RELAX NG Grammar

<element name="Researcher">
  <interleave>
    <optional>
      <element name="Technologies">
        <attribute name="datatype">
          <value>tokens</value>
        </attribute>
        <text/>
      </element>
    </optional>
    <optional>
      <element name="TechCostMultiplier">
        <interleave>
          <optional>
            <element name="food">
              <ref name="nonNegativeDecimal"/>
            </element>
          </optional>
          <optional>
            <element name="wood">
              <ref name="nonNegativeDecimal"/>
            </element>
          </optional>
          <optional>
            <element name="stone">
              <ref name="nonNegativeDecimal"/>
            </element>
          </optional>
          <optional>
            <element name="metal">
              <ref name="nonNegativeDecimal"/>
            </element>
          </optional>
          <optional>
            <element name="time">
              <ref name="nonNegativeDecimal"/>
            </element>
          </optional>
        </interleave>
      </element>
    </optional>
  </interleave>
</element>

Resistance

Controls the damage resistance of the unit.

Example

<Resistance>
  <Foundation>
    <Damage>
      <Hack>10.0</Hack>
      <Pierce>0.0</Pierce>
      <Crush>5.0</Crush>
    </Damage>
    <Capture>10</Capture>
  </Foundation>
  <Entity>
    <Damage>
      <Poison>5</Poison>
    </Damage>
  </Entity>
</Resistance>

Foundation

Resistance of an unfinished structure (i.e. a foundation)..

Damage

Capture

Resistance against Capture attacks..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

ApplyStatus

Resistance against StatusEffects..

Duration

Optional.

The reduction in duration of the status. The normal duration time is multiplied by this factor..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

BlockChance

Optional.

The chance of blocking the status. In the interval [0,1]..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Entity

Resistance of an entity..

Damage

Capture

Resistance against Capture attacks..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

ApplyStatus

Resistance against StatusEffects..

Duration

Optional.

The reduction in duration of the status. The normal duration time is multiplied by this factor..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

BlockChance

Optional.

The chance of blocking the status. In the interval [0,1]..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

RELAX NG Grammar

<element name="Resistance">
  <interleave>
    <zeroOrMore>
      <choice>
        <element name="Foundation">
          <oneOrMore>
            <choice>
              <element name="Damage">
                <oneOrMore>
                  <element>
                    <anyName/>
                    <ref name="nonNegativeDecimal"/>
                  </element>
                </oneOrMore>
              </element>
              <element name="Capture">
                <ref name="nonNegativeDecimal"/>
              </element>
              <element name="ApplyStatus">
                <oneOrMore>
                  <element>
                    <anyName/>
                    <interleave>
                      <optional>
                        <element name="Duration">
                          <ref name="nonNegativeDecimal"/>
                        </element>
                      </optional>
                      <optional>
                        <element name="BlockChance">
                          <ref name="nonNegativeDecimal"/>
                        </element>
                      </optional>
                    </interleave>
                  </element>
                </oneOrMore>
              </element>
            </choice>
          </oneOrMore>
        </element>
        <element name="Entity">
          <oneOrMore>
            <choice>
              <element name="Damage">
                <oneOrMore>
                  <element>
                    <anyName/>
                    <ref name="nonNegativeDecimal"/>
                  </element>
                </oneOrMore>
              </element>
              <element name="Capture">
                <ref name="nonNegativeDecimal"/>
              </element>
              <element name="ApplyStatus">
                <oneOrMore>
                  <element>
                    <anyName/>
                    <interleave>
                      <optional>
                        <element name="Duration">
                          <ref name="nonNegativeDecimal"/>
                        </element>
                      </optional>
                      <optional>
                        <element name="BlockChance">
                          <ref name="nonNegativeDecimal"/>
                        </element>
                      </optional>
                    </interleave>
                  </element>
                </oneOrMore>
              </element>
            </choice>
          </oneOrMore>
        </element>
      </choice>
    </zeroOrMore>
  </interleave>
</element>

ResourceDropsite

Types

Sharable

Allows allies to use this entity..

Value type: boolean (true or false).

RELAX NG Grammar

<element name="ResourceDropsite">
  <interleave>
    <element name="Types">
      <list>
        <zeroOrMore>
          <choice>
            <value>food</value>
            <value>wood</value>
            <value>stone</value>
            <value>metal</value>
          </choice>
        </zeroOrMore>
      </list>
    </element>
    <element name="Sharable">
      <data type="boolean"/>
    </element>
  </interleave>
</element>

ResourceGatherer

Lets the unit gather resources from entities that have the ResourceSupply component.

Example

<ResourceGatherer>
  <MaxDistance>2.0</MaxDistance>
  <BaseSpeed>1.0</BaseSpeed>
  <Rates>
    <food.fish>1</food.fish>
    <metal.ore>3</metal.ore>
    <stone.rock>3</stone.rock>
    <wood.tree>2</wood.tree>
  </Rates>
  <Capacities>
    <food>10</food>
    <metal>10</metal>
    <stone>10</stone>
    <wood>10</wood>
  </Capacities>
</ResourceGatherer>

MaxDistance

Max resource-gathering distance.

Value type: positive decimal (e.g. 1.0 or 2.5).

BaseSpeed

Base resource-gathering rate (in resource units per second).

Value type: positive decimal (e.g. 1.0 or 2.5).

Rates

Per-resource-type gather rate multipliers. If a resource type is not specified then it cannot be gathered by this unit.

food

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

wood

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

stone

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

metal

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

food.fish

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

food.fruit

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

food.grain

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

food.meat

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

wood.tree

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

wood.ruins

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

stone.rock

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

stone.ruins

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

metal.ore

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

metal.ruins

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

Capacities

Per-resource-type maximum carrying capacity.

food

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

wood

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

stone

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

metal

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

RELAX NG Grammar

<element name="ResourceGatherer">
  <interleave>
    <element name="MaxDistance">
      <ref name="positiveDecimal"/>
    </element>
    <element name="BaseSpeed">
      <ref name="positiveDecimal"/>
    </element>
    <element name="Rates">
      <interleave>
        <optional>
          <element name="food">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="wood">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="stone">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="metal">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="food.fish">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="food.fruit">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="food.grain">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="food.meat">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="wood.tree">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="wood.ruins">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="stone.rock">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="stone.ruins">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="metal.ore">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="metal.ruins">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
      </interleave>
    </element>
    <element name="Capacities">
      <interleave>
        <optional>
          <element name="food">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="wood">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="stone">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="metal">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
      </interleave>
    </element>
  </interleave>
</element>

ResourceSupply

Provides a supply of one particular type of resource.

Example

<ResourceSupply>
  <Max>1000</Max>
  <Initial>1000</Initial>
  <Type>food.meat</Type>
  <KillBeforeGather>false</KillBeforeGather>
  <MaxGatherers>25</MaxGatherers>
  <DiminishingReturns>0.8</DiminishingReturns>
  <Change>
    <AnyName>
      <Value>2</Value>
      <Interval>1000</Interval>
    </AnyName>
    <Growth>
      <State>alive</State>
      <Value>2</Value>
      <Interval>1000</Interval>
      <UpperLimit>500</UpperLimit>
    </Growth>
    <Rotting>
      <State>dead notGathered</State>
      <Value>-2</Value>
      <Interval>1000</Interval>
    </Rotting>
    <Decay>
      <State>dead</State>
      <Value>-1</Value>
      <Interval>1000</Interval>
      <LowerLimit>500</LowerLimit>
    </Decay>
  </Change>
</ResourceSupply>

KillBeforeGather

Whether this entity must be killed (health reduced to 0) before its resources can be gathered.

Value type: boolean (true or false).

Max

Max amount of resources available from this entity..

Initial

Optional.

Initial amount of resources available from this entity, if this is not specified, Max is used..

Type

Type and Subtype of resource available from this entity.

Value is one of:

food.fish
food.fruit
food.grain
food.meat
wood.tree
wood.ruins
stone.rock
stone.ruins
metal.ore
metal.ruins

MaxGatherers

Amount of gatherers who can gather resources from this entity at the same time.

Value type: non-negative integer (e.g. 0 or 5).

DiminishingReturns

Optional.

The relative rate of any new gatherer compared to the previous one (geometric sequence). Leave the element out for no diminishing returns..

Value type: positive decimal (e.g. 1.0 or 2.5).

Change

Optional.

Optional element containing all the modifications that affects a resource supply.

Value

The amount of resource added per interval..

Value type: integer.

Interval

The interval in milliseconds..

Value type: positive integer (e.g. 1 or 5).

UpperLimit

Optional.

The upper limit of the value after which the Change has no effect..

Value type: non-negative integer (e.g. 0 or 5).

LowerLimit

Optional.

The bottom limit of the value after which the Change has no effect..

Value type: non-negative integer (e.g. 0 or 5).

State

Optional.

What state the entity must be in for the effect to occur..

RELAX NG Grammar

<element name="ResourceSupply">
  <interleave>
    <element name="KillBeforeGather">
      <data type="boolean"/>
    </element>
    <element name="Max">
      <choice>
        <data type="nonNegativeInteger"/>
        <value>Infinity</value>
      </choice>
    </element>
    <optional>
      <element name="Initial">
        <choice>
          <data type="nonNegativeInteger"/>
          <value>Infinity</value>
        </choice>
      </element>
    </optional>
    <element name="Type">
      <choice>
        <value>food.fish</value>
        <value>food.fruit</value>
        <value>food.grain</value>
        <value>food.meat</value>
        <value>wood.tree</value>
        <value>wood.ruins</value>
        <value>stone.rock</value>
        <value>stone.ruins</value>
        <value>metal.ore</value>
        <value>metal.ruins</value>
      </choice>
    </element>
    <element name="MaxGatherers">
      <data type="nonNegativeInteger"/>
    </element>
    <optional>
      <element name="DiminishingReturns">
        <ref name="positiveDecimal"/>
      </element>
    </optional>
    <optional>
      <element name="Change">
        <oneOrMore>
          <element>
            <anyName/>
            <interleave>
              <element name="Value">
                <data type="integer"/>
              </element>
              <element name="Interval">
                <data type="positiveInteger"/>
              </element>
              <optional>
                <element name="UpperLimit">
                  <data type="nonNegativeInteger"/>
                </element>
              </optional>
              <optional>
                <element name="LowerLimit">
                  <data type="nonNegativeInteger"/>
                </element>
              </optional>
              <optional>
                <element name="State">
                  <list>
                    <oneOrMore>
                      <choice>
                        <value>alive</value>
                        <value>dead</value>
                        <value>gathered</value>
                        <value>notGathered</value>
                      </choice>
                    </oneOrMore>
                  </list>
                </element>
              </optional>
            </interleave>
          </element>
        </oneOrMore>
      </element>
    </optional>
  </interleave>
</element>

ResourceTrickle

Controls the resource trickle ability of the unit.

Rates

Trickle Rates.

food

Optional.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

wood

Optional.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

stone

Optional.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

metal

Optional.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Interval

Number of miliseconds must pass for the player to gain the next trickle..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

RELAX NG Grammar

<element name="ResourceTrickle">
  <interleave>
    <element name="Rates">
      <interleave>
        <optional>
          <element name="food">
            <ref name="nonNegativeDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="wood">
            <ref name="nonNegativeDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="stone">
            <ref name="nonNegativeDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="metal">
            <ref name="nonNegativeDecimal"/>
          </element>
        </optional>
      </interleave>
    </element>
    <element name="Interval">
      <ref name="nonNegativeDecimal"/>
    </element>
  </interleave>
</element>

Selectable

Allows this entity to be selected by the player.

Example

<Selectable/>

EditorOnly

Optional.

If this element is present, the entity is only selectable in Atlas.

Overlay

Specifies the type of overlay to be displayed when this entity is selected..

Shape

Optional.

Specifies shape of overlay. If not specified, footprint shape will be used..

Square

Set the overlay to a square of the given size.

width

Size of the overlay along the left/right direction (in metres).

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

depth

Size of the overlay along the front/back direction (in metres).

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

Circle

Set the overlay to a circle of the given size.

radius

Radius of the overlay (in metres).

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

AlwaysVisible

Optional.

If this element is present, the selection overlay will always be visible (with transparency and desaturation).

Texture

Displays a texture underneath the entity..

MainTexture

Texture to display underneath the entity. Filepath relative to art/textures/selection/..

Value type: text.

MainTextureMask

Mask texture that controls where to apply player color. Filepath relative to art/textures/selection/..

Value type: text.

Outline

Traces the outline of the entity with a line texture..

LineTexture

Texture to apply to the line. Filepath relative to art/textures/selection/..

Value type: text.

LineTextureMask

Texture that controls where to apply player color. Filepath relative to art/textures/selection/..

Value type: text.

LineThickness

Thickness of the line, in world units..

Value type: positive decimal (e.g. 1.0 or 2.5).

RELAX NG Grammar

<element name="Selectable">
  <interleave>
    <optional>
      <element name="EditorOnly">
        <empty/>
      </element>
    </optional>
    <element name="Overlay">
      <interleave>
        <optional>
          <element name="Shape">
            <choice>
              <element name="Square">
                <attribute name="width">
                  <data type="decimal">
                    <param name="minExclusive">0.0</param>
                  </data>
                </attribute>
                <attribute name="depth">
                  <data type="decimal">
                    <param name="minExclusive">0.0</param>
                  </data>
                </attribute>
              </element>
              <element name="Circle">
                <attribute name="radius">
                  <data type="decimal">
                    <param name="minExclusive">0.0</param>
                  </data>
                </attribute>
              </element>
            </choice>
          </element>
        </optional>
        <optional>
          <element name="AlwaysVisible">
            <empty/>
          </element>
        </optional>
        <choice>
          <element name="Texture">
            <element name="MainTexture">
              <text/>
            </element>
            <element name="MainTextureMask">
              <text/>
            </element>
          </element>
          <element name="Outline">
            <element name="LineTexture">
              <text/>
            </element>
            <element name="LineTextureMask">
              <text/>
            </element>
            <element name="LineThickness">
              <ref name="positiveDecimal"/>
            </element>
          </element>
        </choice>
      </interleave>
    </element>
  </interleave>
</element>

Settlement

RELAX NG Grammar

<element name="Settlement">
  <interleave>
    <empty/>
  </interleave>
</element>

SkirmishReplacer

general

Optional.

The general element replaces {civ} with the civ code..

RELAX NG Grammar

<element name="SkirmishReplacer">
  <interleave>
    <optional>
      <element name="general">
        <interleave>
          <text/>
        </interleave>
      </element>
    </optional>
  </interleave>
</element>

Sound

Lists the sound groups associated with this unit.

Example

<Sound>
  <SoundGroups>
    <walk>actor/human/movement/walk.xml</walk>
    <run>actor/human/movement/walk.xml</run>
    <attack_melee>attack/weapon/sword.xml</attack_melee>
    <death>actor/human/death/death.xml</death>
  </SoundGroups>
</Sound>

SoundGroups

RELAX NG Grammar

<element name="Sound">
  <interleave>
    <element name="SoundGroups">
      <zeroOrMore>
        <element>
          <anyName/>
          <text/>
        </element>
      </zeroOrMore>
    </element>
  </interleave>
</element>

StatisticsTracker

This component records statistics over the course of the match, such as the number of trained, lost, captured and destroyed units and buildings The statistics are consumed by the summary screen and lobby rankings.

Example

<StatisticsTracker>
  <UnitClasses>Infantry FemaleCitizen</UnitClasses>
  <StructureClasses>House Wonder</StructureClasses>
</StatisticsTracker>

UnitClasses

The tracker records trained, lost, killed and captured units of entities that match any of these Identity classes..

Value type: text.

datatype

Required value: tokens

StructureClasses

The tracker records constructed, lost, destroyed and captured structures of entities that match any of these Identity classes..

Value type: text.

datatype

Required value: tokens

RELAX NG Grammar

<element name="StatisticsTracker">
  <interleave>
    <element name="UnitClasses">
      <attribute name="datatype">
        <value>tokens</value>
      </attribute>
      <text/>
    </element>
    <element name="StructureClasses">
      <attribute name="datatype">
        <value>tokens</value>
      </attribute>
      <text/>
    </element>
  </interleave>
</element>

StatusBars

BarWidth

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

BarHeight

Height of a normal sized bar. Some bars are scaled accordingly..

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

HeightOffset

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

RELAX NG Grammar

<element name="StatusBars">
  <interleave>
    <element name="BarWidth">
      <data type="decimal"/>
    </element>
    <element name="BarHeight">
      <data type="decimal"/>
    </element>
    <element name="HeightOffset">
      <data type="decimal"/>
    </element>
  </interleave>
</element>

StatusEffectsReceiver

RELAX NG Grammar

<element name="StatusEffectsReceiver">
  <interleave>
    <empty/>
  </interleave>
</element>

TechnologyManager

RELAX NG Grammar

<element name="TechnologyManager">
  <interleave>
    <empty/>
  </interleave>
</element>

TerritoryDecay

DecayRate

Decay rate in capture points per second.

Territory

Specifies territory in which this entity will decay..

RELAX NG Grammar

<element name="TerritoryDecay">
  <interleave>

	    <element name="DecayRate">

		      <choice>
        <ref name="positiveDecimal"/>
        <value>Infinity</value>
      </choice>

	    </element>

	    <element name="Territory">

		      <list>

			        <oneOrMore>

				          <choice>

					            <value>neutral</value>

					            <value>enemy</value>

				          </choice>

			        </oneOrMore>

		      </list>

	    </element>

	  </interleave>
</element>

TerritoryInfluence

Root

Value type: boolean (true or false).

Weight

Value type: non-negative integer (e.g. 0 or 5).

Radius

Value type: non-negative integer (e.g. 0 or 5).

RELAX NG Grammar

<element name="TerritoryInfluence">
  <interleave>
    <element name="Root">
      <data type="boolean"/>
    </element>
    <element name="Weight">
      <data type="nonNegativeInteger">
        <param name="maxInclusive">65535</param>
      </data>
    </element>
    <element name="Radius">
      <data type="nonNegativeInteger"/>
    </element>
  </interleave>
</element>

Trader

Lets the unit generate resouces while moving between markets (or docks in case of water trading).

Example

<Trader>
  <GainMultiplier>0.75</GainMultiplier>
  <GarrisonGainMultiplier>0.2</GarrisonGainMultiplier>
</Trader>

GainMultiplier

Trader gain for a 100m distance and mapSize = 1024.

Value type: positive decimal (e.g. 1.0 or 2.5).

GarrisonGainMultiplier

Optional.

Additional gain for garrisonable unit for each garrisoned trader (1.0 means 100%).

Value type: positive decimal (e.g. 1.0 or 2.5).

RELAX NG Grammar

<element name="Trader">
  <interleave>
    <element name="GainMultiplier">
      <ref name="positiveDecimal"/>
    </element>
    <optional>
      <element name="GarrisonGainMultiplier">
        <ref name="positiveDecimal"/>
      </element>
    </optional>
  </interleave>
</element>

Trainer

Allows the entity to train new units.

Example

<Trainer>
  <BatchTimeModifier>0.7</BatchTimeModifier>
  <Entities datatype="tokens">
    units/{civ}/support_female_citizen
    units/{native}/support_trader
    units/athen/infantry_spearman_b
  </Entities>
</Trainer>

BatchTimeModifier

Optional.

Modifier that influences the time benefit for batch training. Defaults to 1, which means no benefit..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Entities

Optional.

Space-separated list of entity template names that this entity can train. The special string "{civ}" will be automatically replaced by the civ code of the entity's owner, while the string "{native}" will be automatically replaced by the entity's civ code..

Value type: text.

datatype

Required value: tokens

RELAX NG Grammar

<element name="Trainer">
  <interleave>
    <optional>
      <element name="BatchTimeModifier">
        <ref name="nonNegativeDecimal"/>
      </element>
    </optional>
    <optional>
      <element name="Entities">
        <attribute name="datatype">
          <value>tokens</value>
        </attribute>
        <text/>
      </element>
    </optional>
  </interleave>
</element>

TrainingRestrictions

Specifies unit training restrictions, currently only unit category

Example

<TrainingRestrictions>
  <TrainingRestrictions>
    <Category>Hero</Category>
  </TrainingRestrictions>
</TrainingRestrictions>

Category

Specifies the category of this unit, for satisfying special constraints. Choices include: Hero, Juggernaut, WarDog.

Value type: text.

MatchLimit

Optional.

Specifies how many times this entity can be trained during a match..

Value type: positive integer (e.g. 1 or 5).

RELAX NG Grammar

<element name="TrainingRestrictions">
  <interleave>
    <element name="Category">
      <text/>
    </element>
    <optional>
      <element name="MatchLimit">
        <data type="positiveInteger"/>
      </element>
    </optional>
  </interleave>
</element>

Treasure

Provides a bonus when taken. E.g. a supply of resources.

Example

<Treasure>
  <CollectTime>1000</CollectTime>
  <Resources>
    <Food>1000</Food>
  </Resources>
</Treasure>

CollectTime

Amount of milliseconds that it takes to collect this treasure..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Resources

Optional.

Amount of resources that are in this..

food

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

wood

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

stone

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

metal

Optional.

Value type: positive decimal (e.g. 1.0 or 2.5).

RELAX NG Grammar

<element name="Treasure">
  <interleave>
    <element name="CollectTime">
      <ref name="nonNegativeDecimal"/>
    </element>
    <optional>
      <element name="Resources">
        <interleave>
          <optional>
            <element name="food">
              <ref name="positiveDecimal"/>
            </element>
          </optional>
          <optional>
            <element name="wood">
              <ref name="positiveDecimal"/>
            </element>
          </optional>
          <optional>
            <element name="stone">
              <ref name="positiveDecimal"/>
            </element>
          </optional>
          <optional>
            <element name="metal">
              <ref name="positiveDecimal"/>
            </element>
          </optional>
        </interleave>
      </element>
    </optional>
  </interleave>
</element>

TreasureCollector

Defines the treasure collecting abilities.

Example

<TreasureCollector>
  <MaxDistance>2.0</MaxDistance>
</TreasureCollector>

MaxDistance

The maximum treasure taking distance in m..

Value type: positive decimal (e.g. 1.0 or 2.5).

RELAX NG Grammar

<element name="TreasureCollector">
  <interleave>
    <element name="MaxDistance">
      <ref name="positiveDecimal"/>
    </element>
  </interleave>
</element>

TriggerPoint

Reference

Optional.

Value type: text.

RELAX NG Grammar

<element name="TriggerPoint">
  <interleave>
    <optional>
      <element name="Reference">
        <text/>
      </element>
    </optional>
  </interleave>
</element>

TurretHolder

TurretPoints

Points that will be used to visibly garrison a unit..

X

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

Y

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

Z

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

Template

Value type: text.

Ejectable

Whether this template is tied to the turret position (i.e. not allowed to leave the turret point)..

Value type: boolean (true or false).

AllowedClasses

Optional.

If specified, only entities matching the given classes will be able to use this turret..

Value type: text.

datatype

Required value: tokens

Angle

Optional.

Angle in degrees relative to the turretHolder direction..

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

LoadingRange

Optional.

The maximum distance from this holder at which entities are allowed to occupy a turret point. Should be about 2.0 for land entities and preferably greater for ships..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

RELAX NG Grammar

<element name="TurretHolder">
  <interleave>
    <element name="TurretPoints">
      <oneOrMore>
        <element>
          <anyName/>
          <interleave>
            <element name="X">
              <data type="decimal"/>
            </element>
            <element name="Y">
              <data type="decimal"/>
            </element>
            <element name="Z">
              <data type="decimal"/>
            </element>
            <optional>
              <interleave>
                <element name="Template">
                  <text/>
                </element>
                <element name="Ejectable">
                  <data type="boolean"/>
                </element>
              </interleave>
            </optional>
            <optional>
              <element name="AllowedClasses">
                <attribute name="datatype">
                  <value>tokens</value>
                </attribute>
                <text/>
              </element>
            </optional>
            <optional>
              <element name="Angle">
                <data type="decimal"/>
              </element>
            </optional>
          </interleave>
        </element>
      </oneOrMore>
    </element>
    <optional>
      <element name="LoadingRange">
        <ref name="nonNegativeDecimal"/>
      </element>
    </optional>
  </interleave>
</element>

Turretable

RELAX NG Grammar

<element name="Turretable">
  <interleave>
    <empty/>
  </interleave>
</element>

UnitAI

Controls the unit's movement, attacks, etc, in response to commands from the player.

Example

<UnitAI/>

DefaultStance

Value is one of:

violent
aggressive
defensive
passive
standground
skittish
passive-defensive

FormationController

Value type: boolean (true or false).

FleeDistance

Value type: positive decimal (e.g. 1.0 or 2.5).

Formations

Optional.

Optional list of space-separated formations this unit is allowed to use. Choices include: Scatter, Box, ColumnClosed, LineClosed, ColumnOpen, LineOpen, Flank, Skirmish, Wedge, Testudo, Phalanx, Syntagma, BattleLine..

Value type: text.

datatype

Required value: tokens

CanGuard

Value type: boolean (true or false).

CanPatrol

Value type: boolean (true or false).

PatrolWaitTime

Number of seconds to wait in between patrol waypoints..

Value type: non-negative integer (e.g. 0 or 5).

CheeringTime

Optional.

Value type: non-negative integer (e.g. 0 or 5).

RoamDistance

Value type: positive decimal (e.g. 1.0 or 2.5).

RoamTimeMin

Value type: positive decimal (e.g. 1.0 or 2.5).

RoamTimeMax

Value type: positive decimal (e.g. 1.0 or 2.5).

FeedTimeMin

Value type: positive decimal (e.g. 1.0 or 2.5).

FeedTimeMax

Value type: positive decimal (e.g. 1.0 or 2.5).

RELAX NG Grammar

<element name="UnitAI">
  <interleave>
    <element name="DefaultStance">
      <choice>
        <value>violent</value>
        <value>aggressive</value>
        <value>defensive</value>
        <value>passive</value>
        <value>standground</value>
        <value>skittish</value>
        <value>passive-defensive</value>
      </choice>
    </element>
    <element name="FormationController">
      <data type="boolean"/>
    </element>
    <element name="FleeDistance">
      <ref name="positiveDecimal"/>
    </element>
    <optional>
      <element name="Formations">
        <attribute name="datatype">
          <value>tokens</value>
        </attribute>
        <text/>
      </element>
    </optional>
    <element name="CanGuard">
      <data type="boolean"/>
    </element>
    <element name="CanPatrol">
      <data type="boolean"/>
    </element>
    <element name="PatrolWaitTime">
      <data type="nonNegativeInteger"/>
    </element>
    <optional>
      <element name="CheeringTime">
        <data type="nonNegativeInteger"/>
      </element>
    </optional>
    <optional>
      <interleave>
        <element name="RoamDistance">
          <ref name="positiveDecimal"/>
        </element>
        <element name="RoamTimeMin">
          <ref name="positiveDecimal"/>
        </element>
        <element name="RoamTimeMax">
          <ref name="positiveDecimal"/>
        </element>
        <element name="FeedTimeMin">
          <ref name="positiveDecimal"/>
        </element>
        <element name="FeedTimeMax">
          <ref name="positiveDecimal"/>
        </element>
      </interleave>
    </optional>
  </interleave>
</element>

UnitMotion

Provides the unit with the ability to move around the world by itself.

Example

<UnitMotion>
  <WalkSpeed>7.0</WalkSpeed>
  <PassabilityClass>default</PassabilityClass>
</UnitMotion>

FormationController

Value type: boolean (true or false).

WalkSpeed

Basic movement speed (in metres per second)..

Value type: positive decimal (e.g. 1.0 or 2.5).

RunMultiplier

Optional.

How much faster the unit goes when running (as a multiple of walk speed)..

Value type: positive decimal (e.g. 1.0 or 2.5).

InstantTurnAngle

Angle we can turn instantly. Any value greater than pi will disable turning times. Avoid zero since it stops the entity every turn..

Value type: positive decimal (e.g. 1.0 or 2.5).

Acceleration

Acceleration (in metres per second^2)..

Value type: positive decimal (e.g. 1.0 or 2.5).

PassabilityClass

Identifies the terrain passability class (values are defined in special/pathfinder.xml)..

Value type: text.

Weight

Makes this unit both push harder and harder to push. 10 is considered the base value..

Value type: positive decimal (e.g. 1.0 or 2.5).

DisablePushing

Optional.

Value type: boolean (true or false).

RELAX NG Grammar

<element name="UnitMotion">
  <interleave>
    <element name="FormationController">
      <data type="boolean"/>
    </element>
    <element name="WalkSpeed">
      <ref name="positiveDecimal"/>
    </element>
    <optional>
      <element name="RunMultiplier">
        <ref name="positiveDecimal"/>
      </element>
    </optional>
    <element name="InstantTurnAngle">
      <ref name="positiveDecimal"/>
    </element>
    <element name="Acceleration">
      <ref name="positiveDecimal"/>
    </element>
    <element name="PassabilityClass">
      <text/>
    </element>
    <element name="Weight">
      <ref name="positiveDecimal"/>
    </element>
    <optional>
      <element name="DisablePushing">
        <data type="boolean"/>
      </element>
    </optional>
  </interleave>
</element>

UnitMotionFlying

MaxSpeed

Value type: non-negative decimal (e.g. 0.0 or 2.5).

TakeoffSpeed

Value type: non-negative decimal (e.g. 0.0 or 2.5).

StationaryDistance

Optional.

Allows the object to be stationary when reaching a target. Value defines the maximum distance at which a target is considered reached..

Value type: positive decimal (e.g. 1.0 or 2.5).

LandingSpeed

Value type: non-negative decimal (e.g. 0.0 or 2.5).

AccelRate

Value type: non-negative decimal (e.g. 0.0 or 2.5).

SlowingRate

Value type: non-negative decimal (e.g. 0.0 or 2.5).

BrakingRate

Value type: non-negative decimal (e.g. 0.0 or 2.5).

TurnRate

Value type: non-negative decimal (e.g. 0.0 or 2.5).

OvershootTime

Value type: non-negative decimal (e.g. 0.0 or 2.5).

FlyingHeight

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

ClimbRate

Value type: non-negative decimal (e.g. 0.0 or 2.5).

DiesInWater

Value type: boolean (true or false).

PassabilityClass

Value type: text.

RELAX NG Grammar

<element name="UnitMotionFlying">
  <interleave>
    <element name="MaxSpeed">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="TakeoffSpeed">
      <ref name="nonNegativeDecimal"/>
    </element>
    <optional>
      <element name="StationaryDistance">
        <ref name="positiveDecimal"/>
      </element>
    </optional>
    <element name="LandingSpeed">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="AccelRate">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="SlowingRate">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="BrakingRate">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="TurnRate">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="OvershootTime">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="FlyingHeight">
      <data type="decimal"/>
    </element>
    <element name="ClimbRate">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="DiesInWater">
      <data type="boolean"/>
    </element>
    <element name="PassabilityClass">
      <text/>
    </element>
  </interleave>
</element>

Upgrade

Entity

Entity to upgrade to.

Value type: text.

Icon

Optional.

Icon to show in the GUI.

Value type: text.

Variant

Optional.

The name of the variant to switch to when upgrading.

Value type: text.

Tooltip

Optional.

This will be added to the tooltip to help the player choose why to upgrade..

Value type: text.

Time

Optional.

Time required to upgrade this entity, in seconds.

Value type: non-negative integer (e.g. 0 or 5).

Cost

Optional.

Resource cost to upgrade this unit.

food

Optional.

Value type: non-negative integer (e.g. 0 or 5).

wood

Optional.

Value type: non-negative integer (e.g. 0 or 5).

stone

Optional.

Value type: non-negative integer (e.g. 0 or 5).

metal

Optional.

Value type: non-negative integer (e.g. 0 or 5).

RequiredTechnology

Optional.

Define what technology is required for this upgrade.

CheckPlacementRestrictions

Optional.

Upgrading will check for placement restrictions (nb:GUI only).

RELAX NG Grammar

<element name="Upgrade">
  <interleave>
    <oneOrMore>
      <element>
        <anyName/>
        <interleave>
          <element name="Entity">
            <text/>
          </element>
          <optional>
            <element name="Icon">
              <text/>
            </element>
          </optional>
          <optional>
            <element name="Variant">
              <text/>
            </element>
          </optional>
          <optional>
            <element name="Tooltip">
              <text/>
            </element>
          </optional>
          <optional>
            <element name="Time">
              <data type="nonNegativeInteger"/>
            </element>
          </optional>
          <optional>
            <element name="Cost">
              <oneOrMore>
                <choice>
                  <interleave>
                    <optional>
                      <element name="food">
                        <data type="nonNegativeInteger"/>
                      </element>
                    </optional>
                    <optional>
                      <element name="wood">
                        <data type="nonNegativeInteger"/>
                      </element>
                    </optional>
                    <optional>
                      <element name="stone">
                        <data type="nonNegativeInteger"/>
                      </element>
                    </optional>
                    <optional>
                      <element name="metal">
                        <data type="nonNegativeInteger"/>
                      </element>
                    </optional>
                  </interleave>
                </choice>
              </oneOrMore>
            </element>
          </optional>
          <optional>
            <element name="RequiredTechnology">
              <choice>
                <text/>
                <empty/>
              </choice>
            </element>
          </optional>
          <optional>
            <element name="CheckPlacementRestrictions">
              <empty/>
            </element>
          </optional>
        </interleave>
      </element>
    </oneOrMore>
  </interleave>
</element>

Upkeep

Controls the resource upkeep of an entity.

Rates

Upkeep Rates.

food

Optional.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

wood

Optional.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

stone

Optional.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

metal

Optional.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Interval

Number of milliseconds must pass for the player to pay the next upkeep..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

RELAX NG Grammar

<element name="Upkeep">
  <interleave>
    <element name="Rates">
      <interleave>
        <optional>
          <element name="food">
            <ref name="nonNegativeDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="wood">
            <ref name="nonNegativeDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="stone">
            <ref name="nonNegativeDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="metal">
            <ref name="nonNegativeDecimal"/>
          </element>
        </optional>
      </interleave>
    </element>
    <element name="Interval">
      <ref name="nonNegativeDecimal"/>
    </element>
  </interleave>
</element>

Visibility

RetainInFog

Value type: boolean (true or false).

AlwaysVisible

Value type: boolean (true or false).

Corpse

Value type: boolean (true or false).

Preview

Value type: boolean (true or false).

RELAX NG Grammar

<element name="Visibility">
  <interleave>
    <element name="RetainInFog">
      <data type="boolean"/>
    </element>
    <element name="AlwaysVisible">
      <data type="boolean"/>
    </element>
    <element name="Corpse">
      <data type="boolean"/>
    </element>
    <element name="Preview">
      <data type="boolean"/>
    </element>
  </interleave>
</element>

Vision

Range

Value type: non-negative integer (e.g. 0 or 5).

RevealShore

Optional.

Value type: boolean (true or false).

RELAX NG Grammar

<element name="Vision">
  <interleave>
    <element name="Range">
      <data type="nonNegativeInteger"/>
    </element>
    <optional>
      <element name="RevealShore">
        <data type="boolean"/>
      </element>
    </optional>
  </interleave>
</element>

VisionSharing

Bribable

Value type: boolean (true or false).

Duration

Optional.

Duration (in second) of the vision sharing for spies.

Value type: positive decimal (e.g. 1.0 or 2.5).

FailureCostRatio

Optional.

Fraction of the bribe cost that will be incured if a bribe failed.

Value type: non-negative decimal (e.g. 0.0 or 2.5).

RELAX NG Grammar

<element name="VisionSharing">
  <interleave>
    <element name="Bribable">
      <data type="boolean"/>
    </element>
    <optional>
      <element name="Duration">
        <ref name="positiveDecimal"/>
      </element>
    </optional>
    <optional>
      <element name="FailureCostRatio">
        <ref name="nonNegativeDecimal"/>
      </element>
    </optional>
  </interleave>
</element>

VisualActor

Display the unit using the engine's actor system.

Examples

<VisualActor>
  <Actor>units/hellenes/infantry_spearman_b.xml</Actor>
</VisualActor>
<VisualActor>
  <Actor>structures/hellenes/barracks.xml</Actor>
  <FoundationActor>structures/fndn_4x4.xml</FoundationActor>
</VisualActor>

Actor

Filename of the actor to be used for this unit.

Value type: text.

FoundationActor

Optional.

Filename of the actor to be used the foundation while this unit is being constructed.

Value type: text.

Foundation

Optional.

Used internally; if present, the unit will be rendered as a foundation.

ConstructionPreview

Optional.

If present, the unit should have a construction preview.

DisableShadows

Optional.

Used internally; if present, shadows will be disabled.

ActorOnly

Optional.

Used internally; if present, the unit will only be rendered if the user has high enough graphical settings..

SilhouetteDisplay

Value type: boolean (true or false).

SilhouetteOccluder

Value type: boolean (true or false).

SelectionShape

Optional.

Bounds

Determines the selection box based on the model bounds.

Footprint

Determines the selection box based on the entity Footprint component.

Box

Sets the selection shape to a box of specified dimensions.

width

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

height

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

depth

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

Cylinder

Sets the selection shape to a cylinder of specified dimensions.

radius

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

height

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

VisibleInAtlasOnly

Value type: boolean (true or false).

RELAX NG Grammar

<element name="VisualActor">
  <interleave>
    <element name="Actor">
      <text/>
    </element>
    <optional>
      <element name="FoundationActor">
        <text/>
      </element>
    </optional>
    <optional>
      <element name="Foundation">
        <empty/>
      </element>
    </optional>
    <optional>
      <element name="ConstructionPreview">
        <empty/>
      </element>
    </optional>
    <optional>
      <element name="DisableShadows">
        <empty/>
      </element>
    </optional>
    <optional>
      <element name="ActorOnly">
        <empty/>
      </element>
    </optional>
    <element name="SilhouetteDisplay">
      <data type="boolean"/>
    </element>
    <element name="SilhouetteOccluder">
      <data type="boolean"/>
    </element>
    <optional>
      <element name="SelectionShape">
        <choice>
          <element name="Bounds">
            <empty/>
          </element>
          <element name="Footprint">
            <empty/>
          </element>
          <element name="Box">
            <attribute name="width">
              <data type="decimal">
                <param name="minExclusive">0.0</param>
              </data>
            </attribute>
            <attribute name="height">
              <data type="decimal">
                <param name="minExclusive">0.0</param>
              </data>
            </attribute>
            <attribute name="depth">
              <data type="decimal">
                <param name="minExclusive">0.0</param>
              </data>
            </attribute>
          </element>
          <element name="Cylinder">
            <attribute name="radius">
              <data type="decimal">
                <param name="minExclusive">0.0</param>
              </data>
            </attribute>
            <attribute name="height">
              <data type="decimal">
                <param name="minExclusive">0.0</param>
              </data>
            </attribute>
          </element>
        </choice>
      </element>
    </optional>
    <element name="VisibleInAtlasOnly">
      <data type="boolean"/>
    </element>
  </interleave>
</element>

WallPiece

Example

<WallPiece/>

Length

Meters. Used in rmgen wallbuilder and the in-game wall-placer..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Orientation

Optional.

Multiples of Pi, measured anti-clockwise. Default: 1; full revolution: 2. Used in rmgen wallbuilder. How the wallpiece should be rotated so it is orientated the same way as every other wallpiece: with the "line" of the wall running along a map's `z` axis and the "outside face" towards positive `x`. If the piece bends (see below), the orientation should be that of the start of the wallpiece, not the middle..

Value type: non-negative decimal (e.g. 0.0 or 2.5).

Indent

Optional.

Meters. Default: 0. Used in rmgen wallbuilder. Permits piece to be placed in front (-ve value) or behind (+ve value) a wall..

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

Bend

Optional.

Multiples of Pi, measured anti-clockwise. Default: 0. Used in rmgen wallbuilder. The difference in orientation between the ends of a wallpiece..

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

RELAX NG Grammar

<element name="WallPiece">
  <interleave>
    <element name="Length">
      <ref name="nonNegativeDecimal"/>
    </element>
    <optional>
      <element name="Orientation">
        <ref name="nonNegativeDecimal"/>
      </element>
    </optional>
    <optional>
      <element name="Indent">
        <data type="decimal"/>
      </element>
    </optional>
    <optional>
      <element name="Bend">
        <data type="decimal"/>
      </element>
    </optional>
  </interleave>
</element>

WallSet

Example

<WallSet/>

Templates

Tower

Template name of the tower piece.

Value type: text.

Gate

Template name of the gate piece.

Value type: text.

WallLong

Template name of the long wall segment.

Value type: text.

WallMedium

Template name of the medium-size wall segment.

Value type: text.

WallShort

Template name of the short wall segment.

Value type: text.

WallCurves

Optional.

Whitespace-separated list of template names of curving wall segments..

Value type: text.

WallEnd

Optional.

Value type: text.

Fort

Optional.

Value type: text.

MinTowerOverlap

Maximum fraction that wall segments are allowed to overlap towers, where 0 signifies no overlap and 1 full overlap.

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

MaxTowerOverlap

Minimum fraction that wall segments are required to overlap towers, where 0 signifies no overlap and 1 full overlap.

Value type: decimal (e.g. -10.0 or 0.0 or 2.5).

RELAX NG Grammar

<element name="WallSet">
  <interleave>
    <element name="Templates">
      <interleave>
        <element name="Tower">
          <text/>
        </element>
        <element name="Gate">
          <text/>
        </element>
        <element name="WallLong">
          <text/>
        </element>
        <element name="WallMedium">
          <text/>
        </element>
        <element name="WallShort">
          <text/>
        </element>
        <optional>
          <element name="WallCurves">
            <text/>
          </element>
        </optional>
        <optional>
          <element name="WallEnd">
            <text/>
          </element>
        </optional>
        <optional>
          <element name="Fort">
            <text/>
          </element>
        </optional>
      </interleave>
    </element>
    <element name="MinTowerOverlap">
      <data type="decimal">
        <param name="minInclusive">0.0</param>
        <param name="maxInclusive">1.0</param>
      </data>
    </element>
    <element name="MaxTowerOverlap">
      <data type="decimal">
        <param name="minInclusive">0.0</param>
        <param name="maxInclusive">1.0</param>
      </data>
    </element>
  </interleave>
</element>

Wonder

RELAX NG Grammar

<element name="Wonder">
  <interleave>
    <empty/>
  </interleave>
</element>