Cite as
The Ur-Quan Masters (2002 import)
Original
https://sourceforge.net/p/sc2/uqm/
Pinned
sc2/uqm @ 2f5b2c30f30e377eca0c0a483c0180860ab8813c
Accessed
2026-10-22
Licence
Code: GNU GPL version 2 or later, by the header of each source file ("Copyright Paul Reiche, Fred Ford. 1992-2002"); sc2/COPYING at the pinned commit is the GPL v2 text alone. Content: the project's current sc2/COPYING (commit a0d90e239b3a8e3dcb9d732fd76a385aac2593e5, 2026-08-21) puts the voiceovers, dialogue, graphics, sounds, and music under Creative Commons Attribution-NonCommercial-ShareAlike 2.5, and the documentation under Creative Commons Attribution 2.0; the pinned commit states no content license. The atlas reads only the code.
Credit
Star Control II's code by Paul Reiche and Fred Ford of Toys for Bob (the file headers), as Toys for Bob released the 3DO version's source in 2002; imported and ported to SDL by The Ur-Quan Masters project (the commit's author is meep-eep).
Notes
The pinned commit is the first with files ("Initial revision", 2002-09-03 00:56, git-svn trunk from the project's CVS), the 3DO version's code as the project first committed it; the next commit is "Initial import after Mega-Patch." and the tag `initial` (5389c45, 2002-10-14) comes later. The code already carries the start of the SDL port (SDL_wrapper.c). It may differ from the 1992 DOS release. Each ship's stats are #defines and a RACE_DESC table in sc2/src/sc2code/ships/<race>/<race>.c; ship.c holds turning, thrust, and energy, process.c the move step, gravity.c and misc.c the planet, hyper.c hyperspace. SourceForge's git server ignores --filter=blob:none, so a fetch downloads the content blobs too; the sparse checkout keeps them out of the working tree.

Cited on

Claims (9)

In the 3DO source as The Ur-Quan Masters first imported it (2002), each pass of the battle loop sleeps until 5 ticks (BATTLE_FRAME_RATE) after the previous pass woke, on a clock of 120 ticks a second (ONE_SECOND), so battle runs at most 24 frames a second (computed: 120 / 5). The sleep is the port's SleepTask, in its SDL wrapper. When nth_frame is set, which encount.c does only while the cyborg option flies the player's ships in an encounter, the loop only yields (TaskSwitch) and does not wait. The atlas calls one pass a frame.sc2/src/sc2code/element.h L22sc2/src/sc2code/libs/timlib.h L24sc2/src/sc2code/battle.c L229–232sc2/src/SDL_wrapper.c L1315–1325sc2/src/sc2code/encount.c L745–758Code
The Earthling Cruiser's stats set MAX_THRUST 24, THRUST_INCREMENT 3, TURN_WAIT 1, and THRUST_WAIT 4. Speeds are in world units per frame; DISPLAY_TO_WORLD makes one display unit 4 world units. Each frame, ship_preprocess counts a ship's turn wait down, or, when it is 0 and a turn is held, steps the ship one of its 16 facings and sets the wait to TURN_WAIT. Thrust works the same way with its own wait: when the wait is 0 and thrust is held, ship_preprocess calls inertial_thrust once and sets the wait to THRUST_WAIT. Each such call is one thrust step, which adds THRUST_INCREMENT to the velocity along the facing, up to MAX_THRUST (sc2/speed-cap). So the Cruiser turns a facing every 2 frames and takes a thrust step every 5 frames. Each step raises its speed by 3 world units per frame (3/4 of a display unit per frame), to a top speed of 24 world units (6 display units) per frame, which it reaches from rest after 8 steps along an axis (computed). Comments beside the two thrust values read DISPLAY_TO_WORLD (6), which is 24 and agrees with the code, and DISPLAY_TO_WORLD (2), which is 8 and disagrees with the code's 3.sc2/src/sc2code/ships/human/human.c L29–32sc2/src/sc2code/ships/human/human.c L56–67sc2/src/sc2code/races.h L74–84sc2/src/sc2code/units.h L30–33sc2/src/sc2code/units.h L105–112sc2/src/sc2code/ship.c L223–254sc2/src/sc2code/ship.c L69–80sc2/src/sc2code/velocity.h L49–53sc2/src/sc2code/process.c L141–151Code
inertial_thrust caps the speed itself, not each axis: after adding a thrust step it compares the sum of the squared components with MAX_THRUST squared, so a ship is no faster on a diagonal. Asteroids clamps each axis of its ship's velocity apart, so its diagonal is faster (asteroids/top-speed). A step that would pass the cap still applies if the result is slower than the current speed. At the cap, a step along the line of travel sets the velocity to exactly MAX_THRUST along the facing (if the ship isn't above the cap); a step off the line instead adds half a thrust step along the facing and takes a whole step off along the line of travel, kept if that ends within the cap or slower than before, so the course swings toward the facing. While the ship is flagged in a gravity well, a thrust step may take it past the cap up to MAX_ALLOWED_SPEED, 18 display units per frame.sc2/src/sc2code/ship.c L75–128sc2/src/sc2code/ship.c L56–62Code
A ship that stops thrusting keeps its velocity: the frame's move step (process.c) adds the velocity to the position without changing it, and ship_preprocess changes it only through inertial_thrust, called while thrust is held. The Earthling Cruiser's own code (human.c) sets a velocity only for its missile. Other code can still change a ship's velocity, such as a planet's pull (sc2/gravity-well) and the Arilou Skiff's own routine (sc2/arilou).sc2/src/sc2code/process.c L141–151sc2/src/sc2code/ship.c L241–254sc2/src/sc2code/ships/human/human.c L111–140Code
The Arilou Skiff's stats set THRUST_INCREMENT equal to MAX_THRUST, 40 world units (10 display units) per frame, with TURN_WAIT and THRUST_WAIT 0. For such a ship inertial_thrust sets the velocity straight to MAX_THRUST along the facing. The Skiff's own preprocess routine, which ship_preprocess runs before turning and thrust, zeroes its velocity whenever its thrust wait is 0, outside its jump (while it isn't NONSOLID). So the Skiff moves at full speed only on frames thrust is held and stops when it is released, with no inertia.sc2/src/sc2code/ships/arilou/arilou.c L29–32sc2/src/sc2code/ship.c L50–55sc2/src/sc2code/ships/arilou/arilou.c L185–196sc2/src/sc2code/ship.c L217–247sc2/src/sc2code/ships/arilou/arilou.c L280Code
A Melee planet is an element with 200 hit points and a mass of 200, above GRAVITY_MASS's threshold of 100 (10 times MAX_SHIP_MASS), whose per-frame postprocess is CalculateGravity. That routine pulls every other colliding element without such mass that lies within 255 display units of the planet (GRAVITY_THRESHOLD, tested on each axis and then as a radius, measured the short way across the arena's wrapped edges): it adds 1 world unit per frame to the element's velocity, aimed at the planet, whatever the distance, and flags a ship as in a gravity well. A block under #ifdef NEVER, never compiled, works out a pull from the distance, capped at 6, and only prints it.sc2/src/sc2code/misc.c L22–54sc2/src/sc2code/element.h L131–133sc2/src/sc2code/gravity.c L28–131sc2/src/sc2code/units.h L131–136Code
A ship's crew is its hit points: element.h defines hit_points as crew_level, and do_damage takes damage to a player's ship from its crew through DeltaCrew, which reports failure when the crew would reach 0 or less; the ship's life span is then set to 0 and it becomes nonsolid. DeltaCrew changes nothing for the enemy in the last battle (its comment: "Samatra can't be crew-modified"). The Earthling Cruiser's table entry gives 18 crew, at its maximum of 18 (MAX_CREW); in encounters and the last battle a ship takes its crew from the fleet instead, up to that maximum.sc2/src/sc2code/element.h L127sc2/src/sc2code/misc.c L195–203sc2/src/sc2code/status.c L300–334sc2/src/sc2code/ships/human/human.c L23sc2/src/sc2code/ships/human/human.c L47sc2/src/sc2code/races.h L92sc2/src/sc2code/ship.c L380–385sc2/src/sc2code/ship.c L145–151Code
A ship's battery pays for both its weapons and refills by itself. Each frame, ship_preprocess counts the energy counter down, or, when it is 0 and the battery is below full, adds ENERGY_REGENERATION; every successful DeltaEnergy, a refill or a shot's cost, resets the counter to ENERGY_WAIT. A weapon fires only if DeltaEnergy can take its whole cost. The Earthling Cruiser holds 18 (MAX_ENERGY), regains 1 unit every 9 frames (ENERGY_WAIT 8), pays 9 a missile (WEAPON_ENERGY_COST) at most once every 11 frames (WEAPON_WAIT 10), and 4 (SPECIAL_ENERGY_COST) for each use of its point-defense laser, taken only when a colliding, uncloaked object is within 100 display units (LASER_RANGE) to fire at. So a full battery holds two missiles and refills from empty in 162 frames, 6.75 seconds at 24 frames a second (computed).sc2/src/sc2code/ships/human/human.c L23–33sc2/src/sc2code/ships/human/human.c L48–66sc2/src/sc2code/ships/human/human.c L186–214sc2/src/sc2code/ship.c L210–215sc2/src/sc2code/status.c L260–295sc2/src/sc2code/ship.c L284–322Code
While the flagship moves in HyperSpace, MoveSIS adds up how far the flagship moves on each axis (as absolute values) since it entered (LoadHyperspace zeroes the sums), takes the square root of the sum of their squares, and charges 1 unit of FuelOnBoard for each 16 logical units of that distance; the first charge comes at 32, since the count starts at 1 (computed). The fuel gauge shows FuelOnBoard divided by 100 (FUEL_TANK_SCALE), so each charge is 1/100 of a shown unit. Nothing is charged with an empty tank or while the ARILOU_SPACE_SIDE game state is above 1. The atlas reads those values as QuasiSpace: hyper.c loads the ARISPACE graphics into hyperstars[2], picks the stars as hyperstars[1 + (ARILOU_SPACE_SIDE >> 1)], and from 2 up AddEncounterElement returns at once, adding no encounter.sc2/src/sc2code/hyper.c L91–122sc2/src/sc2code/process.c L296–297sc2/src/sc2code/hyper.c L298–299sc2/src/sc2code/sis.c L645–671sc2/src/sc2code/sis.h L75sc2/src/sc2code/hyper.c L288–289sc2/src/sc2code/hyper.c L764–765sc2/src/sc2code/hyper.c L893–902Code