79 lines
6.2 KiB
Markdown
79 lines
6.2 KiB
Markdown
# Change Request CR-006 — Boards That Fit Your Fleet
|
||
|
||
**Project:** Deadhead: Space Freight Tycoon
|
||
**Applies to:** a build with Phases 1–10 and CR-001 to CR-005 complete
|
||
**Do this:** as **Phase 10F**, after Phase 10E and before Phase 11
|
||
**Related docs:** `implementation-plan.md`, `CR-002-open-markets.md`, `DECISIONS.md`
|
||
|
||
---
|
||
|
||
## 1. Why
|
||
|
||
User feedback after CR-005:
|
||
|
||
> On the jobs list the weight should also be highlighted if your ship can't carry it. But I'd also like there to be more options that do fit your current stats and ship size instead of just one.
|
||
|
||
Each board has 8 contracts in three mass bands (3 up to a Courier's 20 t, 3 up to a Freighter's 100 t, 2 up to a Bulk Hauler's 400 t). Only the first contract of each band is guaranteed to be Standard cargo to a discovered place. The other two Courier-band jobs are usually skill-gated (High-Value tier 1–5) or first contact out of a Courier's range. A player with one Courier and an unskilled pilot typically has **one** job per board they can fly, and five of the eight contracts are for ships they don't own.
|
||
|
||
Boards are already generated per player (decision 0.5.21), so generation can look at the player's fleet.
|
||
|
||
## 2. How it works
|
||
|
||
| Rule | Detail |
|
||
|---|---|
|
||
| Fleet | Every ship the player owns, with its assigned pilot's skills (no pilot: no skills, like a fresh hire). Taken when the board is first generated in a period, like the discovered locations. |
|
||
| Flyable band | A band is flyable when some ship in the fleet can carry its minimum mass. |
|
||
| Preview slots | A band no ship can carry keeps `boardPreviewSlots` contracts (default 1): a look at what a bigger ship would earn. Its other slots move to flyable bands, largest flyable band first, round-robin. The board size does not change. |
|
||
| Fit slots | In a flyable band, all but `boardOpenSlotsPerBand` contracts (default 1) are **fit**: built for one ship of the fleet that can carry the band's minimum. Mass is within the band and that ship's capacity; the destination is discovered, reachable (range and landing) and needs no more Long Haul than its pilot has; the cargo is Standard or a skill cargo the pilot has, at a tier up to the pilot's level. Never first contact. |
|
||
| Open slots | The remaining contracts in a flyable band are generated as today (skill-gated, first contact or any). |
|
||
| No fit possible | If no ship of the fleet can reach any discovered place from this location, the slot is generated as today. |
|
||
| No fleet | With an empty fleet (or no fleet input) boards are generated exactly as before. |
|
||
|
||
Example, one Courier with an unskilled pilot at Earth: Courier band 3 + 2 freed (Freighter band keeps 1) + 1 freed (Hauler band keeps 1) = 6 contracts, **5 fit** (Earth → Moon, 5–20 t, Standard) and 1 open, plus one Freighter and one Bulk Hauler preview.
|
||
|
||
On the board, a contract's mass is highlighted when none of the player's ships can carry it: the ships at that location, or the whole fleet when none are there.
|
||
|
||
## 3. Rules for this change
|
||
|
||
- All rules in `implementation-plan.md` §0.1 apply. Update `progress.md` after every step.
|
||
- Board generation stays a pure, deterministic sim function: the same inputs (now including the fleet) give the same board.
|
||
- The two new numbers are config, not code.
|
||
- More flyable jobs means more income per board; the payout balance is Phase 12's job. Note anything that looks off.
|
||
|
||
## 4. Decisions
|
||
|
||
Record as plan §0.5.52–0.5.53.
|
||
|
||
- **0.5.52 Boards fit the fleet.** Location boards are generated with the player's fleet (ship models and pilot skills) as input. Bands the fleet can't carry shrink to a preview; in bands it can, all but a configured number of contracts are ones some ship-and-pilot pair can take.
|
||
- **0.5.53 Weight warning.** The board highlights a contract's mass when none of the player's ships at that location (or in the fleet, when none are there) can carry it. Display only.
|
||
|
||
## 5. Steps — Phase 10F
|
||
|
||
### Step 10F.1 — Client: weight warning
|
||
- On location boards, the mass is shown in rose with a "Too heavy" pill when it exceeds the largest capacity among the player's ships at that location (all ships when none are there). No ships at all: no warning.
|
||
- **Test:** a board with a 50 t job and a Courier at the location shows the warning on it and not on a 10 t job; with the Courier elsewhere and a Freighter at the location, no warning on 50 t.
|
||
- **Replaced by CR-019:** boards show only completable jobs, so the weight warning and its test are gone (Step 19.4).
|
||
|
||
### Step 10F.2 — Content: board config
|
||
- GameConfig gains `boardPreviewSlots` (default 1) and `boardOpenSlotsPerBand` (default 1), non-negative integers.
|
||
- **Test:** schema accepts and rejects them like other counts; defaults are as listed.
|
||
|
||
### Step 10F.3 — Sim: fleet-aware boards
|
||
- `BoardInput.fleet` (optional): `{ modelId, skills }[]`. Implement §2.
|
||
- **Test:** no fleet gives the same board as before (existing tests unchanged); determinism with a fleet; Courier-only fleet at Earth: board size unchanged, at least `bands' total − previews − open` fit contracts, each passing `checkRoute`, `checkPilotEligibility` and capacity for the Courier and pilot; a skilled pilot (High-Value 3) gets High-Value fit jobs at tiers ≤ 3 over many periods; a full fleet keeps the configured band counts.
|
||
- **Amended by CR-019:** With a fleet, only completable candidates are kept (no previews, no open jobs the fleet can't take); an empty fleet gets an empty board (Step 19.2).
|
||
|
||
### Step 10F.4 — Server: pass the fleet
|
||
- `locationBoard` reads the player's ships and their assigned pilots' skills and passes them as the fleet.
|
||
- **Amended by CR-019:** it passes the location's qualifying fleet instead (decision 0.5.115, Step 19.3).
|
||
- **Test:** a player with one Courier gets at least 5 Earth contracts that pass sim `validateDispatch` for that Courier and pilot.
|
||
|
||
### Step 10F.5 — Regression
|
||
- Plan amendments (§6), full suite, coverage, lint, build. Stop for review.
|
||
|
||
## 6. Amendments to earlier steps
|
||
|
||
- **Step 3.9 (board generation):** boards take the player's fleet as input (decision 0.5.52).
|
||
- **Step 6.9 (location board endpoint):** passes the player's fleet to generation.
|
||
- **Step 9.4 (contracts screen):** contracts too heavy for the player's ships are highlighted (decision 0.5.53).
|