Spencer Morris スペンサー・モリス← the streetLet's talk
SM04

NIGHTFALL

FLAGSHIP · 10 MIN
Inventiveness / flagship case study

A ten-operation shooter where every asset is generated

NIGHTFALL is a co-op horde shooter at night in the rain: you and two AI squadmates cross a quarantined district, restore power and hold out for the helicopter. It has ten operations, all built in four days, and no asset store. Every building, gun, infected body, texture and gunshot comes out of a script, and the agents that wrote those scripts never saw a screen. My job was to set the bar, write the rules they worked under, build the tools that let them see their own work, and keep it running at frame rate on a 30 W laptop GPU.

InventivenessTen-operation campaign, all ten operations mergedNov 2026 to nowCreative and technical director; I wrote the contracts and briefs, directed AI agents, reviewed every frame and merged
A horde charging down Mercer Street into the LMG. Recorded for this page with the game's offscreen harness (Sector 7, 24 idle infected placed with --spawn, fire pressed by script), bodycam post on, HUD off.
operations in four days, each built around its own rule change; seven through a second polish pass
lines of game code, Blender build scripts and sound generators
generated models (Blender, headless)
synthesised sound files, no samples
1 NIGHTFALL

Every model, texture and sound comes out of a script

The first commit is not code. It is a contract: what a model file carries, how materials are named, what a texture tile means in metres, where each work stream may write, and a look target in plain words: grounded modern military realism at night, Modern Warfare 2019 night missions, bevelled edges that catch a rim light, wear where hands and boots go, no chunky low-poly. Then a brief per stream: buildings, vehicles, props, weapons, characters, animations, textures, audio.

Models are Blender Python run headless. A GLB carries geometry, UVs, material names and a vertex tint, and no textures; Godot binds each material name to a shared library, so a brick wall on a building and a brick on the ground read the same. Textures are numpy: each material builds a height field first and derives the normal, ambient occlusion, albedo and roughness from the same masks, at physical scale (a brick is 215 by 65 mm on a 2 m tile). Sound is numpy too: band-limited noise, multi-stage envelopes, convolution reverb on synthetic impulse responses, and for the infected a glottal pulse train pushed through vocal-tract formants with jitter and subharmonics. No samples, no recorded voices, no downloads.

The only outside inputs are listed in CREDITS.md: MakeHuman base meshes (CC0), CC0 and CC BY motion capture, and the Barlow fonts. Every stream had to finish by rebuilding everything from its scripts once, clean, to prove the scripts were the source of truth, then look at its own renders and fix what was weak. The briefs say it bluntly: programmer art is a failure.

2 NIGHTFALL

The game renders for agents that cannot see a screen

This laptop runs many agent sessions at once, and nothing may open a window on it. So the first tool was a wrapper, tools/godot_run.sh: a private Xvfb display, a machine-wide GPU lock that agents queue on, and a timeout. Logic runs go headless at about 250 fps. Renders go to the GPU.

On top of that sits a dev harness driven entirely by flags. --at puts the player at a pose on frame 10, --spawn places idle infected, --press presses and releases input actions on given frames, --maim takes limbs off on a physics frame, --sky fires a sky event at a given second, --tower calls air strikes on the tower, and --shot saves a frame from any camera pose. With --fixed-fps 60 the engine steps exactly a sixtieth of a second per frame, so shots on consecutive frames show a muzzle flash or a tracer frame by frame. An agent tuning gunplay could render a burst, read the frames and fix what it saw; one early commit is literally titled "Refine gunplay effects from offscreen video review".

Autoplay is the other half. A bot plays the whole campaign in god mode and ends with a RESULT line: whether it won, the damage the infected dealt by kind of attack, and each survivor's damage taken, downs and kills. The acceptance bar for any change is the same: the script check reports 0 failed, and a god-mode autoplay wins with zero script errors.

The sky war from above the roofs of Halden Square: flares, barrages, flak and lightning fired on a schedule with --sky. Recorded offscreen for this page.
3 NIGHTFALL

Logic authored as Blender node trees runs inside the game

The most inventive piece is a compiler. lab/gn/gn.py builds Blender geometry node trees from Python; gnc.py compiles a field tree into three backends: a GLSL function any shader can include, a compute shader and GDScript. It also asks Blender to evaluate the same tree and saves the outputs, and a checker compares every backend against Blender's own answer. Four experiments went from that lab into the game.

The city around the playable streets is one 362-node tree compiled to 429 statements. It places 5,248 props in 0.21 ms on the GPU, against 480 ms in GDScript, and the far city draws 13 by 13 tiles from the vertex shader with no instance data at all, for about 0.2 ms of GPU. Halden Tower is 9,110 cells with a support graph built from Shortest Edge Paths inside nested Repeat zones: what each cell rests on, what load it carries, what fails next. The GDScript port replays ten strike cases and matches Blender cell for cell over 905 rounds. In the game every explosion reaches the tower, the solver runs on a worker thread at most two rounds ahead of the screen, and the building comes down storey by storey.

The flesh ripple started as a numpy simulation of flesh over bone taking a hit. I fitted a 3,030-weight network to it, wrote the network out as nodes (each layer a Combine Matrix and a Transform Point), and compiled that to a function the character shader evaluates per vertex and per pixel. Nodes and numpy agree to 1.4e-9 m. In the game a bullet hit costs about 1 ms of CPU and each body carries two live hits. The anatomy field answers "what tissue is here" for any point in a body: skin, fat, muscle, bone, organs. When a limb comes off, the cut face on the body and on the flying piece is shaded from that field, so no cross-section is ever modelled.

4 NIGHTFALL

The frame budget on a 30 W laptop GPU

Everything is measured on an RTX 4050 in a Dell XPS 14, power-limited to 30 W, at the panel's 3200 by 2000. The rule for builders is to stay at or below Sector 7: about 10 ms of GPU and about 2,000 draw calls.

The worst CPU cost was one query. Infected that got jostled checked they were still on the navmesh every frame, and that query walks every polygon of the map, all 5,802 of them. With 120 infected charging it took 15 ms of a 16.7 ms physics step. Now each one checks every twelfth frame, or as soon as it has moved 0.8 m since the last check. The horde update fell from 17 to 19 ms to about 6. The same pass trimmed the High preset: three shadow-casting lights instead of six, no SSIL, 64-cell volumetric fog instead of 96, no shadow map for every muzzle flash of an automatic weapon, and infected cast shadows only within 14 m, because past that a shadow at night is not seen. GPU in the 120-infected benchmark went from 36.7 to 27.8 ms.

The second pass was measured per render pass with Godot's --gpu-profile and took the plaza horde benchmark from 28.0 to 14.8 ms. FSR 2 cost about 7 ms at that size plus a 2 ms motion-vector pass over every skinned body, so it went; FSR 1 with SMAA replaced it and High renders sharper at a 0.88 scale. Every small light the camera was inside, such as a tracer leaving the muzzle, had been drawing a full-screen pass; those stopped drawing and the transparent pass fell from about 5 ms to 1.7 in a firefight. Severed limbs draw only their own triangles instead of the whole body with a discard. A Low preset for integrated graphics swaps volumetric fog for analytic fog.

USS Cascadia, the engine room hold, played by the god-mode autoplay bot with three squadmates. Recorded offscreen for this page.
5 NIGHTFALL

Night has to be dark and still readable

A night shooter fails two ways: flat ambient light that looks like dusk, or black frames where nothing reads. The answer was light in the air. Every lamp, flash, fire, tracer and teammate's torch lights the haze around it. That is the airlight integral: light scattered toward the camera along one view ray, with Godot's range window, a Henyey-Greenstein phase and extinction in the haze. With all three it has no closed form. The first version evaluated a small fitted network (3-8-8-1) twice a pixel. The shipped version reads a baked 64 by 32 by 8 table that stores the share of the closed-form chord gathered by the normalised angle the segment subtends at the light. That share is a smooth S-curve, so a small table read with trilinear filtering reproduces it, and because the shader only takes the difference of two reads, a constant error cancels. It is one texture read, and more accurate: mean error 0.001 against the network's 0.009.

The camera itself became part of the look. A bodycam pass adds barrel distortion, colour fringing, rolling-shutter skew, smeared chroma, sensor noise that rises with gain, and auto exposure metered from a 16 by 9 copy of the frame read back asynchronously. The gain shuts fast and opens slowly, between 0.6 and 1.8, so a shot fired in the black safehouse clips white, drops to black behind it and crawls back through grain. Overhead, a sky war runs in the cloud deck: shell bursts, flak streams, stray tracers, lightning, parachute flares that light the street with moving shadows, and a tear in the clouds that widens with the director's intensity.

After the first render review I wrote the visual bar as six tests every frame must pass from the player's eye: under 60% of the frame near black with shapes always reading as silhouettes; no plain surface bigger than about 3 by 3 m; no box props within 3 m; the right material at the right scale; at least three light sources of different colour temperature in view; and something alive in every view.

6 NIGHTFALL

A director paces the horde

The director keeps a single intensity number. Damage to the squad raises it by the amount over 55, a downed survivor sets it to 1, and kills within 6 m add 0.035. It decays by 0.035 a second, faster while resting. In BUILD it trickles in two to four infected every three to six seconds; at 0.95 it peaks; once it has peaked for five seconds and fallen under 0.9 it relaxes for 18 to 30 seconds. Every 75 to 115 seconds a mob of 22 to 32 is called, and specials come on their own clock, stalkers twice as often as anything else.

Feel was tuned the same way, in numbers the player never sees: hit-stop on headshots and severed limbs, positional shake by each gun's punch, shell-shock that muffles and rings after a close blast, a struck bone snapping back over the animation. Infected lose arms and legs above or below the joint and then limp, crawl or fight one-armed. Some tuning went the other way: a fifth fewer infected per rush, double ammo and half the reload times.

Geometry nodes lab: the 9,110-cell support-graph tower collapsing after two strikes, with the solver's round counter overlaid. Transcoded from renders/gn-lab/tower_collapse.mp4.
7 NIGHTFALL

Ten operations built in parallel

With Sector 7 working, the game became a campaign of ten standalone operations, each a level script plus a mission written as a list of steps. The second one built was a ballistic missile submarine adrift in a storm, on a new interior kit of hull shells, bulkheads, watertight doors, pipe runs and flood water. Its best moment was the Dead Boat: the main bus trips, every light and glowing panel dies through a new shader global, and the squad crosses the boat on night vision to reset the breakers while stalkers close in. Night vision got automatic brightness so a bulkhead a metre away is not a white sheet.

That operation turned into the rules for the rest. A rule change beats new scenery. Open on two or three minutes of dread. Holds need a room with shape and a stated reason. One clock per operation, near the end. Dense from the first pass: I had rejected the first submarine walls as "extremely plain, it needs to feel like a submarine", and the rule now is that every space is dressed before anyone sees it.

The other eight were built by agents working in parallel, each in its own git worktree and branch: Lower Manhattan, a bullet train at 285 km/h, the National Mall, a gunship over Al-Qadir, Shinjuku in the rain, a fogged Korean valley, a prison on a rock in a storm and a crashing airliner. Shared engine files took additive changes only, two shared systems (drivable vehicles, far crowds) each had one owner, and nothing merged until its god-mode autoplay won and Sector 7 and the submarine still won after it. All ten are merged, and seven have already had a second polish pass.

The city compiled from one 362-node tree, flown from above into the street. Transcoded from renders/gn-lab/city_flight.mp4.
The learned flesh ripple on a test body at 1/12 speed, with hit parameters overlaid. Transcoded from renders/gn-lab/ripple_hits.mp4.
The anatomy field shading arbitrary cuts through an infected; no cross-section is modelled. Transcoded from renders/gn-lab/anatomy_cut.mp4.
⇄ Route map

How the pieces connect

specifiesbriefsGLB, webp, wavcompiled kernelsframesdrivesrunsrenders and perfRESULTbrancheslessons and the bar1Contracts and briefs2Asset generators3Node-tree compiler4Godot game5Render stack6Offscreen harness7Autoplay and checks8Builder agents9Me, as coordinator
1. Contracts and briefs. CONTRACTS.md, docs/briefs, CAMPAIGN.md, BUILDERS.md: the rules and the visual bar every agent works to
2. Asset generators. Blender headless Python for models, numpy for textures and synthesised audio; 198 models, 498 sounds
3. Node-tree compiler. lab/gn: Blender geometry node fields to GLSL, compute and GDScript, checked against Blender's reference output
4. Godot game. LevelBuilder and InteriorBuilder levels, MissionOp step lists, horde, squad AI, director
5. Render stack. Forward+, volumetric fog, airlight table, bodycam post, FSR 1 and SMAA, sky war
6. Offscreen harness. godot_run.sh: private Xvfb, GPU lock; flags for poses, spawns, inputs, shots, fixed-step frames
7. Autoplay and checks. god-mode bot that reports RESULT, script check, perf numbers
8. Builder agents. one worktree and branch per operation, additive edits to shared engine files
9. Me, as coordinator. set the bar, read the renders, profile, merge
✓ Tickets

Decisions, and what I gave up for them

DECISION01

Generate every asset from scripts

CHOSE
Blender, numpy texture and audio generators under written contracts, with only CC0/CC BY base meshes and motion capture from outside
OVER
asset store packs and AI image services
WHY
Scripts can be rebuilt, reviewed and changed by an agent; a bought asset is a fixed file that never matches the rest. It also keeps licensing clean.
DECISION02

Compile Blender node trees instead of porting them by hand

CHOSE
a compiler from geometry node fields to GLSL, compute and GDScript, checked against Blender's own evaluation
OVER
rewriting each effect in shader code
WHY
Authoring in nodes gives a visual tool for procedural logic, and the reference check turns a port into a test: the tower solver had to match Blender cell for cell before it went in.
DECISION03

FSR 1 and SMAA over FSR 2

CHOSE
FSR 1 upscale with SMAA on High and Ultra
OVER
FSR 2 temporal upscaling
WHY
At 3200 by 2000 on a 30 W GPU, FSR 2 cost about 7 ms plus 2 ms of motion vectors over every skinned body and moved tonemap and glow to output resolution. That was half the budget for a sharper image the bodycam pass softens anyway.
DECISION04

A baked table over a fitted network for airlight

CHOSE
a 64 x 32 x 8 table of the normalised scattering integral
OVER
evaluating a 3-8-8-1 network twice per pixel
WHY
One texture read instead of two network evaluations, and nine times lower mean error.
DECISION05

Offscreen, deterministic verification

CHOSE
a flag-driven harness, fixed-step rendering and a god-mode autoplay bot that reports RESULT
OVER
playtesting in a window
WHY
Agents need to check their own work without a screen on a shared laptop, and a scripted run can be repeated after every change.
DECISION06

Worktrees for levels, shared checkout for assets

CHOSE
one worktree and branch per operation, additive-only edits to shared engine files, merges by a coordinator
OVER
the shared checkout that worked for the asset streams
WHY
Asset streams wrote to disjoint folders. Levels all touch the same engine files, so they need isolation and a review before merge.
⏱ Timetable

Timeline

  1. Asset contracts, material library, Blender kit and briefs for the work streams
  2. Playable Sector 7: squad AI, the director, missions, HUD and every generated asset
  3. Cover, dismemberment, ragdolls and gunplay tuned from offscreen video review
  4. Geometry nodes lab: the node-tree compiler and four runtime tests
  5. Flesh ripple, cut anatomy, Halden Tower and the far city brought into the game
  6. Navmesh fix and leaner High preset: horde update 17 to 19 ms down to about 6
  7. Airlight haze, bodycam lens and auto exposure
  8. FSR 1 and SMAA, baked airlight table: 28.0 to 14.8 ms GPU
  9. Sky war in the clouds and the rip
  10. USS Cascadia and the Dead Boat blackout
  11. CAMPAIGN.md and the builders' visual bar; eight operations build in parallel
  12. All ten operations merged; Operation Overwatch, the gunship, lands last
Godot 4.7 (Forward+, Jolt)GDScriptGLSLBlender 5 headless Pythonnumpy (textures, audio, training)MPFB2 base meshesFSR 1 + SMAAXvfb offscreen harness
Sources and method

Written from the project's code, documentation and commit history, reviewed in November 2026. Business figures come from me. Clips and screenshots are labelled with where they came from; none show customer data.

  • README.md
  • CAMPAIGN.md
  • BUILDERS.md
  • CONTRACTS.md
  • CREDITS.md
  • lab/gn/README.md
  • docs/briefs/
  • tools/godot_run.sh
  • tools/airlight/bake.py
  • game/scripts/game/director.gd
  • game/scripts/actors/horde.gd
  • game/scripts/actors/bodycam.gd
  • game/scripts/dev/harness.gd
  • git log (commits 57e2f95, c9dd684, 2ddd284, 9dccd3d, df028e2, 34992a8, 5b284bd, aa3f3fd, 16efaf8, 8f74fbf, 33e2dd8, 7fc38d4)