Skip to content

Tiberium

Grows, spreads, and harvests the registered Tiberium types across map cells.

Features & systemsUnits, buildings & economyBuildings & economy

Changed in 0.1.0
rules.ini
[Tiberiums]
0=MyTiberium ; example Tiberium type, registered in slot 0
[MyTiberium]
Image=1
Value=25
Power=10
Growth=8
GrowthPercentage=.02
Spread=20
SpreadPercentage=.02

Each entry in [Tiberiums] names a rules section that supplies the type’s settings. An entry whose own number is below the count of types registered so far re-reads the type already in that Tiberium slot; every other entry creates a new type in the next free slot, so with the conventional 0= through 3= list the entry numbers and the slots coincide. A named section that does not exist leaves the type on its built-in values, which include no overlay set at all.

The slot selects the storage compartment a harvested load occupies, and it raises the growth stage a cell must reach before it spreads.

Image selects the overlay set, and through it two runtime limits: the number of growth stages the set carries, and whether the type is allowed onto sloped ground.

A cell holds one Tiberium overlay and one growth stage from 0 through 11. The cell is worth Value multiplied by the stage plus one, so a ripe cell of a twelve-stage set is worth twelve times the setting. A blossom tree — a terrain object that seeds Tiberium into the ground beside it, described under other sources — sits on a cell that reports the type it seeds but is worth nothing, because worth comes from the overlay and that cell carries none.

An overlay declared Tiberium=yes whose own land type is clear gives its cell the Tiberium land type, and that land type — not the overlay — is what every harvesting test reads.

When a scenario finishes loading, and again whenever a Tiberium overlay is placed onto the map directly, the cell’s stage is replaced by a smoothing lookup on the number of its eight neighbors holding the same type, running on a twelve-stage set from stage 0 with no matching neighbor up to stage 11 with all eight. A stage stored in the map file does not survive that pass.

Drawing a cell uses that stage as a frame number in the selected flat or slope overlay. If the selected SHP does not carry that frame, the overlay is omitted from both the tactical view and its redraw rectangle instead of reading beyond the artwork’s frame table.

The main game logic offers every type a growth pass and then a spread pass each frame. Both are gated by the scenario’s TiberiumGrowthEnabled switch, which the Tiberium growth trigger action turns on and off during play.

A type takes a growth pass when its timer runs out; the timer is then reloaded with Growth frames whether or not anything grew.

Each type keeps a queue of cells that have not finished ripening. A pass first sizes a budget as the queued count multiplied by GrowthPercentage, clamped to between 5 and 50, then draws a random figure from 1 up to that budget and processes that many entries. Every entry taken counts against the budget, including one whose cell has since changed type and is simply dropped.

A cell gains one stage when all of the following hold, tested in this order:

  1. the scenario’s growth switch is on;
  2. the cell still holds Tiberium of a registered type;
  3. its stage is below the last one the overlay set carries;
  4. that type’s GrowthPercentage is at least 0.00001.

A cell still short of stage 11 goes back into the queue with a delay of up to 49 frames and is offered to the spread queue at the same time; a cell that has reached stage 11 is dropped from growth entirely.

Spread passes are scheduled the same way, from the Spread delay, and no flag shortens them. The budget is the queued count multiplied by SpreadPercentage, clamped to between 5 and 25, with a random figure drawn from 1 up to it. Only a cell that finds somewhere to seed counts against that budget; a cell hemmed in on all eight sides is dropped from the queue without spending any of it, and a cell with more than one free neighbor is re-queued to run again on the next pass.

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

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

The source cell picks a random starting facing, walks all eight neighbors from there, and seeds the first that accepts growth. A newly seeded cell starts at stage 5.

A neighboring cell 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 never has been;
  3. it holds no building with strength left, unless that building’s type is invisible — the exemption keeps growth from outlining a hidden structure;
  4. it holds no SpawnsTiberium=yes terrain object, which is what keeps a blossom tree’s own cell bare;
  5. its land type is Buildable=yes;
  6. it carries no overlay at all, so veins, walls, crates and existing Tiberium all block it;
  7. it is flat, or carries one of the four standard ramps, and a type whose overlay set carries no ramp frames refuses every slope; and
  8. its theater tile set is AllowTiberium=yes.

The four standard ramps of rule 7 are the slopes that fall away toward one of the map’s four directions, raising two of the cell’s corners; the corner, steep and double ramp shapes lie outside that set. A Tiberium overlay found on one of those other slopes is removed outright the next time the cell’s attributes are recalculated.

The census that decides whether a cell is worth a pass runs that same list, and it is where a wasted pass comes from. The census puts the question without naming a type, so the second half of rule 7 — the refusal a type whose overlay set carries no ramp frames applies to every slope — is skipped, and a sloped neighbor counts as free. The seeding walk then puts the question again with the type in hand, and that refusal runs. A type barred from slopes therefore spends a pass on a cell whose only free neighbors are sloped, and seeds nothing.

A UnitType with Harvester=yes takes the harvest mission on its own. A vehicle with neither that flag nor Weeder=yes given the same mission stands still for 30 seconds at a time, and a harvester whose house owns no building named in its Dock list — including a harvester with an empty list — is switched to guard.

A harvester that is not full first heads back to the patch it recorded on its last trip, and otherwise searches out to TiberiumFarScan. The plain search takes the harvester’s own cell when that is already Tiberium ground; otherwise it walks outward one ring at a time and takes the richest qualifying cell in the first ring that yields any. A cell is skipped when any of these holds, tested in this order:

  1. it lies outside the playable area;
  2. the match is a campaign, the local player owns the harvester, and the cell is shrouded;
  3. it sits in a different movement zone from the harvester’s destination;
  4. the harvester could not enter it, or it is not Tiberium ground.

A computer-controlled harvester in a skirmish or multiplayer game uses a weighted search instead. It scans every ring out to the limit, offers only the first cell of each unbroken run along a side so that the candidates spread across the field, and draws one at random with a weight of at least 1 taken from the cell’s worth divided by the ring’s span over the number of harvesters the house owns. That census counts the first entry of HarvesterUnit whatever the searching vehicle’s own type is.

With no patch and nowhere to go, the harvester is marked useless, its house is flagged short of Tiberium, and it retries after 7 seconds; the idle branch sends it to the repair bay when the house owns one and to hunt otherwise.

Harvesting lifts one growth stage per cycle, and a cycle is nine stage ticks of HarvesterLoadRate frames each. The stage is credited to the compartment of the cell’s own type, so a harvester crossing a mixed field comes home with a mixed load, and taking the last stage clears the cell to bare ground. A harvester that has filled its Storage records the nearest patch within TiberiumNearScan as the patch to return to, and heads home.

The harvester asks each Dock building type in turn for a bay among its own house’s buildings, taking the nearest that answers or the house’s primary building of that type whenever it answers; a building answers only while it is DockUnload=yes and has nothing else attached. A harvester directed at another house’s refinery may enter the bib and dock only when each house declares the other an ally. A one-way alliance grants neither permission, and Dock remains a return-target list rather than a compatibility flag. On arrival the harvester turns to face east, the building west of it runs its pre-production animation, and one stored unit is handed to the house every HarvesterDumpRate minutes’ worth of frames. An emptied harvester waits for a Refinery=yes building west of it to finish its production animation before taking the harvest mission again.

Each unit handed over adds five to the house’s score. A computer house in a skirmish or multiplayer game then converts the unit straight to credits at its type’s Value, with no reference to storage capacity at all.

Every other house stores it. The amount is first clipped to the capacity the house’s buildings still have free, and the surplus is discarded rather than credited; what remains is distributed one unit at a time into the house’s standing buildings that declare Storage, filling each in turn. Spending drains loose credits first and only then draws stored units, one at a time from the lowest occupied compartment and each converted at that compartment’s type’s Value. A store is therefore priced when it is spent rather than when it is filled.

A captured building keeps its contents: they leave the old house’s total and join the new one’s, along with the building’s capacity. A destroyed building scatters them across the surrounding cells one unit at a time, each landing as a stage-1 patch wherever the ground accepts growth. A sold building hands them back to its own house along the route a harvester unload takes, after the sale has already withdrawn that building’s own capacity: the house’s remaining storage buildings take what they can and the surplus is discarded, so a house whose only storage was the building it sold keeps none of it, while a computer house in a skirmish or multiplayer game banks the whole store as credits. A building declaring SiloDamage=yes draws its fill level over itself, and shows nothing while it is empty.

Infantry stepping onto a Tiberium cell — including a blossom tree’s cell — takes Power divided by ten, never less than 1, unless the type declares TiberiumProof=yes or the object carries the Tiberium-proof veteran ability. A death caused this way spawns a small visceroid for the Neutral house when the scenario declares TiberiumDeathToVisceroid=yes.

An overlay declaring ChainReaction=yes lets damage set off the Tiberium in its cell, once the cell holds at least the second growth stage. A Tiberium overlay detonates under a warhead declaring Tiberium=yes — or under a sonic wave, which skips the warhead test. The chance is five times the cell’s stage; the blast consumes half the stage and deals that many stages multiplied by Power, and each of the eight neighbors above stage 2 has an 80% chance of a delayed detonation of its own. A zero result draws no explosion and deals no damage, but it still consumes the growth and performs those neighboring checks. An animation declaring TiberiumChainReaction=yes clears the cell it sits on outright, applies TiberiumExplosionDamage, and one time in three leaves one of the type’s Debris animations recolored by its Color.

With TiberiumExplosive=yes a destroyed vehicle carrying Tiberium explodes over one and a half cells. The damage is the sum, across every compartment, of the amount held there multiplied by that compartment’s type Power. Crater-forming animations strip six stages from the cell they land on, and a laser fence clears twelve from every cell along its span.

A blossom tree — a terrain object with SpawnsTiberium=yes and an animation — seeds a neighboring cell at the midpoint of that animation, skipping the source-cell test entirely and using the type named by its TiberiumToSpawn. A Tiberium crate picks a registered type at random, swapping slot 1 for slot 0, and lays a stage-1 patch at the crate plus another ten to twenty scattered around it. A VoxelAnimType declaring IsTiberium=yes seeds Tiberium at stage 0 where it lands — the ring of eight cells around a meteor’s impact, or the single cell beneath any other — always with the type that owns the second Tiberium overlay set. A destroyed object whose type declares TiberiumHeal=yes leaves the type in slot 0 at stage 0 through 2 on its own cell and the four beside it.

Settings the engine parses but never reads

Section titled “Settings the engine parses but never reads”

TiberiumGrows in [MultiplayerDefaults] and TiberiumExplosive in [SpecialFlags] are stored and never consulted; the spellings that work are the scenario [SpecialFlags] entry and the [CombatDamage] entry respectively. TiberiumStrength in [CombatDamage] and TiberiumTransmogrify in [General] are stored and never consulted at all.

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, named for a projectile, house, or Tiberium type and stored as a list index for the preferred multiplayer color.colour 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 point.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 between the animation ticks of a harvester taking on a load.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 carries.integer0
RefineryBuildingTypeMarks a building as a Tiberium refinery for its dock point and unloading animations.booleanno
SiloDamageBuildingTypeDraws a fill level on a building that stores Tiberium.booleanno
SpawnsTiberiumTerrainTypeMakes a TerrainType seed Tiberium into the cells around it.booleanno
SpreadWarheadType, TiberiumA warhead's blast radius, 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 point.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.booleanVaries by type
TiberiumFarScanglobal rulesDistance a harvester searches for a Tiberium patch when it has none in mind.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 more Tiberium once it is already working a field.distance (cells)6
TiberiumProofInfantryTypeStops Tiberium from poisoning an infantry type.booleanno
TiberiumSpreadsscenariosAllows a ripe Tiberium cell to seed its neighbors.booleanUnchanged
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.0In development

    Require mutual alliances for refinery docking

  2. Changed0.1.0In development

    Validate Tiberium overlay frames before drawing