Cite as
id-Software/Quake-Tools
Original
https://github.com/id-Software/Quake-Tools
Pinned
id-Software/Quake-Tools @ c0d1b91c74eb654365ac7755bc837e497caaca73
Accessed
2026-10-22
Licence
GPL-2.0 (qcc/COPYING is the GNU General Public License, version 2; the .qc files' headers read “Copyright (C) 1996-1997 Id Software, Inc.” under GPL version 2 or later). The pinned commit is titled “Source release of qcc and the qutils, updated long ago to be GPL.”
Credit
id Software's QuakeC game code and compiler. John Carmack's qcc/readme.txt says “American wrote a lot of qc code, and even Romero has a bit of work in there” (American McGee and John Romero).
Notes
qcc/v101qc/ is the single-player game's QuakeC: the player's jump (client.qc) and the gravity each level sets (world.qc). The directory name marks it as version 1.01's code; which release of the game shipped exactly this progs is not stated in the repo.

Cited on

Claims (8)

Quake II's PM_CheckJump, which Pmove runs before friction, does nothing while the landing timer flag is set; otherwise it needs an up move of at least 10 and the jump-held flag clear, which only a command with the key released clears, so holding the key never jumps twice. On ground it adds 270 to the vertical velocity, raising it to at least 270, and clears the ground entity; in water at level 2 or more it sets an upward swim speed instead (100 in water, 80 in slime, 50 in lava). Quake's QuakeC jump and QuakeWorld's movement code also add 270. Gravity is sv_gravity, 800.qcc/v101qc/client.qc L811Code
When a monster survives damage from another monster, Quake II's M_ReactToDamage makes the attacker its enemy if both move the same way (walking, flying, or swimming), their class names differ, and the attacker isn't a tank, super tank, Makron, or Jorg; failing that, it fights back only if the attacker was targeting it, and otherwise takes on the attacker's enemy, unless that enemy is itself. Nothing happens when it hurt itself or the attacker is already its enemy. A player it was chasing is kept as the old enemy. Quake's rule, in the version 1.01 QuakeC of id's Quake-Tools release, is simpler: a monster turns on any attacker of a different class, and soldiers turn on each other too.qcc/v101qc/combat.qc L198–210Code
Quake's jump is QuakeC (1.01's client.qc): each frame PlayerPreThink calls PlayerJump while the jump button is held and otherwise sets FL_JUMPRELEASED; on land (water level under 2, not in a water jump), PlayerJump acts only when the player is on the ground and has released the button since the last jump, then clears both flags and adds 270 to the vertical velocity. Holding the button never jumps twice.qcc/v101qc/client.qc L972–977qcc/v101qc/client.qc L773–776qcc/v101qc/client.qc L798–811Code
Computed from the jump and gravity, ignoring frame steps: a Quake jump from flat ground at the default gravity of 800 rises 270² / (2 × 800) ≈ 45.6 units and lands after 2 × 270 / 800 = 0.675 seconds.qcc/v101qc/client.qc L811qcc/v101qc/world.qc L198–199Code
Quake's gravity is the cvar sv_gravity, defaulting to 800, and each level's QuakeC worldspawn sets it to 800 again, or to 100 on E1M8; every frame a walking player is not in water (water level 2 or more) or a water jump, SV_AddGravity takes the entity's gravity field (1 when unset) × sv_gravity × frame time off its vertical velocity, on the ground as well as in the air.qcc/v101qc/world.qc L196–199Code
Because Quake runs friction in SV_ClientThink before the QuakeC jump in PlayerPreThink, and the on-ground flag is set by the walking move when it ends on a floor, a jump can come no sooner than the frame after landing, and that frame takes ground friction first: computed, a hop loses 4/72 of its horizontal speed (5.6%) at 72 frames a second above 100 units/s, or 8/72 (11.1%) when no floor lies within 34 units below a point 16 units ahead.qcc/v101qc/client.qc L798–799Code
Quake III's jump is in the shared movement code: PM_CheckJump, called from PM_WalkMove (so only on walkable ground), needs an up move of at least 10 and the jump-held flag clear, which PmoveSingle clears only on a step whose up move is under 10, so holding the key never jumps twice; it then sets the vertical velocity to JUMP_VELOCITY (270), where Quake's QuakeC adds 270 to it (quake/jump). Gravity is g_gravity, 800, as in Quake. A landing from a fall faster than 200 units/s sets a land timer of 250 ms that a comment says is to "not allow another jump for a little while", but PM_CheckJump never tests it.qcc/v101qc/client.qc L811Code
Quake III checks the jump before friction: each step, PmoveSingle traces for ground before the move, PM_WalkMove calls PM_CheckJump before PM_Friction, and a jump clears the walking flag and hands the step to PM_AirMove, whose friction call skips ground friction without that flag. So a hop on the first step that starts on the ground loses no speed to friction, as in QuakeWorld (quake/qw-hop-friction), where WinQuake's takes one frame of it, 5.6% at 72 frames a second (quake/hop-friction). The hop needs the jump key released and pressed again in the air, as in both.qcc/v101qc/client.qc L972–977qcc/v101qc/client.qc L798–811Code