Click the view to capture the mouse · WASD / arrows move · mouse looks · Ctrl or click fires · Space jumps · C crouches · Z or right-click zooms · Shift walks · 1–9 weapons · / or wheel cycles · Enter uses the holdable · Tab scores · G gives everything · P pause. On touch screens the left half moves, the right half looks, a tap fires.
SQL console — the live game database
How it works
- The BSP becomes tables. A Quake III map (IBSP 46) is copied in lump by lump:
FACESwith their plane and bounding sphere,FACE_VERTSwith texture and lightmap coordinates (the Bézier patches tessellated into triangles),NODES,LEAVESwith their cluster and a decompressed PVS as a hex string,LEAFFACES, and the collision geometry:BRUSHESandBRUSHSIDESwith their planes and contents, indexed throughLEAFBRUSHES— the patches add one-sided facets to them, as cm_patch.c does. Every MD3 is a row ofMODELS; the entity lump becomesMAP_ENTS; bg_itemlist isITEM_DEFS. - Collision is a recursive procedure.
RHCisCM_TraceThroughTree: the moving box's extents push each split plane out, the segment is split at the plane and both sides are visited nearest first; in every leaf reached,CLIP_LEAFclips the segment against each brush and facet whose contents match the mask.TRACE_MOVEruns it against the world, every door and platform (brush models have a leaf of their own) and the players' boxes.FLY_MOVE(PM_SlideMove),WALK_MOVE(the 18-unit step),MOVE_STEPandPUSH_MOVEare bg_pmove.c and g_mover.c in PSQL. - The game is PSQL.
Q3_TICruns at 20 Hz: the player's ground, air and water moves, jumps and footsteps; doors, plats, buttons, bobbing and rotating platforms, pendulums and trains; jump pads that compute their launch velocity from their target, teleporters, hurt triggers; the items of bg_itemlist with their respawn times; the nine weapons from the gauntlet to the BFG10K; damage with armour and the quad, knockback, gibs; the obituaries, the frag count and the announcer; and the bots — see, chase, strafe, pick things up, shoot, die, respawn — inBOT_THINK. The bots find their way over a waypoint graph built when the map loads: a node at every spawn point, item, jump pad and teleporter and on a grid over every floor, an edge wherever a trace says a player can walk, step, drop, fly off a pad or teleport;WP_ROUTEis a breadth-first search in PSQL. - The renderer is a query.
FRAME_ALLfinds the leaf and cluster the eye is in and, once per cluster, marks every face of every leaf whose cluster is in its PVS (R_MarkLeaves) with its plane and bounding sphere. A frame is then a scan of the marked faces with the back-face and frustum tests as expressions, aggregated withLIST()into one row of face ids; the brush models add a row each at their own origin. The same result set carries the MD3 entities in the PVS with their pose and animations, the sounds, effects and console lines of the tic: one round trip per frame. The other renderer mode,FRAME_FACES, projects every vertex in SQL as well. - JavaScript only paints. Two painters share the same rows. The WebGL one is a port of Quake III's renderer: the world's vertices sit on the card, a shader multiplies the texture by the lightmap page and adds the glow stages with the stage's blendFunc and tcMods, the sky is the shader's cloud layers by pixel direction, the MD3 models are lit from the light grid in the vertex shader. The software one is a 32-bit framebuffer and a z-buffer; perspective-correct spans, divided every 16
pixels, that multiply the texture by the lightmap page; triangle lists for the patches and meshes; MD3 models lit
from the light grid, the player parts hung on their tags; the sky's cloud layers by pixel direction; additive and
alpha blended surfaces; the status bar from the game's own pictures. Sounds are rows in
SOUND_EVENTS, spatialised with the Web Audio API.
A port of Firebird Quake 2 to Quake III Arena. The engine is
Electric Firebird (firebird-wasm). The game
data is the Quake III Arena demo (id Software, 1999), which may be freely redistributed; drop in a registered
pak0.pk3 to play the full game's arenas. Quake III Arena is a trademark of id Software.