v0.4.9 — X,Y coordinates, no-switching can still clear the mainline, Q3 corrected, a clearance bug, three sounds, and the box art

A playtest review of seed 58228926 (day 6), plus one long-standing display complaint and the
first real audio beyond a placeholder.

- Coordinate labels read X,Y everywhere shown to a player, not the internal Y,X storage order.
  Display-only.
- "No switching" now means may not add or drop cars, not "never touch it" — these trains can
  still be moved onto Secondary Track to clear the mainline.
- Q3 corrected: Expedite governs WHERE a train may be left standing, not WHEN it leaves. The
  forced same-Stage departure is gone; a new fault costs 1 Revenue if an expedited train is left
  off the station when a Mainline Phase begins. Resolves "3/4 Express prints a rule it can never
  use" as a side effect.
- evaluateClearance now checks every occupant on a Mainline card before offering a judgment
  call, instead of returning on whichever it found first — found while explaining a playtest
  report, fixed with a regression test.
- Three new synthesised sounds: arrive, depart, crash.
- The splash page shows the box art.

Full detail, measurements and reasoning in CHANGELOG.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvU99NEakShRMg3nN3fHAZ
This commit is contained in:
Jesse
2026-08-19 23:51:35 -04:00
co-authored by Claude Sonnet 5
parent 37b1e5b969
commit 859817d173
25 changed files with 1048 additions and 739 deletions
+76 -89
View File
@@ -18,6 +18,7 @@
import {
COLLISION_PENALTY,
EXPEDITE_FAULT_PENALTY,
MAINLINE_PROFILES,
enhancementRule,
crossingStages,
@@ -307,6 +308,38 @@ function mainlinePhase(s: GameState, events: GameEvent[]): AdvanceResult {
return d !== 0 ? d : Number(a.trainIsExtra) - Number(b.trainIsExtra);
});
/**
* Q3 — A STATION MASTER FAULT: an expedited train not at the station when a Mainline Phase begins
* was not kept ready to highball, wherever in the district it has been left — switched onto
* Secondary Track to clear a move, say. Checked against positions as they stand BEFORE this phase
* moves anything, and charged every Phase it is still caught away: the fault is in leaving it
* there, not a one-time slip. A train the ordinary §8.1 rules are holding at the Office itself is
* unaffected — this only bites when the train is not even in the queue to leave.
*/
for (const [, tray] of order) {
if (!isExpedited(tray) || tray.position.at !== 'grid') continue;
const area = areaAtSeat(s, tray.position.seat);
const { coord } = tray.position;
if (coord.row === area.officeCoord.row && coord.col === area.officeCoord.col) continue;
const owner = playerAtSeat(s, tray.position.seat);
const p = s.players[owner];
if (!p) continue;
p.revenue -= EXPEDITE_FAULT_PENALTY;
events.push({
type: 'expediteFault',
player: owner,
trainNumber: tray.trainNumber ?? 0,
where: `(${coord.col},${coord.row})`,
});
events.push({
type: 'revenueChanged',
player: owner,
delta: -EXPEDITE_FAULT_PENALTY,
total: p.revenue,
reason: 'expedited train left off the station',
});
}
for (const [id, tray] of order) {
if (s.movedThisPhase.has(id)) continue;
const where = tray.position;
@@ -329,13 +362,13 @@ function mainlinePhase(s: GameState, events: GameEvent[]): AdvanceResult {
(tray.position.at !== 'grid' ||
where.at !== 'grid' ||
(tray.position.coord.row === where.coord.row && tray.position.coord.col === where.coord.col));
if (!tray.departsThisStage && stillThere) {
if (stillThere) {
tray.stopPointClaimed = true;
// The point goes to whoever is SITTING in the district it stopped in.
const owner = tray.position.at === 'grid' ? playerAtSeat(s, tray.position.seat) : 0;
const label =
tray.position.at === 'grid'
? `(${tray.position.coord.row},${tray.position.coord.col})`
? `(${tray.position.coord.col},${tray.position.coord.row})`
: tray.position.at === 'mainline'
? `Mainline card ${tray.position.index}`
: `the ${tray.position.side} Division Point`;
@@ -475,14 +508,18 @@ function spendDispatchBonus(
return 0;
}
/** Q3 — an expedited train does not spend a Stage standing at the Office. */
/**
* Does this train leave in the same Stage it arrives (§7)?
* Q3 — is this train subject to the "kept ready" fault (§7)?
*
* Expedite does not change WHEN a train leaves — it is released by the ordinary §8.1 rules like any
* other train, and may be switched normally while it stands. What it means is that it must not be
* held anywhere but the station: a train the player parks on Secondary Track to clear a switching
* move faults if it is not back on the Office square by the next Mainline Phase (`mainlinePhase`).
*
* Two ways to earn it. `expedite` is printed and permanent. `stopThenExpedite` is the X17 Campaign
* Train — "one turn at station (speeches) then expedite": its FIRST arrival is an ordinary stop while
* the speeches are made, and every arrival after that is expedited. `speechMade` is set on that first
* stop, so the train is slow once and fast thereafter.
* stop, so the train is exempt once and subject to the fault thereafter.
*/
function isExpedited(tray: CrewTray): boolean {
const rules = trainProfile(tray.trainNumber ?? 0, tray.trainIsExtra)?.rules;
@@ -491,18 +528,7 @@ function isExpedited(tray: CrewTray): boolean {
return rules.stopThenExpedite === true && tray.speechMade === true;
}
function moveTrain(
s: GameState,
id: TrayId,
tray: CrewTray,
events: GameEvent[],
/**
* Which pass is asking. The Mainline Phase moves every train once; Supervisor Shift then asks the
* Expedited arrivals to go again. The train cannot tell the difference, but the player must — see
* `trainHighballed.why`.
*/
pass: 'mainline' | 'expedite' = 'mainline',
): MoveOutcome {
function moveTrain(s: GameState, id: TrayId, tray: CrewTray, events: GameEvent[]): MoveOutcome {
const dir = step(tray.direction);
if (tray.position.at === 'divisionPoint') {
@@ -588,10 +614,7 @@ function moveTrain(
trainNumber: tray.trainNumber ?? 0,
from: 'the Office',
to: 'the Mainline',
why:
pass === 'expedite'
? 'its card prints EXPEDITE, so it leaves at the end of the Stage it arrived in — you got the Cargo phase with it, but no Local Operations turn to switch it'
: 'it stood a full Stage at the Office, so §8.1 released it this Mainline Phase',
why: 'it stood a full Stage at the Office, so §8.1 released it this Mainline Phase',
});
return 'moved';
}
@@ -751,28 +774,44 @@ function evaluateClearance(
for (const t of n.transits) if (t.tray) occupants.push({ tray: t.tray, onCard: i });
}
/**
* TWO PASSES, NOT ONE — an opposite-direction occupant is an absolute bar and has to be checked
* against EVERY occupant before any same-direction judgment call is offered.
*
* A single pass returned on whichever occupant it examined first, in `node.transits` insertion
* order — which is fine while a Subdivision holds at most one train, but the dispatch exception
* below means it now legitimately can hold two: a Telegraph-cleared facing train sits on the same
* card as whatever it was cleared past. Found from a playtest report where the Superintendent was
* asked to rule on a same-direction train instead of being auto-held against an uncleared
* opposite-direction one also on the card — the loop had reached the same-direction occupant
* first simply because it entered the transit list first, and returned before ever looking at
* the other.
*/
for (const { tray: other } of occupants) {
if (other === id) continue;
const otherTray = s.trays.get(other);
if (!otherTray || otherTray.direction === tray.direction) continue;
// §8.1 — a train moving TOWARDS the considered train is an absolute bar. That stands.
//
// The exception is dispatching technology. Telegraph/Telephone/Radio exist precisely so the
// Superintendent can arrange a meet with a facing train: "once a day, when dispatching
// facing trains, add +4/+8/+12 to the other train's number". Without a device there is no
// way to pass the order, so the train simply holds.
if (spendDispatchBonus(s, tray, otherTray, events) > 0) continue;
return 'blocked';
}
for (const { tray: other, onCard } of occupants) {
if (other === id) continue;
const otherTray = s.trays.get(other);
if (!otherTray) continue;
if (!otherTray || otherTray.direction !== tray.direction) continue;
const onNode = s.division.nodes[onCard];
if (otherTray.direction !== tray.direction) {
// §8.1 — a train moving TOWARDS the considered train is an absolute bar. That stands.
//
// The exception is dispatching technology. Telegraph/Telephone/Radio exist precisely so the
// Superintendent can arrange a meet with a facing train: "once a day, when dispatching
// facing trains, add +4/+8/+12 to the other train's number". Without a device there is no
// way to pass the order, so the train simply holds.
if (spendDispatchBonus(s, tray, otherTray, events) > 0) return 'clear';
return 'blocked';
}
// Red Flags — "a stopped train is prevented from being hit; the approaching train is prevented
// from moving". Flagging is per-train rather than per-card, so it protects one specific train
// where ABS Signals protects everything on the card.
//
// Both of these now read the card the OTHER train is standing on rather than the card being
// Both of these read the card the OTHER train is standing on rather than the card being
// entered. They were the same card while this only looked one card ahead; across a Subdivision
// they are not, and the protection belongs where the train it protects actually is.
if (onNode?.kind === 'mainline' && (onNode.redFlagged ?? []).includes(other)) return 'blocked';
@@ -871,27 +910,9 @@ function arriveAtOffice(
});
/**
* Q3 — AN EXPEDITED TRAIN DEPARTS THE STAGE IT ARRIVED, BUT NOT BEFORE THE WORK IS DONE.
*
* It used to leave inside this very Mainline Phase — a second `moveTrain` on the spot. That made
* "departs the Stage it arrives" true and the coaches worthless: Load/Unload runs AFTER Mainline,
* so an expedited train was gone before a single Porter could reach it. Measured over 60 games,
* Train 2 arrived 32 times and stood at an Office during Load/Unload exactly none of them, and
* every coach-carrying express is expedited (1/2 Crack Limited, 5/6 The Sparrow, 19 Military).
* The Crack Limited's own card says "stop at Terminals only", which it could never do.
*
* So it stands here through Load/Unload and leaves at the end of the Stage instead. It still does
* not lay over to the next Stage — the keyword is honoured — and it is still subject to every
* §8.1 condition when it goes, so it can be held.
*/
if (isExpedited(tray)) {
tray.departsThisStage = true;
return 'moved';
}
/**
* X17 Campaign Train — the speeches happen at the first Office it reaches. Recorded AFTER the
* expedite test above, so this arrival is the ordinary stop the card pays for and every later one
* runs expedited.
* X17 Campaign Train — the speeches happen at the first Office it reaches, and every arrival after
* that runs expedited (`isExpedited` reads `speechMade`). Setting it here is idempotent on every
* later arrival, so it needs no guard against re-firing.
*/
if (trainProfile(tray.trainNumber ?? 0, tray.trainIsExtra)?.rules.stopThenExpedite) {
tray.speechMade = true;
@@ -1018,40 +1039,6 @@ function retireTrain(
// ---------------------------------------------------------------------------
function shiftChange(s: GameState, events: GameEvent[]): AdvanceResult {
/**
* EXPEDITED DEPARTURES — the last thing that happens in a Stage (Q3, and `arriveAtOffice`).
*
* Run here rather than as a phase of its own because there is no decision in it: the trains that
* arrived expedited this Stage try to leave, in train-number order like any other movement, and
* §8.1 may still hold them. Being after Load/Unload is the whole point — it is what gives the
* Porters their one Stage with the train.
*/
const expedited = [...s.trays.entries()]
.filter(([, t]) => t.departsThisStage)
.sort(([, a], [, b]) => (a.trainNumber ?? 0) - (b.trainNumber ?? 0));
for (const [id, tray] of expedited) {
tray.departsThisStage = false;
/**
* An expedited train that would need a §8.1 ruling STAYS, and runs normally from then on.
*
* Said in the log, because it is the difference between "this train leaves at the end of the
* Stage" and "this train is still here next turn", and a player watching one Expedited train
* vanish and the next one linger has no way to tell why. Measured on one seed: with ordinary
* traffic running, Train 6 was held this way and collected four Local Operations turns.
*/
if (moveTrain(s, id, tray, events, 'expedite') === 'needsClearance') {
events.push({
type: 'trainHeld',
trainNumber: tray.trainNumber ?? 0,
reason:
'it EXPEDITES and was due out at the end of this Stage, but the Subdivision ahead needs a ' +
'clearance ruling and Supervisor Shift has no Superintendent to give one. It stays, and ' +
'runs like an ordinary train from now on — so you DO get a Local Operations turn with it',
});
continue;
}
}
// §5 — the Fedora passes every three Stages: shift changes at Stages 3, 6, 9 and 12.
if (s.clock.stage % STAGES_PER_SHIFT === 0) {
s.clock.superintendent = playerLeftOf(s, s.clock.superintendent);
+14 -5
View File
@@ -486,11 +486,14 @@ function freightBudgetLeft(
}
/**
* Whether a train may do switching work at all (§7).
* Whether a train may set out or sort cars (§7).
*
* Six cards print "no switching" — the two expresses, the Light Engine, the Campaign, Circus and
* Military trains. They run the Division; they do not shunt. This covers moving, setting out and
* sorting alike, because all three are switching.
* Military trains — which means they may not ADD or DROP cars, not that they may never be touched: a
* train held at the Office may still need to clear onto Secondary Track ahead of other traffic. So
* this covers `switch.dropCars` and `switch.sortConsist` only; `switch.move` handles `noSwitching`
* itself, the same way it handles `dropOnly`, because the restriction has to bite on the pick-up a
* move would make, not on the move itself.
*/
function switchingRefusal(tray: CrewTray): RejectionCode | null {
return rulesOf(tray).noSwitching ? 'NO_SWITCHING' : null;
@@ -626,8 +629,6 @@ export function check(s: GameState, player: PlayerIndex, i: Intent): RejectionCo
if (turnOf(s, player).movesRemaining < 1) return 'NO_MOVES_REMAINING';
const tray = s.trays.get(i.trayId);
if (!tray) return 'NO_SUCH_TRAY';
const noSwitch = switchingRefusal(tray);
if (noSwitch) return noSwitch;
const from = trayCoord(s, i.trayId);
if (!from) return 'ILLEGAL_MOVE';
const dests = destinationsFor(s, player, i.trayId, from, i.reverse);
@@ -652,6 +653,14 @@ export function check(s: GameState, player: PlayerIndex, i: Intent): RejectionCo
*/
const fresh = dest.couples.slice(ownCutFor(s, player, i.trayId, i.reverse).length);
if (fresh.length > 0) {
/**
* "NO SWITCHING" MEANS NO ADDING OR DROPPING CARS, not "never move". A no-switching train
* held at the Office may still need to clear onto Secondary Track ahead of other traffic —
* §7 governs coupling, setting out and sorting, and a move that picks nothing up is none of
* those. Handled here, alongside `dropOnly`, rather than as a blanket refusal on the intent:
* the restriction has to bite on the pick-up itself, the same reasoning as the comment above.
*/
if (rules.noSwitching) return 'PICKUP_NOT_ALLOWED';
if (rules.dropOnly) return 'PICKUP_NOT_ALLOWED';
if (rules.pickUpEmptiesOnly && fresh.some((c) => c.loaded)) return 'EMPTIES_ONLY';
const freight = fresh.filter(isFreight).length;
+6
View File
@@ -1004,6 +1004,12 @@ export const MOVES_PER_LOCAL_OPS_NIGHT = 5;
export const LABORER_ACTIONS_PER_LOAD = 4;
export const COLLISION_PENALTY = 5;
export const COLLISION_FLOOR_PER_DAY = 3;
/**
* Q3 — an expedited train left parked off the Office when a Mainline Phase begins is a Station
* Master fault: the train was not kept ready to highball the moment the Subdivision allowed it.
* Charged every Phase it is caught there, not just once, since the fault is being left that way.
*/
export const EXPEDITE_FAULT_PENALTY = 1;
export function collectiveRevenueFloor(players: number, days: number): number {
return 3 * players * days;
+10 -3
View File
@@ -124,6 +124,13 @@ export type GameEvent =
| { type: 'trainHeld'; trainNumber: number; reason: string }
/** A train whose card pays for standing still (X18 Circus) collected on it. */
| { type: 'trainStoodStill'; trainNumber: number; where: string }
/**
* Q3 — A STATION MASTER FAULT. An expedited train is not to be held anywhere but the station: if
* it is still off the Office square — parked on Secondary Track, say, to clear a switching move —
* when a Mainline Phase begins, that is a failure to keep it ready to highball, and it costs
* Revenue. `where` names the square it was found on. Always followed by a `revenueChanged`.
*/
| { type: 'expediteFault'; player: PlayerIndex; trainNumber: number; where: string }
/**
* `why` is the RULE that let it go now, not a restatement of the move.
*
@@ -134,9 +141,9 @@ export type GameEvent =
*/
| { type: 'trainHighballed'; trainNumber: number; from: string; to: string; why: string }
/**
* `expedited` because it changes what the player must do RIGHT NOW. Q3 — an expedited train
* departs the same Stage it arrives, so there is no Local Operations turn in which to work it;
* every other train stands until the next Mainline Phase and can be switched in between.
* `expedited` flags a train that must not be left standing off the station (Q3) — it may be
* switched normally like any other arrival, but it has to be back on the Office square before the
* next Mainline Phase begins, or `expediteFault` fires.
*/
| { type: 'trainArrived'; trainNumber: number; consist: RollingStock[]; office: string; expedited: boolean }
| { type: 'trainDiverted'; trainNumber: number; to: string; reason: string }
+4 -9
View File
@@ -384,17 +384,12 @@ export type CrewTray = {
* X17 Campaign Train — "one turn at station (speeches) then expedite".
*
* It makes its speech at the first Office it reaches: that arrival is an ordinary stop, and from
* then on the train runs expedited, departing every Office in the Stage it arrives. Recorded on the
* tray for the same reason as `stopPointClaimed` — it is the TRAIN that stops, and an Extra runs
* once, so there is no later visit to hang it on.
* then on the train is expedited — it may be switched normally, but it faults (Q3) if it is left
* off the Office square when a Mainline Phase begins. Recorded on the tray for the same reason as
* `stopPointClaimed` — it is the TRAIN that stops, and an Extra runs once, so there is no later
* visit to hang it on.
*/
speechMade?: boolean;
/**
* Arrived expedited this Stage, so it departs at the END of the Stage rather than laying over to
* the next one (Q3). Set on arrival; cleared when `shiftChange` attempts the departure — after
* Load/Unload, which is what gives the Porters their one Stage with the train.
*/
departsThisStage?: boolean;
};
// ---------------------------------------------------------------------------
+3 -2
View File
@@ -552,7 +552,8 @@ export function officeSvg(
out += `<text class="bs-cn" x="6" y="12">${esc(cell.label)}</text>`;
out += `<text class="bs-coord" x="${W - 5}" y="12" text-anchor="end">${cell.row},${cell.col}</text>`;
// X,Y — east/west then north/south, not the internal row/col storage order.
out += `<text class="bs-coord" x="${W - 5}" y="12" text-anchor="end">${cell.col},${cell.row}</text>`;
/**
* THE ROSTER, one chip per A/D track — not one per train.
@@ -872,7 +873,7 @@ export function officeSvg(
out += `<g data-ghost="${g.row},${g.col}" transform="translate(${px(g.col)},${py(g.row)})" class="bs-ghost">` +
`<rect x="0" y="0" width="${W}" height="${H}" rx="4"/>` +
`<text x="${W / 2}" y="${H / 2}" text-anchor="middle">place here</text>` +
`<text class="bs-coord" x="${W / 2}" y="${H / 2 + 15}" text-anchor="middle">${g.row},${g.col}</text>` +
`<text class="bs-coord" x="${W / 2}" y="${H / 2 + 15}" text-anchor="middle">${g.col},${g.row}</text>` +
`</g>`;
}
+24 -30
View File
@@ -280,25 +280,25 @@ export function narrate(e: GameEvent, ctx: NarrateContext = {}): Narration {
};
case 'trainArrived':
/**
* AN EXPEDITED TRAIN IS NOT COMING BACK ROUND — AND IS NOT GONE YET EITHER.
* AN EXPEDITED ARRIVAL IS AN ORDINARY ARRIVAL, WITH ONE STANDING OBLIGATION.
*
* This said "it will highball again next Mainline Phase" to every arrival, which is backwards
* for an Expedited train. Corrected once to "it leaves again this same Mainline Phase", which
* was ALSO wrong and in a way that cost the player work: the expedited departure was moved to
* Supervisor Shift precisely so the Porters and Laborers get their Stage with the train, so
* Cargo IS available and only Local Operations is not. Telling a player there is "no turn in
* which to work it" talked them out of the one turn they had.
*
* So both branches now name the phases: what you can still do with this train, and when it
* goes. That is the whole of the reported confusion — "some trains seem to be moving before I
* can switch or do other operations on them".
* This used to say the train stands through Cargo and is forced out at the end of the Stage —
* true once, and wrong: Q3 means the train must not be PARKED anywhere but the station, not
* that it is rushed out early. It is switched, worked and released exactly like any other
* arrival; the only difference is what happens if it is left on Secondary Track when the next
* Mainline Phase begins (`expediteFault`).
*/
return {
tone: 'plain',
text: e.expedited
? `Train ${e.trainNumber} ARRIVED at the ${e.office} carrying ${carsLabel(e.consist)} — its card prints EXPEDITE, so it stands through the Cargo phase and departs at the END OF THIS STAGE. Porters and Laborers can work it now; it is normally gone before your next Local Operations turn, so it cannot be switched — unless §8.1 holds it for a ruling, in which case it stays and runs like any other train.`
? `Train ${e.trainNumber} ARRIVED at the ${e.office} carrying ${carsLabel(e.consist)} — its card prints EXPEDITE, so keep it on the Office square: parked anywhere else in the district when the next Mainline Phase begins costs a Revenue point. It works and switches normally in the meantime.`
: `Train ${e.trainNumber} ARRIVED at the ${e.office} carrying ${carsLabel(e.consist)} — it stands here for the rest of this Stage. You can work it in Cargo now, switch it in the NEXT Stage's Local Operations, and it departs in that Stage's Mainline Phase.`,
};
case 'expediteFault':
return {
tone: 'bad',
text: `Train ${e.trainNumber} was left at ${e.where}, off the station, when the Mainline Phase began — an expedited train must be kept ready to highball. Station Master fault.`,
};
case 'trainDiverted':
return {
tone: 'good',
@@ -582,7 +582,7 @@ export function impediments(s: GameState, player: PlayerIndex = 0): Impediment[]
// the board says it on the card instead.
if (b.kind === 'noStopping') continue;
out.push({
where: `${tray.trainNumber === null ? 'crew' : `Train ${tray.trainNumber}`} → (${b.coord.row},${b.coord.col})`,
where: `${tray.trainNumber === null ? 'crew' : `Train ${tray.trainNumber}`} → (${b.coord.col},${b.coord.row})`,
why: b.why,
// Not "stuck": these are the shape of the district and of the other trains in it, which is
// the puzzle rather than a fault. Amber, not red.
@@ -602,12 +602,10 @@ export function impediments(s: GameState, player: PlayerIndex = 0): Impediment[]
* said so.
*
* Reported again as "passenger trains arrive at my Office and move on before I can load or unload
* them", which turned out to be three separate silences. This block only looked at trains carrying
* them", which turned out to be two separate silences. This block only looked at trains carrying
* a LOADED coach, so a train arriving to PICK UP said nothing at all. A Whistle Post's Office card
* carries a passenger facility with zero Porters, so the engine answered `RESOURCE_SPENT` — "all
* Porters used" — to a player who had used none. And an expedited train leaves at the end of the
* Stage it arrives, so its one Load/Unload phase is now-or-never and nothing said which trains
* those are.
* Porters used" — to a player who had used none.
*
* §9.2 also requires an empty coach in the DIVISION YARD to swap into the train, which no panel
* mentioned at all.
@@ -620,8 +618,6 @@ export function impediments(s: GameState, player: PlayerIndex = 0): Impediment[]
.filter((t): t is NonNullable<typeof t> => !!t && t.consist.some((c) => c.type === 'coach'));
if (coachTrains.length > 0) {
const label = (t: (typeof coachTrains)[number]): string =>
t.trainNumber === null ? 'the local crew' : `Train ${t.trainIsExtra ? 'X' : ''}${t.trainNumber}`;
const say = (why: string, severity: Impediment['severity'] = 'waiting'): void => {
out.push({ where: 'Office — passengers', why, severity });
};
@@ -658,17 +654,6 @@ export function impediments(s: GameState, player: PlayerIndex = 0): Impediment[]
say('no EMPTY coach in the Division Yard to swap into the train (§9.2 requires one)');
}
}
// NOW OR NEVER. An expedited train leaves at the end of this Stage, so this is the only
// Load/Unload phase it will ever stand for — the exact thing the playtest report was about.
for (const t of coachTrains) {
if (!t.departsThisStage) continue;
say(
`${label(t)} is EXPEDITED — it leaves at the END of this Stage, so this is the only ` +
'Load/Unload phase it will stand for. Work it now or not at all.',
'risk',
);
}
}
}
@@ -748,6 +733,15 @@ export function cuesFor(events: readonly GameEvent[]): string[] {
// A train running the whole length of the Division pays every player, and it is the one event
// nobody made happen on the turn it lands. It should be heard, not found in the log.
if (e.type === 'trainCompleted') out.push('completed');
// A train pulling into an Office. `trainDiverted` (the Yard Office siding) is deliberately not
// included — that one goes straight to a work track without the A/D stop `arrive` depicts.
if (e.type === 'trainArrived') out.push('arrive');
// Only an OFFICE departure, not every highball: a fresh make-up leaving a Division Point already
// sounds `train` ("All aboard"), and a train clearing the whole Division already sounds
// `completed` — this is the one case neither of those covers.
if (e.type === 'trainHighballed' && e.from === 'the Office') out.push('depart');
// §10 — the one event nobody wants to hear and everybody needs to.
if (e.type === 'trainsDestroyed') out.push('crash');
if (e.type === 'stageBegan') {
// A Stage BEGINNING is the previous one ending — except the first, which is the game opening
// and has nothing behind it. A Day boundary rings the bell only: sounding both would collide,
+14 -19
View File
@@ -678,7 +678,8 @@ function sampleDetail(s: GameState, kind: string, list: Intent[]): string {
/** One readable line for a single intent. */
export function describeIntent(s: GameState, i: Intent): string {
const at = (c: { row: number; col: number }): string => `(${c.row},${c.col})`;
// X,Y — east/west then north/south, not the internal row/col storage order.
const at = (c: { row: number; col: number }): string => `(${c.col},${c.row})`;
// An intent belongs to whoever is acting, so it is described against THEIR district.
// The acting PLAYER, not a seat — `describeIntent` describes an intent against the district of
// whoever is making it. Named `seat` once, and then used as an `officeAreas` key, which is the
@@ -1229,7 +1230,7 @@ export function snapshot(
? `${t.position.side} Division Point`
: t.position.at === 'mainline'
? `Mainline card ${t.position.index}`
: `Office Area (${t.position.coord.row},${t.position.coord.col})`,
: `Office Area (${t.position.coord.col},${t.position.coord.row})`,
})),
};
}
@@ -1424,7 +1425,9 @@ export function trainRules(t: {
* DOES rather than that it exists, because the restriction is the whole character of the card: a
* Military train that cannot be worked by Porters plays nothing like a Local.
*/
if (p.rules.noSwitching) parts.push('NO SWITCHING — it runs the Division and does not shunt');
if (p.rules.noSwitching) {
parts.push('NO SWITCHING — may not add or drop cars, but may still be moved clear of the mainline');
}
if (p.rules.terminalsOnly) parts.push('TERMINALS ONLY — Porters may work it at a Terminal and nowhere else');
if (p.rules.coachStaysOnStationTrack) {
// Said "may only be set out at the Office", which reads as a place you can do it. You cannot:
@@ -1446,15 +1449,12 @@ export function trainRules(t: {
}
if (p.rules.expedite) {
// The single most-asked question in play — "why did that train leave before I could switch it?"
// — so it names the phases rather than the Stage. It stands through Cargo and goes at the end of
// the Stage, which is after the Porters and Laborers but before the next Local Operations.
// It is released and switched exactly like any other train — the restriction is on where it may
// be LEFT, not on when it leaves.
parts.push(
'EXPEDITED — it does not lay over. It stands through the Cargo phase and departs at the END OF ' +
'THE STAGE IT ARRIVES IN, so Porters and Laborers can work it but it is normally gone before ' +
'your next Local Operations turn and cannot be switched. UNLESS §8.1 wants a clearance ruling ' +
'at that moment: there is no Superintendent in Supervisor Shift to give one, so the train ' +
'stays and runs like any other from then on.',
'EXPEDITED — must be kept ready to highball. It works and switches normally, but if it is not ' +
'back on the Office square when the next Mainline Phase begins, that is a Station Master ' +
'fault and costs 1 Revenue.',
);
}
if (p.rules.stopEarnsPoint) parts.push('EARNS A POINT for one Stage spent standing still, once');
@@ -1736,14 +1736,9 @@ function switchingMoves(s: GameState, player: PlayerIndex): Frame['moves'] {
const out: Frame['moves'] = [];
for (const [id, tray] of s.trays) {
if (tray.position.at !== 'grid' || tray.position.seat !== seatOf(s, player)) continue;
/**
* A crew that may not switch is not a crew you can be switching.
*
* `movesFor` is pure track geometry — it answers where a train COULD roll — and six cards print
* "no switching", which `check` enforces and it does not. Offering the Circus Train in a "which
* train are you switching?" row is offering a train whose every move the rules refuse.
*/
if (trainProfile(tray.trainNumber ?? 0, tray.trainIsExtra)?.rules.noSwitching) continue;
// A no-switching train may still be moved clear of the mainline (§7) — only coupling, setting
// out and sorting are refused, and `check` rejects those the same way it rejects a pick-up X13
// (dropOnly) is not allowed to make, so this row is not filtered any differently for either.
const { to, blocked } = movesFor(s, player, id);
out.push({ trayId: id, label: trainName(s, id), from: tray.position.coord, to, blocked });
}
+3 -2
View File
@@ -344,7 +344,7 @@ export function actionGroups(game: Game): { options: Intent[]; groups: ActionGro
const tray = game.state.trays.get(trayId);
const where =
tray?.position.at === 'grid'
? `, standing at (${tray.position.coord.row}, ${tray.position.coord.col})`
? `, standing at (${tray.position.coord.col}, ${tray.position.coord.row})`
: '';
groups.push({
kind: prefix,
@@ -670,7 +670,8 @@ function subjectOf(
node?: number;
links: string[];
} | null {
const at = (c: { row: number; col: number }): string => `(${c.row}, ${c.col})`;
// X,Y — east/west then north/south, not the internal row/col storage order.
const at = (c: { row: number; col: number }): string => `(${c.col}, ${c.row})`;
/**
* ABS Signals is placed on a MAINLINE card, which is not in the Office Area at all — so it names
* a Division NODE and carries no coordinate. It used to travel as `{ row: -1, col: node }`, and
+43 -29
View File
@@ -11,6 +11,11 @@ body{margin:0;background:var(--bg);color:var(--fg);
font:15px/1.6 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:28px}
main{width:100%;max-width:760px}
.hero{display:flex;gap:24px;align-items:flex-start}
.hero-image{width:230px;flex:none;border-radius:9px;overflow:hidden;border:1px solid var(--line)}
.hero-image img{display:block;width:100%;height:auto}
.hero-content{flex:1;min-width:0}
@media(max-width:640px){.hero{flex-direction:column}.hero-image{width:100%;max-width:280px}}
h1{font-size:32px;margin:0 0 2px;letter-spacing:.02em}
.tag{color:var(--dim);margin:0;font-size:14px}
.blurb{color:#c6ccd6;margin:16px 0 26px;max-width:66ch}
@@ -32,39 +37,48 @@ footer{margin-top:26px;color:var(--dim);font-size:11px;display:flex;gap:18px;fle
</head>
<body>
<main>
<h1>Station Master</h1>
<p class="tag">TimeTable and Train Order (TT&amp;TO) railroading, 1840&ndash;1950.</p>
<div class="hero">
<div class="hero-image">
<img src="./images/station-master-splash.jpg"
alt="Station Master — TimeTable &amp; Train Order Railroading, 1840&ndash;1950. Box art: two trains meet at a junction beside a train order office."
width="560" height="700">
</div>
<div class="hero-content">
<h1>Station Master</h1>
<p class="tag">TimeTable and Train Order (TT&amp;TO) railroading, 1840&ndash;1950.</p>
<svg class="trackline" viewBox="0 0 700 24" preserveAspectRatio="none" aria-hidden="true">
<line class="rail" x1="0" y1="10" x2="700" y2="10"/>
<line class="rail" x1="0" y1="15" x2="700" y2="15"/>
<g id="ties"></g>
</svg>
<svg class="trackline" viewBox="0 0 700 24" preserveAspectRatio="none" aria-hidden="true">
<line class="rail" x1="0" y1="10" x2="700" y2="10"/>
<line class="rail" x1="0" y1="15" x2="700" y2="15"/>
<g id="ties"></g>
</svg>
<p class="blurb">
As Station Master in your line-side office, you manage the town's railroad connection. You are
responsible for all track between your Limits, a district of industries hanging beneath it, and
trains that arrive whether or not you are ready for them. Spot the right cars, work the loads,
and get every train away again &mdash; a train with nowhere to stand is a collision, and a
collision costs more than the freight was worth.
</p>
<p class="blurb">
As Station Master in your line-side office, you manage the town's railroad connection. You are
responsible for all track between your Limits, a district of industries hanging beneath it, and
trains that arrive whether or not you are ready for them. Spot the right cars, work the loads,
and get every train away again &mdash; a train with nowhere to stand is a collision, and a
collision costs more than the freight was worth.
</p>
<div class="doors">
<a class="door" href="./play.html">
<h2>Play solitaire</h2>
<p>Play by yourself and run the entire division for five full days. Your goal is 20 Revenue.
Your game data is saved in your browser &mdash; if you close the tab and reopen this site
without clearing your cache, your game is preserved and you can continue automatically.
During the game you can also explicitly save your progress for later replay.</p>
<span class="go">Start a game &rarr;</span>
</a>
<div class="doors">
<a class="door" href="./play.html">
<h2>Play solitaire</h2>
<p>Play by yourself and run the entire division for five full days. Your goal is 20 Revenue.
Your game data is saved in your browser &mdash; if you close the tab and reopen this site
without clearing your cache, your game is preserved and you can continue automatically.
During the game you can also explicitly save your progress for later replay.</p>
<span class="go">Start a game &rarr;</span>
</a>
<a class="door" href="./replays.html">
<h2>Replays</h2>
<p>Replay a saved game, step by step or advancing automatically through phases, Stages and
Days. Open one saved on the site, or a saved file that someone has sent you.</p>
<span class="go">Browse replays &rarr;</span>
</a>
<a class="door" href="./replays.html">
<h2>Replays</h2>
<p>Replay a saved game, step by step or advancing automatically through phases, Stages and
Days. Open one saved on the site, or a saved file that someone has sent you.</p>
<span class="go">Browse replays &rarr;</span>
</a>
</div>
</div>
</div>
<div class="rule"></div>
+2 -2
View File
@@ -819,8 +819,8 @@ function renderActions(
.map(
(m) =>
`<button class="act crew${m.trayId === chosen?.trayId ? ' on' : ''}" data-crew="${esc(m.trayId)}"${cellRef(m.from)} ` +
`data-tip="Draw this crew's reachable squares on the board, and show its moves below. ${esc(m.label)} is standing at (${m.from.row}, ${m.from.col}) with ${m.to.length} square${m.to.length === 1 ? '' : 's'} it can reach.">` +
`${esc(m.label)} <span class="dim">(${m.from.row}, ${m.from.col})</span></button>`,
`data-tip="Draw this crew's reachable squares on the board, and show its moves below. ${esc(m.label)} is standing at (${m.from.col}, ${m.from.row}) with ${m.to.length} square${m.to.length === 1 ? '' : 's'} it can reach.">` +
`${esc(m.label)} <span class="dim">(${m.from.col}, ${m.from.row})</span></button>`,
)
.join('') +
`</div>`;
+81 -17
View File
@@ -64,6 +64,38 @@ export function playCue(cue: string): void {
osc.stop(at + dur + 0.02);
};
/**
* A burst of filtered noise — the breath of steam behind a whistle, one chuff of a moving
* locomotive, or the boom of an impact. Shared by `stage` (one long burst) and the chuffs in
* `arrive`/`depart` (several short ones), and the wide-open burst under `crash`.
*/
const noiseBurst = (
at: number,
dur: number,
gain: number,
freq: number,
q: number,
type: BiquadFilterType = 'bandpass',
): void => {
const frames = Math.max(1, Math.floor(c.sampleRate * dur));
const buf = c.createBuffer(1, frames, c.sampleRate);
const data = buf.getChannelData(0);
for (let i = 0; i < frames; i++) data[i] = Math.random() * 2 - 1;
const src = c.createBufferSource();
src.buffer = buf;
const filt = c.createBiquadFilter();
filt.type = type;
filt.frequency.value = freq;
filt.Q.value = q;
const amp = c.createGain();
amp.gain.setValueAtTime(0, at);
amp.gain.linearRampToValueAtTime(gain, at + Math.min(0.05, dur / 4));
amp.gain.exponentialRampToValueAtTime(0.0001, at + dur);
src.connect(filt).connect(amp).connect(c.destination);
src.start(at);
src.stop(at + dur + 0.02);
};
const t = c.currentTime + 0.02;
if (cue === 'stage') {
@@ -73,23 +105,55 @@ export function playCue(cue: string): void {
for (const fg of [[392, 0.16], [466, 0.13], [587, 0.1], [784, 0.05]]) {
tone(t, fg[0]!, d, fg[1]!, 'sawtooth', fg[0]! * 0.985);
}
const frames = Math.floor(c.sampleRate * d);
const buf = c.createBuffer(1, Math.max(1, frames), c.sampleRate);
const data = buf.getChannelData(0);
for (let i = 0; i < frames; i++) data[i] = Math.random() * 2 - 1;
const src = c.createBufferSource();
src.buffer = buf;
const band = c.createBiquadFilter();
band.type = 'bandpass';
band.frequency.value = 1400;
band.Q.value = 0.8;
const amp = c.createGain();
amp.gain.setValueAtTime(0, t);
amp.gain.linearRampToValueAtTime(0.05, t + 0.05);
amp.gain.exponentialRampToValueAtTime(0.0001, t + d);
src.connect(band).connect(amp).connect(c.destination);
src.start(t);
src.stop(t + d);
noiseBurst(t, d, 0.05, 1400, 0.8);
return;
}
if (cue === 'arrive') {
/**
* A LOCOMOTIVE SLOWING TO A STOP: chuffs (one per wheel revolution) spaced FARTHER apart as
* road speed drops, then a soft two-partial bell tap as it settles — a lighter cousin of the
* `day` bell, not a repeat of it.
*/
let at = t;
const gaps = [0.13, 0.17, 0.22, 0.28];
for (let i = 0; i < gaps.length; i++) {
noiseBurst(at, 0.07, 0.11 - i * 0.015, 190, 1.1, 'bandpass');
at += gaps[i]!;
}
for (const fg of [[1046, 0.07], [1568, 0.04]]) {
tone(at + 0.12, fg[0]!, 0.3, fg[1]!, 'sine');
}
return;
}
if (cue === 'depart') {
/**
* THE INVERSE OF `arrive`: chuffs starting slow and pulling closer together as the train
* gathers speed, then one falling, fading horn note — a single call, not `completed`'s pair,
* since this train is only leaving the Office, not clearing the whole Division.
*/
let at = t;
const gaps = [0.22, 0.15, 0.1, 0.07, 0.05];
for (let i = 0; i < gaps.length; i++) {
noiseBurst(at, 0.06, 0.06 + i * 0.012, 210, 1.2, 'bandpass');
at += gaps[i]!;
}
tone(at, 349, 0.45, 0.1, 'sawtooth', 300);
return;
}
if (cue === 'crash') {
/**
* IMPACT, NOT MUSIC: two tones bent sharply downward at a DISSONANT (non-harmonic) interval,
* so the ear reads a collision rather than a chord — `couple`'s clank is consonant on purpose,
* and this is its opposite. A wide-open noise boom and a percussive sub-bass thump give it
* weight under the screech.
*/
tone(t, 311, 0.35, 0.16, 'square', 70);
tone(t, 233, 0.4, 0.13, 'sawtooth', 52);
noiseBurst(t, 0.4, 0.16, 900, 0.4, 'lowpass');
tone(t, 45, 0.3, 0.18, 'sine');
return;
}