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
+56 -19
View File
@@ -468,9 +468,10 @@ describe('§8.1 — a train that just arrived from the mainline stops for the St
* Nothing states the rule, which makes it exactly the kind of property a later change to the loop
* would break in silence. These pin it.
*
* It is also what gives the printed **Expedite** rule something to do — an Expedited train departs
* at the END of the Stage it arrived, precisely because the general rule forbids it departing at
* all. It stands through Load/Unload first, which is what makes its coaches workable.
* v0.4.9 CORRECTED Q3 so **Expedite is not an exception to this any more**: an Expedited train
* stops for the Stage exactly like any other and may be switched in the Local Operations turn that
* follows. What Expedite restricts is where the train may be left standing afterwards, not when it
* departs — see `advance.test.ts`'s `expediteFault` coverage for that half.
*/
const arriving = (s: GameState, trainNumber: number, isExtra = false): string => {
const id = 'arriving';
@@ -503,12 +504,14 @@ describe('§8.1 — a train that just arrived from the mainline stops for the St
);
});
it('unless its card prints Expedite — but it still stands through Load/Unload first', () => {
it('an Expedite train follows the same rule now — no exception any more', () => {
/**
* Q3, as revised in v0.4.2. An Expedite train leaves the Stage it arrives, but at the END of that
* Stage rather than inside the Mainline Phase. It used to be gone before Load/Unload ran, which
* made the coaches on every coach-carrying express (1/2, 5/6, 19) permanently unworkable —
* measured, Train 2 arrived 32 times in 60 games and stood for Load/Unload in none of them.
* Q3, as CORRECTED in v0.4.9. Before this, an Expedite train left the Stage it arrived — at the
* end of it rather than inside the Mainline Phase (v0.4.2's fix for coaches otherwise never
* reaching Load/Unload) — which made it the one exception to "stops for the Stage". That forced
* departure is gone: Expedite no longer changes WHEN a train leaves, only where it may be left
* standing afterwards (`expediteFault`, pinned in `advance.test.ts`). So it stops for the Stage
* exactly like Train 9 above.
*/
const s = game();
assert.equal(trainProfile(3, false)?.rules.expedite, true, 'train 3 should be an Expedite train');
@@ -518,19 +521,9 @@ describe('§8.1 — a train that just arrived from the mainline stops for the St
assert.equal(
s.trays.get(id)!.position.at, 'grid',
'an Expedite train left inside the Mainline Phase, before Load/Unload could reach it',
'an Expedite train departed again in the same Stage it arrived from a mainline card',
);
assert.equal(s.trays.get(id)!.departsThisStage, true, 'it is not flagged to leave at the end of the Stage');
assert.ok(areaOf(s, 0).adOccupancy.includes(id), 'it is not standing on an A/D track');
// Run the end of the Stage directly. Load/Unload waits on the player, and the thing under test
// is the departure pass that follows it — not that phase's own input handling.
s.clock.phase = 'shiftChange';
advance(s);
assert.notEqual(
s.trays.get(id)?.position.at, 'grid',
'an Expedite train should be gone by the end of the Stage it arrived',
);
});
});
@@ -666,6 +659,50 @@ describe('Telegraph, Telephone and Radio dispatch meets', () => {
assert.deepEqual(s.trays.get('mine')!.position, { at: 'divisionPoint', side: 'west' });
});
it('holds against an uncleared facing train even if a same-direction one is checked first', () => {
// Reproduces a playtest report: the Superintendent was asked to rule on a same-direction train
// instead of being automatically held against an opposite-direction one also occupying the
// card. Root cause — `evaluateClearance` returned on whichever occupant it examined first, in
// `node.transits` insertion order, rather than checking every occupant. Only visible once a
// card can hold two trains at once, which the Telegraph/Telephone/Radio exception is exactly
// what creates: a facing train dispatched past another sits on the same card as it.
const s = game();
const ml = s.division.nodes[1];
assert.equal(ml?.kind, 'mainline');
if (ml?.kind === 'mainline') {
ml.card = 'plains';
// SAME direction, entered the transit list FIRST — what the old code asked about.
s.trays.set('sameDir', {
id: 'sameDir', trainNumber: 3, trainIsExtra: false, engineAt: 0,
consist: [], direction: 'east', position: { at: 'mainline', index: 1 }, movesUsed: 0,
});
ml.transits.push({ tray: 'sameDir', stagesRemaining: 2, stagesTotal: 2, direction: 'east' });
// OPPOSITE direction, entered SECOND, no dispatch device on the board — an absolute bar.
s.trays.set('facing', {
id: 'facing', trainNumber: 5, trainIsExtra: false, engineAt: 0,
consist: [], direction: 'west', position: { at: 'mainline', index: 1 }, movesUsed: 0,
});
ml.transits.push({ tray: 'facing', stagesRemaining: 2, stagesTotal: 2, direction: 'west' });
}
s.trays.set('mine', {
id: 'mine', trainNumber: 9, trainIsExtra: false, engineAt: 0,
consist: [], direction: 'east', position: { at: 'divisionPoint', side: 'west' }, movesUsed: 0,
});
s.clock.phase = 'mainline';
s.movedThisPhase = new Set();
const r = advance(s);
assert.equal(
s.trays.get('mine')!.position.at, 'divisionPoint',
'the train entered despite an uncleared opposite-direction occupant on the card',
);
assert.ok(
!r.events.some((e) => e.type === 'clearanceRequested'),
'the Superintendent was asked to rule on the same-direction occupant instead of an automatic hold',
);
});
it('lets a junior train win the meet with a Telegraph', () => {
// Train 9 against Train 3: +4 makes the other count as 7 — still senior. Radio's +12 wins.
const s = game();