In 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's OverlayData mod 6) + 1 steps from the cell, no more than the room left, and the timer restarts at TICKS_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. | src/script/unit.c L1650–1669 | Code |
| 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. | src/script/structure.c L125–136 | Code |
| 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. | src/structure.c L188–215src/structure.c L264–269 | Code |
| 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. | src/structure.c L786–814src/structure.c L530–531 | Code |
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. | src/map.c L669–679src/map.c L694src/explosion.c L100src/explosion.c L167src/unit.c L1517src/unit.c L1557src/map.c L771–785 | Code |
OpenDUNE runs on the data files of Dune II 1.07, dune2.exe included, and keeps the original behavior behind a switch: with dune2_enhanced at 0 the "game acts like the original Dune II, including bugs", and at 1, the default, it applies the fixes that enhancement.txt lists. | README.txt L64README.txt L95–97src/opendune.c L81enhancement.txt L3–4 | Code |
Each time a harvester's script calls Script_Unit_Harvest while the harvester stands on spice or thick spice with a load below 100, the load grows by 0 or 1 at random, capped at 100, and in 1 call out of 32 the tile loses a level: thick spice becomes spice, and spice becomes sand. The status line reports the load as a percentage full. | src/script/unit.c L1650–1669src/map.c L784–788src/unit.c L2061–2069 | Code |
A refinery empties a docked harvester a step at a time: each call to Script_Structure_RefineSpice moves up to 3 load units at full health, 2 once damaged, and 1 below 171/256 of full health (computed from hp × 256 / max × 3 / 256, at least 1), and pays 7 credits per unit to the player, or 6 to 9 at random per call to a computer house; the next call waits 6 script ticks. Computed: a full harvester (100) is worth 700 credits to the player. | src/script/structure.c L125–136src/script/structure.c L146–151 | Code |
| Each refinery stores 1,005 credits and each spice silo 1,000 (the structure table's defaults). On each house tick, credits above a house's storage are lost, except that the player keeps the mission's starting credits as a floor until storage passes them. OpenDUNE moved this check: its comment says the original ran it outside the per-house loop, and enhancement.txt says 1.07 thereby updated only the house that owns the latest structure. In the original mode, a structure still being built also counts toward storage. | src/table/structureinfo.c L832src/table/structureinfo.c L1157src/house.c L184–197src/scenario.c L78src/house.c L200–203enhancement.txt L78–79src/house.c L490–491 | Code |
| A factory or construction yard counts a build down from 256 × the item's build time. On each structure tick, every 30 game-timer ticks at normal game speed, a builder at full health takes 256 off the count (less for a computer house; dune2/ai-build-speed) and pays the build cost ÷ build time, carrying fractions of a credit in 1/256ths; a damaged builder takes off and pays only its share of full health (hit points × 256 ÷ maximum) each tick. When its owner can't pay a tick's share, the build waits, and a player's build goes on hold with a message. Computed: at full health an item takes its build time in structure ticks and costs about its build cost, which OpenDUNE's 60 Hz game timer makes half a second per unit of build time at normal speed. | src/structure.c L1665src/structure.c L66–69src/structure.c L175src/structure.c L188–215src/structure.c L264–269src/opendune.c L1168src/timer.c L364 | Code |
| A computer house builds at no more than (20 × mission index + 95)/256 of full speed, where the first mission is index 0, and pays per tick in the same proportion. Computed: 95/256, about 37%, in the first mission, rising to 255/256 in the ninth. | src/structure.c L193–202src/opendune.c L288–295src/opendune.c L931 | Code |
| The executable's structure table sets, among others, a concrete slab at 5 credits, 16 build-time units, and 20 hit points; a windtrap at 300, 48, and 200; a refinery at 400, 80, and 450; a spice silo at 150, 48, and 150; an outpost at 400, 80, and 500; a light factory at 400, 96, and 350; a heavy factory at 600, 144, and 200; and a palace at 999, 130, and 1,000. Each row also names the structures a house must own first and the first mission it can be built in; code moves the light factory's first mission from 3 to 2 for every house but the Harkonnen. PROFILE.INI, read from the game data at start, can replace a row's cost, time, hit points, and first mission, along with its fog radius and its build, target, and sort priorities. | src/table/structureinfo.c L16–41src/table/structureinfo.c L601–626src/table/structureinfo.c L796–821src/table/structureinfo.c L1121–1146src/table/structureinfo.c L1186–1211src/table/structureinfo.c L211–236src/table/structureinfo.c L276–301src/table/structureinfo.c L146–171src/opendune.c L568–604src/structure.c L1904–1906src/opendune.c L945 | Code |
| The player's construction yard offers a structure once the house owns every structure in its row's requirement set, the mission number has reached the row's first mission, the house may build it, and the yard's upgrade level is high enough. Two exceptions are coded: for the Harkonnen, the WOR, which trains troopers, needs no barracks and opens from the second mission; for other houses, the light factory opens from the second mission. A computer house's yard skips the requirement set and the upgrade level. | src/structure.c L1895–1912 | Code |
| A structure fits where every footprint tile is rock (entirely or mostly), a concrete slab, or a destroyed wall, with no unit or structure on it; slabs and the construction yard can't go on a slab. For the player, one of the tiles ringing the footprint, corners included, must also hold one of the player's structures, or a slab or wall the player owns; the construction yard is exempt, and a computer house's placement skips the check. For every structure but slabs and the construction yard, which never count missing slabs, the footprint tiles without a slab take (maximum hit points ÷ 2) × (tiles without a slab) ÷ (footprint tiles) off the new structure's starting hit points. Computed: such a structure placed with no slab starts at half health. | src/structure.c L748–784src/structure.c L786–814src/table/structureinfo.c L1305–1309src/table/landscapeinfo.c L57–74src/table/landscapeinfo.c L129–134src/table/landscapeinfo.c L165–170src/table/structureinfo.c L16–22src/structure.c L530–531src/structure.c L549–554 | Code |
| The executable's unit table sets hit points, speed (out of 256), range in tiles, fire delay, and damage per shot: the Trike 100, 45, 3, 50, and 5; the Quad 130, 40, 3, 50, and 7; the combat tank 200, 25, 4, 80, and 25; the siege tank 300, 20, 5, 90, and 30; the rocket launcher 100, 30, 9, 120, and 75; the Devastator 400, 10, 5, 100, and 40; and the sonic tank 110, 30, 8, 80, and 60. PROFILE.INI, read from the game data at start, can replace any of these. | src/table/unitinfo.c L967–1031src/table/unitinfo.c L1113–1177src/table/unitinfo.c L675–739src/table/unitinfo.c L748–812src/table/unitinfo.c L529–593src/table/unitinfo.c L821–885src/table/unitinfo.c L894–958src/unit.h L197src/script/unit.c L607–609src/opendune.c L629–651 | Code |
| A shot carries its unit's table damage, with no roll; only troopers and trooper squads firing beyond 2 tiles switch to a missile at damage − damage/4. The whole damage applies only at the point of impact, where a unit, or a structure on the impact tile, loses it from its hit points, down to 0, with no armor or defense stat; units farther from the point take less (dune2/splash). Units flagged to fire twice (among them the Trike, Quad, rocket launcher, siege tank, and Devastator) follow a shot with a second after a delay of 5 rather than twice their fire delay (at normal game speed), but only while above half health; every fire delay gets 0 or 1 added at random. | src/script/unit.c L623–628src/script/unit.c L658–659src/script/unit.c L683–692src/map.c L427–431src/unit.c L1544–1548src/structure.c L1049–1053src/table/unitinfo.c L1012src/table/unitinfo.c L1158src/table/unitinfo.c L574src/table/unitinfo.c L793src/table/unitinfo.c L866 | Code |
| A shell or missile damages where it explodes, not the unit it was fired at: the explosion damages every unit within one tile of the point (two for the Death Hand explosion), its own side's included, by the damage halved once per quarter tile of distance, so full within a quarter tile, half to a half, a quarter to three quarters, and an eighth to one tile; the frigate and bullets in flight take none. A structure on the impact tile takes the full damage. A shell flies to the target's position at the moment of firing and explodes there, or earlier on a wall, structure, or mountain tile in its path; a turret's shell passes over its own side's walls and structures. | src/map.c L405–431src/map.c L488–501src/unit.c L1540src/unit.c L1981–1983src/unit.c L2020–2021src/unit.c L1438–1444src/unit.c L1399–1412src/tile.c L39–45 | Code |
| The rocket launcher's and the Deviator's missiles aim at a random point near the target. 15 times in 16 the miss distance is a random byte halved until it is at most 8 + the distance to the target in whole tiles, and 1 time in 16 at most 8 + a second random byte, in sixteenths of a tile, in a random direction. The rocket turret's missiles carry no such flag and fly to the target point. | src/unit.c L1985–1987src/tile.c L319–325src/table/unitinfo.c L1405–1454src/table/unitinfo.c L1551–1600src/table/unitinfo.c L1478–1527src/unit.h L31–33src/table/unitinfo.c L595src/table/unitinfo.c L668src/script/structure.c L529 | Code |
| From the third mission on, every 10,800 game-timer ticks at normal game speed, each structure marked as degrading loses hit points while it stands above half its table maximum: 3 for the Harkonnen, 2 for the Ordos, and 1 for every other house. Placement marks a structure when any footprint tile lacks a concrete slab, except a construction yard, which never counts missing slabs; in the original mode it marks every structure placed, slabs or not, and OpenDUNE's enhanced mode (the default) leaves a construction yard and a structure built wholly on slabs unmarked. Structures a scenario places start unmarked, and slabs and walls never decay. Computed: OpenDUNE's 60 Hz timer makes the interval 3 minutes, and a structure placed with no slab, which starts at half health, doesn't decay until repaired above it. | src/structure.c L61–63src/structure.c L95src/structure.c L121–122src/table/houseinfo.c L9–12src/table/houseinfo.c L41–44src/table/houseinfo.c L25–92src/structure.c L550–561src/structure.c L766–777src/table/structureinfo.c L536–542src/scenario.c L284–285src/opendune.c L1168 | Code |
| A computer house's construction yard builds only structures the house has lost. Removing a structure records its type and position in the first free of five slots per house; while the house's AI is active and it has credits, an idle yard builds the first recorded type it can build, places the finished structure at once at the recorded position, and clears the slot. If no slot matches or placement fails at every match, the house gets the cost back and the structure is dropped. | src/structure.c L1338–1342src/structure.c L1993–2003src/structure.c L308–319src/structure.c L240–261 | Code |
The first time a computer house's structure is hit, Structure_HouseUnderAttack sets the house's full-scale-attack flag and, in OpenDUNE's enhanced mode (the default), sends its armed units on area guard to hunt. In the original mode the routine returns after setting the flag: OpenDUNE's comment says Dune II searched only for carryalls (unit type 0), so the rest did nothing, and enhancement.txt adds that the bug "makes the game much easier in its original form". | src/structure.c L1940–1971src/map.c L500enhancement.txt L39–42 | Code |