Skip to content

Tiberium

Tiberium grows and spreads across map cells, and harvesters carry it to refineries for credits.

Features & systemsUnits, buildings & economyBuildings & economy

Changed in 0.2.0
rules.ini
[Tiberiums]
0=MyTiberium ; example type, registered in Tiberium slot 0
[MyTiberium]
Image=1
Value=25
Power=1
Color=NeonGreen
Growth=2200
GrowthPercentage=.09
Spread=2200
SpreadPercentage=.09

Each entry in [Tiberiums] names the rules section that defines one Tiberium type. Types are registered in the order the entries first name them, and each type’s Tiberium slot is its position in that order, counted from 0. The number on an entry is ignored. An entry naming a type already registered, by this file or an earlier one, reuses that type.

Every rules file, and the scenario’s own overrides, reads the section of each registered type, whether or not that file has a [Tiberiums] list. A map can therefore change a shipped type by writing its section alone. Rules registration lists gives the order the files are read in.

If the named section does not exist, the type keeps its built-in values, which include no overlay set.

A type’s slot decides which storage compartment its harvested Tiberium goes into, and how ripe its cells must be before they spread. TiberiumToSpawn, Tiberium crates and several destruction effects also name a type by its slot.

Image selects the type’s overlay set. Every set has twelve growth stages, and the set decides whether the type can grow on sloped ground.

A cell holds at most one Tiberium overlay and a growth stage from 0 to 11.

An overlay with Tiberium=yes gives its cell the Tiberium land type when the overlay’s Land is Clear. Otherwise the cell takes the overlay’s land type. Harvesters look only for the Tiberium land type, so they cannot collect an overlay that sets any other.

A blossom tree’s cell counts as holding the type the tree seeds, but it has no overlay, so no harvester can collect from it. Other sources of Tiberium covers the tree.

When a scenario loads, the engine replaces the stage of every Tiberium cell. The new stage depends on how many of the cell’s eight neighbors hold the same type, so the stages stored in the map do not survive:

Neighbors with the same type012345678
Stage01346781011

A cell shows the frame for its stage from one of its type’s overlays. The cell’s map position picks that overlay, not the overlay the cell actually holds. Flat cells use the set’s flat overlays and sloped cells use its slope overlays. The type’s Color recolors the result.

Slope overlays exist only for the four simple slopes, and the large-Tiberium set has none. A type on that set never spreads onto a slope, and shows nothing on one where a map or an animation’s TiberiumSpawnType places it. A cell is also not drawn when the chosen overlay has no frame for its stage.

Each type runs growth passes and spread passes on separate timers, counted in frames. Both kinds of pass stop while the scenario’s TiberiumGrowthEnabled switch is off. The Tiberium growth trigger action turns the switch on and off during play.

A growth pass runs every Growth frames. The delay restarts after each pass, whether or not anything grew.

Each type keeps a queue of its cells that are still below stage 11. A pass takes a random number of cells from the front of that queue, at least 1. The upper limit is the queue length multiplied by GrowthPercentage, raised to 5 if lower and cut to 50 if higher. A type with GrowthPercentage below 0.00001 never grows.

Each cell taken gains one stage if it still holds this type’s Tiberium. A cell that has since lost its Tiberium or changed type still uses up one of the pass’s cells, and leaves the queue.

After it grows, a cell below stage 11 goes back into the queue, near the back, and is queued to spread if it can. A cell that reaches stage 11 leaves the growth queue.

The queue is rebuilt from the map when a scenario starts and when a saved game loads. During play, it is also rebuilt once it has taken in about as many entries as the map has cells.

A cell the map stores at stage 11 does not grow at scenario start, even if its stage is lowered when the scenario loads. It joins the queue at the next rebuild.

A spread pass runs every Spread frames; TiberiumGrows does not shorten this delay. Each type keeps a queue of cells that may spread. A pass seeds from cells at the front of that queue until it has spent a random budget, at least 1. The upper limit is the queue length multiplied by SpreadPercentage, raised to 5 if lower and cut to 25 if higher.

A cell can spread only when all of the following hold, tested in this order:

  1. TiberiumSpreads=yes is in force;
  2. the cell still holds Tiberium;
  3. its stage is above the ripeness threshold of the type it holds;
  4. that type’s SpreadPercentage is at least 0.00001;
  5. nothing is standing in the cell.

A spreading cell starts at a random neighbor and checks all eight in turn. It seeds the first neighbor that accepts growth, and the new cell starts at stage 5.

A neighbor accepts growth when all of the following hold, tested in this order:

  1. it lies inside the playable area;
  2. it is not under a bridge and has never been under one;
  3. it holds no building with strength left, unless the building’s type is Invisible or InvisibleInGame, so that growth does not outline a hidden structure;
  4. it holds no SpawnsTiberium=yes terrain object, so a blossom tree’s cell stays bare;
  5. its land type is Buildable=yes;
  6. it has no overlay, so veins, walls, crates and existing Tiberium all block it;
  7. it is flat or on one of the four simple slopes, and it is flat if the type’s overlay set has no slope overlays;
  8. its tile set is AllowTiberium=yes.

The four simple slopes each raise two adjacent corners of the cell. Corner, steep and double slopes never accept Tiberium, and any Tiberium a map places on one is removed as the map loads.

Only a cell that has a neighbor accepting growth spends budget. A cell with none, or one that fails the spread tests, leaves the queue without spending any.

A cell that had more than one free neighbor goes straight back to the front of the queue, so it usually seeds again in the same pass. A cell that seeds its last free neighbor is not queued to spread again until the queue is rebuilt, even if a neighbor is later cleared. The spread queue is rebuilt at the same times as the growth queue.

A type whose set has no slope overlays can waste its passes. When the engine counts a cell’s free neighbors, it counts a sloped neighbor as free for every type, but seeding then refuses the slope for this type. A cell whose only free neighbors are sloped spends budget and seeds nothing. With two or more such neighbors it returns to the front of the queue each time, so it can use up the whole pass.

A UnitType with Harvester=yes harvests Tiberium on its own. It starts harvesting when it is placed on the map, including when it leaves a factory or a repair bay. When it later goes idle, it resumes harvesting if its house is computer-controlled or it is standing on Tiberium.

A player-owned harvester that goes idle anywhere else takes a guard mission instead, so a player can park it. An armed harvester behaves the same way, except that it may take area guard instead of guard.

A harvester whose house owns none of the buildings in its Dock list, or whose list is empty, switches to guard.

A vehicle with neither Harvester=yes nor Weeder=yes that is given the harvest mission stands still.

A harvester that is not full first drives back to the patch it recorded on its previous trip, if it has one. Otherwise it searches for Tiberium out to one cell less than TiberiumFarScan.

The search takes the cell the harvester stands in if it is Tiberium ground. Otherwise it checks rings of cells at increasing distance and takes the most valuable cell in the nearest ring that has any. A cell’s value is its type’s Value multiplied by its stage plus one.

A cell is skipped when any of the following holds, tested in this order:

  1. it lies outside the playable area;
  2. the game is a campaign, the local player owns the harvester, and the cell is shrouded;
  3. it is in a different movement zone from the cell the harvester is heading to, or from the cell it stands in when it is not moving;
  4. the harvester cannot enter it, or it is not Tiberium ground.

A computer-controlled harvester in a skirmish or multiplayer game searches differently when it sets out with no recorded patch. It checks every ring out to the limit instead of stopping at the first ring that has Tiberium. Along each side of a ring, it considers only the first cell of each unbroken run of Tiberium, which spreads the candidates across the field. It then picks one candidate at random, weighted by value and distance.

A candidate’s weight is its value divided by a distance factor, and never less than 1. The factor is twice the ring’s distance divided by the number of harvesters the house owns, rounded down and at least 1. Richer and nearer cells are therefore favored, and distance matters less the more harvesters the house owns. The count includes every type in HarvesterUnit, whatever the searching vehicle’s type.

If the search finds nothing and the harvester has nowhere to drive, it waits 7 seconds and then takes a guard mission. A harvester parked on a refinery first moves off it.

A Harvester=yes vehicle that gives up this way marks its house short of Tiberium for the rest of the scenario. A computer-controlled house marked this way stops building replacement harvesters. Its harvesters that go to guard also stay there instead of resuming harvesting.

A harvester standing on Tiberium ground lifts one growth stage every 9 times HarvesterLoadRate frames and stores it as one unit. The unit goes into the compartment of the cell’s type, so a harvester that works a mixed field carries a mixed load.

Each lift lowers the cell by one stage. A cell at stage 0 is cleared to bare ground by the next lift, which gives nothing, so a cell at stage 11 yields 11 units, not 12.

When the cell runs out before the harvester is full, the harvester searches out to one cell less than TiberiumNearScan for the next one. If it finds none, it heads home with a partial load.

A harvester that fills its Storage runs the same search out to one cell less than TiberiumNearScan, records the cell it finds as the patch to return to, and heads home.

A harvester returning on its own looks for a bay among its house’s buildings whose types are in its Dock list and that it can reach. It takes the nearest bay across all the listed types. Within one type, the house’s primary building beats every bay of that type built before it, however near. A bay built after the primary still wins if it is nearer than the primary.

A building accepts a harvester only when all of the following hold:

  1. it is DockUnload=yes;
  2. its house and the harvester’s house are each allied with the other, which a house always is with itself;
  3. it is not being built or sold, and it has not been switched off;
  4. no other vehicle is docked there or on its way in.

A player can also order a harvester into an allied house’s refinery. Rule 2 still applies, so the alliance must run both ways.

A harvester does not always pick a free bay. It compares the nearest free bay with the nearest bay of any kind. If the free bay is farther by more than the distance the harvester could drive while waiting, it drives to the busy one and waits in line.

The wait counts what the vehicle at that building still has to unload, that vehicle’s drive in if it has not arrived yet, and every load already waiting in line there. Waiting reserves nothing: the harvester chooses again when it arrives, by which time the bay may be free or the line longer.

A harvester heading for a bay that is destroyed, sold or captured before it docks goes back to harvesting, whoever owns it. A full harvester looks for another bay at once, and one with room left first fills up. This also applies to a harvester the player ordered into the bay.

A docked harvester turns to face east, and the building west of it plays its pre-production animation. The harvester then hands its house one unit every HarvesterDumpRate minutes of game time, starting with its lowest slot.

Once it is empty, the harvester waits for a Refinery=yes building west of it to finish its production animation. It then resumes harvesting, unless the player has given it another order.

A player order that sends the harvester elsewhere while it unloads ends the unload early. The harvester still waits for the refinery’s animation, then leaves with the units it has not handed over.

Each unit a harvester unloads adds five points to its house’s score.

A computer-controlled house in a skirmish or multiplayer game converts each unit to credits at once, at its type’s Value. Its storage capacity does not matter.

Every other house stores each unit. Units beyond the house’s free storage capacity are lost. The rest fill the house’s standing buildings that declare Storage, one building at a time.

Stored units become credits only when the house spends. Spending uses loose credits first, then stored units one at a time. Each building gives up its units lowest slot first, before the next building is used. Each unit is priced at its type’s Value when it is spent, not when it is harvested.

A captured building keeps its contents. They move from the old house’s total to the new house’s total, along with the building’s capacity.

A destroyed building scatters its contents one unit at a time, one to three cells from where it stood. Each unit starts stage 1 Tiberium of its type where the ground accepts growth.

On a cell that already holds that type, a unit adds one stage if the cell is below stage 11, TiberiumGrowthEnabled is on and the type’s GrowthPercentage is at least 0.00001. Any other unit is lost.

A sold building hands its contents back to its house after the building’s capacity has been removed. The house’s remaining storage buildings take what fits and the rest is lost, so a house whose only storage was the sold building loses all of it. A computer-controlled house in a skirmish or multiplayer game converts the whole store to credits instead.

A building with SiloDamage=yes shows how full it is with an extra animation. The animation does not appear while the building is less than one-eighth full.

Infantry take damage each time they finish moving into a Tiberium cell. The damage is the Tiberium type’s Power divided by ten, rounded down, and at least 1. Armor, veterancy and other damage reductions do not lower it.

Infantry whose type sets TiberiumProof=yes, or that have the TIBERIUM_PROOF veteran ability, take none. When the scenario sets TiberiumDeathToVisceroid=yes, infantry killed this way leave a small visceroid owned by the Neutral house, unless a vehicle stands in the cell.

An overlay with ChainReaction=yes lets explosions set off the Tiberium in its cell. For a Tiberium overlay, the explosion’s warhead must set Tiberium=yes. A sonic wave sets the cell off without that warhead test.

A cell detonates only at stage 2 or higher, with a chance of 5% per stage. The detonation removes half the cell’s stages, rounded down. It deals that many stages multiplied by Power as damage, through the C4Warhead.

After a detonation, each neighboring Tiberium cell above stage 2 has an 80% chance of being hit 1 to 8 seconds later by the INVISO animation. With the shipped rules, that hit can set off a neighbor whose overlay has ChainReaction=yes in turn. A type with Power=0 shows no explosion and deals no damage, but its detonation still removes the stages and still hits neighbors.

On an overlay with ChainReaction=yes, an explosion that passes the warhead test also removes one stage for every ten points of its damage, whether or not the cell detonates. Explosions never thin or set off a cell whose overlay lacks it. In the shipped rules, the overlays of the Image=1 set do not set it.

An animation with TiberiumChainReaction=yes that starts on a Tiberium cell clears the cell and deals TiberiumExplosionDamage through the C4Warhead. One time in three, it also leaves one of the type’s Debris animations, recolored with the type’s Color.

With TiberiumExplosive=yes in [CombatDamage], a destroyed vehicle carrying Tiberium explodes over a radius of one and a half cells. The damage is the sum, over its compartments, of the amount held multiplied by that type’s Power. A vehicle with no death explosion from Explosion never sets it off, and a scenario with HarvesterImmune=yes prevents it. Spilled harvester loads covers when it goes off.

Some effects remove stages outright. An animation with Crater=yes that plays at ground level removes six stages from its cell. If it also sets Scorch=yes, it does so only half the time. Laying a laser fence clears every cell along the run.

A blossom tree is a terrain object with SpawnsTiberium=yes and IsAnimated=yes. While it is idle, it starts its animation on each frame with the chance set by AnimationProbability, and plays it at AnimationRate.

When the animation reaches the halfway frame of the tree’s shape file, the animation stops and the tree seeds one neighboring cell. The seed uses the type in slot TiberiumToSpawn, starts at stage 5, and must pass the neighbor tests under Spread. The tree seeds even while TiberiumSpreads=no or TiberiumGrowthEnabled=no.

A Tiberium crate places stage 1 Tiberium of a randomly chosen registered type. When the choice is slot 1, it uses slot 0 instead.

A VoxelAnimType with IsTiberium=yes seeds stage 0 Tiberium where it comes down, unless it lands in water or on a bridge. With IsMeteor=yes it seeds the eight cells around the impact instead of the impact cell. The type is always the first registered type with Image=3, or slot 0 if no type uses that set.

A destroyed object whose type sets TiberiumHeal=yes seeds slot 0 Tiberium in the cells to its north-west, north, east, south and west, but not in the cell it stood on. The step every kind shares covers it. A destroyed harvester can spill its load as slot 0 Tiberium, as Spilled harvester loads describes.

Settings the engine parses but never reads

Section titled “Settings the engine parses but never reads”

The following settings have no effect:

32 of 32

KeyDescriptionValueWhen omitted
AllowTiberiumtile controlsLets Tiberium take root on the tiles of a theater tile set.booleanno
Buildableglobal rulesAllows buildings and new Tiberium growth on a land type.booleanno
ChainReactionOverlayTypeWhether damage to the overlay's cell can set off the Tiberium standing there.booleanno
Color5 applicable typesColor scheme for a projectile, house, or Tiberium type; the multiplayer setting holds the index of the player's preferred color.color schemeVaries by type
DebrisTiberiumAnimations a Tiberium type can leave behind when a chain reaction wipes one of its cells.list of AnimTypesnone
DockAircraftType, BuildingType, InfantryType, UnitTypeBuildingTypes an object returns to for docking.list of BuildingTypesnone
DockUnloadBuildingTypeLets a Tiberium harvester dock at a building and unload there.booleanno
GrowthTiberiumGame frames a Tiberium type waits between growth passes.integer0
GrowthPercentageTiberiumShare of a Tiberium type's queued cells that one growth pass may ripen.floating point0.1
HarvesterUnitType, global rulesMakes a UnitType harvest Tiberium, or sets the IQ at which the computer starts replacing lost harvesters.booleanVaries by type
HarvesterDumpRateglobal rulesMinutes a docked harvester spends handing over each stored unit.floating point.016
HarvesterLoadRateglobal rulesGame frames per step of a harvester's loading cycle, which lifts one unit every nine steps.integer2
HarvesterUnitglobal rulesUnitTypes the engine treats as a house's harvesters when it counts or replaces them.typelistnone
Image13 applicable typesSelects an Image ID, animation Image ID, Tiberium overlay variant, or building main-shape basename according to scope.stringVaries by type
PowerBuildingType, TiberiumPower a BuildingType contributes to its house, negative for consumption, or the damage a Tiberium type deals.integer0
RefineryBuildingTypeMarks a structure as a Tiberium refinery, which decides when its production animation plays for a docked harvester.booleanno
SiloDamageBuildingTypeDraws a fill level on a building that stores Tiberium.booleanno
SpawnsTiberiumTerrainTypeMakes a TerrainType seed Tiberium into the cells around it.booleanno
SpreadWarheadType, TiberiumHow slowly a warhead's damage thins with distance, or the frames a Tiberium type waits between spread passes.integerVaries by type
SpreadPercentageTiberiumShare of a Tiberium type's queued cells that one spread pass may seed from.floating point0.1
StorageAircraftType, BuildingType, InfantryType, UnitTypeUnits of Tiberium an object can hold.integer0
TiberiumOverlayType, WarheadType, random map generationMarks an overlay as Tiberium, lets a warhead set Tiberium off, or sets how much Tiberium a generated map receives.booleanVaries by type
TiberiumExplosionDamageglobal rulesDamage a Tiberium chain-reaction animation deals where it stands.integer100
TiberiumExplosiveNo effect in some scopesglobal rules, scenariosMakes a destroyed harvester detonate its load; the scenario flag of the same name is stored and never read.booleanno
TiberiumFarScanglobal rulesDistance a harvester searches for Tiberium when it sets out with no recorded patch to return to.distance (cells)32
TiberiumGrowsNo effect in some scopesglobal rules, scenariosShortens every Tiberium type's growth delay in a scenario; the multiplayer-defaults entry of the same name is stored and never read.booleanVaries by type
TiberiumGrowthEnabledscenariosAllows Tiberium to ripen and spread during a scenario.booleanyes
TiberiumNearScanglobal rulesDistance a harvester searches for the next Tiberium cell once the cell it is working runs out.distance (cells)6
TiberiumProofInfantryTypeStops Tiberium from poisoning an infantry type.booleanno
TiberiumSpreadsscenariosAllows a ripe Tiberium cell to seed its neighbors.booleanyes
TiberiumToSpawnTerrainTypeRegistration slot of the Tiberium type a Tiberium-spawning TerrainType produces.integer0
ValueTiberiumCredits paid for each growth stage of a Tiberium type.integer0

History

  1. Changed0.1.0

    Require mutual alliances for refinery docking

  2. Changed0.1.0

    Validate Tiberium overlay frames before drawing

  3. Changed0.2.0In development

    Send a harvester to work when it leaves a factory

  4. Changed0.2.0In development

    Keep harvesting when a refinery is lost on the way in

  5. Changed0.2.0In development

    Pick the nearest docking bay on a large map

  6. Changed0.2.0In development

    Choose a refinery by what the trip really costs

  7. Changed0.2.0In development

    Queue a Tiberium cell to grow only once

  8. Changed0.2.0In development

    Fix Tiberium on the large-crystal set and on slopes

  9. Changed0.2.0In development

    Drop a Tiberium cell that can no longer spread

  10. Changed0.2.0In development

    Register Tiberium types by name