Civ4UnitInfos

From Civilization Modding Wiki
Jump to navigationJump to search

The Civ4UnitInfos XML file controls data related to individual units: for example, a unit's strength value or hammer cost. There are also more detailed options, affecting things like transport capability, prerequisites, and other complex features.

All tags must be opened and closed; the first is the 'open', the second the 'closed' tag. If nothing goes inside a 'list tag', then it should just be the opening tag with a / before the closing bracket. The following tables contain all available tags, as well as their purpose and accepted values.

Header Tags

Tag Usage
UnitInfos This begins and ends the file. Everything must go in between these two, or it will not work.
UnitInfo Each different unit's data is enclosed in a seperate tag like this.
Class The class as defined in CIV4UnitClassInfos.xml. Class is the thing that holds, say, a Swordsman and a Praetorian together; each civilisation can only have one of each class.
Type The name of the unit; which must be unique
UniqueNames Only ever a closing tag. Just put it in, OK?
Special Should be NONE unless it comes under a heading in CIV4SpecialUnitInfos.xml; in which case write that.
Capture Either NONE, or the unit which the unit turns into when captured
Combat The combat, out of UNITCOMBAT_MELEE, UNITCOMBAT_ARCHER, UNITCOMBAT_MOUNTED, UNITCOMBAT_GUN, UNITCOMBAT_SIEGE, UNITCOMBAT_NAVAL, UNITCOMBAT_AIR and UNITCOMBAT_HELICOPTER of the unit - used to determine bonuses in combat.
Domain DOMAIN_ - then AIR, SEA or LAND
DefaultUnitAI The default way in which the AI uses the unit.
Invisible Either NONE (either meaning not invisible or completely invisible, see below) or INVISIBLE_STEALTH or INVISIBLE_SUBMARINE
SeeInvisible Either NONE or a category of invisibility above. Means that the unit can see all units with this type of invisibility

Text Tags

Description Either text or a key from the text files. The name displayed for the unit.
Civilopedia As above for the Civiliopedia entry
Strategy As above for the Sid's Tips, also displayed above the Civilopedia entry
Advisor Almost always ADVISOR_MILITARY; the rationale that the game gives for reccomending the unit.

Boolean Tags

All of these can either be 1 (on) or 0 (off)

Tag Usage
bAnimal The unit is an animal; the Barbarian State controls it, it can spring from anywhere and it cannot enter cultural borders.
bFood A city does not generate food while building this unit
bNoBadGoodies When this unit is entering a Tribal Village, the villagers will never be hostile
bOnlyDefensive This unit cannot attack other units
bNoCapture This unit cannot capture cities
bQuickCombat ALways 0; not sure what it actually does
bRivalTerritory Can explore rival territory
bMilitaryHappiness Counts as a Military Unit in the eyes of the rabble
bMilitarySupport Costs money to maintain as part of your military, affected by Pacifism and the like.
bMilitaryProduction Counts as a military unit for production bonuses/penalties
bPillage Can pillage enemy tiles
bSpy Is a spy
bSabotage Should only be 1 in Vanilla or Warlords; can Sabotage Production
bDestroy Should only be 1 in Vanilla or Warlords; can Destroy Improvement
bStealPlans Should only be 1 in Vanilla or Warlords; can Steal Plans
bInvestigate Should only be 1 in Vanilla or Warlords; can Investigate City
bCounterSpy Should only be 1 in Vanilla or Warlords; can Perform Counterespionage
bFound Can found a city
bGoldenAge Counts as a Great Person to start a Golden Age
bInvisible Is invisible to all units
bFirstStrikeImmune Is immune to all First Strikes
bNoDefensiveBonus Does not receive defensive bonuses
bIgnoreBuildingDefense Ignores defensive bonuses from enemy buildings, like Walls and Castles
bCanMoveImpassible If the unit is a Submarine, it can go under Ice.
bCanMoveAllTerrain Can move across all terrain
bFlatMovementCost Pays a flat movement cost to enter all terrain
bIgnoreTerrainCost Ignores movement penalties from terrain
bNukeInnume Takes no damage from enemy nukes
bPrereqBonuses Needs the mentioned resources to be built (can be NONE)
bPrereqReligion Needs the mentioned religion to be built (can be NONE)
bMechanized Not sure what this does - used for all land units in a vehicle
bSuicide Kills itself upon attacking, like a Kamikaze in the Defence mod
bHiddenNationality Bears no marking of nationality
bAlwaysHostile Can attack enemy units without declaring war, and can be attacked without triggering a war. All nations treat it as an enemy unit.

List Tags

Prerequisite Tags

Integer Tags

Miscellaneous Tags

Art Tags


<UnitInfos></UnitInfos> This begins and ends the file. Everything must go in between these two, or it will not work.

<UnitInfo></UnitInfo> Each different unit's data is enclosed in a seperate tag like this.

<Class></Class> The class as defined in CIV4UnitClassInfos.xml. Class is the thing that holds, say, a Swordsman and a Praetorian together; each civilisation can only have one of each class.

<Type></Type> The unit's in-game name, which must be unique.

<UniqueNames/> Only ever a closing tag, this must be put in after the <Type></Type> tag to show that the unit's 'name' is now finished.

<Special></Special> Should be NONE unless the unit is in one of your special categories in CIV4SpecialUnitInfos.xml; in which case put that in.

<Capture></Capture> Should be NONE unless the unit can be captured, in which case it is the class of the unit which appears when it is captured

<Combat></Combat> Shows the unit's combat, out of UNITCOMBAT_MELEE, UNITCOMBAT_ARCHER, UNITCOMBAT_MOUNTED, UNITCOMBAT_GUN, UNITCOMBAT_SIEGE, UNITCOMBAT_NAVAL, UNITCOMBAT_AIR and UNITCOMBAT_HELICOPTER

<Domain></Domain> DOMAIN_, then AIR, SEA or LAND. Shows whether the unit is an air, sea or land unit.

<DefaultUnitAI></DefaultUnitAI> How the AI uses the unit, by default.

<Invisible></Invisible> Either NONE, INVISIBLE_SUBMARINE or INVISIBLE_STEALTH. If it is not NONE, then the value is what sort of invisibility it has (see below)

<SeeInvisible></SeeInvisible> NONE, or else the sort of invisible unit (see above) that it can see.

<Description></Description> The name of the unit as displayed on screen. Can either be text or a tag from another file. If it is not out of a text database, the computer will read what is in here.

<Civilopedia></Civilopedia> As above; the entry in the Civilopedia for the unit.

<Strategy></Strategy> The Sid's Tips, as above. Also displayed at the top of the Civilopedia entry

<Advisor></Advisor> The advisor that will chip in (normally ADVISOR_MILITARY) when building this unit is a good idea.

Boolean Tags

<bAnimal></bAnimal> Is the unit an animal, out of 1 (yes) or 0 (no). If it is, the Barbarians only can build it and it will not enter cultural borders.

<bFood></bFood> If 1, the city cannot grow while producing this unit, in the same manner as Settlers and Workers. 0 means that the city can grow and train at the same time.

<bNoBadGoodies></bNoBadGoodies> Is set to 1 for Scouts and Explorers; means that Tribal Villages will never attack this unit.

<bOnlyDefensive></bOnlyDefensive> If set to 1, the unit cannot attack other units.

<bNoCapture></bNoCapture> If set to 1, the unit cannot take cities, even when there are no units in them.

<bQuickCombat></bQuickCombat> Always set to 0; not sure what it does.

<bRivalTerritory></bRivalTerritory> If set to 1, the unit can enter enemy territory without declaring war.

<bMilitaryHappiness></bMilitaryHappiness> If set to 1, the unit is treated as a military unit by the people of a city in terms of deciding whether they are angry about lack of protection or happy from the Monarchy civic

<bMilitarySupport></bMilitarySupport> If set to 1, counts as a military unit for the penalty posed by Pacifism and other bonusus/penalties like that.

<bMilitaryProduction></bMilitaryProduction> If set to 1, the unit counts as a military unit for the purposes of production and any bonuses and penalties applied on the prodution of military units.

<bPillage></bPillage> If set to 1, the unit can pillage enemy tiles

<bSpy></bSpy> If set to 1, the unit is a spy

<bSabotage></bSabotage> In Vanilla and Warlords, this means that the unit can sabotage production like a Spy in an enemy city. It should be 0 in BTS.

<bDestroy></bDestroy> As above, but for Destroy Improvement

<bStealPlans></bStealPlans> As above, for Steal Plans

<bInvestigate></bInvestigate> As above, for Investigate City

<bCounterSpy></bCounterSpy> As above, for Perform Counterespionage.

<bFound></bFound> If set to 1, the unit can found a new city.

<bGoldenAge></bGoldenAge> If set to 1, the unit counts as a Great Person to start a Golden Age.

<bInvisible></bInvisible> If set to 1, is invisible to all units.

<bFirstStrikeImmune></bFirstStrikeImmune> If set to 1, the unit is immune to all first strikes.

<bNoDefensiveBonus></bNoDefensiveBonus> If set to 1, the unit does not recieve defensive bonuses

<bIgnoreBuildingDefense></bIgnoreBuildingDefense> If set to 1, the unit ignores defensive bonuses from enemy walls and castles, like a Gunpowder unit.

<bCanMoveImpassable></bCanMoveImpassable> If set to 1, the unit can move under ice. Used for Submarines.

<bCanMoveAllTerrain></bCanMoveAllTerrain> If set to 1, the unit can move over all terrain.

<bFlatMovementCost></bFlatMovementCost> If set to 1, the unit pays this fixed price to enter all terrain.

<bIgnoreTerrainCost></bIgnoreTerrainCost> If set to 1, the unit ignores the cost of terrain to move into.

<bNukeImmune></bNukeImmune> If set to 1, the unit is immune to damage from nukes.

<bPrereqBonuses></bPrereqBonuses> Set to 0 for all unit except Work Boats. Not sure what it does.

<bPrereqReligion></bPrereqReligion> If set to 1, the unit requires the State Religion to be present in the city.

<bMechanized></bMechanized> Not sure what this does. Can be 1 or 0.

<bSuicide></bSuicide> If set to 1, the unit dies when it makes an attack

<bHiddenNationality></bHiddenNationality> If set to 1, the unit bears no marking of nationality.

<bAlwaysHostile></bAlwaysHostile> If set to 1, can attack the enemy without declaring war.

List Tags

<UnitClassUpgrades></UnitClassUpgrades> Inside here you put all of the unit classes which the unit upgrades to.
<UnitClassUpgrade></UnitClassUpgrade> Enclose in this tag everything which the unit upgrades to.

<UnitClassTargets></UnitClassTargets> Not sure what this does.
<UnitCombatTargets></UnitCombatTargets> Same as above

<UnitClassDefenders></UnitClassDefenders> Same as above
<UnitCombatDefenders></UnitCombatDefenders> Same as above

<FlankingStrikes></FlankingStrikes> All Flank Attacks which the unit gets should go under here.
<FlankingStrike></FlankingStrike> Put the unit and number of Flanking Strikes here.

<UnitAIs></UnitAIs> Inside here go the methods which the AI uses to command this unit.
<UnitAI></UnitAI> Put each AI in here.

<NotUnitAIs></NotUnitAIs> As <UnitAIs>, but for the tasks which the AI will never consider the unit for.
<NotUnitAI></NotUnitAI> As above for <UnitAI>

<Builds></Builds> For all the things that the unit can build on tiles
<Build></Build> Each thing that the unit can build goes in one of these.

<ReligionSpreads></ReligionSpreads> Put the religions which the unit can spread here.
<ReligionSpread></ReligionSpread> Each religion goes in here

<CorporationSpreads></CorporationSpreads> As above for <ReligionSpreads>
<CorporationSpread></CorporationSpread> As above for <ReligionSpread>

<GreatPeoples></GreatPeoples> The types of Super Specialist that this person can become
<GreatPeopleType></GreatPeopleType> Each type of Super Specialist goes in here.

<Buildings></Buildings> All of the things that the unit can construct in a city go here.
<Building></Building> Each building goes in one of these

<ForceBuildings></ForceBuildings> Don't know what this does


Preresquisite Tags

<HolyCity></HolyCity> If not NONE, then it is the Holy City needed to build the unit.

<ReligionType></ReligionType> For units, always NONE.

<StateReligion></StateReligion> If not NONE, the State Religion needed to build this unit

<PrereqReligion></PrereqReligion> As above for Religion

<PrereqCorporation></PrereqCorporation> As above for Corporation

<PrereqBuilding></PrereqBuilding> As above for building

<PrereqTech></PrereqTech> As above for technology <TechTypes></TechTypes> Encloses the above <BonusType></BonusType> If not NONE, the resource needed to build the unit

<PrereqBonuses></PrereqBonuses> Don't know what this does

<ProductionTraits></ProductionTraits> The leader traits which affect production of this unit

<Flavors><Flavors> The 'flavors' of a unit - not sure what they do


Integer Tags


<iAIWeight></iAIWeight> The preference given by the AI to this unit

<iCost></iCost> The cost in hammers of the unit

<iHurryCostModifier></iHurryCostModifier> The number by which you multiply the cost to get the hurry cost

<iAdvancedStartCost></iAdvancedStartCost> The cost on Advanced Start

<iAdvancedStartCostIncrease></iAdvancedStartCostIncrease> The increase in cost on Advanced Start

<iMinAreaSize></iMinAreaSize> Don't know what this does

<iMoves></iMoves>The number of moves a unit has

<bNoRevealMap></bNoRevealMap> If 1, the unit does not reveal the map

<iAirRange></iAirRange> For Air Units, the range

<iAirUnitCap></iAirUnitCap> Should be 0

<iDropRange></iDropRange> The range which the unit can parachute-jump

<iNukeRange></iNukeRange> The range at which the 'nuke' can be launched (0 for non-nukes)

<iWorkRate></iWorkRate> The rate at which the unit improves tiles

<iBaseDiscover></iBaseDiscover> The rate at which a unit discovers tiles

<iDiscoverMultiplier></iDiscoverMultiplier> Affects the rate at which the unit discovers tiles

<iBaseHurry></iBaseHurry> No idea

<iHurryMultiplier></iHurryMultiplier> Like <iDiscoverMultiplier>

<iBaseTrade></iBaseTrade> No idea

<iTradeMultiplier></iTradeMultiplier> See above

<iGreatWorkCulture></iGreatWorkCulture> The amount of culture that the unit can generate from a Great Work

<iEspionagePoints></iEspionagePoints> Used for spies

<TerrainImpassables></TerrainImpassables>

<FeatureImpassables/>

<TerrainPassableTechs/>

<FeaturePassableTechs/>

<iCombat>2</iCombat>

<iCombatLimit>100</iCombatLimit>

<iAirCombat>0</iAirCombat>

<iAirCombatLimit>0</iAirCombatLimit>

<iXPValueAttack>4</iXPValueAttack>

<iXPValueDefense>2</iXPValueDefense>

<iFirstStrikes>0</iFirstStrikes>

<iChanceFirstStrikes>0</iChanceFirstStrikes>

<iInterceptionProbability>0</iInterceptionProbability>

<iEvasionProbability>0</iEvasionProbability>

<iWithdrawalProb>0</iWithdrawalProb>

<iCollateralDamage>0</iCollateralDamage>

<iCollateralDamageLimit>0</iCollateralDamageLimit>

<iCollateralDamageMaxUnits>0</iCollateralDamageMaxUnits>

<iCityAttack>0</iCityAttack>

<iCityDefense>0</iCityDefense>

<iAnimalCombat>0</iAnimalCombat>

<iHillsAttack>0</iHillsAttack>

<iHillsDefense>0</iHillsDefense>

<TerrainNatives>

<TerrainNative></TerrainNative>

<FeatureNatives/>

<TerrainAttacks/>

<TerrainDefenses/>

<FeatureAttacks/>

<FeatureDefenses/>

<UnitClassAttackMods/>

<UnitClassDefenseMods/>

<UnitCombatMods/>

<UnitCombatCollateralImmunes/>

<DomainMods/>

<BonusProductionModifiers/>

<iBombRate>0</iBombRate>

<iBombardRate>0</iBombardRate>

<SpecialCargo>NONE</SpecialCargo>

<DomainCargo>NONE</DomainCargo>

<iCargo></iCargo> The number of units that it can carry


Misc Tags

<iConscription></iConscription> If 1, the unit can be Drafted

<iCultureGarrison></iCultureGarrison> Don't know what this does

<iExtraCost></iExtraCost> <iAsset>0</iAsset> <iPower>0</iPower>


Art Tags


<UnitMeshGroups> <iGroupSize>3</iGroupSize> <fMaxSpeed>1.75</fMaxSpeed> <fPadTime>1</fPadTime> <iMeleeWaveSize>3</iMeleeWaveSize> <iRangedWaveSize>0</iRangedWaveSize> <UnitMeshGroup> <iRequired>3</iRequired> <EarlyArtDefineTag>ART_DEF_UNIT_LION</EarlyArtDefineTag> </UnitMeshGroup> </UnitMeshGroups> <FormationType>FORMATION_TYPE_ANIMAL</FormationType> <HotKey/> <bAltDown>0</bAltDown> <bShiftDown>0</bShiftDown> <bCtrlDown>0</bCtrlDown> <iHotKeyPriority>0</iHotKeyPriority> <FreePromotions/> <LeaderPromotion>NONE</LeaderPromotion> <iLeaderExperience>0</iLeaderExperience>