Skip to content

Building animations

Steps a structure's own artwork through five frame sequences and runs up to thirteen separate animations pinned to it, one per slot.

Features & systemsUnits, buildings & economyBuildings & economy

A structure moves on screen through two mechanisms that share almost nothing. Its own artwork carries frames, and a small state machine steps through them. Separately, a structure runs up to thirteen attached animations — independent animation objects, each named in [Animations], pinned to a point on the structure’s artwork, cycling on their own timing, and created and destroyed as the structure changes state. The second is most of this page.

Each attached animation lives in a slot. A BuildingType declares one set of settings per slot, a structure holds at most one animation in each at a time, and each slot is filled and emptied by its own events. A slot no event ever reaches still stores every setting written for it and creates nothing from them.

The table lists every slot with the assignment that names its animation and the moment something puts one there. Take the last column as a pointer: the mechanism below governs how any slot’s animation is built, while the timing belongs to the setting that names it.

SlotNamed byFilled when
Upgrade one, two, threePowerUp1Anim=, PowerUp2Anim=, PowerUp3Anim=, each with a PowerUp<n>DamagedAnim=, PowerUp<n>LocXX=, PowerUp<n>LocYY=, PowerUp<n>LocZZ= and PowerUp<n>YSort= beside itThe first, second and third Upgrades= plug is installed. Removing a plug empties its slot
Active one to fourActiveAnim=, ActiveAnimTwo=, ActiveAnimThree=, ActiveAnimFour=The structure comes online, either as construction finishes or as the scenario places it
Pre-productionPreProductionAnim=Work is being set up on the structure
ProductionProductionAnim=The structure’s work is in progress
TurretTurretAnim=The structure comes online, or its charge-up begins
Special one to threeSpecialAnim=, SpecialAnimTwo=, SpecialAnimThree=An event on a UnitRepair=yes, SiloDamage=yes or FirestormWall=yes structure

Two of the active slots carry behavior the other two do not. On a SensorArray=yes structure, slot one starts two seconds — 30 frames — after construction finishes; every other path that starts slot one, and every path that starts the other three, applies no delay. Slot one is also the slot a UnitRepair=yes bay stops while it services a vehicle, and slot two the one a TurretAnimIsExclusive=yes turret displaces while it charges.

The turret slot is the one slot whose animation does not run on its own timing: its frame is set every pass from the structure’s facing, or from a charge counter stepped at TurretChargeAnimRate on a ChargeAnim=yes structure. TeslaCharge sounds as that wind-up begins; TeslaZap sounds nowhere.

Whatever the occasion, one routine fills a slot. It takes the slot’s healthy or damaged name and stops there if that name is empty; otherwise it looks the name up in [Animations] and creates an animation at the structure’s drawing position, offset by the slot’s …X and …Y and carrying its two draw-order biases. A name no [Animations] entry registers gets as far as the lookup and no further: nothing is created and the slot stays as it was, though the damage-state flag below has already moved by then. Filling a slot that already holds an animation replaces it and hands the new one the stage the old had reached, so the swap does not show as a jump.

One path bypasses the slot’s names. The lettered turret variants a wall tower cycles through are built from the structure’s Image ID with _B, _C or _D appended, and take the turret slot’s offset and biases but not its name.

A slot empties in three ways: its animation plays to its end, something stops it deliberately, or the structure is taken off the map, which stops all thirteen at once. The first is why a looping animation holds its slot for the rest of the structure’s life while a finite one leaves it free.

A running animation belongs to the structure rather than to the cell. Placing the structure down re-applies every slot’s offset from the new position, and the structure’s redraw pass brings its animations to the brightness and translucency it is drawn at, so one fading into a cloaking field takes them with it. Fog reaches them the same way: a structure passing under fog marks each of its animations fogged, an animation created on an already fogged structure is marked as it is created, and one whose AnimType leaves ShouldFogRemove at its default is not drawn while that mark is set. Uncovering the structure clears it.

Each slot carries a second name for its damaged form, and which of the two is used is fixed as the animation is created, from whether the structure has fallen to ConditionYellow or below. A slot that names no damaged form is given its healthy name as the art file is read, so one name serves both states; a slot that names only a damaged form runs nothing while the structure is healthy.

A structure keeps one flag recording which form it is currently showing, and that flag is per structure rather than per slot. Creating any animation in a form different from the flag flips it and restarts every animation the structure is running in the new form. Crossing ConditionYellow in either direction does the same directly, so a structure that takes a hit past the threshold swaps its whole set at once.

The consequence worth planning around runs the other way. Any slot started in the healthy form drags the rest of them back to healthy whether or not the structure is damaged, and they stay there until the next damage step or repair step re-tests the threshold. A repair bay’s animations and three of the four production moments each do this.

…X and …Y offset the animation from the point the structure is drawn at, in screen pixels: …X to the right, …Y down the screen. The offset pins the animation to a point on the artwork rather than to a cell.

…ZAdjust and …YSort both decide what the animation ends up drawn over, through two different mechanisms.

  • …ZAdjust biases the depth value the animation’s pixels are tested against. A negative figure brings the animation toward the viewer, so it covers the structure and anything else at that depth; a positive figure pushes it away, so the structure covers it.
  • …YSort is added to the animation’s sorting position, in leptons, of which a cell is 256. That position orders the ground layer, which is sorted once a frame. An AnimType left at the default Surface=no goes into the air layer instead, which is never sorted, so the bias reaches nothing there.

The two power flags are two responses to the same shortfall. …Powered=yes freezes the animation on its current frame while the house cannot meet its drain and resumes it at full power; the animation stays on screen throughout. …PoweredLight=yes instead destroys the animation on the shortfall and creates it again at full power.

Only one of the two is consulted. The pass over a house’s structures tests …Powered first and reaches …PoweredLight only when that flag is no, so …PoweredLight=yes left beside the default …Powered=yes never does anything. That pass reaches all thirteen slots on every structure the house owns, which is the one route by which a structure carrying none of the three special-slot flags runs a special animation. Fields, fences and lights covers which structures a house-wide shortfall reaches and which it spares.

The power cursor, the Turn off building trigger action and an EMP pulse reach the freeze by a different route, stopping one structure’s …Powered=yes animations directly rather than through the house-wide pass. A …PoweredLight=yes animation keeps running through all three.

Only the first 15 characters of an animation name are kept, and where a slot’s settings are read from is not uniform. The table gives the entry each half of a slot is taken from; the split shows only on a structure that borrows another’s artwork, where the two entries are different sections.

SlotNamesOffset, biases and power flags
Active one to fourThe Image ID art entryThe Image ID art entry
Special, production and pre-productionThe Image ID art entryThe art entry named after the ObjectType ID
TurretThe rules entry named after the ObjectType IDThe rules entry named after the ObjectType ID

Everything but the turret slot reads its remaining settings only once the slot holds a name, healthy or damaged; on a structure that names neither, those settings are not read at all. The turret slot reads its four unconditionally.

The upgrade slots and the active slots share one array

Section titled “The upgrade slots and the active slots share one array”

The thirteen slots are one array with the three upgrade slots at its head, and two paths walk into it by number rather than by name.

The art file is read one declared upgrade at a time — PowerUp1Anim= and its companions into the first slot, PowerUp2Anim= and its companions into the second — and the walk is bounded by Upgrades= rather than by the number of upgrade slots. A type declaring four upgrades therefore has its fourth plug’s six art assignments read over the first active slot’s two names, its offset and both of its biases, each field only where that plug’s assignment is present. A fifth, sixth and seventh declared upgrade reach active slots two, three and four in turn.

The structure’s own artwork has no slots in it. A structure is in one of five frame sequences at a time, four of them declared as a first frame, a frame count and a per-frame delay: AnimIdle whenever nothing else has taken it over, AnimActive while it is working, and AnimAux1 and AnimAux2 for the two further states a missile silo uses. The fifth is the construction sequence, which is not declared at all: its frame count is half the frame count of the Buildup= file — or GateStages plus one on a gate — and its rate is that count divided into BuildupTime. A Theater=yes structure is timed again as each theater is set up, over every frame in the file at a fixed five seconds, so neither the halving nor BuildupTime reaches it.

Damaged artwork is a second block of frames after the first, and where that block begins depends on which sequence the structure is in. A damaged structure in the idle sequence draws the very next frame after the one it would otherwise draw; in any of the other three it is offset by the largest end any of the four sequences reaches. ExtraDamageStage promises a third condition and reaches nothing.

Four further shapes are drawn around the structure rather than as part of it, and none is an attached animation: BibShape under it, DeployingAnim in place of it while it unloads, and DoorAnim with UnderDoorAnim around its factory door. Each is a shape file loaded with the rules and drawn from a frame the structure works out, so none cycles on its own. Despite the name, Bib=yes has nothing to do with the apron artwork: it opens the eastern edge of the footprint to vehicles and draws nothing.

99 of 99

KeyDescriptionValueWhen omitted
ActiveAnimBuildingTypeThe animation the structure runs in its first active slot.string(empty)
ActiveAnimDamagedBuildingTypeThe animation the first active slot runs while the structure is damaged.stringInherited
ActiveAnimXBuildingTypeHow far right of the structure's drawing point the first active slot's animation sits, in screen pixels.integer0
ActiveAnimYBuildingTypeHow far below the structure's drawing point the first active slot's animation sits, in screen pixels.integer0
ActiveAnimZAdjustBuildingTypeThe depth bias applied to the first active slot's animation.integer0
ActiveAnimYSortBuildingTypeThe sorting bias applied to the first active slot's animation, in leptons.integer0
ActiveAnimPoweredBuildingTypeWhether the first active slot's animation freezes while its house is short of power.booleanyes
ActiveAnimPoweredLightBuildingTypeWhether the first active slot's animation is destroyed and recreated with its house's power.booleanno
ActiveAnimTwoBuildingTypeThe animation the structure runs in its second active slot.string(empty)
ActiveAnimTwoDamagedBuildingTypeThe animation the second active slot runs while the structure is damaged.stringInherited
ActiveAnimTwoXBuildingTypeHow far right of the structure's drawing point the second active slot's animation sits, in screen pixels.integer0
ActiveAnimTwoYBuildingTypeHow far below the structure's drawing point the second active slot's animation sits, in screen pixels.integer0
ActiveAnimTwoZAdjustBuildingTypeThe depth bias applied to the second active slot's animation.integer0
ActiveAnimTwoYSortBuildingTypeThe sorting bias applied to the second active slot's animation, in leptons.integer0
ActiveAnimTwoPoweredBuildingTypeWhether the second active slot's animation freezes while its house is short of power.booleanyes
ActiveAnimTwoPoweredLightBuildingTypeWhether the second active slot's animation is destroyed and recreated with its house's power.booleanno
ActiveAnimThreeBuildingTypeThe animation the structure runs in its third active slot.string(empty)
ActiveAnimThreeDamagedBuildingTypeThe animation the third active slot runs while the structure is damaged.stringInherited
ActiveAnimThreeXBuildingTypeHow far right of the structure's drawing point the third active slot's animation sits, in screen pixels.integer0
ActiveAnimThreeYBuildingTypeHow far below the structure's drawing point the third active slot's animation sits, in screen pixels.integer0
ActiveAnimThreeZAdjustBuildingTypeThe depth bias applied to the third active slot's animation.integer0
ActiveAnimThreeYSortBuildingTypeThe sorting bias applied to the third active slot's animation, in leptons.integer0
ActiveAnimThreePoweredBuildingTypeWhether the third active slot's animation freezes while its house is short of power.booleanyes
ActiveAnimThreePoweredLightBuildingTypeWhether the third active slot's animation is destroyed and recreated with its house's power.booleanno
ActiveAnimFourBuildingTypeThe animation the structure runs in its fourth active slot.string(empty)
ActiveAnimFourDamagedBuildingTypeThe animation the fourth active slot runs while the structure is damaged.stringInherited
ActiveAnimFourXBuildingTypeHow far right of the structure's drawing point the fourth active slot's animation sits, in screen pixels.integer0
ActiveAnimFourYBuildingTypeHow far below the structure's drawing point the fourth active slot's animation sits, in screen pixels.integer0
ActiveAnimFourZAdjustBuildingTypeThe depth bias applied to the fourth active slot's animation.integer0
ActiveAnimFourYSortBuildingTypeThe sorting bias applied to the fourth active slot's animation, in leptons.integer0
ActiveAnimFourPoweredBuildingTypeWhether the fourth active slot's animation freezes while its house is short of power.booleanyes
ActiveAnimFourPoweredLightBuildingTypeWhether the fourth active slot's animation is destroyed and recreated with its house's power.booleanno
SpecialAnimBuildingTypeThe animation the structure runs in its first special slot.string(empty)
SpecialAnimDamagedBuildingTypeThe animation the first special slot runs while the structure is damaged.stringInherited
SpecialAnimXBuildingTypeHow far right of the structure's drawing point the first special slot's animation sits, in screen pixels.integer0
SpecialAnimYBuildingTypeHow far below the structure's drawing point the first special slot's animation sits, in screen pixels.integer0
SpecialAnimZAdjustBuildingTypeThe depth bias applied to the first special slot's animation.integer0
SpecialAnimYSortBuildingTypeThe sorting bias applied to the first special slot's animation, in leptons.integer0
SpecialAnimPoweredBuildingTypeWhether the first special slot's animation freezes while its house is short of power.booleanyes
SpecialAnimPoweredLightBuildingTypeWhether the first special slot's animation is destroyed and recreated with its house's power.booleanno
SpecialAnimTwoBuildingTypeThe animation the structure runs in its second special slot.string(empty)
SpecialAnimTwoDamagedBuildingTypeThe animation the second special slot runs while the structure is damaged.stringInherited
SpecialAnimTwoXBuildingTypeHow far right of the structure's drawing point the second special slot's animation sits, in screen pixels.integer0
SpecialAnimTwoYBuildingTypeHow far below the structure's drawing point the second special slot's animation sits, in screen pixels.integer0
SpecialAnimTwoZAdjustBuildingTypeThe depth bias applied to the second special slot's animation.integer0
SpecialAnimTwoYSortBuildingTypeThe sorting bias applied to the second special slot's animation, in leptons.integer0
SpecialAnimTwoPoweredBuildingTypeWhether the second special slot's animation freezes while its house is short of power.booleanyes
SpecialAnimTwoPoweredLightBuildingTypeWhether the second special slot's animation is destroyed and recreated with its house's power.booleanno
SpecialAnimThreeBuildingTypeThe animation the structure runs in its third special slot.string(empty)
SpecialAnimThreeDamagedBuildingTypeThe animation the third special slot runs while the structure is damaged.stringInherited
SpecialAnimThreeXBuildingTypeHow far right of the structure's drawing point the third special slot's animation sits, in screen pixels.integer0
SpecialAnimThreeYBuildingTypeHow far below the structure's drawing point the third special slot's animation sits, in screen pixels.integer0
SpecialAnimThreeZAdjustBuildingTypeThe depth bias applied to the third special slot's animation.integer0
SpecialAnimThreeYSortBuildingTypeThe sorting bias applied to the third special slot's animation, in leptons.integer0
SpecialAnimThreePoweredBuildingTypeWhether the third special slot's animation freezes while its house is short of power.booleanyes
SpecialAnimThreePoweredLightBuildingTypeWhether the third special slot's animation is destroyed and recreated with its house's power.booleanno
ProductionAnimBuildingTypeThe animation a structure runs while its work is in progress.string(empty)
ProductionAnimDamagedBuildingTypeThe animation the production slot runs while the structure is damaged.stringInherited
ProductionAnimXBuildingTypeHow far right of the structure's drawing point the production animation sits, in screen pixels.integer0
ProductionAnimYBuildingTypeHow far below the structure's drawing point the production animation sits, in screen pixels.integer0
ProductionAnimZAdjustBuildingTypeThe depth bias applied to the production animation.integer0
ProductionAnimYSortBuildingTypeThe sorting bias applied to the production animation, in leptons.integer0
PreProductionAnimBuildingTypeThe animation a structure runs while work is being set up on it.string(empty)
PreProductionAnimDamagedBuildingTypeThe animation the pre-production slot runs while the structure is damaged.stringInherited
PreProductionAnimXBuildingTypeHow far right of the structure's drawing point the pre-production animation sits, in screen pixels.integer0
PreProductionAnimYBuildingTypeHow far below the structure's drawing point the pre-production animation sits, in screen pixels.integer0
PreProductionAnimZAdjustBuildingTypeThe depth bias applied to the pre-production animation.integer0
PreProductionAnimYSortBuildingTypeThe sorting bias applied to the pre-production animation, in leptons.integer0
TurretAnimBuildingTypeThe animation a building's turret is drawn from, or the voxel model that replaces it.string(empty)
TurretAnimDamagedBuildingTypeThe turret animation a building shows once it is damaged.stringComputed
TurretAnimXBuildingTypeThe horizontal screen offset from a building's artwork to its turret.integer0
TurretAnimYBuildingTypeThe vertical screen offset from a building's artwork to its turret.integer0
TurretAnimZAdjustBuildingTypeThe depth bias a building's turret art is drawn with.integer0
TurretAnimYSortBuildingTypeThe bias added to where a building's turret animation falls in the draw order.integer0
TurretAnimIsVoxelBuildingTypeDraws a building's turret from a voxel model rather than from an animation.booleanno
TurretAnimIsExclusiveBuildingTypeRuns a building's turret animation only while its weapon is charging, in place of its second active animation.booleanno
TurretChargeAnimRateBuildingTypeThe delay between frames of a building's turret animation while its weapon charges.integer3
ChargeAnimBuildingTypeDrives a turretless structure's turret animation from its charge counter.booleanno
TeslaChargeglobal rulesSound a structure makes as its electric weapon begins charging.soundnone
TeslaZapNo effectglobal rulesParsed sound that no turret ever discharges.soundnone
UpgradesBuildingTypeHow many upgrade plugs the structure accepts.integer0
AnimIdleBuildingTypeThe first frame, frame count and step delay of a structure's resting animation.string0,1,0
AnimActiveBuildingTypeThe first frame, frame count and step delay of a structure's working animation.string0,1,0
AnimAux1BuildingTypeThe first frame, frame count and step delay of a structure's first auxiliary animation.string0,1,0
AnimAux2BuildingTypeThe first frame, frame count and step delay of a structure's second auxiliary animation.string0,1,0
ExtraDamageStageNo effectBuildingTypeParsed flag that the engine never uses.booleanyes
DeployingAnimBuildingTypeThe shape file that replaces a structure's own artwork while it unloads.string(empty)
DoorAnimBuildingTypeThe shape file drawn over a structure as its factory door works.string(empty)
DoorStagesBuildingTypeThe number of frames the factory door animation steps through.integer0
DamagedDoorBuildingTypeDraws the factory door animation from a second block of frames once the structure is damaged.booleanno
UnderDoorAnimBuildingTypeThe shape drawn beneath a structure's factory door while it unloads.string(empty)
BibBuildingTypeOpens the eastern edge of the structure's footprint to vehicles.booleanno
BibShapeBuildingTypeThe apron shape drawn on the ground under a structure.string(empty)
SensorArrayBuildingTypeWhether the structure marks the cells around it as sensed, revealing cloaked objects standing there.booleanno
UnitRepairBuildingTypeMakes the building take in one vehicle or aircraft at a time and repair it for credits.booleanno
SiloDamageBuildingTypeDraws a fill level on a building that stores Tiberium.booleanno
FirestormWallBuildingTypeWhether the structure is a firestorm wall section, raised and lowered with its house's firestorm defense.booleanno
SurfaceAnimTypePlaces the animation in the ground layer, among the units and structures, rather than in the layer above them.booleanno
YSortAdjustAnimTypeBiases where the animation falls in the ground layer's drawing order, in leptons.integer0