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

MaximumLevel

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

Range

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

RELAX NG Grammar

<element name="AlertRaiser">
  <interleave>
    <element name="MaximumLevel">
      <data type="nonNegativeInteger"/>
    </element>
    <element name="Range">
      <data type="nonNegativeInteger"/>
    </element>
  </interleave>
</element>

Armour

Controls the damage resistance of the unit.

Example

<Armour>
  <Hack>10.0</Hack>
  <Pierce>0.0</Pierce>
  <Crush>5.0</Crush>
</Armour>

Hack

Hack damage protection.

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

Pierce

Pierce damage protection.

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

Crush

Crush damage protection.

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

Foundation

Optional.

Armour given to building foundations.

Hack

Hack damage protection.

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

Pierce

Pierce damage protection.

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

Crush

Crush damage protection.

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

RELAX NG Grammar

<element name="Armour">
  <interleave>
    <element name="Hack">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="Pierce">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="Crush">
      <ref name="nonNegativeDecimal"/>
    </element>
    <optional>
      <element name="Foundation">
        <interleave>
          <element name="Hack">
            <ref name="nonNegativeDecimal"/>
          </element>
          <element name="Pierce">
            <ref name="nonNegativeDecimal"/>
          </element>
          <element name="Crush">
            <ref name="nonNegativeDecimal"/>
          </element>
        </interleave>
      </element>
    </optional>
  </interleave>
</element>

Attack

Controls the attack abilities and strengths of the unit.

Example

<Attack>
  <Melee>
    <Hack>10.0</Hack>
    <Pierce>0.0</Pierce>
    <Crush>5.0</Crush>
    <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>
    <Hack>0.0</Hack>
    <Pierce>10.0</Pierce>
    <Crush>0.0</Crush>
    <MaxRange>44.0</MaxRange>
    <MinRange>20.0</MinRange>
    <ElevationBonus>15.0</ElevationBonus>
    <PrepareTime>800</PrepareTime>
    <RepeatTime>1600</RepeatTime>
    <ProjectileSpeed>50.0</ProjectileSpeed>
    <Spread>2.5</Spread>
    <Bonuses>
      <Bonus1>
        <Classes>Cavalry</Classes>
        <Multiplier>2</Multiplier>
      </Bonus1>
    </Bonuses>
    <RestrictedClasses datatype="tokens">Champion</RestrictedClasses>
    <Splash>
      <Shape>Circular</Shape>
      <Range>20</Range>
      <FriendlyFire>false</FriendlyFire>
      <Hack>0.0</Hack>
      <Pierce>10.0</Pierce>
      <Crush>0.0</Crush>
    </Splash>
  </Ranged>
  <Charge>
    <Hack>10.0</Hack>
    <Pierce>0.0</Pierce>
    <Crush>50.0</Crush>
    <MaxRange>24.0</MaxRange>
    <MinRange>20.0</MinRange>
  </Charge>
  <Slaughter>
    <Hack>1000.0</Hack>
    <Pierce>0.0</Pierce>
    <Crush>0.0</Crush>
    <MaxRange>4.0</MaxRange>
  </Slaughter>
</Attack>

Melee

Optional.

Hack

Hack damage strength.

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

Pierce

Pierce damage strength.

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

Crush

Crush damage strength.

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).

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).

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 attackers attack strength is multiplied by this.

Value type: non-negative decimal (e.g. 0.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

Ranged

Optional.

Hack

Hack damage strength.

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

Pierce

Pierce damage strength.

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

Crush

Crush damage strength.

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

Minimum attack range (in metres).

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

ElevationBonus

Optional.

give an elevation advantage (in meters).

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

PrepareTime

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.

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).

ProjectileSpeed

Speed of projectiles (in metres per second). If unspecified, then it is a melee attack instead.

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

Spread

Radius over which missiles will tend to land (when shooting to the maximum range). Roughly 2/3 will land inside this radius (in metres). Spread is linearly diminished as the target gets closer..

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

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 attackers attack strength is multiplied by this.

Value type: non-negative decimal (e.g. 0.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

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).

Hack

Hack damage strength.

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

Pierce

Pierce damage strength.

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

Crush

Crush damage strength.

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

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 attackers attack strength is multiplied by this.

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

Charge

Optional.

Hack

Hack damage strength.

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

Pierce

Pierce damage strength.

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

Crush

Crush damage strength.

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

MaxRange

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

MinRange

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

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 attackers attack strength is multiplied by this.

Value type: non-negative decimal (e.g. 0.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

Slaughter

Optional.

A special attack to kill domestic animals.

Hack

Hack damage strength.

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

Pierce

Pierce damage strength.

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

Crush

Crush damage strength.

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

MaxRange

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

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 attackers attack strength is multiplied by this.

Value type: non-negative decimal (e.g. 0.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>
    <optional>
      <element name="Melee">
        <interleave>
          <element name="Hack">
            <ref name="nonNegativeDecimal"/>
          </element>
          <element name="Pierce">
            <ref name="nonNegativeDecimal"/>
          </element>
          <element name="Crush">
            <ref name="nonNegativeDecimal"/>
          </element>
          <element name="MaxRange">
            <ref name="nonNegativeDecimal"/>
          </element>
          <element name="RepeatTime">
            <data type="positiveInteger"/>
          </element>
          <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>
          <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>
    </optional>
    <optional>
      <element name="Ranged">
        <interleave>
          <element name="Hack">
            <ref name="nonNegativeDecimal"/>
          </element>
          <element name="Pierce">
            <ref name="nonNegativeDecimal"/>
          </element>
          <element name="Crush">
            <ref name="nonNegativeDecimal"/>
          </element>
          <element name="MaxRange">
            <ref name="nonNegativeDecimal"/>
          </element>
          <element name="MinRange">
            <ref name="nonNegativeDecimal"/>
          </element>
          <optional>
            <element name="ElevationBonus">
              <ref name="nonNegativeDecimal"/>
            </element>
          </optional>
          <element name="PrepareTime">
            <data type="nonNegativeInteger"/>
          </element>
          <element name="RepeatTime">
            <data type="positiveInteger"/>
          </element>
          <element name="ProjectileSpeed">
            <ref name="nonNegativeDecimal"/>
          </element>
          <element name="Spread">
            <ref name="nonNegativeDecimal"/>
          </element>
          <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>
          <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>
          <optional>
            <element name="Splash">
              <interleave>
                <element name="Shape">
                  <text/>
                </element>
                <element name="Range">
                  <ref name="nonNegativeDecimal"/>
                </element>
                <element name="FriendlyFire">
                  <data type="boolean"/>
                </element>
                <element name="Hack">
                  <ref name="nonNegativeDecimal"/>
                </element>
                <element name="Pierce">
                  <ref name="nonNegativeDecimal"/>
                </element>
                <element name="Crush">
                  <ref name="nonNegativeDecimal"/>
                </element>
                <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>
        </interleave>
      </element>
    </optional>
    <optional>
      <element name="Charge">
        <interleave>
          <element name="Hack">
            <ref name="nonNegativeDecimal"/>
          </element>
          <element name="Pierce">
            <ref name="nonNegativeDecimal"/>
          </element>
          <element name="Crush">
            <ref name="nonNegativeDecimal"/>
          </element>
          <element name="MaxRange">
            <ref name="nonNegativeDecimal"/>
          </element>
          <element name="MinRange">
            <ref name="nonNegativeDecimal"/>
          </element>
          <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>
          <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>
    </optional>
    <optional>
      <element name="Slaughter">
        <interleave>
          <element name="Hack">
            <ref name="nonNegativeDecimal"/>
          </element>
          <element name="Pierce">
            <ref name="nonNegativeDecimal"/>
          </element>
          <element name="Crush">
            <ref name="nonNegativeDecimal"/>
          </element>
          <element name="MaxRange">
            <ref name="nonNegativeDecimal"/>
          </element>
          <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>
          <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>
    </optional>
  </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

Radius

Optional.

Define the radius this aura affects, if it is a range aura.

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

Type

Controls how this aura affects nearby units.

Value is one of:

formation
Affects units in the same formation.
range
Affects units in a certain range.
garrison
Affects the structure or unit this unit is garrisoned in.
garrisonedUnits
Affects the units that are garrisoned on a certain structure.
global
Affects all units while this unit is alive.

Modifications

Modification list.

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).

AuraName

Optional.

name to display in the GUI.

Value type: text.

AuraDescription

Optional.

description to display in the GUI, requires a name.

Value type: text.

Affects

Affected classes.

Value type: text.

AffectedPlayers

Optional.

Affected players.

Value type: text.

RELAX NG Grammar

<element name="Auras">
  <interleave>
    <oneOrMore>
      <element>
        <anyName/>
        <interleave>
          <optional>
            <element name="Radius">
              <data type="nonNegativeInteger"/>
            </element>
          </optional>
          <element name="Type">
            <choice>
              <value>formation</value>
              <value>range</value>
              <value>garrison</value>
              <value>garrisonedUnits</value>
              <value>global</value>
            </choice>
          </element>
          <element name="Modifications">
            <oneOrMore>
              <element>
                <anyName/>
                <choice>
                  <element name="Add">
                    <data type="decimal"/>
                  </element>
                  <element name="Multiply">
                    <data type="decimal"/>
                  </element>
                </choice>
              </element>
            </oneOrMore>
          </element>
          <optional>
            <element name="AuraName">
              <text/>
            </element>
          </optional>
          <optional>
            <element name="AuraDescription">
              <text/>
            </element>
          </optional>
          <element name="Affects">
            <text/>
          </element>
          <optional>
            <element name="AffectedPlayers">
              <text/>
            </element>
          </optional>
        </interleave>
      </element>
    </oneOrMore>
  </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>Special</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: CivilCentre, House, DefenseTower, Farmstead, Market, Barracks, Dock, Fortress, Field, Temple, Wall, Fence, Storehouse, Stoa, Resource, Special, Wonder, Apadana, Embassy, Monument.

Value type: text.

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="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/{civ}_civil_centre
    structures/celt_sb1
  </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 unit's four-character 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).

GarrisonArrowMultiplier

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

GarrisonArrowClasses

Value type: text.

RELAX NG Grammar

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

Cost

Specifies the construction/training costs of this entity.

Example

<Cost>
  <Population>1</Population>
  <PopulationBonus>15</PopulationBonus>
  <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).

PopulationBonus

Population cap increase while this entity exists.

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

BuildTime

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

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

Resources

Resource costs to construct/train this unit.

food

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

wood

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

stone

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

metal

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="PopulationBonus">
      <data type="nonNegativeInteger"/>
    </element>
    <element name="BuildTime">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="Resources">
      <interleave>
        <element name="food">
          <data type="nonNegativeInteger"/>
        </element>
        <element name="wood">
          <data type="nonNegativeInteger"/>
        </element>
        <element name="stone">
          <data type="nonNegativeInteger"/>
        </element>
        <element name="metal">
          <data type="nonNegativeInteger"/>
        </element>
      </interleave>
    </element>
  </interleave>
</element>

Decay

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).

Inactive

Optional.

If this element is present, the entity will not do any decaying.

SinkingAnim

Optional.

If this element is present, the entity will decay in a ship-like manner.

RELAX NG Grammar

<element name="Decay">
  <interleave>
    <element name="DelayTime">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="SinkRate">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="SinkAccel">
      <ref name="nonNegativeDecimal"/>
    </element>
    <optional>
      <element name="Inactive">
        <empty/>
      </element>
    </optional>
    <optional>
      <element name="SinkingAnim">
        <empty/>
      </element>
    </optional>
  </interleave>
</element>

EntityLimits

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

Example

<EntityLimits>
  <Limits>
    <DefenseTower>25</DefenseTower>
    <Fortress>10</Fortress>
    <Wonder>1</Wonder>
    <Hero>1</Hero>
    <Apadana>1</Apadana>
    <Monument>5</Monument>
  </Limits>
  <LimitChangers>
    <Monument>
      <CivCentre>2</CivCentre>
    </Monument>
  </LimitChangers>
</EntityLimits>

Limits

LimitChangers

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>
  </interleave>
</element>

Fogging

Allows this entity to be replaced by mirages 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 outline rendering. 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>
</Footprint>
<Footprint>
  <Circle radius="0.5"/>
  <Height>0.0</Height>
</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: positive decimal (e.g. 1.0 or 2.5).

depth

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

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

Circle

Set the footprint to a circle of the given size.

radius

Radius of the footprint (in metres).

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

Height

Vertical extent of the footprint (in metres).

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">
          <ref name="positiveDecimal"/>
        </attribute>
        <attribute name="depth">
          <ref name="positiveDecimal"/>
        </attribute>
      </element>
      <element name="Circle">
        <attribute name="radius">
          <ref name="positiveDecimal"/>
        </attribute>
      </element>
    </choice>
    <element name="Height">
      <ref name="nonNegativeDecimal"/>
    </element>
  </interleave>
</element>

Formation

FormationName

Name of the formation.

Value type: text.

Icon

Value type: text.

RequiredMemberCount

Minimum number of entities the formation should contain.

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

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.

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 the center of each row 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 vulerable units are right in the center of the formation. .

Value type: text.

WidthDepthRatio

Average width/depth, counted in number of units..

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

Sloppyness

Sloppyness in meters (the max difference between the actual and the perfectly aligned formation position.

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 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).

Animations

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

RELAX NG Grammar

<element name="Formation">
  <interleave>
    <element name="FormationName">
      <text/>
    </element>
    <element name="Icon">
      <text/>
    </element>
    <element name="RequiredMemberCount">
      <data type="nonNegativeInteger"/>
    </element>
    <element name="DisabledTooltip">
      <text/>
    </element>
    <element name="SpeedMultiplier">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="FormationShape">
      <text/>
    </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="Sloppyness">
      <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="Animations">
      <zeroOrMore>
        <element>
          <anyName/>
          <text/>
        </element>
      </zeroOrMore>
    </element>
  </interleave>
</element>

FormationAttack

CanAttackAsFormation

Value type: text.

RELAX NG Grammar

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

GarrisonHolder

Max

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

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

List

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

Value type: text.

datatype

Required value: tokens

EjectHealth

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

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

EjectClassesOnDestroy

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

Value type: text.

datatype

Required value: tokens

BuffHeal

Number of hit points 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).

Pickup

Optional.

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

Value type: boolean (true or false).

VisibleGarrisonPoints

Optional.

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).

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="EjectHealth">
      <ref name="nonNegativeDecimal"/>
    </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="Pickup">
        <data type="boolean"/>
      </element>
    </optional>
    <optional>
      <element name="VisibleGarrisonPoints">
        <zeroOrMore>
          <element>
            <anyName/>
            <interleave>
              <element name="X">
                <data type="decimal"/>
              </element>
              <element name="Y">
                <data type="decimal"/>
              </element>
              <element name="Z">
                <data type="decimal"/>
              </element>
            </interleave>
          </element>
        </zeroOrMore>
      </element>
    </optional>
  </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>
  <HP>5</HP>
  <Rate>2000</Rate>
  <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).

HP

Hitpoints healed per Rate.

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

Rate

A heal is performed every Rate 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>
    <element name="HP">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="Rate">
      <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>
  <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).

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.

RegenRate

Hitpoint regeneration rate per second..

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.

Unhealable

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

Value type: boolean (true or false).

Repairable

Indicates that the entity can be repaired by builder 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="SpawnEntityOnDeath">
        <text/>
      </element>
    </optional>
    <element name="RegenRate">
      <data type="decimal"/>
    </element>
    <element name="DeathType">
      <choice>
        <value>vanish</value>
        <value>corpse</value>
        <value>remain</value>
      </choice>
    </element>
    <element name="Unhealable">
      <data type="boolean"/>
    </element>
    <element name="Repairable">
      <data type="boolean"/>
    </element>
  </interleave>
</element>

Identity

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

Example

<Identity>
  <Civ>hele</Civ>
  <GenericName>Infantry Spearman</GenericName>
  <SpecificName>Hoplite</SpecificName>
  <Icon>units/hele_infantry_spearman.png</Icon>
</Identity>

Civ

Civilisation that this unit is primarily associated with, typically a 4-letter code. Choices include: gaia (world objects), cart (Carthaginians), celt (Celts), hele (Hellenes), iber (Iberians), pers (Persians), rome (Romans).

Value type: text.

GenericName

Generic English-language name for this class of unit.

Value type: text.

SpecificName

Optional.

Specific native-language name for this unit type.

Value type: text.

SelectionGroupName

Optional.

Name used to group ranked entities.

Value type: text.

Tooltip

Optional.

Value type: text.

GateConversionTooltip

Optional.

Value type: text.

Rollover

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: Unit, Infantry, Melee, Cavalry, Ranged, Mechanical, Ship, Siege, Champion, Hero, Elephant, Chariot, Mercenary, Spear, Sword, Bow, Javelin, Sling, Support, Animal, Domestic, Organic, Structure, Civic, CivCentre, Economic, Defensive, Gates, Wall, BarterMarket, Village, Town, City, ConquestCritical, Worker, Female, Healer, Slave, CitizenSoldier, Trade, Market, NavalMarket, Warship, SeaCreature, ForestPlant, DropsiteFood, DropsiteWood, DropsiteStone, DropsiteMetal, GarrisonTower, GarrisonFortress.

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..

Value type: text.

datatype

Required value: tokens

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

Icon

Optional.

Value type: text.

RequiredTechnology

Optional.

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

Value type: text.

RELAX NG Grammar

<element name="Identity">
  <interleave>
    <element name="Civ">
      <text/>
    </element>
    <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="GateConversionTooltip">
        <text/>
      </element>
    </optional>
    <optional>
      <element name="Rollover">
        <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>
    <optional>
      <element name="Formations">
        <attribute name="datatype">
          <value>tokens</value>
        </attribute>
        <text/>
      </element>
    </optional>
    <optional>
      <element name="Icon">
        <text/>
      </element>
    </optional>
    <optional>
      <element name="RequiredTechnology">
        <text/>
      </element>
    </optional>
  </interleave>
</element>

Loot

xp

Optional.

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

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="Loot">
  <interleave>
    <optional>
      <element name="xp">
        <data type="nonNegativeInteger"/>
      </element>
    </optional>
    <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>

Looter

RELAX NG Grammar

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

Minimap

Type

Value is one of:

food
wood
stone
metal
structure
settlement
unit
support
hero

Colour

Optional.

r

Value type: integer.

g

Value type: integer.

b

Value type: integer.

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>settlement</value>
        <value>unit</value>
        <value>support</value>
        <value>hero</value>
      </choice>
    </element>
    <optional>
      <element name="Colour">
        <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>
  </interleave>
</element>

Mirage

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

RELAX NG Grammar

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

Obstruction

Causes this entity to obstruct the motion of other units.

Example

<Obstruction/>

Static

width

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

depth

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

Unit

radius

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

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: positive decimal (e.g. 1.0 or 2.5).

depth

Value type: positive decimal (e.g. 1.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).

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">
          <ref name="positiveDecimal"/>
        </attribute>
        <attribute name="depth">
          <ref name="positiveDecimal"/>
        </attribute>
      </element>
      <element name="Unit">
        <attribute name="radius">
          <ref name="positiveDecimal"/>
        </attribute>
      </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">
              <ref name="positiveDecimal"/>
            </attribute>
            <attribute name="depth">
              <ref name="positiveDecimal"/>
            </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="DisableBlockMovement">
      <data type="boolean"/>
    </element>
    <element name="DisableBlockPathfinding">
      <data type="boolean"/>
    </element>
    <optional>
      <element name="ControlPersist">
        <empty/>
      </element>
    </optional>
  </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>

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>
  <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).

TurnRate

Maximum graphical rotation speed around Y axis, in radians per second.

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="TurnRate">
      <ref name="positiveDecimal"/>
    </element>
  </interleave>
</element>

ProductionQueue

Allows the building to train new units and research technologies

Example

<ProductionQueue>
  <BatchTimeModifier>0.7</BatchTimeModifier>
  <Entities datatype="tokens">
    units/{civ}_support_female_citizen
    units/{civ}_support_trader
    units/celt_infantry_spearman_b
  </Entities>
</ProductionQueue>

BatchTimeModifier

Modifier that influences the time benefit for batch training.

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

Entities

Optional.

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

Value type: text.

datatype

Required value: tokens

Technologies

Optional.

Space-separated list of technology names that this building can research..

Value type: text.

datatype

Required value: tokens

RELAX NG Grammar

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

Promotion

Entity

Value type: text.

RequiredXp

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

RELAX NG Grammar

<element name="Promotion">
  <interleave>
    <element name="Entity">
      <text/>
    </element>
    <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>
  <LineColour r="20" g="128" b="240"/>
  <LineDashColour r="158" g="11" b="15"/>
  <LineCostClass>default</LineCostClass>
  <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 LineColour and LineDashColour).

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).

LineColour

r

Value type: integer.

g

Value type: integer.

b

Value type: integer.

LineDashColour

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.

LineCostClass

The pathfinder cost 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="LineColour">
      <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="LineDashColour">
      <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>
    <element name="LineCostClass">
      <text/>
    </element>
  </interleave>
</element>

ResourceDropsite

Types

RELAX NG Grammar

<element name="ResourceDropsite">
  <interleave>
    <element name="Types">
      <list>
        <oneOrMore>
          <choice>
            <value>food</value>
            <value>wood</value>
            <value>stone</value>
            <value>metal</value>
          </choice>
        </oneOrMore>
      </list>
    </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.

Food gather rate (may be overridden by "food.*" subtypes).

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

wood

Optional.

Wood gather rate.

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

stone

Optional.

Stone gather rate.

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

metal

Optional.

Metal gather rate.

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

treasure

Optional.

Treasure gather rate (only presense on value makes sense, size is only used to determine the delay before gathering, so it should be set to 1).

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

food.fish

Optional.

Fish gather rate (overrides "food").

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

food.fruit

Optional.

Fruit gather rate (overrides "food").

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

food.grain

Optional.

Grain gather rate (overrides "food").

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

food.meat

Optional.

Meat gather rate (overrides "food").

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

food.milk

Optional.

Milk gather rate (overrides "food").

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

wood.tree

Optional.

Tree gather rate (overrides "wood").

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

wood.ruins

Optional.

Tree gather rate (overrides "wood").

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

stone.rock

Optional.

Rock gather rate (overrides "stone").

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

stone.ruins

Optional.

Rock gather rate (overrides "stone").

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

metal.ore

Optional.

Ore gather rate (overrides "metal").

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

treasure.food

Optional.

Food treasure gather rate (overrides "treasure").

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

treasure.wood

Optional.

Wood treasure gather rate (overrides "treasure").

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

treasure.stone

Optional.

Stone treasure gather rate (overrides "treasure").

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

treasure.metal

Optional.

Metal treasure gather rate (overrides "treasure").

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

Capacities

Per-resource-type maximum carrying capacity.

food

Food capacity.

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

wood

Wood capacity.

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

stone

Stone capacity.

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

metal

Metal capacity.

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="treasure">
            <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="food.milk">
            <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="treasure.food">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="treasure.wood">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="treasure.stone">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
        <optional>
          <element name="treasure.metal">
            <ref name="positiveDecimal"/>
          </element>
        </optional>
      </interleave>
    </element>
    <element name="Capacities">
      <interleave>
        <element name="food">
          <ref name="positiveDecimal"/>
        </element>
        <element name="wood">
          <ref name="positiveDecimal"/>
        </element>
        <element name="stone">
          <ref name="positiveDecimal"/>
        </element>
        <element name="metal">
          <ref name="positiveDecimal"/>
        </element>
      </interleave>
    </element>
  </interleave>
</element>

ResourceSupply

Provides a supply of one particular type of resource.

Example

<ResourceSupply>
  <Amount>1000</Amount>
  <Type>food.meat</Type>
</ResourceSupply>

KillBeforeGather

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

Value type: boolean (true or false).

Amount

Amount of resources available from this entity.

Type

Type of resources.

Value is one of:

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

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 rate at which adding more gatherers decreases overall efficiency. Lower numbers = faster dropoff. Leave the element out for no diminishing returns..

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

RELAX NG Grammar

<element name="ResourceSupply">
  <interleave>
    <element name="KillBeforeGather">
      <data type="boolean"/>
    </element>
    <element name="Amount">
      <choice>
        <data type="nonNegativeInteger"/>
        <value>Infinity</value>
      </choice>
    </element>
    <element name="Type">
      <choice>
        <value>wood.tree</value>
        <value>wood.ruins</value>
        <value>stone.rock</value>
        <value>stone.ruins</value>
        <value>metal.ore</value>
        <value>food.fish</value>
        <value>food.fruit</value>
        <value>food.grain</value>
        <value>food.meat</value>
        <value>food.milk</value>
        <value>treasure.wood</value>
        <value>treasure.stone</value>
        <value>treasure.metal</value>
        <value>treasure.food</value>
      </choice>
    </element>
    <element name="MaxGatherers">
      <data type="nonNegativeInteger"/>
    </element>
    <optional>
      <element name="DiminishingReturns">
        <ref name="positiveDecimal"/>
      </element>
    </optional>
  </interleave>
</element>

ResourceTrickle

Controls the resource trickle ability of the unit.

FoodRate

Food given to the player every interval.

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

WoodRate

Wood given to the player every interval.

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

StoneRate

Stone given to the player every interval.

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

MetalRate

Metal given to the player every interval.

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="FoodRate">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="WoodRate">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="StoneRate">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="MetalRate">
      <ref name="nonNegativeDecimal"/>
    </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.

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">
      <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>
    </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>attack/weapon/sword.xml</attack>
    <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>

Stamina

Max

Maximum stamina (msecs of running).

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

RELAX NG Grammar

<element name="Stamina">
  <interleave>
    <element name="Max">
      <data type="positiveInteger"/>
    </element>
  </interleave>
</element>

StatusBars

BarWidth

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

BarHeight

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>

TerritoryDecay

HealthDecayRate

Decay rate in hitpoints per second.

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

RELAX NG Grammar

<element name="TerritoryDecay">
  <interleave>
    <element name="HealthDecayRate">
      <data type="positiveInteger"/>
    </element>
  </interleave>
</element>

TerritoryInfluence

OverrideCost

Optional.

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

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>
    <optional>
      <element name="OverrideCost">
        <data type="nonNegativeInteger">
          <param name="maxInclusive">255</param>
        </data>
      </element>
    </optional>
    <element name="Root">
      <data type="boolean"/>
    </element>
    <element name="Weight">
      <data type="nonNegativeInteger"/>
    </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>
  <MaxDistance>2.0</MaxDistance>
  <GainMultiplier>1.0</GainMultiplier>
</Trader>

GainMultiplier

Additional gain multiplier.

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>
  </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, FemaleCitizen, WarDog.

Value type: text.

RELAX NG Grammar

<element name="TrainingRestrictions">
  <interleave>
    <element name="Category">
      <text/>
    </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>

UnitAI

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

Example

<UnitAI/>

AlertReactiveLevel

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

DefaultStance

Value is one of:

violent
aggressive
defensive
passive
standground

FormationController

Value type: boolean (true or false).

FleeDistance

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

CanGuard

Value type: boolean (true or false).

NaturalBehaviour

Behaviour of the unit in the absence of player commands (intended for animals).

Value is one of:

violent
Will actively attack any unit it encounters, even if not threatened.
aggressive
Will attack nearby units if it feels threatened (if they linger within LOS for too long).
defensive
Will attack nearby units if attacked.
passive
Will never attack units but will attempt to flee when attacked.
skittish
Will never attack units. Will typically attempt to flee for short distances when units approach.
domestic
Will never attack units and will not attempt to flee when attacked.

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="AlertReactiveLevel">
      <data type="nonNegativeInteger"/>
    </element>
    <element name="DefaultStance">
      <choice>
        <value>violent</value>
        <value>aggressive</value>
        <value>defensive</value>
        <value>passive</value>
        <value>standground</value>
      </choice>
    </element>
    <element name="FormationController">
      <data type="boolean"/>
    </element>
    <element name="FleeDistance">
      <ref name="positiveDecimal"/>
    </element>
    <element name="CanGuard">
      <data type="boolean"/>
    </element>
    <optional>
      <interleave>
        <element name="NaturalBehaviour">
          <choice>
            <value>violent</value>
            <value>aggressive</value>
            <value>defensive</value>
            <value>passive</value>
            <value>skittish</value>
            <value>domestic</value>
          </choice>
        </element>
        <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>
  <CostClass>infantry</CostClass>
</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).

Run

Optional.

Speed

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

Range

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

RangeMin

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

RegenTime

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

DecayTime

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.

CostClass

Identifies the movement speed/cost class (values are defined in special/pathfinder.xml).

Value type: text.

RELAX NG Grammar

<element name="UnitMotion">
  <interleave>
    <element name="FormationController">
      <data type="boolean"/>
    </element>
    <element name="WalkSpeed">
      <ref name="positiveDecimal"/>
    </element>
    <optional>
      <element name="Run">
        <interleave>
          <element name="Speed">
            <ref name="positiveDecimal"/>
          </element>
          <element name="Range">
            <ref name="positiveDecimal"/>
          </element>
          <element name="RangeMin">
            <ref name="nonNegativeDecimal"/>
          </element>
          <element name="RegenTime">
            <ref name="positiveDecimal"/>
          </element>
          <element name="DecayTime">
            <ref name="positiveDecimal"/>
          </element>
        </interleave>
      </element>
    </optional>
    <element name="PassabilityClass">
      <text/>
    </element>
    <element name="CostClass">
      <text/>
    </element>
  </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).

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).

RELAX NG Grammar

<element name="UnitMotionFlying">
  <interleave>
    <element name="MaxSpeed">
      <ref name="nonNegativeDecimal"/>
    </element>
    <element name="TakeoffSpeed">
      <ref name="nonNegativeDecimal"/>
    </element>
    <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>
  </interleave>
</element>

Visibility

RELAX NG Grammar

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

Vision

Range

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

RetainInFog

Value type: boolean (true or false).

AlwaysVisible

Value type: boolean (true or false).

RELAX NG Grammar

<element name="Vision">
  <interleave>
    <element name="Range">
      <data type="nonNegativeInteger"/>
    </element>
    <element name="RetainInFog">
      <data type="boolean"/>
    </element>
    <element name="AlwaysVisible">
      <data type="boolean"/>
    </element>
  </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: positive decimal (e.g. 1.0 or 2.5).

height

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

depth

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

Cylinder

Sets the selection shape to a cylinder of specified dimensions.

radius

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

height

Value type: positive decimal (e.g. 1.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">
              <ref name="positiveDecimal"/>
            </attribute>
            <attribute name="height">
              <ref name="positiveDecimal"/>
            </attribute>
            <attribute name="depth">
              <ref name="positiveDecimal"/>
            </attribute>
          </element>
          <element name="Cylinder">
            <attribute name="radius">
              <ref name="positiveDecimal"/>
            </attribute>
            <attribute name="height">
              <ref name="positiveDecimal"/>
            </attribute>
          </element>
        </choice>
      </element>
    </optional>
    <element name="VisibleInAtlasOnly">
      <data type="boolean"/>
    </element>
  </interleave>
</element>

WallPiece

Example

<WallPiece/>

Length

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

RELAX NG Grammar

<element name="WallPiece">
  <interleave>
    <element name="Length">
      <ref name="nonNegativeDecimal"/>
    </element>
  </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.

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>
      </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

TimeTillVictory

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

RELAX NG Grammar

<element name="Wonder">
  <interleave>
    <element name="TimeTillVictory">
      <data type="nonNegativeInteger"/>
    </element>
  </interleave>
</element>