Skip to content

Commit 7224e2b

Browse files
authored
Merge pull request #51: the ship flies itself, and the pilot decides where (docs/TODO/205 to 225)
The ship flies itself, and the pilot decides where (docs/TODO/205 to 225)
2 parents 5df7d99 + 3710b96 commit 7224e2b

371 files changed

Lines changed: 20342 additions & 2569 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 268 additions & 401 deletions
Large diffs are not rendered by default.

‎docs/ARCHITECTURE.md‎

Lines changed: 56 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,40 @@ rules. This file is a map.
2323
on the GPU. The controls read an input interface, not the browser. Two pointer
2424
seams cross the platform seam. `onScreenClick` is input. `onScreenMove` reports
2525
only: a screen may repaint what it describes, but it must never select or
26-
spend.
27-
- The HUD is a read-only painter, and it is three files. `hud/hud-model.ts`
26+
spend. `engine/hold-buttons.ts` is the third: a button that holds a key down
27+
while it is held, such as the laser (docs/TODO/206).
28+
- The HUD is a read-only painter, and it is four files. `hud/hud-model.ts`
2829
works out where a marker goes. `hud-binding.ts` turns the state into a
29-
dashboard. `hud.ts` paints one. A screen lives behind `ui/screen-host.ts`, and
30+
dashboard. `hud.ts` paints one. `hud-buttons.ts` paints the buttons over the
31+
flight view, such as the course buttons, and a click on one sends its code
32+
(docs/TODO/205). A screen lives behind `ui/screen-host.ts`, and
3033
it reaches the page through `ui/screen-shell.ts`. A screen owns its own
3134
rendering, its own input and its own local state.
3235
- `src/game/prompts.ts` decides what a key can do about the situation right now.
3336
It returns a `Command` and words. It never returns a letter. `cockpit-view.ts`
3437
looks the label up, through `ui/key-help.ts`. That is how invariant 9 reaches
3538
prose. A prompt is derived state, and the code saves nothing about it.
39+
- `src/game/courses.ts` decides what the ship can do next with no hand on the
40+
stick (docs/TODO/205). A course is one such thing, such as a trip to the
41+
station or a skim of the star. It follows the shape of `prompts.ts`: a flat
42+
view in, a ranked list out, and no key. The list is derived state. The code
43+
saves the course that the pilot picks, and never the list.
44+
`course-pilot.ts` flies the picked course, one frame at a time, and it
45+
reports a `FlightDemand`. `flight-instruments.ts` throws the switches that a
46+
course asks for: the torus drive, the hand-over to the docking computer, and
47+
the end of the course. A commander with no docking computer gets the docking
48+
mini game (docs/TODO/212). EVERY commander gets the same line-up first. The
49+
computer flies the ship to the right distance from the station, stops it, and
50+
turns it to face the port. `world-step.ts` then asks the one question: a
51+
fitted docking computer takes the ship in, and a commander with none gets the
52+
rails and the game. `dock-rails.ts` holds the ship on the slot axis while the
53+
pilot matches the slot and the speed. It is the one file that moves the
54+
commander's ship other than by flying it, and it only ever takes up a residue.
55+
The last turn is flown, with `bankToTurn` and both sticks. `course-actions.ts` joins the list to the Game: it
56+
builds the flat view, and it applies a pick. At the station, the LAUNCH row
57+
opens `screens/courses.ts`, and a pick leaves on the course. In flight, the
58+
list is a set of buttons over the view, and not a screen, because the flight
59+
world stops under a screen.
3660
- The console is one line, so `SessionState.queued` is the line that waits for it
3761
(`session.ts`). Some consequences make sense only after their cause: what a
3862
scan cost your legal record, or what a deed cost your reputation. The console
@@ -51,13 +75,16 @@ rules. This file is a map.
5175

5276
**Two halves split what a commander does.** Neither half reaches into the other.
5377

54-
- `docked.ts` — what she does once the ship stops. The arrival, the menu, the
78+
- `docked.ts` — what the commander does once the ship stops. The arrival, the menu, the
5579
market, the outfitters and the board are here.
56-
- `flight.ts` — what she does in the sky. That is one slice of time advanced,
80+
- `flight.ts` — what the commander does in the sky. That is one slice of time advanced,
5781
and who is at the controls for it. It has two children of its own:
5882
- `flight-weapons.ts` — what the ship spends, and what it takes. Laser fire is
5983
here.
6084
- `flight-instruments.ts` — the switches that change who flies the ship.
85+
- `flight-course.ts` — the course at the controls. Three things end it. The
86+
work is done, or the pilot taps the lit button, or a hostile ship turns up.
87+
It left `flight-instruments.ts` on 2026-09-12.
6188

6289
A step that ends in a dock, a jump, a tow or a death reports that end to
6390
`game.ts`. The orchestrator then decides what the game becomes.
@@ -68,7 +95,7 @@ spends:
6895
- `world-build.ts` — what is in the sky when you arrive.
6996
- `cockpit-view.ts` — what the cockpit shows about the world.
7097
- `law-actions.ts` — what the law does to a commander. It applies a record.
71-
- `hyperspace-actions.ts` — how a commander leaves a system, and how she arrives
98+
- `hyperspace-actions.ts` — how a commander leaves a system, and how they arrive
7299
in one. The jump is here.
73100
- `career.ts` — what a career keeps when a flight ends.
74101
- `persistence.ts` — the world written down, and put back.
@@ -156,6 +183,20 @@ Two quirks are deliberate:
156183
both callers agree. `combat.ts` takes each ingredient separately, so a test can
157184
drive it. `combat-player.ts` is the assembly step that builds the player's own
158185
trigger out of one `GameState`.
186+
- `src/game/targets.ts` lists what the ship can fight, and holds the pilot's
187+
pick (docs/TODO/206). The pick is one flag on the picked ship's own state,
188+
so a save carries it. It sits on top of `threat-lock.ts`, and never changes
189+
that rule. `target-actions.ts` joins the list to its buttons, and gives each
190+
ship a code that names it for as long as it lives. `close-pass.ts` names a
191+
neutral trader that comes close, one time, so the pilot knows the chance is
192+
there (docs/TODO/209). It never stops the ship.
193+
`cockpit-buttons.ts` says what every button over the flight view reads, in
194+
words, and it holds no world (docs/TODO/206 M5). `game/mission-course.ts`
195+
says what a live mission asks the ship to do here (docs/TODO/208). There
196+
are five shapes: a fight, a hold, an escort, a scoop, and a slip past the
197+
police.
198+
`game/derelict.ts` says what a scan of a derelict reports, read off the
199+
world's own seed.
159200
- `src/game/threat.ts` computes the pirate count, the group tier and the
160201
organisation from the visible value and the reputation. `ship-specs.ts` maps a
161202
tier to a hull. The campaign simulator calls the same rules.
@@ -196,22 +237,27 @@ Two quirks are deliberate:
196237
- `src/game/mission-bridge.ts` is the game's side of the mission machine. It
197238
runs one input, installs the record on the commander, and applies the
198239
effects that are the commander's: credits, reputation and legal status. It
199-
hands the words back, and the caller says them. `src/game/mission-desk.ts`
240+
hands the words back, and the caller says them. It hands a spawn order
241+
back too, and the world step spawns an ambush (docs/TODO/214). `src/game/mission-desk.ts`
200242
is the MISSIONS screen's two actions, acceptance and abandonment, and the
201-
offers it lists. `src/game/hunt-warning.ts` prices her gun against the ship
243+
offers it lists. `src/game/hunt-warning.ts` prices the commander's gun against the ship
202244
a hunt names, through the combat oracle.
203245
- `src/missions/` is the mission machine (docs/TODO/190). `model.ts` holds the
204-
types. A skeleton under `skeletons/` is one mission's rules, written by a
246+
types, `effects.ts` the consequences the game applies, and `words.ts` the
247+
shape of a patron and a dossier. A skeleton under `skeletons/` is one mission's rules, written by a
205248
developer. A dossier is its generated words, and the machine never reads one.
206249
`machine.ts` is one pure step. It takes the record, one input and the facts
207250
it may read. It returns a new record with the effects the game applies.
251+
`settlement.ts` applies a branch's settlement, and `leads.ts` saves a lead
252+
(docs/TODO/217).
208253
A verb module under `verbs/` decides what an input means for one leg, and
209254
the machine takes the branch. `triggers.ts` says what a trigger is called,
210255
and which dossier line a branch may speak with. `lookups.ts` reads a
211256
skeleton: a leg by id, a patron's key, and where a skeleton is offered. `placement.ts` picks a leg's world with one
212257
draw. A band measures tenths on the chart. A handover measures jumps on
213258
the full-tank graph. `tour.ts` places the five arc starts from the seed,
214-
and a galactic jump moves a lead by the same rule (docs/TODO/192). `queries.ts` answers the game's questions without a change. `lint.ts`
259+
and an arc is offered in galaxy 1 alone. So a lead keeps its galaxy across
260+
a galactic jump (docs/TODO/213). `queries.ts` answers the game's questions without a change. `lint.ts`
215261
holds the five failure rules as data checks, and
216262
`test/mission-skeletons.test.ts` runs it over every skeleton. `repair.ts`
217263
reads a saved record for both loaders, and drops the old stage number.

0 commit comments

Comments
 (0)