Loading…
Firebird
Click the view to capture the mouse · WASD / arrows move · mouse looks · Ctrl or click fires · Space jumps · Shift walks · 1–8 weapons · / or wheel cycles · 9 all weapons · P pause. On touch screens the left half moves, the right half looks, a tap fires.
SQL console — the live game database
Ctrl+Enter runs · ↑ ↓ history · Tab completes a name
How it works
- The BSP becomes tables.
FACESwith their plane and texture mapping,FACE_VERTS(the edges and surfedges resolved),LEAVESwith a decompressed PVS as a hex string,MARKSURFACES, andHULLS: the node tree and both clipnode hulls, one row per node with the plane copied in. Alias models contributeMODELSand their animation runs inANIMS; the entity lump becomesMAP_ENTS. - Collision is a recursive procedure.
RHCisSV_RecursiveHullCheck: it splits the segment at every plane it crosses and recurses into both sides, threading the trace state through its parameters.TRACE_MOVEruns it against the world and every door and platform, and tests monsters and the player with a Minkowski slab test.FLY_MOVE,WALK_MOVE,MOVE_STEPandPUSH_MOVEare sv_phys.c in PSQL, clip planes and pushed entities kept in global temporary tables because PSQL has no arrays. - The game is PSQL.
QUAKE_TICruns at 20 Hz: the player's friction, acceleration, jumping and swimming, doors (linked by touching boxes, with keys), platforms, buttons, trains, secret doors, triggers (once, multiple, secret, counter, relay, teleport, push, hurt, changelevel), items and weapons from the axe to the thunderbolt, damage with armour and quad, gibs, and the monster AI of ai.qc:FIND_TARGET,MOVE_TO_GOAL,NEW_CHASE_DIR,CHECK_ATTACK, and the grunt, dog, knight, ogre, scrag, fiend, zombie and shambler attacks, plus the registered episodes' enforcer, death knight, vore (homing pods), spawn, rotfish and Shub-Niggurath. Chthon rises in E1M7 and takes the lightning; Shub falls to the telefrag. - The renderer is a query.
FRAME_FACESfinds the leaf the eye is in, marks the leaves in its PVS that touch the view frustum, collects their faces (DISTINCT, Quake's visframe), drops back faces and faces outside the frustum, and walks each polygon in a single cursor: view transform, clipping to the near plane, projection, and the texel coordinates texinfo gives every vertex. Doors, platforms and ammo boxes are brush models and go through the same cursor at their own origin.FRAME_ENTSlists the alias models and sprites in the PVS with their pose and frame;FRAME_LIGHTSTYLESanimates the lights. - JavaScript only paints. It rasterises the polygons with perspective-correct spans over a surface cache
(texture × lightmap through the colormap, as r_surf.c did), draws the alias models with Gouraud light sampled
from the lightmap below them, sprites, particles, the two-layer sky, and the status bar from gfx.wad.
Sounds are rows in
SOUND_EVENTS, spatialised with the Web Audio API. The map's ambient emitters (drips, hums, torches) loop at their entities; the water and wind ambients come from the BSP leaf the player is in, whichQUAKE_TICreports each frame, faded asS_UpdateAmbientSoundsdid. Quake's music was CD audio, not in the pak: droptrack02.ogg…track11.oggintomusic/(or pick that folder) and each map plays itsworldspawntrack; without them a synthesised drone fills in.
A port of Firebird DOOM's idea to Quake. The engine is
Electric Firebird (firebird-wasm). The game
data is the Quake shareware episode (id Software, 1996), which may be freely redistributed; drop in a registered
pak0.pak/pak1.pak to play the other episodes. Quake is a trademark of id Software.