/**
* Photograph the engine, for the pages that describe it.
*
* node scripts/brand-assets/shots.mjs # everything, full size
* node scripts/brand-assets/shots.mjs --only fidi-night,office-floor
* node scripts/brand-assets/shots.mjs --preview # fast, 1x, PNGs to look at
* node scripts/brand-assets/shots.mjs --manifest-only # captions only, no browser
* node scripts/brand-assets/shots.mjs --list # what a run would shoot, no browser
*
* `capture.mjs` next door makes the two share cards. This makes the product
* imagery: the pictures on lumbridgecorp.com/simulate that show what the thing
* looks like. Same harness, different framing — see `harness.mjs`.
*
* ### Why these are renders and not illustrations
*
* Every image this writes is a screenshot of the built `dist/` in this repo at
* the commit named in the manifest. Nothing is composited, retouched, or drawn.
* That is the whole point: /simulate/tera claims the sun is computed from your
* clock and the city lights come on as it sets, and the honest way to
* illustrate that claim is a photograph of it happening, taken by a script
* anyone can re-run. `og.png` on lumbridgecorp.com spent a month advertising a
* headline the site had stopped using, because it was a hand-made picture of a
* page rather than a render of one. This is that lesson applied to the art.
*
* ### The two outputs
*
* **The site.** `--site
` (default: the sibling `lumbridge-v4` checkout)
* gets web-sized WebP into `apps/web/public/shots/` and a generated TypeScript
* manifest into `apps/web/src/data/shots.ts`. The captions travel *with* the
* images, in the manifest, so a page cannot show a caption for a picture that
* was reframed underneath it. If the directory is not there — which is the
* normal case for anyone who cloned this repo on its own — the step is skipped
* with a note, because the site is Lumbridge's consumer of this script and not
* a dependency of it.
*
* **The archive.** A dated folder under `shots/` keeps the full-resolution
* frame of every shot from every run. Nothing reads it. It is there because the
* cities keep changing and a render of the Bay from August is not recoverable
* once the heightfield moves — the manifest can be regenerated, the past
* cannot.
*/
import { fileURLToPath } from "node:url";
import { dirname, join, resolve } from "node:path";
import { mkdir, writeFile, access } from "node:fs/promises";
import { execFileSync } from "node:child_process";
import { serve, launch, clockShim, FURNITURE, hide } from "./harness.mjs";
const HERE = dirname(fileURLToPath(import.meta.url));
const ROOT = join(HERE, "..", "..");
// ---- The shots --------------------------------------------------------------
/**
* `chapter` is an index into the chapter list, because that is all the DOM
* offers — `renderLegend()` in `main.ts` builds the buttons from the city pack's
* array and binds each to `flyToIndex(i)`, with no id on the element. `expect`
* is the `shortLabel` that index is supposed to be, asserted before the shutter
* opens. A city pack is data, and data gets reordered; without the assertion a
* reordered pack silently reframes every picture on the site and captions them
* with the old names.
*
* Every shot is taken **twice from the same camera**, once by day and once at
* night, and the site loads the one that matches the theme the reader is in —
* the daylit frame on the light page, the night frame on the dark one, so the
* picture is in the same light as the page around it. One camera and two clocks
* also happens to be the cheapest possible demonstration of the thing these
* pages claim hardest: the sun is computed from a real time, not painted on.
*
* Times are local to the city and are chosen, not defaulted. Midday is the
* worst light a heightfield ever gets — the sun is behind the camera, nothing
* casts, and 83k buildings read as gravel. The daylight frames are taken in the
* morning or late afternoon for the same reason a photographer would; the night
* frames sit around sixteen degrees below the horizon, which is dark enough for
* the window lights to carry the picture and not so dark that the ground has
* gone.
*
* `aim` is the optional second half of a camera, for the seven subjects the
* chapter list has no button for — SFO, LAX, both bridges, the drivable freeway,
* the state board's relief and the open Pacific. The chapter chooses the
* *stance* (how far back, how high, from which side); `aim` slides the orbit
* target onto a coordinate and adjusts the standoff and the angles from there.
* See the long note beside `aimAt` for how each number reaches the engine, and
* for why the chapter under an aimed shot is chosen so that the blurb still in
* the panel is true of the frame.
*
* `play` is the third camera, and the only one that is not a camera at all: it
* asks the app for a **body**. The three shots that carry it are pictures of an
* agent doing something — the chase camera behind the EV, the crow in the air,
* the aircraft on the corridor — and in those three the play HUD is the subject
* rather than clutter. See the long note beside `enterPlay`.
*/
const SHOTS = [
{
id: "bay-relief",
door: "tera",
city: "sf",
chapter: 0,
expect: "Whole Board",
place: "San Francisco Bay Area",
caption:
"Everything else in the engine stands on this heightfield: 83 named hills, four octaves of value noise, and overlapping peaks combined as tallest-plus-35%-of-the-rest — the one rule that makes a run of summits read as a ridge instead of stacking into a fictional mountain.",
day: {
at: "2026-08-06T09:10:00-07:00",
note: "Ten past nine, sun thirty degrees up: high enough that the marine layer has burned back off the bay, low enough that the East Bay hills still rake shadow west across the flats.",
alt: "The San Francisco Bay Area seen from above in mid-morning light, the peninsula and the East Bay hills casting shadows west, scattered cloud over the water.",
},
night: {
at: "2026-08-06T21:35:00-07:00",
note: "Twenty-five to ten, and the same board is a scatter of lit ground between two dark ranges — the shape of the region is now where the cities are, not where the hills are.",
alt: "The same view of the Bay Area at night, the built-up ground picked out in clusters of light between dark hills and darker water.",
},
},
{
id: "soma",
door: "tera",
city: "sf",
chapter: 2,
expect: "SoMa",
place: "SoMa, San Francisco",
caption:
"South of Market, where the grid turns forty-six degrees and the blocks get long. About 83,000 buildings are on screen here, drawn as instanced geometry on street bearings the city pack declares per district.",
day: {
at: "2026-08-06T17:20:00-07:00",
note: "Twenty past five.",
alt: "Downtown San Francisco south of Market in afternoon light, towers clustered on a street grid turned at an angle to the rest of the city.",
},
night: {
at: "2026-08-06T21:35:00-07:00",
note: "Twenty-five to ten. Nothing about the geometry changed — only the hour the page was asked for.",
alt: "The same towers south of Market at night, windows lit in a scatter across every face.",
},
},
{
id: "fidi",
door: "tera",
city: "sf",
chapter: 3,
expect: "FiDi",
place: "Financial District, San Francisco",
caption:
"The old money and the venture money, stacked between Montgomery and the Embarcadero under the pyramid, with the Bay Bridge running out to the right.",
day: {
at: "2026-08-06T10:10:00-07:00",
note: "Ten past ten in the morning, sun forty-four degrees up.",
alt: "The San Francisco financial district from above in mid-morning light, the pyramid among the towers and the Bay Bridge crossing to the right.",
},
night: {
at: "2026-08-06T21:40:00-07:00",
note: "Twenty to ten, sun sixteen degrees below the horizon. The lights are not a night theme — they are emissive window faces chosen from a seeded RNG as the computed sun goes down. The moonlight carrying the ground is about five orders of magnitude brighter than the real moon-to-sun ratio, deliberately: the honest number renders a black rectangle.",
alt: "The San Francisco financial district at night, tower windows lit from within and the ground reading dark blue rather than black.",
},
},
{
id: "peninsula",
door: "tera",
city: "sf",
chapter: 6,
expect: "Peninsula",
place: "The Peninsula",
caption:
"Twenty miles of city between the water and the ridge, never more than four wide. The camera is about 32 km back — the city scene's orbit limit — which is why the region ships as five chapters rather than one impossible wide shot.",
day: {
at: "2026-08-06T09:20:00-07:00",
note: "Twenty past nine, with an aircraft on approach drawing the line across the bay.",
alt: "The San Francisco peninsula from above in morning light, the Santa Cruz mountains on one side, the bay on the other, and an aircraft trail crossing the water.",
},
night: {
at: "2026-08-06T21:35:00-07:00",
note: "Twenty-five to ten, and the ridge is legible only as the edge the lights stop at.",
alt: "The San Francisco peninsula at night, a band of lit ground between dark water and a darker mountain ridge.",
},
},
{
id: "socal-dtla",
door: "tera",
city: "socal",
chapter: 1,
expect: "DTLA",
place: "Downtown Los Angeles",
caption:
"The second city pack, on the same engine and the same renderer. A city is pure data — coastlines, hills, district street bearings, landmarks and camera chapters in one file with no code in it — so adding one is a reviewable contribution rather than a fork. The camera is square to downtown's grid, which is why everything else in the frame looks crooked.",
day: {
at: "2026-08-06T18:10:00-07:00",
note: "Ten past six, the San Gabriels standing behind the basin.",
alt: "Downtown Los Angeles from above in late afternoon light, the river running past the tower cluster and the San Gabriel mountains behind the basin.",
},
night: {
at: "2026-08-06T21:20:00-07:00",
note: "Twenty past nine. The basin is the one place on either board where the lit ground runs to the edge of the frame in every direction.",
alt: "Downtown Los Angeles at night, the tower cluster lit and the surrounding basin covered in light to the horizon.",
},
},
{
id: "sfo",
door: "tera",
city: "sf",
chapter: 6,
expect: "Peninsula",
aim: { lat: 37.6189, lng: -122.375, zoom: -5, azimuth: 180, elevation: 10 },
place: "San Francisco International",
caption:
"An airport is composed rather than modelled — runways, taxiways, aprons and massed terminals, with the markings painted into a canvas instead of built — because the pattern of the runways is what the eye recognises from altitude, long before any building does. SFO's two pairs are laid from true bearings and not from the numbers painted on them: the 28s point 298.6°, the 01s 26.5°, and they cross at 92.1°. A designator is magnetic and rounded to ten degrees, so building from the paint would have laid the whole airport thirteen degrees out.",
day: {
at: "2026-08-06T17:20:00-07:00",
note: "Twenty past five, the light running along the runways rather than across them. The 28 thresholds sit about seventy metres inside the bay edge this pack traced long before the airport did — that outline was drawn with “the runways are built out onto the mud” written on the vertex, and now they are.",
alt: "San Francisco International Airport from above in late afternoon light: two pairs of runways crossing at close to a right angle on made ground, a horseshoe of terminals with aircraft parked around it, and the bay beyond.",
},
night: {
at: "2026-08-06T21:35:00-07:00",
note: "Twenty-five to ten, and the only thing on the field that has not gone dark is the paint. The markings use an unlit material deliberately — a lit one dims into the concrete at dusk, and an emissive one would be a claim about approach lighting nobody has modelled — so after sunset the airport is a diagram of itself.",
alt: "The same airport at night, the concrete gone dark and the painted runway markings still bright, so the pattern of the field reads as pale lines on black.",
},
},
{
id: "golden-gate",
door: "tera",
city: "sf",
chapter: 10,
expect: "Marin",
aim: { lat: 37.8205, lng: -122.479, zoom: -5, azimuth: 60, elevation: 12 },
place: "The Golden Gate",
caption:
"One kit draws both of the Bay's crossings, because a suspension bridge is arithmetic over a path and a list of towers: a main cable hanging between the tower tops, a regular series of hangers down to the deck, and piers under every metre that hangs from nothing. Here that resolves to two cross-braced towers 227 m over the strait, one main span, and international orange. Every reach is classified before it is drawn — the previous builder hung a catenary between every pair of towers, which is how the Bay Bridge ended up with a two-and-a-half kilometre span over dry land.",
day: {
at: "2026-08-06T17:40:00-07:00",
note: "Twenty to six, raking down the strait, so the towers throw along the deck and the bridge puts its own shadow on the water. The road does not stop at the anchorages: both ends run onto land, because started at the waterline the deck appeared to float with its approaches missing.",
alt: "The Golden Gate Bridge from above in late afternoon light, international orange, its two towers cross-braced and the main cable sagging to mid-span between them, with the Marin headlands on one side and the Presidio on the other.",
},
night: {
at: "2026-08-06T20:50:00-07:00",
note: "Ten to nine, sun seven and a half degrees under — nautical twilight, and an hour earlier than every other night frame here. That is not a preference. The other nine are cities, and a city at half past nine is carried by its own windows; a bridge over open water has none, so the hour that works everywhere else renders this one as a black rectangle. What is left at this one is the residual sky, the deck lamps, and orange going to brown.",
alt: "The same bridge in deep twilight, the international orange darkened almost to brown, the towers and cables silhouetted against the last light on the water.",
},
},
{
id: "bay-bridge",
door: "tera",
city: "sf",
chapter: 11,
expect: "The Bay",
aim: { lat: 37.7995, lng: -122.3775, zoom: -5, azimuth: 24, elevation: 16 },
place: "The Bay Bridge",
caption:
"The same kit, given the real 2013 topology: two suspension towers west of Yerba Buena, one east, and a piered causeway into Oakland. The classifier is the whole difference between this and the Golden Gate — a reach no cable could hold up gets a deck on piers instead, and a pier is skipped wherever the ground has already come up to meet it, which is what lands the crossing on the island rather than standing it on stilts over the top. Towers, cables, hangers and piers merge into two draw calls: the painted structure, and the roadway on it.",
day: {
at: "2026-08-06T17:40:00-07:00",
note: "Twenty to six, looking north-east from off the city. One crossing, three different answers to the same water: two suspension spans off the waterfront, a single tower east of Yerba Buena, and a causeway on piers running out toward an Oakland that is past the top of the frame.",
alt: "The Bay Bridge from above in late afternoon light, leaving the San Francisco waterfront over two suspension spans, crossing Yerba Buena Island and continuing east on piers toward Oakland.",
},
night: {
at: "2026-08-06T21:35:00-07:00",
note: "Twenty-five to ten, and only one of the two shores it joins is in the frame. The deck leaves San Francisco's lit ground and runs north-east over water with nothing on it, so what carries the structure at this hour is the silhouette of the towers and the cable rather than the crossing.",
alt: "The same crossing at night, the lights of San Francisco filling the lower left and the bridge leaving them as a dark line over unlit water.",
},
},
{
id: "pacific-sea",
door: "tera",
city: "sf",
chapter: 6,
expect: "Peninsula",
aim: { lat: 37.762, lng: -122.53, zoom: -4, elevation: -16 },
place: "The Pacific, off Ocean Beach",
caption:
"The sea is a surface rather than a colour. Two samples of one tangent-space swell map, the second 2.6× smaller and turned 63°, so no crest holds its shape and the water never resolves into a repeating weave; a Fresnel term that leaves 60% of the body colour when you look straight down into it and all of the sky at grazing; and a specular lobe narrow enough that the sun comes back as a broken path instead of a mirror disc. The swell's wavelength is not physical and could not be — real swell at these scales is a fraction of a screen pixel — it is tuned until the glitter lands at a handful of pixels a tile.",
day: {
at: "2026-08-06T19:30:00-07:00",
note: "Half past seven, sun seven degrees up and almost dead ahead of the camera, which is the only geometry in which a glitter path exists at all. Turn ninety degrees and this water is flat blue.",
alt: "The Pacific seen from low over the San Francisco peninsula at sunset, the sun's reflection broken into a bright path running to the horizon, with the coastline in the corner of the frame.",
},
night: {
at: "2026-08-06T21:20:00-07:00",
note: "Twenty past nine, sun twelve degrees under, and the specular lobe has not gone anywhere — there is simply something else in it. The moon lays the same broken path across the same swell, orders of magnitude down, and the coast is now the brightest thing in the frame.",
alt: "The same stretch of ocean after dark, the moon's reflection broken into a path across the swell, the lit edge of the city along the bottom of the frame.",
},
},
{
id: "california-relief",
door: "tera",
city: "california",
chapter: 0,
expect: "State",
place: "California",
caption:
"A third board, and the first that is a state rather than a city: 428 units across at 1,919 metres to the unit, which is the same heightfield code the Bay Area runs at 94. The Central Valley is the flat green band between the Sierra crest and the Coast Ranges; the Basin and Range steps away east of the Sierra, Death Valley is the pale pan below sea level inside it, and the Salton Sea is the water in the south-east corner. Adding a board is a data contribution — coastlines, ranges, roads, landmarks and chapters in one file with no code in it.",
day: {
at: "2026-08-06T17:30:00-07:00",
note: "Half past five, and every ridge in the Basin and Range is throwing its shadow east. That is the hour the steps between them separate at all: at midday the sun is behind the camera and the whole state is one sheet of sand.",
alt: "The state of California rendered from above as a relief board in late afternoon light, the Sierra Nevada and the Coast Ranges either side of the Central Valley, the Basin and Range stepping east into shadow, and the Salton Sea in the south.",
},
night: {
at: "2026-08-06T21:10:00-07:00",
note: "Ten past nine, and the relief has gone. What is left is the state's other shape: two clusters of light six hundred kilometres apart, with the corridors between them drawn by the ground that is lit along them.",
alt: "The same board at night, the land dark and the built-up ground picked out around Los Angeles and San Francisco.",
},
},
{
id: "freeway",
door: "tera",
city: "california",
chapter: 1,
expect: "101",
/*
* Short, and the ceiling is not comfort — it is the end of the road.
*
* The chase camera follows a car that has been driving since the page
* loaded, so the wait chooses the stretch. At about twenty seconds the EV
* reaches San Francisco, the app swaps to the Bay Area board, and the shot
* is of a different product entirely; at about twelve it is passing through a
* town, where a metre-scale road runs between buildings drawn at 1,919 m to
* the unit. This lands it in open oak country with both carriageways in the
* frame.
*/
settle: 3000,
place: "US-101, the Salinas Valley",
caption:
"The one corridor you can drive, built at one metre to the metre on a board that is otherwise 1,919. The cross-section is what makes it read as a road: verge, shoulder, a solid edge line, lane dividers, a median. Everywhere else on a board that is a single texture on one ribbon, with the v axis carrying distance so a dash cycle comes out 24 metres long whatever the board's scale is; here it is eight ribbons a carriageway, because at a chase camera's height an embankment has to have a side to it. The unbadged Lumbridge EV ahead is on the asphalt, not gliding above it.",
day: {
at: "2026-08-06T09:00:00-07:00",
note: "Nine in the morning, the sun across the carriageway rather than down it, so the median and the shoulders have an edge. The speed on the readout is the simulation's, not a caption.",
alt: "A divided freeway seen from a chase camera above and behind a dark car, with dashed lane markings, solid edge lines, shoulders and a median, running through dry hill country.",
},
night: {
at: "2026-08-06T21:30:00-07:00",
note: "Half past nine, and the markings are doing the work they are actually for.",
alt: "The same freeway at night, the lane markings and edge lines catching what light there is, the hills either side almost black.",
},
},
{
id: "lax",
door: "tera",
city: "socal",
chapter: 2,
expect: "Westside",
aim: { lat: 33.9425, lng: -118.4081, zoom: -1, azimuth: 40, elevation: 16 },
place: "Los Angeles International",
caption:
"The same airport kit, on the second city pack, producing an airport nobody would mistake for the first: four parallels, two either side of the terminal horseshoe, instead of two crossing pairs. The property is a cardinal rectangle — Westchester Parkway north, Imperial Highway south, Aviation Boulevard east, the dunes above Dockweiler west — with the runway pattern set about seven degrees off it, and that disagreement between the fence and the pavement is the thing that reads as LAX from altitude.",
day: {
at: "2026-08-06T17:50:00-07:00",
note: "Ten to six, with the basin's grid running out to the San Gabriels behind and the Santa Monica Bay in front. The traffic overhead is the real traffic: registration and type come off the same feed.",
alt: "Los Angeles International Airport from above in late afternoon light: four parallel runways either side of a horseshoe of terminals, the street grid of the basin all around it and the Pacific beyond.",
},
night: {
at: "2026-08-06T21:20:00-07:00",
note: "Twenty past nine. This is the one board where the lit ground runs to the edge of the frame in every direction and the airfield is the hole in it.",
alt: "The same airport at night, its dark field surrounded by the lights of the Los Angeles basin running to the horizon.",
},
},
/*
* ---- The three that take a body ----------------------------------------
*
* Everything above is a camera looking at the world. These three are the
* world being *driven*, and they exist because /arena needs a picture of each
* spatial environment actually running: `drive-101-v1`, `crow-nav-v1` and
* `california-flight-v1` are scored against Tera's vehicle, actor and
* aircraft controllers, and the play HUD across the top of each frame is the
* observation those environments are built out of.
*
* They replace three hand-made screenshots. Those were the last pictures on
* lumbridgecorp.com that no script could reproduce, which meant they were also
* the last pictures nobody could re-shoot when the engine moved: all three
* still showed a left column with "Explore as your crow →" in it, a "FULL
* VIEW" badge no visitor to the site ever sees, and a single daylight frame
* served to dark-mode readers as well. Being a script is the point of them.
*/
{
id: "drive-101",
door: "tera",
city: "california",
chapter: 1,
expect: "101",
/*
* A place on the leg, not a number of seconds, and `freeway`'s `settle: 3000`
* next door is the argument for it: the traffic simulation has been running
* since page load, so a duration is only ever "boot plus a bit" and boot is
* not a constant. The same nine seconds put this car at 55% of the leg in a
* 1x preview and 69% in the 2x render, which is a different stretch of road
* — the second one had the edge of a town across the top of the frame, where
* buildings drawn at 1,919 m to the unit stand beside a road built at one.
*
* 55% is open oak country with both carriageways in the frame and other
* traffic on them, which is the picture: an agent alone on a road is not
* being asked anything.
*/
play: { mode: "drive", expect: "Drive", untilProgress: 0.55 },
place: "US-101, at the wheel",
caption:
"Taking the body is an input the app already accepts: the Drive button on the dock hands the vehicle controller the held keys and the follow camera, and the strip across the top is that controller reporting itself — speed, which road, whether the assist or a person is steering, how far along the leg, which camera. It is the same state Arena's drive-101 environment builds its observation out of, drawn for a human rather than serialised for a policy, which is the whole claim these pictures exist to make: the environment is this, running, and not a diagram of it. The unbadged Lumbridge EV is on the asphalt of the one corridor built at a metre to the metre, on a board that is otherwise 1,919 metres to the unit.",
day: {
at: "2026-08-06T09:00:00-07:00",
note: "Nine in the morning, the sun across the carriageway rather than down it, so the median and the shoulders keep an edge under the car. Everything on the readout is the simulation's own number — 56 mph is what the controller is doing, not a figure somebody typed into a mock-up.",
alt: "A chase camera above and behind a dark car driving a divided freeway through dry oak country, another vehicle further down the same carriageway, and a heads-up strip across the top of the frame reading its speed, the road name, the assist state and the route progress.",
},
night: {
at: "2026-08-06T21:15:00-07:00",
note: "Quarter past nine, and this corridor at night is what a car on an unlit road actually is: two tail lamps, the markings taking the light back, and a second set of lamps up the carriageway. Nothing here is lit that would not be — the hills either side of US-101 have nothing on them to switch on, which is exactly the argument for shooting the crow over a city instead.",
alt: "The same chase camera at night, the car reduced to its tail lamps with the lane markings and edge lines catching what light there is against black hills, and the same heads-up strip along the top.",
},
},
{
id: "crow-nav",
door: "tera",
city: "sf",
chapter: 0,
expect: "Whole Board",
/*
* The Bay Area board rather than California, which is where the hand-made
* original was taken. Two reasons, and the second is the one that decides it.
*
* The crow is authored at about a metre. On the state board a metre is
* 0.0005 of a scene unit and the frame around it is bare ground drawn at
* 1,919 m to the unit, so the original is a bird in front of a featureless
* sand-coloured wall with one oak the size of a hill behind it — the same
* scale mismatch the `freeway` note warns about, and it reads as a rendering
* fault. On the Bay Area board a metre is a hundredth of a unit and there is
* a city under the wings.
*
* And the night frame has to stand on its own. It is served to every
* dark-mode reader on the page and it is the only frame they get; a crow
* over unlit valley floor at half past nine is a black rectangle with a bird
* in it. Over San Francisco the ground carries itself.
*/
play: { mode: "actor", expect: "Crow", run: 5000 },
place: "Over San Francisco, as a crow",
caption:
"The same dock, a different body. Explore hands the held keys to an articulated crow, and the wings are not a clip being played: the controller carries a pose — flap, glide, bank, tuck, perch — and a phase whose rate rises with throttle and falls as the reserve goes, so what the bird is doing is a readout of the same numbers the HUD is showing. Airspeed and altitude in place of a speedometer, and the flight energy that beating spends and gliding does not, which is why Arena's crow-nav environment can price powered circling: it costs the one quantity the goal also needs.",
day: {
at: "2026-08-06T09:20:00-07:00",
note: "Twenty past nine, over the downtown towers with the bay, a crossing and the far shore stacked up behind them — the whole board is in one frame because the body is above all of it, which is the one camera the chapter list has no button for.",
alt: "An articulated crow seen from behind, wings spread, flying over the towers of downtown San Francisco in morning light with the bay, a crossing and the far shore beyond, and a heads-up strip along the top reading its airspeed, altitude, pose and flight energy.",
},
night: {
at: "2026-08-06T21:35:00-07:00",
note: "Twenty-five to ten, and the frame has inverted: by day the bird is the dark thing on a pale board, and at night it is the dark thing on a board made of windows. Same body, same altitude, same pose — only the hour was asked for.",
alt: "The same crow at night, silhouetted against the lit windows of the San Francisco towers below and the dark bay beyond, with the same heads-up strip along the top.",
},
},
{
id: "california-flight",
door: "tera",
city: "california",
chapter: 0,
expect: "State",
/*
* Chapter 0 rather than 1, and it matters for the same reason an aimed shot
* picks its chapter: the blurb left in the panel is a caption inside the
* photograph. "State" says the two cities are joined as one route board,
* which is exactly what the aircraft in the frame is flying between; "101"
* would be talking about a road the frame does not contain.
*
* The aircraft is on the California board and nowhere else — `main.ts`
* builds it only for that pack — so this shot cannot move to another board
* the way the crow did. Five seconds from the LA waypoint is far enough that
* it is over ground rather than sitting on its start, and near enough that
* the basin is still what is underneath at night.
*/
play: { mode: "aircraft", expect: "Flight", run: 5000 },
place: "The California corridor, flying",
caption:
"The third body and the only one with a published route: the distributed-electric aircraft starts at Los Angeles on a three-waypoint corridor to San Francisco, and Fly takes it off its own autopilot and gives you the yoke. The HUD is in knots, metres and watt-hours because that is what an aircraft has, and the battery is the reason the environment is not a pure altitude race — Arena's california-flight scores waypoint progress against energy, and climbing is the cheapest way to farm a number that is not the goal.",
day: {
at: "2026-08-06T18:00:00-07:00",
note: "Six in the evening, five seconds off the Los Angeles waypoint on a heading of 320°, with the coast ranges throwing across the corridor and the Pacific past the wingtip. The altitude on the readout is above sea level, not above the ridge under it — the controller keeps both, and the one that terminates an episode is the clearance.",
alt: "A distributed-electric aircraft seen from behind and above, flying north-west over green coastal mountains in late afternoon light with a freeway threading the valley below and the Pacific beyond, and a heads-up strip along the top reading its airspeed, altitude, flight mode and battery.",
},
night: {
at: "2026-08-06T21:20:00-07:00",
note: "Twenty past nine, and three things are carrying a frame that has no daylight in it: the basin's lit ground in the corner, the moon's path broken across the water, and the aircraft's own lights — red on the port wingtip, green on the starboard, white strobes and a tail light — which are unlit materials, so they are the only part of this picture that does not care what the sun is doing.",
alt: "The same aircraft at night over the lights of the Los Angeles basin, the same heads-up strip along the top.",
},
},
{
id: "office-floor",
hide: ["#device-section"],
door: "office",
chapter: 1,
expect: "Studio",
place: "SF HQ · Studio",
caption:
"The same renderer from inside, at one unit to the metre — which is why this cannot share a THREE.Scene with the city, where San Francisco puts one unit at about 94. A live/work studio rather than a floorplate: the desk, the bench and the domestic half are one room, and an Office is one building's interior while a Space is a room within it.",
day: {
at: "2026-08-06T11:20:00-07:00",
note: "Twenty past eleven, daylight through the glazing — the sun is the real one over this coordinate, and the pack says where on the earth it stands and which way it is turned.",
alt: "A studio interior rendered in 3D as an open-topped model: desks with monitors, a sofa and rug, shelving and planting, with its floor plan drawn beside it.",
},
night: {
at: "2026-08-06T21:30:00-07:00",
note: "Half past nine. The building has switched its own lights on, because the sun it is following has gone down over the real San Francisco — and a fitting brightens as somebody walks under it.",
alt: "The same studio at night, lit from within by its ceiling fittings against a dark ground.",
},
},
{
id: "office-desks",
door: "office",
chapter: 2,
expect: "Agent Bench",
place: "SF HQ · Studio",
caption:
"The bench, and the hardware on it. A microphone on the desk and a speaker on the machine are declared by the pack and simulated deterministically behind an adapter a real device API can occupy later — power, gain, level, volume, all readable by anyone, all honestly labelled as demonstration data. Stepping in here does not throw the city away: the city scene is retained and paused rather than disposed, because rebuilding the Bay's heightfield costs about 2.3 seconds.",
day: {
at: "2026-08-06T11:20:00-07:00",
note: "Twenty past eleven, daylight across the bench.",
alt: "A close view of a two-place desk bench in a studio: monitors, chairs, a desk microphone and a speaker, with planting behind.",
},
night: {
at: "2026-08-06T21:30:00-07:00",
note: "Half past nine, and the windows have stopped being the light source. The fittings have taken over.",
alt: "The same bench at night, lit by the studio's own lighting with darkness beyond the windows.",
},
},
{
id: "office-commons",
hide: ["#device-section"],
door: "office",
office: "LA HQ",
chapter: 6,
expect: "Courtyard",
place: "LA HQ · Office, Arts District",
caption:
"A second studio, eight hundred kilometres south, and the argument for the format being a format. A courtyard block square to the 1781 pueblo grid rather than to the compass — which is the whole reason a pack carries a heading, because the heading decides which walls the sun comes through. Same engine, same clock, same sun; nothing here was ever a mesh file.",
day: {
at: "2026-08-06T11:20:00-07:00",
note: "Twenty past eleven, and the courtyard is taking the sun the way a courtyard at 36 degrees off north does.",
alt: "An open courtyard inside a two-storey block rendered in 3D: planters, a parasol, tables and chairs, glazed offices around the edges.",
},
night: {
at: "2026-08-06T21:30:00-07:00",
note: "Half past nine, and the courtyard is lit from the rooms around it rather than from above.",
alt: "The same courtyard at night, lit from the glazed rooms around its edges.",
},
},
{
id: "office-hangar",
hide: ["#device-section"],
door: "office",
office: "Frontier Valley",
chapter: 0,
expect: "Hangar",
place: "Frontier Valley, Alameda Point",
caption:
"A third pack, still in development, and the clearest statement of what an office pack is: one room, fifty-four metres by thirty, nine to the trusses, in a hangar on the old naval air station across the estuary. It feels nothing like either studio because four metres above an airfield is not a hundred and eighty-eight above Transbay, and the pack is what says so.",
day: {
at: "2026-08-06T11:20:00-07:00",
note: "Twenty past eleven. North light through the clerestory, which is the light a shed actually wants.",
alt: "A large open hangar interior rendered in 3D: benches of desks down the middle, freestanding meeting boxes at one end, a mezzanine deck at the other, and a twelve-metre door.",
},
night: {
at: "2026-08-06T21:30:00-07:00",
note: "Half past nine, and the trusses are carrying the lights.",
alt: "The same hangar at night, lit from the roof trusses.",
},
},
];
/** The two frames every shot is taken in, in the order they are rendered. */
const VARIANTS = ["day", "night"];
// ---- Sizes ------------------------------------------------------------------
/**
* Shot at 2x and delivered at two widths, because the pages that use these run
* a picture at about 720 CSS px on a desktop and full-bleed on a phone.
*
* WebP rather than PNG, and by a wide margin: these frames are photographs of a
* continuous-tone render, and PNG spends about 650 KB on what WebP says in 90.
* The encoder is the browser that is already open — this box has no `sharp`, no
* ImageMagick and no `rsvg-convert`, which is the same constraint that made the
* share cards a screenshot in the first place.
*/
const VIEWPORT = { width: 1440, height: 900 };
const SIZES = [
{ suffix: "1600", width: 1600, quality: 0.82 },
{ suffix: "800", width: 800, quality: 0.84 },
];
/** The archive frame: full sensor, near-lossless, kept forever. */
const ARCHIVE_QUALITY = 0.94;
/**
* ---- Aiming at things the chapter list does not stop at ---------------------
*
* A shot's camera is normally a chapter, because a chapter is the only camera
* the product ships. Then SFO, LAX, the Golden Gate, the Bay Bridge and a
* surfaced freeway arrived, and none of them has a chapter: they are things you
* find on a board rather than places the legend sends you to. Photographing them
* needs a camera the pack does not carry.
*
* The engine has no back door for one — there is no `?pose=` and no global — so
* this drives the same three inputs a reader has, through the DOM, and every
* one of them is a documented, exact transform rather than a nudge:
*
* - **Where.** A click on the plan view is `onSeek` in `main.ts`: it slides the
* orbit target to a lat/lng and carries the camera with it, keeping the
* distance, height and rotation the chapter chose. So a shot picks a chapter
* for its *stance* and a coordinate for its *subject*. The plan view's
* pixel-to-coordinate map is affine, and `#minimap-readout` prints the
* coordinate under the pointer to four decimals — so three hovers solve the
* map exactly, and the fourth event is a click that lands within a metre.
* Solving it beats hard-coding it: the board's bounds are pack data and the
* widget's size is a CSS rule, and either can move.
*
* - **How far.** `minimap.ts` has its own wheel handler that dollies the camera
* along its view vector by `exp(clamp(deltaY, ±160) · 0.0022)`. One notch of
* -160 is therefore exactly ×0.7035, and `zoom: -9` is ×0.0417 — reproducible
* to the float. The clamp is why standoff is counted in notches: a single
* enormous wheel event is silently the same as a small one.
*
* - **Which way up, and from which side.** `OrbitControls` maps a drag to
* `2π · delta / clientHeight` on both axes, so at this viewport one pixel is
* exactly 0.4°. `elevation` and `azimuth` are therefore written in degrees and
* converted here, because "lower the camera 20°" is a thing a photographer
* says and "drag 50 px" is not.
*
* Two things learned by looking at the output, both worth keeping:
*
* **Get close.** `minVisibilityM` scales with the board span, so the haze over a
* ninety-four-kilometre board is real and thick. At 130 units of standoff SFO is
* a grey rectangle; at 31 it is an airport. Every aim below is a close one.
*
* **The panel names the chapter you left, not the place you flew to**, because
* `city.current()` is set by `flyTo` and a seek is deliberately not a flight.
* That is honest — it is what the app does when a reader clicks the map — but it
* is a caption in the photograph, so each aimed shot picks the chapter whose
* blurb is *true of the frame*: SFO is shot from Peninsula, whose description
* already says "an airport built out onto the mud", and both bridges are shot
* from The Bay, whose description counts the crossings.
*/
/** One wheel notch on the plan view, as a multiplier on the standoff. */
const ZOOM_NOTCH = Math.exp(-160 * 0.0022);
/** `OrbitControls` turns `2π · px / clientHeight`; at this viewport, per degree. */
const DRAG_PX_PER_DEGREE = VIEWPORT.height / 360;
/** The plan view's canvas, in CSS pixels. */
async function planRect(page) {
const rect = await page.evaluate(() => {
const canvas = document.querySelector("#minimap canvas");
if (!canvas) return null;
const r = canvas.getBoundingClientRect();
return { x: r.x, y: r.y, w: r.width, h: r.height };
});
if (!rect || rect.w < 40) {
throw new Error(
"no plan view to aim with — `#minimap canvas` is missing or collapsed, so a " +
"shot carrying `aim` cannot be framed",
);
}
return rect;
}
/** Hover one point of the plan view and read the coordinate it prints. */
async function probePlan(page, rect, fx, fy) {
const px = rect.w * fx;
const py = rect.h * fy;
await page.mouse.move(rect.x + px, rect.y + py);
await page.waitForTimeout(140);
const text = await page.evaluate(() => document.querySelector("#minimap-readout")?.textContent ?? "");
const found = /(-?\d+\.\d+),\s*(-?\d+\.\d+)/.exec(text);
if (!found) {
throw new Error(
`the plan view printed no coordinate at (${fx}, ${fy}) — got ${JSON.stringify(text)}. ` +
"`#minimap-readout` is how an aimed shot finds its subject, so this is not skippable",
);
}
return { px, py, lat: Number(found[1]), lng: Number(found[2]) };
}
/**
* Solve the plan view's pixel-to-coordinate map, and return its inverse.
*
* Three probes rather than two, and inside the board rather than at its corners,
* because `onPointerMove` clamps the hover to the board's own rectangle inside
* the canvas — a probe in the margin reports the edge and would flatten the
* solve. The axes are independent (north is up), so a lat pair and a lng pair
* are the whole transform.
*/
async function solvePlan(page, rect) {
const origin = await probePlan(page, rect, 0.3, 0.3);
const east = await probePlan(page, rect, 0.72, 0.3);
const south = await probePlan(page, rect, 0.3, 0.72);
const lngPerPx = (east.lng - origin.lng) / (east.px - origin.px);
const latPerPy = (south.lat - origin.lat) / (south.py - origin.py);
if (!(Math.abs(lngPerPx) > 1e-9) || !(Math.abs(latPerPy) > 1e-9)) {
throw new Error("the plan view reported the same coordinate at three points — it is not ready");
}
return (lat, lng) => ({
px: origin.px + (lng - origin.lng) / lngPerPx,
py: origin.py + (lat - origin.lat) / latPerPy,
});
}
/** Put the camera on a subject the legend has no button for. See the note above. */
async function aimAt(page, rect, toPx, aim) {
const toPixel = toPx(aim.lat, aim.lng);
if (
toPixel.px < 0 || toPixel.px > rect.w ||
toPixel.py < 0 || toPixel.py > rect.h
) {
throw new Error(
`${aim.lat}, ${aim.lng} is off this board's plan view — the seek would be clamped ` +
"to the edge and the shot would be of somewhere else",
);
}
await page.mouse.move(rect.x + toPixel.px, rect.y + toPixel.py);
await page.mouse.down();
await page.mouse.up();
await page.waitForTimeout(250);
/*
* The notches are **dispatched into the page**, not driven through Playwright's
* mouse, and this is not a shortcut — it is the fix for a race that produced a
* different picture at 1x and at 2x.
*
* A dolly notch is multiplicative: five of them are ×0.172 and three of them
* are ×0.348, so losing one is not a rounding error, it is a different
* photograph. Chrome coalesces wheel events, and at `deviceScaleFactor: 2` the
* app is drawing four times the pixels, so real wheel events sent 60 ms apart
* arrive merged: the preview at 1x landed on the airport and the delivered
* frame at 2x was still a mile out over the bay, from the same shot record.
* `minimap.ts` registers its handler `{ passive: false }` and reads nothing off
* the event but `deltaY` and `deltaMode`, so a synthetic `WheelEvent` is the
* same input with none of the pipeline — n notches applied means n notches
* applied. The seek stays a real click, because `onPointerDown` calls
* `setPointerCapture`, which throws on a pointer id no input device owns.
*/
const notches = Math.abs(aim.zoom ?? 0);
if (notches) {
await page.evaluate(
({ count, deltaY }) => {
const canvas = document.querySelector("#minimap canvas");
if (!canvas) throw new Error("no plan view canvas to dolly with");
for (let i = 0; i < count; i++) {
canvas.dispatchEvent(
new WheelEvent("wheel", { deltaY, deltaMode: 0, bubbles: true, cancelable: true }),
);
}
},
{ count: notches, deltaY: Math.sign(aim.zoom) * 160 },
);
await page.waitForTimeout(250);
}
const azimuth = aim.azimuth ?? 0;
const elevation = aim.elevation ?? 0;
if (azimuth || elevation) {
// Drag from the middle of the canvas, away from the panel and the plan view,
// so no step of the gesture lands on a control.
const from = { x: VIEWPORT.width * 0.52, y: VIEWPORT.height * 0.5 };
const dx = azimuth * DRAG_PX_PER_DEGREE;
const dy = elevation * DRAG_PX_PER_DEGREE;
await page.mouse.move(from.x, from.y);
await page.mouse.down();
for (let step = 1; step <= 12; step++) {
await page.mouse.move(from.x + (dx * step) / 12, from.y + (dy * step) / 12);
}
await page.mouse.up();
}
// `OrbitControls` damps per frame, so the pose is a few frames behind the
// gesture; and the pointer has to leave the plan view or the shot keeps its
// hover crosshair and the coordinate readout under it.
await page.mouse.move(rect.x - 200, rect.y + 400);
await page.waitForTimeout(900);
}
/**
* ---- Taking a body ----------------------------------------------------------
*
* `aim` points a camera at the world. `play` asks the app to hand over a *body*
* — the car, the crow, the aircraft — and then photographs the world moving
* under it, with the play HUD deliberately left in the frame.
*
* It is the same kind of input `aim` is, and for the same reason: the engine has
* no back door. There is no `?mode=drive`, and `main.ts` keeps the control mode
* in a module-scoped `ControlModeState` that nothing outside it can write. What
* it does have is the dock — `