Implement Enhancements, Mainline modifiers and Maneuvers; fix unplayable track

This commit is contained in:
Jesse
2026-07-31 11:02:54 -04:00
parent 401b879140
commit b085d5a0bb
20 changed files with 1853 additions and 50 deletions
+86 -3
View File
@@ -50,14 +50,97 @@ All nine answers are implemented, **170 tests passing**:
| Q8 Crew Tray cap | Already correct. |
| Q9 Second Section | `newTrain.secondSection` plays on a train due out; an identical train is made up behind it next New Train Phase. The **Sister trains optional rule is removed** from Appendix B. |
**Still not implemented**, and now the largest remaining block: the behaviour of the Enhancement
(18), Mainline-modifier (7) and Maneuver (7) cards, plus the Action (10) and Space-use (12) cards in
multiplayer. All are in the deck; playing them is rejected with `NOT_IMPLEMENTED`.
**Enhancements (18) are now implemented** — placement rules, Small Yard consist re-ordering, ABS
Signals, Yard Office diversion, Interlocking, the Telegraph/Telephone/Radio dispatch bonuses and the
three defensive cards, covered by `test/enhancements.test.ts`.
**Mainline modifiers (7) and Maneuvers (6 of 7) are now implemented**, covered by
`test/mainline-cards.test.ts`. They are *not* multiplayer-only — that was a mistaken impression
given earlier. Brakeman, Airbrakes, Helpers and Realignment all change your own crossing times, and
Red Flags prevents a rear-ender, which happens in solitaire too. The real reason they lagged was
sequencing: Enhancements were done first because they change core loops.
| Card | Where it lives | Effect |
| --- | --- | --- |
| Brakeman, Airbrakes | `mainline.modify` on a grade | 1 Stage downhill each; Airbrakes needs Brakeman on the card |
| Helpers | `mainline.modify` on a grade | 1 Stage uphill |
| Realignment ×2 | `mainline.modify` on any Mainline card | converts per `REALIGNMENTS`; barred while a train is on the card |
| Facing Point Locks ×2 | grid, as the Enhancement | the sheet prints this card in **both** lists — one card, not two |
| Red Flags ×5 | `maneuver.redFlags` on a stopped train | an approaching train is held instead of colliding; flags come in when the train rolls |
| Flying Switch | `maneuver.flyingSwitch` during switching | cuts cars into an adjacent industry without the engine entering; costs a Move |
| Poling | — | **deliberately unimplemented** |
Crossing time never falls below one Stage — a train cannot cross in no time.
**Poling stays unimplemented.** The recovered sheet records its effect as "TBD in the source", so
there is nothing to build. A test asserts it remains TBD, to stop anyone "fixing" it by inventing
an effect; a silent no-op would be worse than a rejection.
> **Open question (Q11).** The sheet says Brakeman and Airbrakes give "faster passage downhill" and
> Helpers "faster passage uphill", but never says **which way a Heavy Grade climbs**. Modelled as
> climbing **eastward** — eastbound is uphill, westbound downhill. If grades instead carry their own
> direction, this becomes a property of the Mainline node rather than a constant.
**Still not implemented**: the Action (10) and Space-use (12) cards, which are genuinely
multiplayer-only. Playing them is rejected with `NOT_IMPLEMENTED`.
### Track was unplayable (found while wiring up Enhancements)
Moving track out of the deck into a per-player supply (§12.2) left **no way to play it**. Districts
could only grow through Freight-Facility and Modifier cards, so the Running-Track and
Secondary-Track *straights* that Enhancements attach to essentially never existed. Two bugs
compounded it: `legalActions` offered Enhancements only **empty** grid cells, when an Enhancement
attaches to an **occupied** card.
Measured before the fix: a hand held a playable Enhancement on **4,778** turns and could legally
place one on **33** — and those 33 were all ABS Signals, which targets a Mainline card rather than
the grid.
Fixed by adding a `track.lay` intent drawing from `OfficeArea.trackSupply`, and by giving
Enhancements the occupied cells as candidates. Enhancement placements went 21 → 98 per 40 games.
> **Open question (Q10).** The design moves track to a per-player supply but never says *when* a
> piece may be laid. It is currently treated as a play available during the "draw a card" option,
> limited to **one piece a turn** — which is how track behaved when it *was* a card. This is an
> assumption, flagged in `intents.ts`, and needs confirming.
### Measurement after the answers
100 solitaire Standard games: mean revenue **1.3**, trains scheduled **2.8**, cards played **11.3**.
After Enhancements and the track fix: mean revenue **0.0**, trains scheduled **2.9**, cards played
**13.9**, collisions **0.3**. Still **0 wins against a target of 20**.
### Gap 12 resolved — industry density
The shortfall was structural rather than a missing rule. Freight was 10% of gross revenue and
`carsCoupled` fired **4 times in 100 games**: the chain needs a Freight Facility, an empty car of
its exact type spotted on its industry track, three Laborer advances, and then a crew with spare
capacity to lift the load — and there were only **1.6 freight facilities per game**, because the
recovered sheet puts **9 industries in a 115-card deck** where the prototype had 10 in 52.
**Every industry's `copies` is tripled: 9 → 27, deck 115 → 133** (solitaire 93 → 111). Tripling
uniformly restores roughly the prototype ratio while preserving the sheet's proportions exactly —
the outbound/inbound balance and the lockout structure are untouched.
`ROLLING_STOCK_SUPPLY` scaled with it, from 62 pieces to **80**: worst-case demand at 27 industries
is boxcar 15, hopper 12, tank 9, reefer 6, and a Division Yard that runs dry would starve the very
loop the increase exists to feed. That supply was already flagged as provisional, not transcribed.
| | 9 industries / 115 | 27 industries / 133 |
| --- | --- | --- |
| revenue per player | 0.0 | **1.1** |
| freight facilities per game | 1.6 | **3.6** |
| freight share of gross | 10% | **18%** |
| laborer actions | 9.8 | **16.9** |
| collisions | 0.3 | **0.1** |
| trains scheduled | 2.9 | **2.1** |
First positive mean revenue recorded, and the `carsCoupled` anomaly cleared. **Still 0 wins against
a target of 20**, so this is progress on a diagnosis, not a balanced game. Note the side effect:
trains scheduled fell 2.9 → 2.1, because 22 train cards in 133 are drawn less often than 22 in 115.
Train density may need the same treatment.
Still no wins, and still **not a verdict** — roughly a third of the deck does nothing yet, and the
Small Yard enhancement (which is what makes the switching puzzle solvable) is among the unimplemented
cards. Gap 12 stays invalidated until the enhancements are in.