Skip to content

Movement and terrain

Which cells an object may enter, which destinations it can reach, and how fast it crosses each cell.

Features & systemsUnits, buildings & economyUnits & movement

Changed in 0.1.0

Three separate checks stand between a move order and a moving object:

  • A per-step test decides whether the object may enter the next cell.
  • A map-wide zone map decides whether the destination can be reached at all, before any route is planned.
  • A throttle decides what fraction of its top speed a vehicle crosses each cell at.

An object that will not go where it is sent has failed one of the first two. An object that arrives slower than its Speed= suggests is being held back by the third.

Four inputs feed these checks, and each reaches only some of them. Changing one without the others can leave the result unchanged.

InputWhat it reaches
The terrain table in rules.iniThe per-step test, the throttle, and (through its Wheel= column only) the zone map
SpeedTypePicks the terrain table column that the per-step test and the throttle read
MovementZonePicks which set of zones decides whether a destination is reachable, and nothing else on this page
LocomotorHow the object travels. Only the drive locomotor applies the terrain figures to speed, and only the tunnel locomotor adds a test of its own to the per-step test

A cell is one square of the map grid. Ranges, footprints, scan radii and waypoints are all written in cells. The engine measures distance in leptons. One cell is 256 leptons across, and one height level is 104 leptons. A setting that takes a distance in cells is converted to leptons as it is read, so 1.5 becomes 384 leptons, and dividing a lepton position by 256 gives the cell that holds it.

A cell has several places to stand, each occupied separately. Three of them are open to infantry, which is how three infantry share one cell. A vehicle or a structure takes the whole cell. A cell under a bridge has a second, separate set of places for the deck, so the ground under the deck and the deck itself are occupied independently.

The terrain table is twelve rules.ini sections, one per land type: [Clear], [Road], [Water], [Rock], [Wall], [Tiberium], [Beach], [Rough], [Ice], [Railroad], [Tunnel] and [Weeds]. Each section holds one figure per speed type, Foot=, Track=, Wheel=, Hover=, Winged=, Float=, Amphibious= and Creep=, plus Buildable=. The engine has no built-in values for any of the 96 figures.

A land type is read only from files that contain its section. If no file declares the section, every figure for that land type is zero and Buildable is off. Zero means impassable, not slow, so deleting [Rough] closes rough ground to every infantryman and vehicle instead of speeding it up.

When a file does contain the section, each key it writes replaces the figure already in force and each key it leaves out keeps it. A later file or a map can therefore change one entry without restating the rest.

Each figure is used in two ways:

  • Exactly zero refuses the cell. This is the only use the per-step test makes of the table.
  • Any other value is a fraction of full speed, where 1 is full speed and smaller is slower. Only a vehicle moved by the drive locomotor is slowed by it. Every other object on the ground, including infantry, hovercraft, mechs and tunnelers, uses the zero test alone.

A value above 1 is cut to 1 as it is read, and nothing corrects a negative value. A value with a % sign is divided by 100, so 70% and 0.7 are the same figure, while a bare 70 is cut to 1.

rules.ini
[Water] ; the figures the game ships for water, less Float=
Foot=0%
Track=0%
Wheel=0%
Hover=100%
Amphibious=80%
Buildable=no
[MYSKIMMER] ; a UnitType registered in [VehicleTypes]
SpeedType=Hover
MovementZone=AmphibiousCrusher
Locomotor={4A582742-9839-11D1-B709-00A024DDAFD1} ; hover

The skimmer needs its first two settings to cross water. SpeedType=Hover makes it read Hover=100%, which is not zero, so the per-step test lets it onto water. MovementZone=AmphibiousCrusher makes water count as reachable on the zone map.

The hover locomotor is not needed to cross water. It moves the skimmer at the same speed whatever the Hover= figure is, as long as it is not zero. The drive locomotor would scale that speed by the figure.

Aircraft never read the Winged column, because the aircraft cell test treats every cell as clear before it reaches the table. The sections the game ships contain no Winged= line, so that column is zero for all twelve land types. A vehicle given SpeedType=Winged is therefore refused every cell on the map until a rules file fills the column in.

A vehicle’s per-step test runs the checks below in this order. Most checks can refuse the cell outright. The rest record an obstruction, which the route search prices instead of avoiding.

  1. Land type restriction. A vehicle with MovementRestrictedTo= is refused every cell of any other land type, apart from the tunnel and rail bridge allowances that key describes.
  2. Tunnel direction. A vehicle may not enter a tunnel cell more than a quarter turn off the tunnel’s direction. The same limit applies to a tunnel cell it is leaving, so a vehicle cannot cross a tunnel mouth sideways.
  3. Height step. A step between cells at different heights is refused unless a ramp or a bridge joins them. Height, ramps and bridges gives the rules.
  4. Map edge. Once a vehicle has entered the map, cells outside the playable area are refused. A train, a vehicle on the retreat mission and a vehicle in a team that is leaving the map are exempt.
  5. Locomotor. The tunnel locomotor refuses every cell a subterranean vehicle may not burrow through. The other nine locomotors accept every cell.
  6. Crate. In a campaign, a computer-controlled vehicle is refused a cell holding a crate.
  7. Wall. A wall is refused unless the vehicle can get through it. It gets through a Crushable=yes wall if it can crush, through Crusher=yes or the veteran CRUSHER ability. It gets through any other wall only if its primary weapon’s warhead can destroy that wall. Walls in combat and movement gives the pairings.
  8. Occupants. Each object in the cell adds a verdict. Buildings, gates, allied objects moving or standing still, enemy objects, crushable objects and cloaked objects are all weighed. Some occupants never block:
    • the transport the vehicle is boarding, and the repair bay it is entering;
    • the refinery bib a harvester is docking at;
    • an invisible structure, a limpet mine, an open laser fence and an inactive firestorm wall.
  9. Terrain figure. The cell is refused when its land type’s figure in the vehicle’s SpeedType column is exactly zero. This check comes near the end, so an earlier refusal can hide it.
  10. Reservations. A cell that another object has claimed for its next step counts as blocked by something moving. If enemy infantry claimed it, a vehicle that can crush infantry treats the cell as clear, and one with a weapon that fires at ground targets treats the infantry as destroyable. Any other vehicle is refused.

A terrain object such as a tree counts as destroyable only when the warhead of the weapon the vehicle would use against it has Wood=yes and the terrain type is not Immune=yes. Otherwise the tree refuses the cell.

An IsTrain=yes vehicle ignores every verdict except an outright refusal, both while its route is planned and while it drives.

When no check refuses the cell, the test returns the most severe obstruction it found. From least to most severe, the verdicts are:

  1. Clear.
  2. A cloaked enemy.
  3. Something moving through.
  4. A closed friendly gate.
  5. A friendly obstruction that could be destroyed.
  6. An enemy obstruction that could be destroyed.
  7. A friendly object standing in the way.
  8. Strictly prohibited.

Only the last keeps a route out of the cell. The route search enters a cell with any other verdict at a path cost that depends on the verdict, so a route can lead through a wall the vehicle is able to destroy. Route search gives those costs.

A cell under a bridge is tested either at the deck’s height or at ground level. At deck height the terrain figure is skipped, which is how a tracked vehicle crosses a river on a bridge although [Water] Track= is 0. At ground level under the same bridge, the cell is tested exactly as it would be in the open.

Every step compares the height of the cell being left with the height of the cell being entered. A ramp here is a sloped tile, the artwork that carries ground from one height level to the next.

  • Same height. Allowed.
  • One level apart. Allowed only across a ramp, and the ramp must be the lower of the two cells. Climbing, that is the cell being left; descending, it is the cell being entered.
  • Four levels apart. The bridge case. Allowed only where the lower cell is spanned by a bridge and the span can be traveled.
  • Any other difference. Refused.

A cliff two levels high stops every vehicle and every infantryman moving across the ground, whatever its terrain figures or movement zone. A tunneler can pass under it by burrowing.

Infantry run a similar test, with these differences:

  • MovementRestrictedTo= does not apply to them.
  • Their test never asks the locomotor, so an infantryman moved by the tunnel locomotor is not held to the burrowing test.
  • A wall at its last damage stage is a gap they can walk through. A wall at any earlier stage refuses them unless their weapon can destroy walls.
  • A computer-controlled infantryman is refused a cell holding a crate in every game mode, not only in a campaign.
  • Tiberium gets no separate treatment. Its cells are tested through their land type’s figure like any other ground.
  • The terrain figure is skipped while the infantryman is being unloaded, as when it steps out of the structure that built it or out of a transport aircraft.

An aircraft’s test reads no terrain at all. Height, walls, cliffs, water and occupants do not stop it. One rule remains: in a campaign, a player’s aircraft that is not a loaner is refused a shrouded cell.

Before a route is planned, the engine checks that the destination is reachable on the zone map, which is rebuilt when the ground changes. The zone map is built in three stages:

  1. Every cell gets one of seven blockage ratings.
  2. Each of the ten movement zone classes accepts some ratings and refuses the others.
  3. Each connected run of accepted cells becomes one of that class’s movement zones. A destination outside the object’s zone is unreachable.

A cell takes the first rating in this table that fits. The rating ignores the object, its speed type and every terrain column except Wheel, so one rating serves every class.

RatingSet by
OutsideThe cell lies outside the playable area
CrushableThe cell has a Crushable=yes overlay
BlockedThe cell has a wall overlay
ImpassableThe overlay’s land type prices Wheel= at exactly zero
WaterThe land type is Water or Beach, whatever those sections say
ImpassableThe cell’s land type prices Wheel= at 0.01 or below, or an active firestorm wall stands there
Partly blockedA terrain object covers some, but not all, of the places infantry could stand in the cell
BlockedA terrain object covers all of those places
Open landNothing above applied

Because only Wheel= is read, a land type priced at zero for Wheel is rated impassable even when its Track= or Hover= figure is generous. Every class except Subterannean and Fly then loses all of that ground.

Water and beach cells are rated by land type alone. A hovercraft therefore needs both a [Water] Hover= figure above zero, for the per-step test, and a movement zone that accepts water, for the zone map. Neither setting covers for the other.

The two impassable thresholds differ. A cell whose own land type has a Wheel= figure of 0.005 lets a wheeled vehicle step in, but it is rated impassable, so most classes cannot plan a route to it.

The table below shows which classes accept each rating. A movement zone name means nothing more than this row of choices.

RatingMovement zones that accept it
Open landAll ten
CrushableCrusher, Destroyer, AmphibiousDestroyer, AmphibiousCrusher, Subterannean, InfantryDestroyer, Fly
BlockedDestroyer, AmphibiousDestroyer, Subterannean, InfantryDestroyer, Fly
WaterAmphibious, AmphibiousCrusher, AmphibiousDestroyer, Fly
Partly blockedInfantry, InfantryDestroyer, Fly
ImpassableSubterannean, Fly
OutsideNone

Normal, Amphibious and Infantry all refuse crushable ground, so a plain amphibious vehicle routes around a sandbag wall just as an ordinary vehicle does. No class accepts ground outside the playable area, Fly included, so no route leads there.

Height also separates zones. The zone map compares each cell with its neighbor, not with the cell where the zone started, so:

  • A slope that climbs one level per cell never breaks. A long ramp is one zone from bottom to top.
  • A drop of four levels or more always separates the cells on either side of it. Its top and bottom share a zone only if some other connection joins them.
  • A drop of two or three levels may or may not separate them. The zone map is filled in two directions, and one direction stops at a two-level difference while the other stops at four, so the result depends on which side the fill reached the drop from.

An intact bridge span or a tunnel then links the zones at its two ends. Bridges and tunnels are the only links between zones that the ground itself keeps apart.

The route search adds up a path cost for each route, and terrain is never part of it. The terrain table reaches the search only through the per-step test, where zero refuses a cell and every other figure is treated the same. A road and a patch of rough ground cost the same, so a route that follows roads does so because of the map’s layout, not because the search prefers roads. The terrain figures act later, on the throttle.

Route search covers what the search does price, and the search settings that no INI key controls.

Speed= takes a value from 0 to 100. A value above 100 is treated as 100, so raising a fast type’s Speed= past that changes nothing.

For a vehicle moved by the drive locomotor, the distance it covers each frame comes from the chain of factors below. Steps 1 to 4 set the throttle, a fraction from 0 to 1. Steps 1 to 3 are worked out as the vehicle starts each step into a new cell. The terrain affects only the throttle. Steps 5 to 10 are recalculated every frame.

StepFactor
1The terrain figure for the destination cell’s land type
2The slope multiplier, when the ground under the destination is higher or lower than the ground under the vehicle
3Three quarters, once the vehicle’s health has fallen to the yellow condition
4On an Accelerates=yes vehicle only: at most a fifth while the vehicle is crushing something, otherwise the acceleration ramp toward the throttle from steps 1 to 3
5The type’s top speed, reduced by any limpet drone clamped to the vehicle
6The owner’s ground speed bias, which combines the country’s, the difficulty setting’s and the rules-wide bias
7The speed multiplier a crate gave the vehicle. Only the first speed crate counts; later ones do not raise it
8VeteranSpeed plus one, for a vehicle that has the FASTER ability
9The throttle from steps 1 to 4
10Half, while the vehicle is carrying a captured flag

Several details change the result:

  • Step 1 uses the [Road] figures whenever the destination’s ground is two or more levels from the height the vehicle travels at, as on a bridge deck. A vehicle therefore keeps its speed on a bridge over water.
  • The slope multiplier depends only on speed type. Track uses TrackedUphill and TrackedDownhill. Every other speed type uses WheeledUphill and WheeledDownhill, whatever its name suggests.
  • If the terrain figure times the slope multiplier is exactly zero, the vehicle moves at half speed instead of stopping.
  • Steps 5 to 10 round down to a whole number several times along the way, so a slow type loses proportionally more to each factor than a fast one.
  • TiltsWhenCrushes changes only whether the hull tilts while the vehicle crushes something, not its speed.

The damage penalty in step 3 belongs to the drive locomotor alone. Every other object moves at the same speed damaged or undamaged.

Locomotor= names one of ten travel routines. Only the drive locomotor uses the terrain figures for speed.

LocomotorSpeed comes fromTerrain figure
DriveThe full chain aboveSets the throttle
Walk, MechSteps 5 to 10 above, with the throttle fixed at fullIgnored
HoverThe same, times the hover locomotor’s own acceleration rampIgnored
TunnelThe same, times TunnelSpeed while digging down and coming up; a fixed rate undergroundIgnored
FlyThe type’s top speed times the aircraft’s own throttle, and nothing elseIgnored
Jumpjet[JumpjetControls] alone; the type’s Speed= is not readIgnored
Levitate[LEVITATION] alone; the type’s Speed= is not readIgnored
Drop podIts height above the ground, with the rules-wide descent rate as the minimumIgnored
TeleportInstantaneousIgnored

An aircraft’s speed therefore ignores the ground speed bias, the crate multiplier, the veteran ability, the flag penalty and the damage penalty. The setting meant to give aircraft a bias of their own is stored but never read; difficulty settings covers it.

The other movement settings on this page each reach only the locomotors listed here:

SettingsRead by
Accelerates, AccelerationFactor, DeaccelerationFactor and the slope multipliersDrive
PitchAngle, PitchSpeed, RollAngle, FlightLevel, IsDropshipFly
HoverBob, HoverDampenHover and levitate
AllowBurrowing, TunnelSpeedTunnel
SlowdownDistanceFly and drive
Climb, CruiseHeight, WobbleDeviation, WobblesPerSecond, TurnRateJumpjet, from the shared [JumpjetControls] section only

Acceleration is read in three places: in [JumpjetControls] for the jumpjet locomotor, in [LEVITATION] for the levitate locomotor, and on a projectile’s BulletType.

ROT affects each locomotor differently:

  • A mech stops until it finishes turning, and so does a driving vehicle without a turret. A driving vehicle with a turret keeps moving while it turns.
  • A hovercraft turns at twice its ROT. It steers its direction of travel separately from the facing it is drawn at, so it slides through turns instead of pivoting.
  • Infantry start with a fixed turn rate instead of their type’s ROT, and take on their ROT the first time they are healed.

A running object can be moved by a locomotor other than the one its type names. A tunneler leaving a war factory, a passenger falling in a drop pod and a jumpjet infantryman on the ground are examples. Locomotion and piggybacking covers the swap.

Four settings in this group are read but never change movement:

  • MaxBlockCount keeps a count of blocked frames that nothing acts on.
  • PlayerAutoCrush applies to houses a player commands, but the only check that reads it runs for computer-controlled houses.
  • The per-type AutoCrush has no effect either.
  • TooBigToFitUnderBridge changes how a vehicle is drawn against a bridge deck. It does not restrict movement or keep a vehicle off a bridge cell.

Weight and DeployToFire affect other decisions. Weight sets how far a blast rocks a voxel object and whether a vehicle breaks the ice beneath it. DeployToFire limits where a vehicle may fire from, using each land type’s Buildable= flag.

41 of 41

KeyDescriptionValueWhen omitted
AccelerationBulletType, global rules, levitation controlsHow quickly a homing projectile, a jumpjet unit or a levitating unit changes speed.integerVaries by type
AccelerationFactorAircraftType, BuildingType, InfantryType, UnitTypeThe amount a vehicle's throttle climbs by on each movement step while it is speeding up.floating point.03
AcceleratesAircraftType, BuildingType, InfantryType, UnitTypeMakes a driving vehicle ease up to speed and brake as it nears its destination.booleanyes
AllowBurrowingtile controlsGround that a subterranean unit may dive into or surface through.booleanyes
AutoCrushNo effect in some scopes5 applicable typesA parsed per-type flag that nothing acts on, and the IQ at which a computer house starts running things over.booleanVaries by type
Buildableglobal rulesAllows buildings and new Tiberium growth on a land type.booleanno
Climbglobal rulesThe leptons of altitude a jumpjet unit gains or loses each game frame.floating point5
CruiseHeightglobal rulesThe height above ground a jumpjet unit levels off at once it has finished climbing.integer400
CrushableNo effect in some scopes12 applicable typesLets a crusher vehicle drive over the object or overlay, destroying an object or a wall overlay outright.booleanVaries by type
CrusherAircraftType, BuildingType, InfantryType, UnitTypeLets a vehicle drive over crushable objects and walls instead of being blocked by them.booleanno
DeaccelerationFactorAircraftType, BuildingType, InfantryType, UnitTypeHow hard a vehicle brakes. Each frame its throttle drops by this figure times its top speed.floating point.002
DeployToFireUnitTypeMakes a vehicle attack by deploying into its DeploysInto structure on buildable ground, and stops a human player's vehicle from searching for targets.booleanno
FlightLevel5 applicable typesThe cruising altitude a type flies at, or the rules-wide altitude used by anything that names none of its own.integerVaries by type
HoverBobglobal rulesPeriod in minutes of the vertical bob a hovering unit performs.floating point30
HoverDampenglobal rulesFraction of its vertical motion a hovering unit keeps from one frame to the next.floating point.8
IsDropshipAircraftType, BuildingType, InfantryType, UnitTypeFlies an aircraft as a heavy transport that raises its nose on approach instead of banking.booleanno
IsTrainAircraftType, BuildingType, InfantryType, UnitTypeMarks a vehicle as rolling stock, which changes how it finds a path, what blocks it and when it may leave the map.booleanno
LandableAircraftTypeKeeps an aircraft under the player's control instead of letting it enter as an unselectable loaner that may leave the map.booleanno
LocomotorAircraftType, BuildingType, InfantryType, UnitTypeThe class identifier of the locomotion object created to move each instance of the type.Locomotor class identifier{4A582747-9839-11D1-B709-00A024DDAFD1}
MaxBlockCountNo effectlevitation controlsA retry count for blocked levitating units that has no effect.integer4
MovementRestrictedToUnitTypeConfines a vehicle to cells of one land type, which is how rolling stock is held to the rails.landtypenone
MovementZoneAircraftType, BuildingType, InfantryType, UnitTypeSelects which terrain the type can cross when the game decides whether it can reach a cell.mzonetypeNormal
PitchAngleAircraftType, BuildingType, InfantryType, UnitTypeThe angle in degrees an aircraft drops its nose by while it is flying fast enough.floating point20
PitchSpeedAircraftType, BuildingType, InfantryType, UnitTypeThe throttle an aircraft must be above before it pitches and banks.floating point.25
PlayerAutoCrushNo effectglobal rulesParsed crushing permission that the engine never uses.booleanno
ROT5 applicable typesThe rate an object's body and turret turn at, or the rate a homing projectile steers at.integer0
RollAngleAircraftType, BuildingType, InfantryType, UnitTypeThe angle in degrees an aircraft banks by while it is turning.floating point30
SlowdownDistanceAircraftType, BuildingType, InfantryType, UnitTypeHow far short of its destination an object begins slowing down, in leptons.integer500
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
SpeedTypeUnitTypeThe terrain table column a vehicle's per-cell throttle and passability are read from.SpeedTypeContext-dependent
TiltsWhenCrushesAircraftType, BuildingType, InfantryType, UnitTypeMakes a crushing vehicle tilt as it drives into a sandbag wall.booleanyes
TooBigToFitUnderBridgeUnitTypeSplits a vehicle's composed image into two separately sorted pieces while it passes under a bridge.booleanno
TrackedDownhillglobal rulesSpeed multiplier for a tracked vehicle stepping to a lower cell.floating point1
TrackedUphillglobal rulesSpeed multiplier for a tracked vehicle stepping to a higher cell.floating point1
TunnelSpeedglobal rulesMultiplier on how fast a subterranean unit sinks and rises, and divisor of its dig-in wait.floating point1
TurnRateglobal rulesHow fast a jumpjet unit swings around to a new heading.integer3
WeightAircraftType, BuildingType, InfantryType, UnitTypeHow strongly an object resists being rocked, and how heavily it presses on ice.floating point1
WheeledDownhillglobal rulesSpeed multiplier for a vehicle that is not tracked stepping to a lower cell.floating point1
WheeledUphillglobal rulesSpeed multiplier for a vehicle that is not tracked stepping to a higher cell.floating point1
WobbleDeviationglobal rulesHow far a hovering jumpjet unit drifts above and below its flight level.integer40
WobblesPerSecondglobal rulesHow many complete up-and-down cycles a hovering jumpjet unit performs each second.floating point.25

History

  1. Changed0.1.0

    Respect terrain immunity during vehicle pathing

  2. Changed0.1.0

    Use terrain data for Tiberium infantry passability