Demos
Server-side match recording in the .shagdemo binary format. Lobby-hosted demo listing. Client-side playback with a cinematic mode.
Recording
The dedicated game server records every match by default. Recording is:
- Server-side — the client is never the recording authority.
- Tick-aligned — every player input and every entity state delta is captured per tick.
- The match only — recording spans the active match and stops as the post-game begins, never warmup or countdown, so a demo opens on the first shot rather than on people idling at spawn.
- Binary format —
.shagdemois the on-disk format. Compact; not human-readable. Decoded byDemoReader.
Recordings land in public/data/demos/ on the game server's filesystem — the recorder takes an outputDir if a deployment wants them elsewhere, though the lobby scans that fixed path when it builds the list it serves to clients.
Listing Demos
demolist # All recent demos from the lobby
demolist aerowalk # Filter by map name
demolist <player_name> # Filter by player participationOutput is a formatted table. The cached list is also used by demo and demoplay for shorthand-numeric demo selection.
Loading a Demo
demo 1 # Load #1 from the last demolist
demo aerowalk_duel_20260319.shagdemo # Load by filenamedemo only loads — it doesn't start playback. Use demoplay for that.
Playback
demoplay # Start normal playback from the beginning
demoplay cinematic <minutes> # Generate + play a highlight reel
demoplay analyze # Print the highlight detection output
demoplay hud <on|off|toggle> # Control demo presentation overlays
demoplay stop # Stop active playbackNormal playback
The demo loads as a tick stream. The client replays recorded snapshots through the game's render path, including player models, weapon view and effects. Choose a player from the POV controls to follow their first-person view. The game HUD follows their recorded health, armor, ammo, frag count and match state.
A demo opens with the players' names over its first three seconds of play, as a highlight reel's title card shows them, and they fade as the match gets going. At the last frame the picture fades to black under an end card: the winner, read from the final scores, and the demo's frags and length. For a team match it also names the top fragger. Replay watches it again from the start and Exit leaves playback. The recording stops as the post-game begins, before the last round counts towards the match score. So where the round wins stand level at the end and each side is one player, as in Amphi, the frags of that last round decide the winner. Teams that stand level get no winner.
Playback is driven on screen rather than by console commands: the transport HUD carries a timeline you can click anywhere on to seek, a play/pause button, and a speed selector cycling 0.25×, 0.5×, 1×, 2× and 4×. Seeking rebuilds the world at the landing tick rather than fast-forwarding through it.
Keys
| Key | Demo | Highlight reel |
|---|---|---|
| Space | Play or pause | Play or pause |
| ← / → | 5 seconds back or on | Previous or next shot |
| , / . | One frame back or on (pauses) | |
| ↑ / ↓ | Faster or slower, through 0.25× to 4× | |
| P / N | The previous or next frag, from two seconds before it | |
| Tab (hold) | The scoreboard | |
| Q / E | The previous or next player's eyes | |
| 1 – 9 | That player's eyes, in the bar's player order | |
| H | Clean view: hide the overlays, chat and pointer | Same |
| Escape | Leave playback | Leave playback |
Keys held down repeat for the arrows and frame steps only. While you fly the free camera, Space and the arrows move it instead.
The bar's HUD button controls the game HUD seen from the followed player's eyes; it dims during camera shots that are not first-person. The playback bar fades when idle and reappears when you move the mouse. You can also minimize it to a strip.
H and demoplay hud on|off|toggle switch the clean view: the playback overlays, replay chat, exit plate and mouse pointer go, leaving just the picture for screen recording. Press H again to bring them back; Escape still leaves playback. This is separate from the HUD button.
The gold exit plate at the top-left or Escape leaves playback. When you launched it from the lobby, this returns you to the lobby. Loading another demo or starting a live match also cancels the old playback.
Cinematic mode
demoplay cinematic 2 analyses the demo for highlight moments (kills, multi-kills, airborne kills, streaks, first blood and standout movement) and assembles a 2-minute auto-edited reel with camera tracking, dramatic angles, and slow motion on key events.
Cinematic playback uses the same control bar, with previous / next shot buttons instead of manual POV selection and playback speed. Its timeline skips to a shot in the reel. A reel opens on a title card and closes on an end card; see Demo Cinematic Mode. It can cut between first-person action, free-camera views and slow-motion replays; the game HUD appears only for first-person shots.
The analyser runs as DemoService.analyzeLoadedDemo() and outputs a list of timestamped highlights with scores. demoplay analyze prints this list without starting playback — useful for debugging the heuristics.
Stop / cleanup
demoplay stop cleanly halts playback, releases the viewer/renderers/HUD, clears the followed target, and returns the camera to neutral freefly. Demo-owned viewmodel cameras, lights, scene observers, and input listeners are released as well. The currently-loaded demo stays loaded — you can demoplay again to restart, or demo <other> to load a different one.
File Format Reference
.shagdemo is decoded by src/shared/demo/DemoReader.ts, driven client-side by src/games/fps/client/DemoService.ts. Key fields per tick:
- Player state per tick — position, velocity, view angles, health, movement state
- The commands the server applied (format version 3): buttons, view angles, wish direction and weapon slot, per player, per frame. Commands arrive faster than frames are written, so buttons are OR-ed across the interval — a press between two snapshots is never lost — while the analogue fields keep the value they ended on. Recordings from before version 3 carry state only
- All entity state deltas (position, velocity, health, animation state)
- Server events (kills, pickups, match-state transitions, chat, weapon fire, projectile impacts, chain arcs) — captured verbatim, so replays show the full action and the match chatter at the right moments.
Deterministic re-simulation checks use a separate .shagverify bundle, not an ordinary .shagdemo playback file. npm --prefix src/games/fps run demo:verify -- <bundle.shagverify> replays that bundle's commands and checks its recorded checksums.
For the full format, read src/shared/demo/DemoReader.ts.
Finding demos outside the console
The lobby's Demos page lists the same recordings without the console, except recordings shorter than two minutes: no board or search shows them, though the files are kept. Three boards sit at the top:
- Featured — a server-selected handful: one large, the rest in a list beside it. The server prefers this week's recordings with a player from that mode's 30-day top ten, then this week's multiplayer matches, and when the week has none, the newest multiplayer matches of any age. Private rooms count; campaign missions do not.
- Latest — the newest 64 recordings, six to a page.
- Yours — the ones you played in, matched on the verified account from your seat and the stored match result, never on a display name. A lobby server that cannot prove ownership leaves it switched off.
The mode keys at the top right filter every board. Latest and Yours also take a search by player or map. ▶ Watch plays a recording from the start; ⚡ Highlights asks for a length and cuts the recording down to 1, 2 or 3 minutes of its best moments. The arrow beside it opens Export video.
A card shows what a recording's header holds: the map, the mode, who played, how long it ran, when, and its size. The header has no final score, so a card shows none.
Video export
Export a saved recording's highlights to a video file. Leave any live match, then choose Export video from the arrow beside a recording's Highlights. For an already loaded recording, run videoexport. Export is available in release builds with developer 0; rendering, encoding and temporary video storage run locally in your browser.
Choose a 1, 2 or 3 minute highlight target, then Generate video. The same source-length limits as preview apply: at least 3, 6 or 9 minutes respectively. The finished movie includes title, shot and closing cards, so its exact length can differ from the target. Output is 1920×1080 at 60 FPS, SDR H.264 video and 48 kHz stereo AAC audio in MP4. A highlight reel leaves out chat and the gameplay HUD; a full match keeps them.
Background music defaults to <none> for game audio only. Choose any packaged OST song for the main soundtrack, with game sounds layered over it. Start from selects the position in the song, as seconds, m:ss or h:mm:ss (for example 1:23.250). Music plays continuously at normal speed across cuts and slow motion, with a short fade in and out. With a song chosen, each cut between two scenes moves onto the nearest beat of the song (up to 0.35 seconds earlier or 0.65 later; a scene ending later runs on into its slow orbit). A song without a steady beat leaves the cuts where they were. In a highlight reel it stops at the end of the movie or song and does not loop; a full match carries on with the game's songs. The start timestamp must be before the song ends. Selected music uses a fixed 80% gain; game sounds play underneath at 35% of their game-audio-only level. The combined mix retains clipping protection.
Full match
Open Advanced and set Video to Full match with game HUD to record the whole match through one player's eyes, as they played it. Follow player lists the recording's players. The video runs from the recording's first frame to its last at normal speed, in that player's first-person view, with the game's own HUD drawn into every frame: vitals, weapons and ammo, the timer and score, the kill feed, chat, frag and pickup messages, and the crosshair. It opens with the players' names over its first three seconds and ends as demo playback does: five more seconds that fade to black and hold the end card, without its keys. When the player dies, the video follows the death camera as demo playback does. The HUD's animations and timers run on the movie's clock, so they play at their real speed however long a frame takes to render.
Output is 1920×1080 at 60 FPS, H.264 at a 12 Mbit/s target, with 48 kHz stereo AAC game audio. Background music works as for a highlight reel, at the same levels. When the chosen song ends, the game's own playlist follows as it does in a match: its songs, without the one chosen, in a shuffled order that comes round again, with no gap between songs, until the video ends. The music fades out over the last second and a half of the end card. The recording must be between 10 seconds and 20 minutes long; the video is five seconds longer. Rendering takes about three and a half times the match's length on a desktop GPU: a 10-minute match takes about 35 minutes. Game audio is mixed after the picture, in 30-second pieces, and added to the finished file, so temporary storage briefly holds two copies of the video. The file is saved as <recording>-<player>-match.mp4.
Generation uses an isolated WebGL2 scene and leaves the original recording loaded in its viewer. Camera motion follows movie time through shader compilation waits; audio preparation and video rendering must agree on the camera path. Keep the export window visible. Cancel stops an active job; Discard video releases a finished result. Close is protected while a job is active or its result has not been downloaded or discarded.
After generation, click Download and choose a destination. Cancelling or failing a save keeps the finished video available for retry. The file picker requires a supported desktop Chromium browser and a secure context. Temporary browser storage must have enough space for the encoded movie, in addition to the destination copy. A browser-download fallback supports files up to 64 MiB and reports Download started, since it cannot confirm destination close.
A highlight export is bounded to four minutes of movie, 768 MiB of encoded temporary data and twenty minutes of processing. A full-match export is bounded to twenty minutes of movie, twice its expected encoded size (at least 768 MiB) and thirty minutes plus six times the match's length of processing. It stops on missing required sounds, unresolved projectile state, inconsistent traversals or graphics-context loss. WebGPU and other browser families are outside the development acceptance target.
Limits
- Seeking and playback speed are on the demo HUD only; the console has no jump-to-tick or speed command.
- Demos stay on the lobby that recorded them: there is no upload or sharing between lobbies.
- Every lobby match is recorded; there is no opt-out (see the terms of service).
