Naval Gaming

The Naval Gaming spec

Draft for Marlinspike's review, written 2026-10-06. Nothing in it is approved until Marlinspike signs it off, and no sim code is written before then. This page is the spec; it is served on dev only.

This is the rebuild's specification for the launch: single-player Battle Builder. It describes what the game does, in player terms, and the shape of the code that will do it. It covers only what Marlinspike kept for launch on 2026-10-06; everything else is listed under Later and Dropped.

1. Rules

For every number

For every word

The gate

bin/cleanroom_check.sh (in the station repo, run from the projects root) passes on this repo, and Marlinspike signs off. Hits cleared by a citation are listed in cleanroom-accepted.txt at the repo root.

2. Behaviour

What the player sees and does at launch. Dates and "Marlinspike" mark his decisions; "proposed" marks a choice made in this draft for him to confirm.

The game

Naval Gaming is "something people play for its own sake" (Marlinspike, 2026-09-24), not a testbed for a sailing model. At launch it is one product, Battle Builder: you set up two lines of ships and fight in one of them, alone in your browser, with no account (Marlinspike, 2026-09-29).

Battle Builder

Sailing: the helm

Sailing: sail

Wind

The wind is steady for the whole engagement: one direction, one strength (Marlinspike, 2026-10-06). Its strength is a tuning guess, set by play.

Gunnery

Hits

Crew

Morale and striking

NPC captains

The squadron and signals

The view

3. Controls

The sailing keys are Marlinspike's (2026-10-06): helm and sail on A/D and W/S, yards on Q/E and Z/C, auto-trim on F, a double tap for hard over. The gun and signal keys are his too (2026-10-06). The rebuild plan asked for controls designed fresh; these are Marlinspike's choice as owner, made deliberately. The controls panel is generated from the bindings, so this table and the game can't drift apart once the code exists.

The idea: the left hand sails and trims, the right hand fights, the mouse looks.

Keyboard

ActionKeyNotes
Helm to port / starboardA / D, or ← / →Hold to put the helm over; release eases it back amidships.
Helm hard over, helddouble tap A / DStays hard over until the helm is touched again (Marlinspike).
Make more sail / take in sailW / S, or ↑ / ↓One step: none, topsails, full.
Brace fore yards to port / starboardQ / ETurns auto-trim off. On the cutter: the jib sheet (Marlinspike).
Brace main and mizzen yards to port / starboardZ / CTurns auto-trim off. On the cutter: the mainsheet (Marlinspike).
Auto-trim onFBoth yard groups follow the wind again (Marlinspike).
Port guns: Stand Down → Load → Fire at WillJEach press moves to the next order; the order in force shows on the station bar.
Starboard guns: Stand Down → Load → Fire at WillL
Signal listTabOpens without pausing; ↑ / ↓ choose, Enter makes the signal; Tab or Esc closes it.
Slower / faster time, / .1×, 2×, 4×, 8×.
Pause menuEscTime scale, Controls, Fight again, Leave.
Controls panelH

While the signal list is open, ↑ / ↓ move through the list instead of setting sail, and ← / → do nothing. A / D / W / S, the yards and the gun keys stay live (Marlinspike, 2026-10-06).

Mouse

ActionInput
Look aroundDrag; the camera swings back behind the ship on release.
Camera distanceWheel.
Station barClick a gun side to cycle its order; the same command as the key.
Signal listClick a signal to make it.

Not bound at launch

Gamepad, rebinding, and touch. Keys for later features (boats, the telescope, the minimap, range rings, ammunition) are not reserved; they are chosen when those features are specified.

4. Ships

Five classes at launch (Marlinspike, 2026-10-06): four square-rigged, sharing one rig model, and one fore-and-aft cutter with its own. Each class takes its numbers from one real ship or class, cited below. Where armament varied from ship to ship, the class takes its cited ship's exactly and notes the variance (Marlinspike, 2026-10-06). The real ship is the source, not a name in play: in the game a class is "the First Rate", "the Seventy-four" and so on, and individual ships get placeholder names and numbers (Marlinspike, 2026-10-01).

Confidence: H consistent across sources or from a primary or academic text; M one secondary source; L an uncited page or a clash. Source keys are in Sources. Draught is missing for four of the five and best speed for three. Those cells say so; they are not to be filled from memory.

First Rate: HMS Victory (1765), as at Trafalgar, 1805

Source: [VICTORY], which cites Goodwin, Lavery and Winchester.

ValueConf.
Length on the gundeck / keel186 ft / 152 ft 6⅝ inH
Beam / depth in hold51 ft 7½ in / 21 ft 6 inH
Burthen2,142 bmH
Draught, victualled24 ft 3 in forward, 25 ft 6 in aftM
Lower gundeck30 × 32-pdrH
Middle gundeck28 × 24-pdrH
Upper gundeck30 × 12-pdrH
Quarterdeck12 × 12-pdr, 2 × 68-pdr carronadesM
Forecastle2 × 12-pdr, 2 × 68-pdr carronadesM
Complementabout 850M
Rigship, three masts; 6,510 sq yd of sailM
Speed"up to 11 knots"; 7–8 knots in a topgallant gale (point of sail not given)M

Seventy-four: the Arrogant class

Source: [ARROGANT], which cites Winfield 2007, pp. 64 and 77, and Lavery 1984, p. 176.

ValueConf.
Length on the gundeck / keel168 ft / 138 ft 10 inH
Beam / depth in hold46 ft 9 in / 19 ft 9 inH
Burthen1,614 bmH
Draughtcitation needed
Lower gundeck28 × 32-pdrH
Upper gundeck28 × 18-pdrH
Quarterdeck14 × 9-pdrH
Forecastle4 × 9-pdrH
Complement550 (first batch), 600 (second)H
RigshipH
Speedcitation needed

Frigate: HMS Shannon (1806), a 38 of the Leda class

Sources: [SHANNON], [LEDA], citing Winfield 2007 and Gardiner 2000 (no pages given).

ValueConf.
Length on the gundeck / keel150 ft 2 in / 125 ft 6½ in (the class page: 150 ft 1½ in / 125 ft 7⅞ in)H
Beam / depth in hold39 ft 11⅜ in / 12 ft 11 in (the class page: 12 ft 9 in)H
Burthen1,065 bmH
Draughtcitation needed
Upper deck28 × 18-pdrH
Quarterdeck2 × 9-pdr, 12 × 32-pdr carronades, Shannon's own and the figure used (armament varied by ship; the class page gives 8 × 9-pdr, 6 × 32-pdr carronades, noted only)M
Forecastle2 × 9-pdr, 2 × 32-pdr carronadesM
Complement284, later 300M
RigshipH
Speed"13 knots running large, 10 knots close-hauled"; "unweatherly" against frigates of British lines (Gardiner, via [LEDA])M

Shannon is also the source of the best-recorded single-ship action of the period: it took Chesapeake in 11 minutes (see Pacing).

Brig: the Cruizer class brig-sloop

Source: [CRUIZER], which cites Winfield 2008, pp. 282 and 291.

ValueConf.
Length overall / keel100 ft / 77 ft 3½ inH
Beam / depth in hold30 ft 6 in / 12 ft 9 inH
Burthen382 bmH
Draughtcitation needed
Armament16 × 32-pdr carronades, 2 × 6-pdr bow guns, one deckH
Complement121H
Rigbrig: two masts, square-riggedH
Speed"fast sailers and seaworthy"; no figureM

The brig's broadside is all carronade: heavy at close range and short-ranged. That is a real difference between classes, and play should keep it.

Cutter: HMS Surly (1806), Cheerful class

Source: [SURLY], which cites Winfield, British Warships in the Age of Sail 1817–1863, 2014, p. 267 (the later volume). Kept (Marlinspike, 2026-10-06): built in 1806, it is in period; an earlier cutter replaces it only if a better-suited one turns up.

ValueConf.
Length overall / keel63 ft / 46 ft 9⅜ inM
Beam / depth in hold23 ft 6 in / 10 ftM
Burthen137 bmM
Draughtcitation needed
Armament10 × 12-pdr carronades, 2 × 4-pdrM
Complement50M
Rigsingle-masted, fore-and-aft: citation needed (general knowledge, not yet sourced)
Speedcitation needed

What each class needs that history doesn't give

These are tuning guesses, set by play, until a source turns up:

5. Physics

How the sim works out speed, turning, shot, hits and morale, and where each number comes from. Every quantity below is either cited (source keys in Sources), derived by stated physics from cited quantities, or marked tuning guess or citation needed.

The sim core runs on a fixed step with a seeded random number generator, so the same inputs give the same battle (Architecture). The water is flat for physics; swell is drawn, not simulated.

Speed: the polar

Each class has a polar: its best speed through the water at each angle off the true wind, under full sail, in the engagement's wind. Polars are generated by a small sail-force model and stored as JSON tables, one per rig, so the clean-room check can compare them as tables. The model has few inputs, each with its source:

InputSquare rigFore-and-aft (cutter)Source
Closest angle at which the sails fillbetween 6 points (67.5°) for the best ships and 7 points (78.75°) for most4 points (45°)Willis 2003, H
Leeway, close-hauledabout 1 point (11¼°) for most ships; ¼ point for the bestcitation neededWillis 2003, H
Close-hauled speed as a share of best10 of 13 knots for the frigate's classcitation needed[LEDA], M
Best speedFirst Rate "up to 11 knots"; frigate 13 knots running largecitation needed[VICTORY], [LEDA], M
Angle of best speedtuning guess (wind on the quarter)tuning guess
Dead before the windtuning guess (below best: the after sails blanket the fore)tuning guess

Leeway matters: at 7 points close-hauled with a point of leeway, a ship makes good 8 points and gains no ground to windward (Willis 2003). The sim models leeway as a sideways drift, so this comes out of the model rather than being written in.

The frigate's class was "unweatherly" (Gardiner via [LEDA]), so it sits nearer 7 points than 6. Where each other class sits in that range is a tuning guess.

Speed: from polar to speed

Turning

Sail handling

Guns: rate of fire

Guns: crews

GunCrewSource
32-pdr9–14[GUN32], M
24-pdr12 and a powder boy[GUN24], [DRILL], M
18-pdrcitation needed
12-pdr8 and a boy[DRILL], M
9-pdrcitation needed
6-pdr, 4-pdr6 and a boy (6-pdr)[DRILL], M
Carronades"a much smaller crew"; number citation needed[DRILL], [CARRONADE]

A gun with fewer men than its crew reloads more slowly, in proportion (tuning guess).

Guns: the shot

Hits

Morale

6. Pacing

"I loved the idea of pacing and testing of pacing and making adjustments accordingly" (Marlinspike, 2026-10-06). Pacing is a design principle: how long fights last is measured, given a target, and adjusted by a few known levers, never by editing ship data.

History as the anchor

Real actions ran from minutes to hours. These are the anchors the time scales start from:

ActionDurationLosses, killed / woundedHow it endedSource
Shannon vs Chesapeake, 1 June 181311 minutesShannon 23 / 56; Chesapeake about 60 / about 60 of 379boarded and carried[CHESAPEAKE], M
Constitution vs Guerriere, 19 Aug 1812about 15 minutes of close broadsidesConstitution 7 / 7; Guerriere 15 / 78 of 272all three masts gone[GUERRIERE], M
United States vs Macedonian, 25 Oct 1812about 3 hoursUnited States 7 / 5; Macedonian 43 / 71 of 301dismasted[MACEDONIAN], M
Constitution vs Java, 29 Dec 1812about 3 hours from sightingJava 22 / 102 of 426; Constitution 9 / 57dismasted, about to be raked[JAVA], M
Glorious First of June, 1794about 3–3½ hours of main actionabout 1,200 British7 French ships of the line taken[FIRSTJUNE], M
Trafalgar, 21 Oct 1805about 5¾ hours (11:50 to 17:30)British 458 / 1,20817 ships taken, one burning[RMG], [TRAFALGAR], H

A close frigate action could be decided in a quarter of an hour; manoeuvring to it took hours. The game compresses the manoeuvring far more than the fighting.

Targets

Set later by Marlinspike, possibly more than one: a first-rate's fight may run longer than a cutter's. Whether a target fails the test suite is decided when it is set. Until then the pace tool reports and nothing fails on time.

The pace tool

Built from the start, alongside Studio. It runs fights headless and deterministically, for every pair of the five classes (ten class pairs, each fought both ways where sides matter) over fixed seeds and set scenarios, and reports how long each took and what each side lost, against the targets once they exist.

The four levers

Pacing is adjusted only through these, kept in one file:

  1. Time scales: reload, crew movement between stations, sail handling. Symptom it fixes: everything is too slow, or too fast, overall.
  2. Accuracy: what share of a broadside hits, by range. Symptom: nobody hits, or every shot hits.
  3. Hit effect: casualties per hull hit, drive lost per rig hit. Symptom: fights are too bloody, or hits do too little.
  4. Breaking point: the losses that make a ship strike, and how fast morale recovers. Symptom: ships strike too soon, or fight to the last man.

Each lever has a global value and optional per-class overrides, so classes can have different targets without forking the model. Naming the symptom first stops pulling whichever knob is nearest.

The log

Every lever change is logged with the pace tool's report before and after, on the same seeds, and its reason. A lever change with no log entry fails review.

Consistency rules

Tests between levers, run with the suite:

7. Architecture

The shape of the code. These are lessons stated as design (rebuild plan, 2b), not a description of any earlier code. Where a choice is mine rather than the plan's, it says "proposed".

Stack

One pure sim core

One command layer

One ship-state shape

Ships as data, with a schema

Every tunable stat is derived

Studio

Tests from the first commit

Layout (proposed)

www/                  the docroot (as now)
  play/               the game page and its modules
    core/             the sim core: no DOM
    view/             3D view, HUD, menus: read the core's state
    input/            keyboard, mouse, station bar: issue commands
    data/             ship classes, polars, levers (JSON)
  spec/               this spec
  vendor/three/       three.js, vendored
tools/                pace tool, Studio, polar generator: run the core under Node
test/                 or beside each module; decided with the first module

8. Sources

Every source cited in this spec. Pages marked fetched were read on 2026-10-06; books and articles marked read were read in full text. Nothing here comes from a game or game data.

Web pages (fetched 2026-10-06)

KeyPageWhat it cites
[VICTORY]HMS VictoryGoodwin; Lavery; Winchester
[ARROGANT]Arrogant-class ship of the lineWinfield 2007, pp. 64, 77; Lavery 1984, p. 176
[SHANNON]HMS Shannon (1806)Winfield 2007
[LEDA]Leda-class frigateWinfield 2007; Gardiner 2000
[CRUIZER]Cruizer-class brig-sloopWinfield 2008, pp. 282, 291
[SURLY]HMS Surly (1806)Winfield 2014, p. 267
[ARTILLERY]Naval artillery in the Age of Sail
[GUN32]32-pounder gunGoodwin, HMS Victory Pocket Manual; McConnell 1988
[GUN24]24-pounder long gun
[CARRONADE]Carronade
[DRILL]navyandmarine.org: gun drill
[BROADSIDE]nelsonsnavy.co.uk: broadside
[GUERRIERE]USS Constitution vs HMS Guerriere
[MACEDONIAN]USS United States vs HMS Macedonian
[JAVA]HMS Java (1811)
[CHESAPEAKE]Capture of USS Chesapeake
[TRAFALGAR]Battle of TrafalgarGoodwin; Adkins
[FIRSTJUNE]Glorious First of June
[RMG]rmg.co.uk, the Trafalgar timeline

Books and articles

Looked for, not found

Not used

9. Later and dropped

Later (Marlinspike, 2026-10-06, plus sound the same day): staysails; shifting wind and a building sea; grounding; the brigantine, launch and jolly boat; chain and double shot; dismasting; range rings; the ship's boat, prizes by boarding, and taking to the boat when struck; crew carried between battles; crew figures; drawn signal flags; real-nation ensigns; multiplayer rooms; all of Corona del Mar; carved ends; telescope; minimap; shipyard pages; tutorials; sign-in and saved progress; a welcome video; gun sound.

Dropped (Marlinspike, 2026-10-06): riding as a passenger on an ally's ship; the explored chart; the 2D chart view; frame reports; any tool that builds numbers from another game's data; the inherited admin, dossier, rank, register and decoration pages.

10. Open for Marlinspike

Nothing open: all eight items were decided by Marlinspike on 2026-10-06.