Skip to content

Projectile flight and impact

Steps every projectile along one of two flight models each frame and settles where, and how many times, it detonates.

Features & systemsCombat & weaponsWeapons, warheads & projectiles

A projectile carries figures from the weapon that fired it. The weapon supplies the damage, the warhead, the launch speed, the flight allowance, and the object credited with any kill. The projectile type decides how the shot travels, what ends its flight, and how many blasts it delivers.

ROT chooses between two flight models. A projectile with ROT above zero is steered: the missile autopilot turns it toward its target each frame and lifts it over the ground in the way. A projectile with ROT=0 is ballistic: it follows the arc it was launched along, falls under gravity, and bounces off whatever it lands on. Most settings on this page affect only one of the two models.

Firing geometry and beam weapons owns where a shot appears and what is drawn alongside it. This page owns the shot itself, from the velocity it leaves with to the last blast it delivers.

A BulletType is a rules section describing one kind of shot. No list registers it. A weapon’s Projectile= names it, and a name the game has not seen before creates a new projectile type with default settings. A misspelled name therefore produces a projectile with none of the intended settings, and no error.

The weapon section holds how hard the shot hits, how far it can be fired, and how often. The projectile section holds how the shot flies, what it can be aimed at, and what its impact breaks into.

rules.ini
[MyRocketPod] ; a WeaponType, registered by an object naming it as its Primary
Projectile=MYROCKET
Warhead=AP ; a WarheadType registered in [Warheads]
Damage=60
Range=7
ProjectileRange=9
[MYROCKET] ; a BulletType, registered by the weapon above naming it
Image=MISSILE ; the art section its flight imagery is read from
ROT=5 ; above zero, so the missile autopilot flies it
Ranged=yes ; spends the weapon's ProjectileRange as fuel
AA=yes

A projectile in flight occupies no cell. Nothing collides with it, and nothing that searches a cell for occupants finds it. It is always drawn with the airborne objects, whatever its height.

Five things are fixed at launch: the aim point, the direction, the pitch, the speed, and, on a steered projectile, the fuse.

The firer aims at its current target’s position. When that target is a moving vehicle, the firer aims ahead of it, at where the vehicle will be when a shot at the speed of the firer’s primary weapon arrives. On a projectile that is both Inaccurate=yes and Arcing=yes, that aim point is then moved in a random direction by between half and all of BallisticScatter. The pitch and speed below are worked out for the moved point.

A steered projectile or a Dropping=yes projectile leaves along the firer’s gun heading, whichever way the target lies. Every other projectile leaves pointed at the aim point. The gun heading depends on the firer:

  • a vehicle with a turret uses its turret facing;
  • infantry and a vehicle without a turret use their body facing;
  • an aircraft uses the heading its body is drawn at;
  • a structure with a turret that is not a voxel uses its turret facing, rounded to one of 32 directions;
  • any other structure, including one with a voxel turret, fires straight toward its target.

A lepton is the engine’s distance unit. A cell is 256 leptons across and a terrain level is 104 leptons high, so 200 leptons is just under two terrain levels.

The pitch comes from the first of these rules that applies:

  1. An Arcing=yes projectile gets a ballistic arc to the aim point. The high arc is used when the weapon is Lobber=yes, or when the target stands higher above the firer than it is away horizontally. Otherwise the flat arc is used. When no arc at the launch speed reaches the aim point, the weapon does not fire.
  2. A Voxel=yes projectile leaves pointing straight up.
  3. Any other projectile leaves almost level, about 1.4 degrees up, unless the aim point is more than 200 leptons above or below the weapon’s mounting. Then it is pitched at the aim point, with the height difference reduced by 20 leptons first.
    • When that happens and the firer’s target is a structure, the aim height becomes 200 leptons for each point of the structure’s Height. That height is counted from the map’s zero height, not from the ground the structure stands on.

A ballistic projectile does not use the weapon’s Speed=. Once the rules are read, the engine replaces it with a speed worked out from the weapon’s Range= and gravity, fast enough to carry the shot the weapon’s full range. At launch that speed is capped at half the distance to the aim point, so a point-blank shot leaves more slowly than a shot at full range. An arcing shot’s arc is worked out at the capped speed.

A steered projectile leaves at 1 lepton a frame, whatever the distance, and works up to the weapon’s Speed= in flight, as steered flight describes.

Only a steered projectile uses a fuse. The fuse is set on the target’s position at the moment of launch, not on the predicted aim point. It stays shut for the projectile’s Arm delay, except that a shot at an aircraft is armed at once. The Arm page covers when the fuse trips.

An Inviso=yes projectile skips the flight. It is placed directly on its target’s position as it is launched. If a raised firestorm wall lies on the path, the wall consumes it instead.

Every object takes its turn each frame in the order it was placed on the map, and a projectile is placed when it is fired. A projectile therefore normally moves after its target in the same frame, and sees the target where this frame left it. An object that leaves the map and returns, such as a unit leaving a transport, moves to the back of the order.

Each turn runs these steps in order:

  1. A Dropping=yes projectile is marked to detonate.
  2. When AnimLow or AnimHigh is not zero, the flight animation counts down toward its next frame.
  3. On every third frame of the game clock, a Trailer puff is left at the position the projectile is about to leave.
  4. One of the two flight models moves the projectile, and may mark it to detonate.
  5. A Ranged=yes projectile subtracts the distance it just moved from its allowance, and is marked when the allowance runs out.
  6. The projectile takes up its new position. If it now stands in a raised firestorm wall that does not let it through, the wall consumes it and the turn ends.
  7. A projectile not already marked goes through three standing tests: a tall overlay in its cell, ground level, and the anti-aircraft proximity test. What ends a flight lists them.
  8. A steered projectile checks its fuse.
  9. A projectile that is not marked, and whose fuse has not tripped, keeps flying. A Degenerates=yes projectile then loses 1 point of damage, down to a floor of 5. Any other projectile detonates and is removed.

A shot from a weapon with a barrel gets a head start: two of these turns run immediately during firing, so the shot appears past the muzzle, not inside it. The firing sequence says which shots get the head start. Every other shot takes its first turn later in the same frame, once every object ahead of it in the turn order has moved. A head-start shot takes that turn as well, so it moves three times in the frame it is fired.

The autopilot flies a projectile whose ROT is above zero. It homes on the target itself, at the point weapons aim at on it, and reads that point again every frame.

Each frame the autopilot moves the projectile’s speed toward the weapon’s figure, gaining Acceleration leptons a frame. A projectile already faster than that figure slows by half of Acceleration a frame, rounded down.

A new steered projectile is launching until it reaches that speed, unless the weapon’s Speed= is 16 or more. Speed= is written on a 0-to-100 scale, and 16 converts to 40 leptons a frame. While launching, the projectile gains 1 lepton every other frame instead of Acceleration. It keeps its heading, and its pitch turns toward the target by less than one degree a frame.

After launching, the projectile may turn by up to its turn allowance each frame. The allowance is measured in 256ths of a full turn. It swings between ROT and ROT × (1 + 2 × MissileROTVar) over a 15-frame cycle, rounded down, which makes missiles weave. The cycle is offset for each projectile, so missiles fired together do not all weave in step. Within one cell of the target the allowance is multiplied by 1.5.

The heading turns toward the target by up to the full allowance. The pitch follows one of two branches. The projectile follows the terrain only when all of these hold:

  • the target is not an aircraft;
  • Any of: the projectile is Airburst=yes; the horizontal distance to the target is over three cells, or over six for a VeryHigh=yes projectile;
  • the turn allowance this frame is more than 1.

Otherwise the projectile dives.

A launching projectile’s turn allowance is zero, so it never follows terrain. It always takes the dive branch, which is what turns its pitch slightly. At a MissileROTVar of 0.5 or less, a ROT=1 projectile’s allowance never exceeds 1, so it always dives. A ROT of 2 or more always passes the allowance test.

Terrain following looks six frames of travel ahead and holds the projectile above the ground there. The clearance is one terrain level for each whole cell still to the target, up to five levels. An Airburst=yes or VeryHigh=yes projectile holds ten levels instead. When the projectile is more than 20 leptons off that height, it is moved 18 leptons toward it each frame. Its pitch turns at half the allowance: toward a 45-degree climb when it is more than half a level too low, toward an 11-degree descent when it is more than half a level too high, and toward level flight otherwise.

In a dive, the pitch turns straight toward the target at just over half the allowance.

VeryHigh raises the clearance and starts the dive farther out. Airburst raises the clearance and keeps following the terrain all the way to the target, as long as the other two conditions hold.

The projectile has arrived when the distance still to go is no more than half its speed per frame, or when it is at ground level. That distance counts only a quarter of the height difference, or none of it for an Airburst=yes projectile. A projectile that arrives in the air is moved onto its homing point, unless it is Airburst=yes.

A steered projectile that stops gaining on its target detonates instead of circling it forever. After its first 60 frames past launching, the engine keeps a running average of how fast the projectile closes on its target. The flight ends when that average is at least 0 but below 1 lepton a frame. A projectile that is losing ground has a negative average, so this test does not stop it. Airburst=yes and VeryHigh=yes projectiles are exempt, because both are meant to stay above their targets.

A steered projectile that crosses the height of a bridge deck over a bridge cell, from above or below, ends its flight at deck height.

Each frame, a ballistic projectile’s vertical speed drops by [AudioVisual] Gravity, or by half of it for a Floater=yes projectile. The projectile then moves by its whole velocity.

Several tests below ignore friendly objects: those that belong to the firer’s house or to a house allied with it.

A projectile forgets its firer when the firer is destroyed, captured, enters a transport or a structure, or starts to cloak. For the rest of its flight nothing counts as friendly, so the shot can go off on its own side’s units and structures.

The projectile has landed when a step takes it below ground level, through a bridge deck, or into an obstacle. It is then placed on the ground or deck it struck.

An obstacle is a structure or a wall in the cell, and it counts only while the projectile is less than 150 leptons above the ground. These structures do not stop the shot:

  • the structure that fired it;
  • a slack laser fence segment;
  • a structure that counts as a deployed vehicle;
  • a friendly structure.

Walls have no exemptions, so a wall also stops ballistic fire from its owner’s house and allies. Only two overlays count as walls in this test: the ones at positions 2 and 26 of the [OverlayTypes] list, counting from 0. The stock list puts GAWALL and NAWALL there.

Another overlay marked High=yes stops a shot only through the tall-overlay test in What ends a flight. That test applies to both flight models and exempts a projectile marked High=yes. A High=yes projectile gets no exemption from the wall test above. The stock sandbag wall, GASAND, sets Wall=yes but not High=yes, so neither test stops a shot passing over it.

Every landing works out a rebound, even when the projectile is about to detonate. The velocity is scaled by Elasticity and reflected off the slope of the ground it landed on, so a shot that lands on a ramp bounces off downhill. What happens next depends on Bouncy:

  • A projectile that is not Bouncy=yes detonates where it landed.
  • A Bouncy=yes projectile detonates when the cell it was in at the start of the turn holds an object that is not friendly. The firer’s cell never counts. Otherwise it flies on.
  • Any projectile detonates on its third landing.

Three more checks can end a ballistic flight after the move:

  1. A projectile not already marked to detonate goes off on an object that is not friendly when that object stands in the cell the projectile just entered, within 128 leptons (half a cell) of it.
  2. A projectile that has left the playfield is removed at its previous position without detonating, even if it had just landed.
  3. A projectile moving slower than 10 leptons a frame, and lying within 10 leptons of the ground, detonates where it lies.

This table gathers every way a flight ends, in the order a turn tests them. The middle column gives the flight model each applies to. The last column says where the blast is placed, since several of these move the projectile first.

What ends the flightApplies toWhere it goes off
The projectile is Dropping=yesBothWhere it stands, one frame’s travel from where it was launched
It has arrived: half a frame’s travel or less to go, or it is at ground levelSteeredOn its homing point, unless it is Airburst=yes or at ground level
It has stopped gaining on its targetSteeredWhere it stands. Airburst=yes and VeryHigh=yes are exempt
It crossed the height of a bridge deckSteeredAt deck height
It landed, and either is not Bouncy=yes or the cell it was in at the start of the turn holds an object that is not friendlyBallisticOn the ground or deck it struck
It landed for the third timeBallisticWhere it came down
It came within 128 leptons of an object that is not friendly, in the cell it just enteredBallisticOn that object
It left the playfieldBallisticNowhere. It is removed without a blast
It is moving slower than 10 leptons a frame and lies within 10 leptons of the groundBallisticWhere it lies
A Ranged=yes projectile has used up its allowanceBothWhere it stands
It stands in a raised firestorm wall that does not let it throughBothNowhere. The wall consumes it without a blast
A High=yes overlay stands in its cell, the projectile is less than 100 leptons above the ground, and it is not High=yes itselfBothWhere it stands
It is below ground levelBothWhere it stands
It is AA=yes and within 128 leptons of the aircraft, or the airborne jumpjet infantry, it is chasingBothWhere it stands
Its fuse trippedSteered, but never a Dropping=yes projectileWhere it stands. A trip within 64 leptons of the fuse point moves it onto the target, as described below

The blast does not always go off where the projectile stood. Up to three moves pull it onto the target, applied in this order. None of them applies once the projectile has lost its target.

  1. The blast moves onto the target’s center when the projectile is not Airburst=yes and Any of:
    • the fuse tripped within 64 leptons of the point it was set on;
    • a ballistic shot landed and went off because it is not Bouncy=yes, or because the cell it was in at the start of the turn held an object that is not friendly. It must also have come down within 384 leptons (a cell and a half) of the target, or within six times its rebound speed if that is farther. Only half the height difference counts toward that distance.
  2. The blast moves onto the target’s center when it is within 32 leptons of it. Airburst=yes and Inaccurate=yes projectiles skip this move.
  3. Unless the warhead is EMEffect=yes or the projectile is Splits=yes, the blast moves onto a nearby target. An airborne target within 128 leptons of the projectile pulls the blast onto the point weapons aim at on it. Any other target within 42 leptons pulls the blast onto its position, and a structure’s distance is measured to its edge. Inaccurate=yes does not prevent this move.

The warhead decides what the blast does. AnimList chooses the explosion by damage, SplashList replaces it over water, and Spread sets how the damage thins with distance. An EMEffect=yes warhead spends the damage as a pulse instead.

Cluster counts one of two things, and Splits chooses which. An Airburst=yes projectile splits unless it sets Splits=no; the Splits page explains why.

An ordinary projectile repeats its whole detonation Cluster times. The first blast lands on the point of impact. Each later blast lands one to two cells from that same point, in a random direction, so the blasts do not walk away from it.

A splitting projectile detonates once and then releases Cluster bomblets of its AirburstWeapon. The split runs in this order, which decides what a bomblet can still target:

  1. The carrier’s blast, explosion and lighting flash happen.
  2. The candidate list is built from the objects within five cells of the carrier’s target, or of the carrier itself when its target is a cell. Objects the carrier’s blast destroyed are already gone.
  3. Each bomblet keeps the carrier’s target at the RetargetAccuracy chance, and otherwise draws from the list.
  4. The bomblets are created at the carrier’s position, pointing straight down. That position ignores the 32-lepton move onto the target.

Where a projectile’s artwork is read from

Section titled “Where a projectile’s artwork is read from”

Write Image= in a projectile’s rules section, even when it would name the section itself. Repeat it in every rules file that declares the section, including a map’s rules. A section without Image= clears the projectile’s image name.

Every object type reads Image= with its current image name as the default, and that name starts as the section name. A projectile then reads Image= a second time, with an empty default. When the section does not set Image=, the second read leaves the projectile with no image name.

The art settings read after that point are affected:

  • The shape artwork survives, because it was already loaded under the earlier name and a failed load keeps it.
  • Trailer and Rotates are not read at all.
  • AnimLow, AnimHigh, AnimRate and AnimPalette are looked up in an art section with an empty name, so they are not found.

These six settings keep their defaults, or the values an earlier file gave them. An art section named after the projectile does not supply them either. Each of their key pages records the effect on that setting.

40 of 40

KeyDescriptionValueWhen omitted
AABulletTypeAllows the projectile to be fired at targets that are in the air.booleanno
AccelerationBulletType, global rules, levitation controlsHow quickly a homing projectile, a jumpjet unit or a levitating unit changes speed.integerVaries by type
AirburstBulletTypeHolds a homing projectile at cruising height so that it goes off above its target rather than diving onto it.booleanno
AirburstWeaponBulletTypeThe WeaponType supplying the bomblets a splitting projectile releases.classnone
AnimHighBulletTypeThe last frame of the projectile's looping flight animation.integer0
AnimLowBulletTypeThe frame the projectile's flight animation returns to when it loops.integer0
AnimPaletteBulletTypeDraws the projectile's body with the animation palette instead of the normal one.booleanno
AnimRateBulletTypeThe number of game frames each frame of the projectile's flight animation is held for.integer0
ArcingBulletTypeAims the weapon by solving a ballistic arc to the target instead of pointing straight at it.booleanno
ArmBulletTypeHow long after launch a projectile's proximity fuse is held shut, in game frames.integer0
BallisticScatterglobal rulesHow far an inaccurate arcing shot has its aim point thrown off.distance (cells)1
BouncyBulletTypeLets a ballistic projectile rebound off the surface it lands on instead of detonating there.booleanno
ClusterBulletTypeThe number of blasts an ordinary projectile delivers, or the number of bomblets a splitting one releases.integer1
DegeneratesBulletTypeBleeds a point of damage off the projectile for every game frame it stays in flight.booleanno
DroppingBulletTypeMeant to make a bomb that falls from a height, but the projectile detonates as soon as it is fired.booleanno
ElasticityAnimType, BulletType, VoxelAnimTypeThe fraction of its speed a bouncing object keeps when it rebounds off a surface.floating pointVaries by type
FloaterBulletTypeHalves the gravity the projectile is flown and aimed under.booleanno
Gravityglobal rulesThe downward pull applied each frame to ballistic shots, hovering and levitating objects, and some particles.integer3
HeightBuildingType, SmudgeType, random map generationA structure's vertical extent, the number of cell rows a smudge covers, or a generated map's size index.integerVaries by type
HighBulletType, OverlayTypeMarks an overlay tall enough to stop low-flying fire, or a projectile that flies over such an overlay.booleanno
HomingScatterNo effectglobal rulesParsed scatter distance that the engine never uses.distance (cells)2
Image13 applicable typesSelects an Image ID, animation Image ID, Tiberium overlay variant, or building main-shape basename according to scope.stringVaries by type
InaccurateBulletTypeScatters the aim point of an arcing shot before its arc is solved.booleanno
InvisoBulletTypeRemoves the flight entirely; the projectile appears at its target the moment it is fired and is never drawn.booleanno
MissileROTVarglobal rulesHow far a homing projectile's rate of turn swings above its nominal value.floating point.25
MissileSpeedVarNo effectglobal rulesParsed fraction that the engine never uses.floating point.25
ProjectileWeaponTypeThe BulletType the weapon launches.classnone
ProjectileRangeWeaponTypeHow far a fueled projectile may fly before it detonates wherever it happens to be, in cells.distance (cells)390.625
ProximityNo effectBulletTypeParsed flag that the engine never uses.booleanno
RangeWeaponType, SoundsHow far the weapon may be fired, in cells, or how far from the view a sound is still heard.distance (cells)Varies by type
RangedBulletTypeGives the projectile a fuel supply, detonating it once it has flown the firing weapon's projectile range.booleanno
RetargetAccuracyBulletTypeThe chance that a bomblet from a splitting projectile keeps the carrier's target.floating point0
ROT5 applicable typesThe rate an object's body and turret turn at, or the rate a homing projectile steers at.integer0
RotatesBulletTypeDraws the projectile from a set of 32 facing frames instead of always from the same one.booleanno
ShadowNo effectBulletTypeParsed flag that the engine never uses.booleanyes
Speed6 applicable typesThe top travel speed of an object type, the launch speed of a weapon's projectile, or the travel ceiling every jumpjet unit shares.integerVaries by type
SplitsBulletTypeBreaks the projectile into a burst of bomblets when it detonates.booleanContext-dependent
TrailerBulletTypeThe animation left behind the projectile as it flies.classnone
VeryHighBulletTypeRaises a homing projectile's cruising clearance and starts its dive farther from the target.booleanno
VoxelObjectType and derived typesDraws a vehicle, aircraft, or projectile from a voxel model instead of a shape file.booleanno