Command & Conquer
Westwood Studios' 1995 real-time strategy game, read through the source code of its 2020 remaster that Electronic Arts released.
On this page
Command & Conquer came out in 19951. The atlas reads it through the source of TiberianDawn.dll, the game’s code in the 2020 Remastered Collection, which keeps Westwood’s 1995 files beside dated changes for the remaster2. A claim here describes the remaster’s code and names any remaster change it rests on.
The game sets resource-harvesting, construction, and structure-placement up much as Dune II does. A harvester lifts Tiberium a step at a time up to 28 steps3, and a refinery pays the player 25 credits a step, the same 700 credits a full load that Dune II pays; a computer house in a campaign mission gets 708 a step4. Unlike Dune II’s spice, Tiberium grows: existing cells gain a level, and heavy cells and blossom trees seed clear neighbors; a cell harvested to empty is cleared and refills only if a neighbor seeds it5.
A factory pays for a build in 108 installments and waits when the money runs short, and a human player’s extra factories of a kind speed it up6. A player’s new structure must stand on clear ground beside the player’s own buildings, walls, or bibs, corners included7.
Mechanics
| Mechanic | Kind | How |
|---|---|---|
| Resource harvesting | Carried loads | a harvester carries 28 steps of Tiberium and a refinery pays 25 credits a step, 700 a load; the computer gets 708 a step in single player; Tiberium cells grow a level, and heavy cells and blossom trees seed clear neighbors |
| Construction | Pay as built | a factory pays in 108 installments over a time set by the item's cost and the house's power; a human player's extra factories speed it up |
| Structure placement | Adjacent to the base | every footprint cell clear land or road, one of them beside the player's own building, wall, or bib, corners included; the computer is exempt |
Every claim about this game, by concept (7)
References
- ^Command & Conquer came out on 31 August 1995.WikidataWikidata
How we know
+1995-08-31T00:00:00Z
Q868523, publication date (P577) · archived copy ↗ The quote matches our archived copy.
Checked by a second AI model, 2026-10-22.
- ^The atlas reads Command & Conquer through the source of TiberianDawn.dll, the game's code in the 2020 Remastered Collection, which Electronic Arts released under the GPL version 3 with additional terms. The files keep Westwood's 1995 headers beside dated comments and guards for the remaster's changes, so a claim here describes the remaster's code and names any remaster change it rests on.CodeC&C Remastered source
How we know
This repository includes source code for TiberianDawn.dll, RedAlert.dll and the Map Editor for the Command & Conquer Remastered Collection.
README.md#L3 · upstream ↗ 1Electronic Arts Inc. released only TiberianDawn.dll, RedAlert.dll and 2the Command & Conquer Map Editor and their corresponding source code 3under the GPL V3 below, with additional terms at the bottom.
LICENSE.md lines 1–3 at f1f0d42 · upstream ↗ 16 Oct 1995 16:51:16 JOE_BOSTIC
TIBERIANDAWN/DRIVE.CPP#L16 · upstream ↗ Replaced by more generic function from RA, for RA AI. ST - 7/24/2019 5:46PM
TIBERIANDAWN/DISPLAY.CPP#L796 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-22.
Checked by a second AI model, 2026-10-22.
- ^ abIn the remaster's code, a harvester carries at most 28 steps of Tiberium (
STEP_COUNT). Each time its harvest timer runs out while it stands on Tiberium short of a full load, it lifts (the cell'sOverlayDatamod 6) + 1 steps from the cell, no more than the room left, and the timer restarts atTICKS_PER_SECOND, 15 game ticks; the code's comment calls this lifting a complete "level" of 6 steps or a partial one. Dune II's harvester instead fills to 100 units by a random 0 or 1 per harvest call.CodeC&C Remastered source · OpenDUNEHow we know
862 TIBERIUM_STEP=25, // Credits per step of Tiberium. 863 STEP_COUNT=28, // Number of steps a harvester can carry. 864 FULL_LOAD_CREDITS=(TIBERIUM_STEP*STEP_COUNT),
TIBERIANDAWN/TYPE.H lines 862–864 at f1f0d42 · upstream ↗ 2470 if (Target_Legal(NavCom) || !HarvestTimer.Expired() || IsDriving || IsRotating) return(true); ⋮ 2472 if (Tiberium_Load() < 0x0100 && ptr->Land_Type() == LAND_TIBERIUM) { ⋮ 2476 ** "level" of Tiberium. A level happens to be 6 steps. If there ⋮ 2480 int reducer = (ptr->OverlayData % 6) + 1; 2481 reducer = ptr->Reduce_Tiberium(MIN(reducer, UnitTypeClass::STEP_COUNT-Tiberium)); 2482 Tiberium += reducer; ⋮ 2486 HarvestTimer = TICKS_PER_SECOND;
TIBERIANDAWN/UNIT.CPP lines 2470–2486 at f1f0d42 · upstream ↗ 154 return(Cardinal_To_Fixed(UnitTypeClass::STEP_COUNT, Tiberium));TIBERIANDAWN/DRIVE.CPP lines 151–154 at f1f0d42 · upstream ↗ 2146#define TICKS_PER_SECOND 15TIBERIANDAWN/DEFINES.H line 2146 at f1f0d42 · upstream ↗ 1651 if (u->amount >= 100) return 0; ⋮ 1658 u->amount += Tools_Random_256() & 1; ⋮ 1663 if (u->amount > 100) u->amount = 100; ⋮ 1669 return 0;
src/script/unit.c lines 1650–1669 at ebea79a · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-22.
Checked by a second AI model, 2026-10-22.
- ^In the remaster's code, a refinery empties a docked harvester one step at a time, and each step pays its house 25 credits if the house is human: computed, 700 for a full load of 28, which matches Dune II's 100 units at 7 credits. A computer house gets 708 credits a step in a normal (single-player) game, from a formula the remaster's comment calls "wrong" but kept "to not break missions", and 33 in multiplayer, a correction the comment dates to the remaster (14 May 2020). Credits above the house's storage capacity are lost.CodeC&C Remastered source · OpenDUNE
How we know
4511 int bail = techno->Offload_Tiberium_Bail(); ⋮ 4514 House->Harvested(bail);
TIBERIANDAWN/BUILDING.CPP lines 4511–4514 at f1f0d42 · upstream ↗ 1643 if (Tiberium) { 1644 Tiberium--; 1645 if (House->IsHuman) { 1646 return(UnitTypeClass::FULL_LOAD_CREDITS/UnitTypeClass::STEP_COUNT); // 25 in debugger ⋮ 1649 // MBL 05.14.2020: AI harvested credits fix for multiplayer, since they are miscalculated, and it's noticed ⋮ 1653 if (GameToPlay == GAME_NORMAL) // Non-multiplayer game, keep the original calculation; 708 in debugger ⋮ 1655 return(UnitTypeClass::FULL_LOAD_CREDITS+(UnitTypeClass::FULL_LOAD_CREDITS/3)/UnitTypeClass::STEP_COUNT); // Original (708), wrong calcualation but preserving to not break missions ⋮ 1659 return((UnitTypeClass::FULL_LOAD_CREDITS+(UnitTypeClass::FULL_LOAD_CREDITS/3))/UnitTypeClass::STEP_COUNT); // Corrected calculation
TIBERIANDAWN/DRIVE.CPP lines 1641–1660 at f1f0d42 · upstream ↗ 862 TIBERIUM_STEP=25, // Credits per step of Tiberium. 863 STEP_COUNT=28, // Number of steps a harvester can carry. 864 FULL_LOAD_CREDITS=(TIBERIUM_STEP*STEP_COUNT),
TIBERIANDAWN/TYPE.H lines 862–864 at f1f0d42 · upstream ↗ 1722 Tiberium += tiberium; 1723 if (Tiberium > Capacity) { 1724 Tiberium = Capacity; 1725 IsMaxedOut = true;
TIBERIANDAWN/HOUSE.CPP lines 1717–1727 at f1f0d42 · upstream ↗ 131 creditsStep = 7; 132 if (u->o.houseID != g_playerHouseID) {
src/script/structure.c lines 125–136 at ebea79a · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-22.
Checked by a second AI model, 2026-10-22.
- ^In the remaster's code, Tiberium grows and spreads on its own. Each map logic pass scans 30 of the 64 × 64 cells, starting at the cell where the last pass stopped (so 29 new ones), and collects up to 50 Tiberium cells below level (
OverlayData) 11 and up to 50 spread sources: Tiberium cells above level 6, and blossom trees whatever their level, each entered three times. After each full sweep, computed as 142 passes, a random collected cell grows one level, and one heavy cell seeds level-1 Tiberium on a random empty neighbor of clear land; with fast growth on, as by default, or in any multiplayer game, each happens twice, and in the remaster's own multiplayer (GAME_GLYPHX_MULTIPLAYER) a change its comment dates to 1 July 2020 adds (Tiberium setting − 1) × 2 more. A cell harvested to empty is cleared and holds Tiberium again only if a neighbor seeds it. Dune II's spice doesn't grow: during play OpenDUNE's code adds spice only where a spice bloom bursts, filling a circle of radius 5, or where a harvester carrying 32 or more units is destroyed, filling a circle of radius load ÷ 32.CodeC&C Remastered source · OpenDUNErevisedHow we know
904 if (!Special.IsTGrowth && !Special.IsTSpread) return; ⋮ 910 int subcount = 30; ⋮ 917 if (Special.IsTGrowth && ptr->Land_Type() == LAND_TIBERIUM && ptr->OverlayData < 11) { 918 if (TiberiumGrowthCount < sizeof(TiberiumGrowth)/sizeof(TiberiumGrowth[0])) { ⋮ 930 (ptr->Land_Type() == LAND_TIBERIUM && ptr->OverlayData > 6) || 931 (terrain && terrain->Class->IsTiberiumSpawn)) { ⋮ 934 if (terrain) tries = 3;
TIBERIANDAWN/MAP.CPP lines 904–943 at f1f0d42 · upstream ↗ 144 CELL TiberiumGrowth[50]; ⋮ 151 CELL TiberiumSpread[50];
TIBERIANDAWN/MAP.H lines 144–152 at f1f0d42 · upstream ↗ 948 if (TiberiumScan >= MAP_CELL_TOTAL) { 949 int tries = 1; 950 if (Special.IsTFast || GameToPlay != GAME_NORMAL) tries = 2; ⋮ 953 ** Use the Tiberium setting as a multiplier on growth rate. ST - 7/1/2020 3:05PM ⋮ 955 if (GameToPlay == GAME_GLYPHX_MULTIPLAYER) { 956 if (MPlayerTiberium > 1) { 957 tries += (MPlayerTiberium - 1) << 1; ⋮ 972 newcell->OverlayData++; ⋮ 999 if (newcell && newcell->Cell_Object() == NULL && newcell->Land_Type() == LAND_CLEAR && newcell->Overlay == OVERLAY_NONE) { ⋮ 1012 newcell->OverlayData = 1;
TIBERIANDAWN/MAP.CPP lines 946–1012 at f1f0d42 · upstream ↗ 60 IsTGrowth = true; 61 IsTSpread = true; 62 IsTFast = true;
TIBERIANDAWN/SPECIAL.H lines 60–62 at f1f0d42 · upstream ↗ 269#define MAP_CELL_MAX_X_BITS 6 270#define MAP_CELL_MAX_Y_BITS 6 ⋮ 277#define MAP_CELL_TOTAL (MAP_CELL_W*MAP_CELL_H)
TIBERIANDAWN/DEFINES.H lines 269–277 at f1f0d42 · upstream ↗ 254 Map.Logic();TIBERIANDAWN/LOGIC.CPP line 254 at f1f0d42 · upstream ↗ 679 Map_FillCircleWithSpice(packed, 5);src/map.c lines 669–679 at ebea79a · upstream ↗ 694 if (radius == 0) return;src/map.c line 694 at ebea79a · upstream ↗ 100 Map_Bloom_ExplodeSpice(packed, g_playerHouseID);src/explosion.c line 100 at ebea79a · upstream ↗ 167 Map_Bloom_ExplodeSpice(packed, g_playerHouseID);src/explosion.c line 167 at ebea79a · upstream ↗ 1517 if (isSpiceBloom) Map_Bloom_ExplodeSpice(packed, Unit_GetHouseID(unit));src/unit.c line 1517 at ebea79a · upstream ↗ 1557 if (unit->o.type == UNIT_HARVESTER) Map_FillCircleWithSpice(Tile_PackTile(unit->o.position), unit->amount / 32);src/unit.c line 1557 at ebea79a · upstream ↗ 780 if (type == LST_THICK_SPICE && dir > 0) return; ⋮ 785 type = (type == LST_SPICE) ? LST_THICK_SPICE : LST_SPICE;
src/map.c lines 771–785 at ebea79a · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-22.
Revised after a check by a second AI model, 2026-10-22.
- ^In the remaster's code, a factory splits every build into 108 steps and pays in installments: each step costs the unpaid balance ÷ the steps left, and when the house can't pay it, the step is undone and the factory tries again at the next one. The build time in game ticks starts as the item's cost in credits, grows when the house's power fraction is below full (× 256/171), below half (× 256/103), or zero (× 4), and is divided by 108 into ticks per step (1 to 255). A human player's factory runs its step timer once per factory of that kind the house owns each tick; the code's comment says this acceleration "applies only to human players". Computed: for a human player's structure from one factory at full power, an item costing C credits takes 108 × ⌊C ÷ 108⌋ ticks, at least 108 and at most 27,540. Dune II also pays as it builds, but each tick costs cost ÷ build time, and a player's build goes on hold when the money runs out.CodeC&C Remastered source · OpenDUNE
How we know
97 STEP_COUNT=108 // Number of steps to break production down into.TIBERIANDAWN/FACTORY.H line 97 at f1f0d42 · upstream ↗ 238 ** Determine the acceleration factor for factory production. 239 ** This applies only to human players. The computer builds ⋮ 243 if (Object && House->IsHuman) { ⋮ 258 stages = House->BuildingFactories; ⋮ 261 stages = MAX(stages, 1);
TIBERIANDAWN/FACTORY.CPP lines 238–261 at f1f0d42 · upstream ↗ 265 for (int index = 0; index < stages; index++) { 266 if (!Has_Completed() && Graphic_Logic()) { ⋮ 269 int cost = Cost_Per_Tick(); ⋮ 279 if (cost > House->Available_Money()) { 280 Set_Stage(Fetch_Stage()-1); 281 } else { 282 House->Spend_Money(cost); 283 Balance -= cost;
TIBERIANDAWN/FACTORY.CPP lines 265–296 at f1f0d42 · upstream ↗ 724 int steps = STEP_COUNT - Fetch_Stage(); 725 if (steps) { 726 return(Balance / steps);
TIBERIANDAWN/FACTORY.CPP lines 720–728 at f1f0d42 · upstream ↗ 402 Balance = object.Cost_Of() * house.CostBias;TIBERIANDAWN/FACTORY.CPP line 402 at f1f0d42 · upstream ↗ 544 time = Object->Class_Of().Time_To_Build(House->Class->House); ⋮ 549 time /= STEP_COUNT; 550 time = Bound(time, 1, 255); ⋮ 552 Set_Rate(time);
TIBERIANDAWN/FACTORY.CPP lines 543–553 at f1f0d42 · upstream ↗ 296 int time = Raw_Cost(); ⋮ 334 int power = hptr->Power_Fraction(); 335 int inv_scale(256); 336 if (power == 0x000) { 337 inv_scale = 64; ⋮ 339 else if (power < 0x080) { 340 inv_scale = 103; ⋮ 342 else if (power < 0x0100) { 343 inv_scale = 171; ⋮ 345 time = (time * 256) / inv_scale;
TIBERIANDAWN/TECHNO.CPP lines 291–345 at f1f0d42 · upstream ↗ 72 if (Rate) { 73 StageTimer--; 74 if (!StageTimer) { 75 Stage++; 76 StageTimer = Rate;
TIBERIANDAWN/STAGE.H lines 71–77 at f1f0d42 · upstream ↗ 198 buildCost = oi->buildCredits * 256 / oi->buildTime; ⋮ 210 if (buildCost / 256 <= h->credits) {
src/structure.c lines 188–215 at ebea79a · upstream ↗ 265 /* Out of money means the building gets put on hold */ 266 if (s->o.houseID == g_playerHouseID) { 267 s->o.flags.s.onHold = true;
src/structure.c lines 264–269 at ebea79a · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-22.
Checked by a second AI model, 2026-10-22.
- ^In the remaster's code, a structure can be placed where every cell of its footprint, its bib included, is clear: no object, no wall, no owned bib, and ground marked buildable (clear land or road; not Tiberium, beach, rock, or water). For a human house, one of the eight cells around some footprint cell, corners included, must also hold one of the house's buildings or be a cell the house owns, which its walls and bibs are; a computer house's placement skips that check. Dune II's rule is also adjacency with corners counted and also skipped for the computer, but on rock, concrete slab, or destroyed wall, with the construction yard exempt.CodeC&C Remastered source · OpenDUNE
How we know
5490 if (Debug_Map || !House->IsHuman) { ⋮ 5499 short const * ptr = Occupy_List(true); ⋮ 5505 for (FacingType facing = FACING_N; facing < FACING_COUNT; facing++) { 5506 CELL newcell = Adjacent_Cell(cell, facing); ⋮ 5511 ** The special cell ownership flag allows building adjacent 5512 ** to friendly walls and bibs even though there is no official ⋮ 5515 if (Map[newcell].Owner == House->Class->House) { ⋮ 5519 if (base && base->House->Class->House == House->Class->House) {
TIBERIANDAWN/BUILDING.CPP lines 5485–5524 at f1f0d42 · upstream ↗ 2926 if (tech->What_Am_I() != RTTI_BUILDING || ((BuildingClass *)tech)->Passes_Proximity_Check(cell)) { 2927 builder->Transmit_Message(RADIO_HELLO, tech); 2928 if (tech->Unlimbo(Cell_Coord(cell))) {
TIBERIANDAWN/HOUSE.CPP lines 2926–2928 at f1f0d42 · upstream ↗ 1196 if (ScenarioInit || Can_Enter_Cell(Coord_Cell(coord), FACING_NONE) == MOVE_OK) {TIBERIANDAWN/OBJECT.CPP line 1196 at f1f0d42 · upstream ↗ 3832 return(Class->Legal_Placement(cell) ? MOVE_OK : MOVE_NO);TIBERIANDAWN/BUILDING.CPP line 3832 at f1f0d42 · upstream ↗ 4415 offset = Occupy_List(true); ⋮ 4419 if (!Map[cell].Is_Generally_Clear()) {
TIBERIANDAWN/BDATA.CPP lines 4415–4420 at f1f0d42 · upstream ↗ 434 if (Flag.Composite || IsFlagged || Cell_Occupier()) { ⋮ 439 if (Smudge != SMUDGE_NONE && SmudgeTypeClass::As_Reference(Smudge).IsBib && Owner != HOUSE_NONE) { ⋮ 442 if (Overlay != OVERLAY_NONE && (Overlay == OVERLAY_FLAG_SPOT || OverlayTypeClass::As_Reference(Overlay).IsWall)) { ⋮ 468 return(::Ground[Land_Type()].Build);
TIBERIANDAWN/CELL.CPP lines 430–468 at f1f0d42 · upstream ↗ }, true}, // LAND_CLEAR … }, true}, // LAND_ROAD … }, false}, // LAND_WATER … }, false}, // LAND_ROCK … }, false}, // LAND_TIBERIUM … }, false}, // LAND_BEACH
TIBERIANDAWN/CONST.CPP#L269-L275 · upstream ↗ 228 if (Class->IsBib) { ⋮ 231 cell->Owner = ToOwn;
TIBERIANDAWN/SMUDGE.CPP lines 228–231 at f1f0d42 · upstream ↗ 241 if (Class->IsWall) { ⋮ 253 cellptr->Owner = ToOwn;
TIBERIANDAWN/OVERLAY.CPP lines 241–253 at f1f0d42 · upstream ↗ 786 if (g_validateStrictIfZero == 0 && isValid && type != STRUCTURE_CONSTRUCTION_YARD && !g_debugScenario) { ⋮ 798 if (s->o.houseID != g_playerHouseID) continue;
src/structure.c lines 786–814 at ebea79a · upstream ↗ 531 if (validBuildLocation == 0 && s->o.houseID == g_playerHouseID && !g_debugScenario && g_validateStrictIfZero == 0) return false;src/structure.c lines 530–531 at ebea79a · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-22.
Checked by a second AI model, 2026-10-22.
Sources
Code
- Studios, Westwood and Electronic Arts. 2025. “Command & Conquer Remastered Collection source code (electronicarts/CnC_Remastered_Collection).” Commit f1f0d42. electronicarts/CnC_Remastered_Collection @ f1f0d42 · licence, all uses
- OpenDUNE contributors. 2026. “OpenDUNE: a C re-creation of Dune II from its DOS executable (OpenDUNE/OpenDUNE).” Commit ebea79a. OpenDUNE/OpenDUNE @ ebea79a · licence, all uses
Secondary
- Wikidata contributors. 2026. “Wikidata.” Wikimedia Foundation. original · licence, all uses