From 15b3b4fd75cf91461426c7969dcd1556587bb019 Mon Sep 17 00:00:00 2001 From: "nori-sessions[bot]" <264258699+nori-sessions[bot]@users.noreply.github.com> Date: Sun, 1 Nov 2026 14:02:00 +0000 Subject: [PATCH 1/4] Staff: one mechanic per breakdown, no freezing on queue targets, rescue onto the park's network - A mechanic skips a broken or due ride that a nearer mechanic is already heading for, so extra mechanics answer other breakdowns instead of following each other as a pack. - Wandering staff only keep or pick destinations they can reach; a queue tile (walkable but outside the walk graph) froze a handyman for the rest of the game. - A worker standing off the paths is put on the network the guests enter by when it can be, not on a cut-off stretch of path where it could never reach a ride or litter. Co-authored-by: Nori --- src/sim/staff/garden-and-repair.test.ts | 61 +++++++++++++++++++++++++ src/sim/staff/staff-care.test.ts | 30 ++++++++++++ src/sim/staff/staff-system.ts | 53 +++++++++++++++++---- 3 files changed, 136 insertions(+), 8 deletions(-) diff --git a/src/sim/staff/garden-and-repair.test.ts b/src/sim/staff/garden-and-repair.test.ts index b4967ad46..973822850 100644 --- a/src/sim/staff/garden-and-repair.test.ts +++ b/src/sim/staff/garden-and-repair.test.ts @@ -1,5 +1,6 @@ import { describe, expect, it } from 'vitest'; import { Simulation } from '../core/simulation'; +import { TILE_UNITS } from '../core/constants'; import { Surface } from '../map/tile-map'; import { placePath, setPathAddition, PathAddition } from '../map/paths'; import { RidePhase, RideState } from '../rides/ride-store'; @@ -175,6 +176,66 @@ describe('mechanic response', () => { expect(w.rides.cols.lastInspectionTick[w.rides.idToSlot[dueId]]).toBe(0); }); + it('sends a second mechanic to a second breakdown instead of the one already answered', () => { + const w = flatWorld(40, 5); + layPath(w, row(7, 2, 37)); + const nearId = createRide(w, RideType.MerryGoRound, 6, 8); + const farId = createRide(w, RideType.MerryGoRound, 32, 8); + for (const id of [nearId, farId]) { + const slot = w.rides.idToSlot[id]; + w.rides.cols.state[slot] = RideState.Open; + w.rides.cols.phase[slot] = RidePhase.Waiting; + w.rides.cols.queueConnected[slot] = 1; + triggerRideBreakdown(w, id); + } + for (let i = 0; i < 2; i++) { + spawnStaff(w, StaffKind.Mechanic); + w.staff.cols.x[i] = (15 + i) * TILE_UNITS + TILE_UNITS / 2; + w.staff.cols.y[i] = 7 * TILE_UNITS + TILE_UNITS / 2; + } + const near = w.rides.idToSlot[nearId]; + const far = w.rides.idToSlot[farId]; + let nearFixedAt = -1; + let farFixedAt = -1; + + for (let i = 0; i < 8000 && farFixedAt < 0; i++) { + w.tick++; + staffSystem.update(w); + if (nearFixedAt < 0 && w.rides.cols.state[near] === RideState.Open) nearFixedAt = w.tick; + if (w.rides.cols.state[far] === RideState.Open) farFixedAt = w.tick; + } + + // The 26 tiles from the near ride to the far one take about three times the 9-tile walk to + // the near ride, so a mechanic who set out only after the near repair would finish far later. + expect(nearFixedAt).toBeGreaterThan(0); + expect(farFixedAt).toBeGreaterThan(0); + expect(farFixedAt - nearFixedAt).toBeLessThan(nearFixedAt); + }); + + it('joins the park network rather than a cut-off path when placed off the paths', () => { + const w = flatWorld(30, 6); + layPath(w, row(7, 2, 20)); + w.park.entranceX = 2; + w.park.entranceY = 7; + layPath(w, [...row(20, 22, 27), ...row(21, 22, 27)]); + const rideId = createRide(w, RideType.MerryGoRound, 6, 8); + const slot = w.rides.idToSlot[rideId]; + w.rides.cols.state[slot] = RideState.Open; + w.rides.cols.phase[slot] = RidePhase.Waiting; + w.rides.cols.queueConnected[slot] = 1; + triggerRideBreakdown(w, rideId); + spawnStaff(w, StaffKind.Mechanic); + w.staff.cols.x[0] = 24 * TILE_UNITS + TILE_UNITS / 2; + w.staff.cols.y[0] = 18 * TILE_UNITS + TILE_UNITS / 2; + + for (let i = 0; i < 6000 && w.rides.cols.state[slot] !== RideState.Open; i++) { + w.tick++; + staffSystem.update(w); + } + + expect(w.rides.cols.state[slot]).toBe(RideState.Open); + }); + it('leaves a broken ride for later when repair orders are disabled', () => { const w = flatWorld(16, 3); layPath(w, [...row(6, 4, 10), [7, 7], [7, 8]]); diff --git a/src/sim/staff/staff-care.test.ts b/src/sim/staff/staff-care.test.ts index c619a1e21..30e4e58b1 100644 --- a/src/sim/staff/staff-care.test.ts +++ b/src/sim/staff/staff-care.test.ts @@ -4,6 +4,7 @@ import { hashWorld } from '../core/hash'; import { LedgerCategory } from '../economy/ledger'; import { placePath } from '../map/paths'; import { Surface } from '../map/tile-map'; +import { TILE_UNITS } from '../core/constants'; import { FLOWER_BED, FLOWER_BED_COST_CENTS, GROUNDS_GROW_INTERVAL } from './grounds'; import { MAX_STAFF_NAME_LENGTH, @@ -142,6 +143,35 @@ describe('security guards', () => { }); }); +/** Long enough for a wandering handyman to have picked a queue tile as a destination. */ +const WANDER_WARM_UP_TICKS = 6000; + +describe('handymen wandering beside queues', () => { + it.each([1, 2, 3, 4, 5, 6])( + 'keep walking instead of freezing on a queue line they cannot enter (seed %i)', + (seed) => { + const sim = grassSim(seed, 24); + const map = sim.world.map; + for (let x = 2; x <= 21; x++) placePath(map, { x, y: 12, z: 2 }); + for (let y = 2; y <= 10; y++) + for (let x = 2; x <= 21; x++) placePath(map, { x, y, z: 2, queue: true }); + hire(sim, StaffKind.Handyman); + const w = sim.world; + for (let tick = 0; tick < WANDER_WARM_UP_TICKS; tick++) sim.step(); + + const visited = new Set(); + for (let tick = 0; tick < 2000; tick++) { + sim.step(); + visited.add( + map.index((w.staff.cols.x[0] / TILE_UNITS) | 0, (w.staff.cols.y[0] / TILE_UNITS) | 0), + ); + } + + expect(visited.size).toBeGreaterThan(3); + }, + ); +}); + describe('patrol masks', () => { it('keeps painted tiles private to the worker who receives them', () => { const sim = grassSim(7, 32); diff --git a/src/sim/staff/staff-system.ts b/src/sim/staff/staff-system.ts index c66632f2b..7cd734273 100644 --- a/src/sim/staff/staff-system.ts +++ b/src/sim/staff/staff-system.ts @@ -2,6 +2,7 @@ import type { System } from '../core/system'; import type { World } from '../core/world'; import { TILE_UNITS, Z_STEP } from '../core/constants'; import { resolveGraph } from '../pathfinding/graph'; +import { networkFor } from '../pathfinding/network'; import { isReachable, nextDirection, DEFAULT_STAFF_OPTS } from '../pathfinding/navigate'; import type { PatrolMask } from '../pathfinding/navigate'; import type { NavOptions } from '../pathfinding/navigate'; @@ -75,14 +76,23 @@ function moveStaff( navOptions.patrol = navPatrol; const dir = nextDirection(world, from, target, world.rng, navOptions); if (dir < 0) { + // Prefer the network guests enter by, so a worker is never put on a cut-off stretch of path. + const net = networkFor(resolveGraph(map)); + const gate = + world.park.entranceX >= 0 ? map.index(world.park.entranceX, world.park.entranceY) : -1; + const gateComponent = gate >= 0 && map.isWalkable(gate) ? net.component(gate) : -1; let best = -1; + let bestJoined = false; let distance = 0x7fffffff; for (let i = 0; i < walkableCount; i++) { const tile = walkableTiles[i]; if (!patrolAllows(patrol, tile)) continue; + const joined = gateComponent >= 0 && net.component(tile) === gateComponent; + if (bestJoined && !joined) continue; const d = Math.abs((tile % map.width) - x) + Math.abs(((tile / map.width) | 0) - y); - if (d < distance) { + if (d < distance || (joined && !bestJoined)) { best = tile; + bestJoined = joined; distance = d; } } @@ -359,6 +369,7 @@ export function createStaffSystem(): System { if (!broken && !inspectionDue) continue; const rideX = rideServiceX(world, i); const rideY = rideServiceY(world, i); + if (answeredByNearerMechanic(world, slot, rideX, rideY)) continue; let serviceTile = -1; for (let dir = 0; dir < 4; dir++) { const tileX = rideX + DIR_DX[dir]; @@ -546,24 +557,50 @@ function binHasFullSide(data: number): boolean { * Staying within a few tiles keeps the route search short; a worker with nowhere close falls * back to any walkable tile in its patrol. */ +/** + * True when another mechanic already heads for the tile beside this ride's service point and is + * nearer to it (or as near, with the earlier slot), so one breakdown calls one mechanic. + */ +function answeredByNearerMechanic( + world: World, + slot: number, + rideX: number, + rideY: number, +): boolean { + const staff = world.staff.cols; + const own = + Math.abs(((staff.x[slot] / TILE_UNITS) | 0) - rideX) + + Math.abs(((staff.y[slot] / TILE_UNITS) | 0) - rideY); + for (let other = 0; other < world.staff.count; other++) { + if (other === slot || staff.kind[other] !== StaffKind.Mechanic) continue; + if (Math.abs(staff.targetX[other] - rideX) + Math.abs(staff.targetY[other] - rideY) !== 1) + continue; + const theirs = + Math.abs(((staff.x[other] / TILE_UNITS) | 0) - rideX) + + Math.abs(((staff.y[other] / TILE_UNITS) | 0) - rideY); + if (theirs < own || (theirs === own && other < slot)) return true; + } + return false; +} + function wander(world: World, slot: number, patrol: PatrolMask, mapSize: number): void { const staff = world.staff.cols; const map = world.map; const x = (staff.x[slot] / TILE_UNITS) | 0; const y = (staff.y[slot] / TILE_UNITS) | 0; + const here = map.index(x, y); + // Queue lines are walkable but sit outside the walk graph, so only reachable tiles qualify. + const usable = (tile: number) => + patrolAllows(patrol, tile) && map.isWalkable(tile) && isReachable(world, here, tile); const target = mapIndex(world, staff.targetX[slot], staff.targetY[slot]); const arrived = staff.targetX[slot] === x && staff.targetY[slot] === y; - if (!arrived && target >= 0 && patrolAllows(patrol, target) && map.isWalkable(target)) return; + if (!arrived && target >= 0 && usable(target)) return; for (let attempt = 0; attempt < WANDER_NEAR_ATTEMPTS; attempt++) { const tx = x + world.rng.int(2 * WANDER_RADIUS_TILES + 1) - WANDER_RADIUS_TILES; const ty = y + world.rng.int(2 * WANDER_RADIUS_TILES + 1) - WANDER_RADIUS_TILES; if (!map.inBounds(tx, ty)) continue; const candidate = map.index(tx, ty); - if ( - candidate !== map.index(x, y) && - patrolAllows(patrol, candidate) && - map.isWalkable(candidate) - ) { + if (candidate !== here && usable(candidate)) { staff.targetX[slot] = tx; staff.targetY[slot] = ty; return; @@ -571,7 +608,7 @@ function wander(world: World, slot: number, patrol: PatrolMask, mapSize: number) } for (let attempt = 0; attempt < 24; attempt++) { const candidate = world.rng.int(mapSize); - if (patrolAllows(patrol, candidate) && map.isWalkable(candidate)) { + if (usable(candidate)) { staff.targetX[slot] = candidate % map.width; staff.targetY[slot] = (candidate / map.width) | 0; return; From d784116c1bcf30db5e436ac5e00fad344c64a47b Mon Sep 17 00:00:00 2001 From: "nori-sessions[bot]" <264258699+nori-sessions[bot]@users.noreply.github.com> Date: Sun, 1 Nov 2026 14:02:02 +0000 Subject: [PATCH 2/4] Tidewater Docks and Thunderhead Mesa: legal winning strategies Site plans re-laid on each park's new-game map so rides have real queues (the old plans put most rides at lateral 2 with no queue tiles, so four walkers saturated each one), with bins on every footpath, research funding off, the Tidewater loan repaid before expanding to the piers, and patrols that cover the Thunderhead cliff trail. New site-plan steps: bins, repay, wait, flat-step clearing, route bins, null patrols, research funding. runScenario gains realResearch. bench/hard-park-wins.test.ts plays both parks to their deadlines on the scenario seed with the scenario's own research and asserts a win. Co-authored-by: Nori --- bench/hard-park-wins.test.ts | 96 ++++++++ bench/strategy/plans/thunderhead-mesa.json | 246 ++++++++++++++++----- bench/strategy/plans/tidewater-docks.json | 228 ++++++++++++++++--- bench/strategy/run.ts | 7 +- bench/strategy/site-plan.ts | 84 ++++++- bench/strategy/site.ts | 21 +- bench/strategy/strategies.ts | 56 +++-- 7 files changed, 628 insertions(+), 110 deletions(-) create mode 100644 bench/hard-park-wins.test.ts diff --git a/bench/hard-park-wins.test.ts b/bench/hard-park-wins.test.ts new file mode 100644 index 000000000..e6631281a --- /dev/null +++ b/bench/hard-park-wins.test.ts @@ -0,0 +1,96 @@ +import { mkdirSync, writeFileSync } from 'node:fs'; +import { join } from 'node:path'; +import { describe, expect, it } from 'vitest'; +import { serialize } from '../src/save/save'; +import { Simulation } from '../src/sim/core/simulation'; +import { TICKS_PER_MONTH } from '../src/sim/economy/calendar'; +import { rideQueueCapacity } from '../src/sim/rides/ride-operations'; +import { RideState } from '../src/sim/rides/ride-store'; +import { RIDE_CATALOG } from '../src/sim/rides/ride-types'; +import type { RideType } from '../src/sim/rides/ride-types'; +import { SCENARIOS } from '../src/sim/scenario/catalog'; +import { ScenarioStatus } from '../src/sim/scenario/scenario'; +import { prepareScenarioPark } from '../src/sim/scenario/scenario-layout'; +import { runScenario } from './strategy/run'; +import { STRATEGIES } from './strategy/strategies'; + +/** + * Plays Tidewater Docks and Thunderhead Mesa to their deadlines on the map a new game generates + * (the scenario's own seed), with the scenario's own research, cash and loan, and only the + * commands a player issues. Each must end in a win. With HARD_PROOF_SAVES set, the won park is + * saved there for the browser screenshots. + */ + +const TIMEOUT_MS = 300_000; + +const QUEUED_CATEGORIES = new Set(['gentle', 'thrill', 'coaster', 'water', 'transport']); + +/** Tile the browser proof centres on: a busy part of each won park. */ +const FOCUS: Record = { + 'tidewater-docks': [16, 47], + 'thunderhead-mesa': [46, 16], +}; + +function startingResearch(id: string): number[] { + const def = SCENARIOS.find((s) => s.id === id)!; + const sim = new Simulation({ seed: def.seed, width: def.mapWidth, height: def.mapHeight }); + prepareScenarioPark(sim.world, def); + return [...sim.world.research.unlocked].sort((a, b) => a - b); +} + +for (const id of ['tidewater-docks', 'thunderhead-mesa']) { + describe(id, () => { + const def = SCENARIOS.find((s) => s.id === id)!; + + it( + 'wins on the new-game map with the scenario research, its rides open and queueing', + () => { + let research: number[] = []; + const shortQueues: string[] = []; + const unopened: string[] = []; + let finalWorld: Simulation['world'] | null = null; + const result = runScenario(def, STRATEGIES[id], { + seed: def.seed, + realResearch: true, + onMonth: (month, world) => { + if (month === 1) research = [...world.research.unlocked].sort((a, b) => a - b); + finalWorld = world; + if (month !== 12) return; + const rides = world.rides.cols; + for (let slot = 0; slot < world.rides.count; slot++) { + const ride = RIDE_CATALOG[rides.typeId[slot] as RideType]; + const where = `${ride.name} at ${rides.rideX[slot]},${rides.rideY[slot]}`; + const state = rides.state[slot]; + if (state !== RideState.Open && state !== RideState.Broken) unopened.push(where); + if (QUEUED_CATEGORIES.has(ride.category) && rideQueueCapacity(world, slot) <= 4) + shortQueues.push(where); + } + }, + }); + + const dir = process.env.HARD_PROOF_SAVES; + if (dir && finalWorld) { + const world: Simulation['world'] = finalWorld; + mkdirSync(dir, { recursive: true }); + writeFileSync(join(dir, `${id}-won.ocsave`), serialize(world)); + const [x, y] = FOCUS[id]; + const z = world.map.heights[world.map.index(x, y)]; + writeFileSync(join(dir, `${id}-won.json`), JSON.stringify({ focus: [x, y, z] })); + } + + expect(research, 'starts from the scenario research').toEqual( + expect.arrayContaining(startingResearch(id)), + ); + expect(research.length, 'the catalog is not unlocked up front').toBeLessThan( + Object.keys(RIDE_CATALOG).length, + ); + expect.soft(unopened, 'every ride placed in the first year opens').toEqual([]); + expect.soft(shortQueues, 'rides have room to queue').toEqual([]); + expect(result.status, JSON.stringify(result)).toBe(ScenarioStatus.Won); + expect(result.tick).toBeGreaterThanOrEqual(def.objective.byTick); + expect(result.tick).toBeLessThan(def.objective.byTick + TICKS_PER_MONTH); + }, + TIMEOUT_MS, + ); + }); +} diff --git a/bench/strategy/plans/thunderhead-mesa.json b/bench/strategy/plans/thunderhead-mesa.json index 93351160d..f313d8368 100644 --- a/bench/strategy/plans/thunderhead-mesa.json +++ b/bench/strategy/plans/thunderhead-mesa.json @@ -1,9 +1,4 @@ [ - { "kind": "item", "name": "foodStall" }, - { "kind": "item", "name": "drinkStall" }, - { "kind": "item", "name": "toilets" }, - { "kind": "item", "name": "merryGoRound" }, - { "kind": "route", "points": [[46, 20]], "clear": true }, { "kind": "route", "points": [ @@ -21,61 +16,202 @@ [24, 54] ], "clear": true, - "from": [46, 20] - }, - { "kind": "flat", "grid": [46, 20, "west"], "row": 2, "lateral": -6, "name": "swingingShip" }, - { "kind": "flat", "grid": [46, 20, "west"], "row": 4, "lateral": 2, "name": "ferrisWheel" }, - { "kind": "flat", "grid": [46, 20, "west"], "row": 9, "lateral": 2, "name": "swingingShip" }, - { "kind": "flat", "grid": [46, 20, "west"], "row": 9, "lateral": -2, "name": "toilets" }, - { "kind": "flat", "grid": [46, 20, "east"], "row": 2, "lateral": 2, "name": "swingingShip" }, - { "kind": "flat", "grid": [46, 20, "east"], "row": 2, "lateral": -6, "name": "ferrisWheel" }, - { "kind": "flat", "grid": [46, 20, "east"], "row": 3, "lateral": -2, "name": "merryGoRound" }, - { "kind": "flat", "grid": [46, 20, "east"], "row": 6, "lateral": -2, "name": "drinkStall" }, - { "kind": "flat", "grid": [46, 20, "east"], "row": 8, "lateral": 2, "name": "ferrisWheel" }, - { "kind": "flat", "grid": [46, 20, "east"], "row": 8, "lateral": -2, "name": "merryGoRound" }, - { "kind": "flat", "grid": [24, 51, "north"], "row": 2, "lateral": -2, "name": "swingingShip" }, - { "kind": "flat", "grid": [24, 51, "north"], "row": 2, "lateral": 6, "name": "toilets" }, - { "kind": "flat", "grid": [24, 51, "north"], "row": 2, "lateral": -6, "name": "merryGoRound" }, - { "kind": "flat", "grid": [24, 51, "north"], "row": 4, "lateral": 6, "name": "swingingShip" }, - { "kind": "flat", "grid": [24, 51, "north"], "row": 6, "lateral": 2, "name": "ferrisWheel" }, + "from": [46, 13], + "bins": true + }, + { + "kind": "flat", + "grid": [46, 9, "north"], + "row": 2, + "lateral": 2, + "name": "foodStall", + "clear": true + }, + { + "kind": "flat", + "grid": [46, 9, "north"], + "row": 2, + "lateral": -2, + "name": "drinkStall", + "clear": true + }, + { + "kind": "flat", + "grid": [46, 9, "north"], + "row": 5, + "lateral": 5, + "name": "merryGoRound", + "clear": true + }, + { + "kind": "flat", + "grid": [46, 9, "north"], + "row": 5, + "lateral": -2, + "name": "toilets", + "clear": true + }, + { + "kind": "flat", + "grid": [46, 9, "north"], + "row": 8, + "lateral": -6, + "name": "ferrisWheel", + "clear": true + }, + { + "kind": "flat", + "grid": [46, 13, "east"], + "row": 8, + "lateral": 6, + "name": "swingingShip", + "clear": true + }, + { + "kind": "flat", + "grid": [46, 9, "north"], + "row": 13, + "lateral": 6, + "name": "merryGoRound", + "clear": true + }, + { + "kind": "flat", + "grid": [46, 13, "east"], + "row": 4, + "lateral": -4, + "name": "ferrisWheel", + "clear": true + }, + { + "kind": "flat", + "grid": [46, 9, "north"], + "row": 10, + "lateral": 2, + "name": "informationKiosk", + "clear": true + }, + { + "kind": "flat", + "grid": [46, 9, "north"], + "row": 14, + "lateral": -2, + "name": "foodStall", + "clear": true + }, + { + "kind": "flat", + "grid": [46, 13, "east"], + "row": 3, + "lateral": 2, + "name": "drinkStall", + "clear": true + }, + { + "kind": "flat", + "grid": [46, 13, "west"], + "row": 4, + "lateral": -4, + "name": "ferrisWheel", + "clear": true + }, + { "kind": "bins", "x": 28, "y": 8, "width": 30, "height": 18 }, + { "kind": "bins", "x": 22, "y": 22, "width": 26, "height": 28 }, + { + "kind": "flat", + "grid": [24, 54, "east"], + "row": 2, + "lateral": 2, + "name": "toilets", + "clear": true + }, + { + "kind": "flat", + "grid": [24, 54, "east"], + "row": 2, + "lateral": -2, + "name": "foodStall", + "clear": true + }, + { + "kind": "flat", + "grid": [24, 54, "east"], + "row": 5, + "lateral": 2, + "name": "drinkStall", + "clear": true + }, + { + "kind": "flat", + "grid": [24, 54, "east"], + "row": 5, + "lateral": -4, + "name": "swingingShip", + "clear": true + }, + { + "kind": "flat", + "grid": [24, 54, "east"], + "row": 8, + "lateral": 6, + "name": "merryGoRound", + "clear": true + }, + { + "kind": "flat", + "grid": [24, 54, "west"], + "row": 2, + "lateral": 6, + "name": "ferrisWheel", + "clear": true + }, + { + "kind": "flat", + "grid": [24, 54, "west"], + "row": 2, + "lateral": -4, + "name": "swingingShip", + "clear": true + }, { "kind": "flat", "grid": [24, 51, "north"], "row": 7, + "lateral": -4, + "name": "merryGoRound", + "clear": true + }, + { + "kind": "flat", + "grid": [24, 59, "east"], + "row": 2, + "lateral": 4, + "name": "ferrisWheel", + "clear": true + }, + { + "kind": "flat", + "grid": [24, 59, "west"], + "row": 4, + "lateral": -6, + "name": "swingingShip", + "clear": true + }, + { + "kind": "flat", + "grid": [24, 54, "east"], + "row": 12, "lateral": -2, - "name": "informationKiosk" + "name": "foodStall", + "clear": true }, - { "kind": "flat", "grid": [24, 51, "north"], "row": 8, "lateral": -6, "name": "merryGoRound" }, - { "kind": "buy", "x": 56, "y": 28, "width": 18, "height": 26, "rights": false }, - { "kind": "buy", "x": 56, "y": 28, "width": 18, "height": 26, "rights": true }, - { "kind": "buy", "x": 60, "y": 51, "width": 20, "height": 12, "rights": false }, { - "kind": "route", - "points": [ - [60, 30], - [63, 30], - [63, 36], - [66, 36], - [66, 42], - [68, 42], - [68, 48], - [70, 48], - [70, 57], - [62, 57] - ], - "clear": true, - "from": [60, 20] - }, - { "kind": "flat", "grid": [62, 57, "west"], "row": 2, "lateral": 2, "name": "swingingShip" }, - { "kind": "flat", "grid": [62, 57, "west"], "row": 2, "lateral": -2, "name": "ferrisWheel" }, - { "kind": "flat", "grid": [62, 57, "west"], "row": 2, "lateral": 6, "name": "informationKiosk" }, - { "kind": "flat", "grid": [62, 57, "west"], "row": 4, "lateral": 6, "name": "swingingShip" }, - { "kind": "flat", "grid": [62, 57, "west"], "row": 5, "lateral": -6, "name": "merryGoRound" }, - { "kind": "flat", "grid": [62, 57, "west"], "row": 8, "lateral": 2, "name": "swingingShip" }, - { "kind": "flat", "grid": [62, 57, "west"], "row": 9, "lateral": -2, "name": "toilets" }, - { "kind": "flat", "grid": [62, 57, "west"], "row": 10, "lateral": 6, "name": "swingingShip" }, - { "kind": "flat", "grid": [62, 57, "west"], "row": 11, "lateral": -2, "name": "ferrisWheel" }, - { "kind": "flat", "grid": [62, 57, "west"], "row": 14, "lateral": 2, "name": "merryGoRound" }, - { "kind": "flat", "grid": [62, 57, "west"], "row": 14, "lateral": -6, "name": "drinkStall" }, - { "kind": "flat", "grid": [62, 57, "west"], "row": 18, "lateral": 2, "name": "ferrisWheel" } + "kind": "flat", + "grid": [24, 51, "north"], + "row": 11, + "lateral": 2, + "name": "drinkStall", + "clear": true + }, + { "kind": "bins", "x": 8, "y": 46, "width": 30, "height": 20 } ] diff --git a/bench/strategy/plans/tidewater-docks.json b/bench/strategy/plans/tidewater-docks.json index 061b7f6bf..8d7c09aed 100644 --- a/bench/strategy/plans/tidewater-docks.json +++ b/bench/strategy/plans/tidewater-docks.json @@ -1,36 +1,208 @@ [ - { "kind": "item", "name": "foodStall" }, - { "kind": "item", "name": "drinkStall" }, - { "kind": "item", "name": "toilets" }, - { "kind": "item", "name": "merryGoRound" }, - { "kind": "buy", "x": 37, "y": 43, "width": 6, "height": 3, "rights": true }, + { + "kind": "flat", + "grid": [15, 47, "south"], + "row": 2, + "lateral": 4, + "name": "merryGoRound", + "clear": true + }, + { + "kind": "flat", + "grid": [15, 47, "south"], + "row": 4, + "lateral": -5, + "name": "swingingShip", + "clear": true + }, + { + "kind": "flat", + "grid": [11, 47, "north"], + "row": 2, + "lateral": -2, + "name": "drinkStall", + "clear": true + }, + { + "kind": "flat", + "grid": [11, 47, "north"], + "row": 5, + "lateral": -3, + "name": "ferrisWheel", + "clear": true + }, + { + "kind": "flat", + "grid": [11, 47, "north"], + "row": 9, + "lateral": 5, + "name": "merryGoRound", + "clear": true + }, + { + "kind": "flat", + "grid": [11, 47, "north"], + "row": 11, + "lateral": -2, + "name": "toilets", + "clear": true + }, + { + "kind": "flat", + "grid": [8, 47, "west"], + "row": 8, + "lateral": 5, + "name": "swingingShip", + "clear": true + }, + { + "kind": "flat", + "grid": [11, 57, "west"], + "row": 4, + "lateral": 5, + "name": "ferrisWheel", + "clear": true + }, + { + "kind": "flat", + "grid": [8, 47, "west"], + "row": 2, + "lateral": -2, + "name": "foodStall", + "clear": true + }, + { + "kind": "flat", + "grid": [8, 47, "west"], + "row": 6, + "lateral": -2, + "name": "drinkStall", + "clear": true + }, + { + "kind": "flat", + "grid": [8, 47, "west"], + "row": 14, + "lateral": -2, + "name": "informationKiosk", + "clear": true + }, + { + "kind": "flat", + "grid": [19, 47, "north"], + "row": 3, + "lateral": 3, + "name": "ferrisWheel", + "clear": true + }, + { + "kind": "flat", + "grid": [19, 47, "north"], + "row": 2, + "lateral": -2, + "name": "toilets", + "clear": true + }, + { "kind": "bins", "x": 8, "y": 30, "width": 16, "height": 34 }, + { "kind": "repay" }, + { "kind": "wait", "month": 20 }, { "kind": "route", "points": [ - [19, 47], - [19, 61], - [34, 61], - [34, 44], - [45, 44], - [45, 52] + [22, 54], + [22, 59], + [56, 59] ], + "clear": true, + "from": [11, 54] + }, + { + "kind": "flat", + "grid": [34, 59, "south"], + "row": 2, + "lateral": 2, + "name": "swingingShip", + "clear": true + }, + { + "kind": "flat", + "grid": [34, 59, "south"], + "row": 2, + "lateral": -2, + "name": "ferrisWheel", + "clear": true + }, + { + "kind": "flat", + "grid": [34, 59, "south"], + "row": 8, + "lateral": -2, + "name": "toilets", + "clear": true + }, + { + "kind": "flat", + "grid": [34, 59, "south"], + "row": 9, + "lateral": 2, + "name": "swingingShip", + "clear": true + }, + { + "kind": "flat", + "grid": [34, 59, "south"], + "row": 11, + "lateral": -2, + "name": "ferrisWheel", + "clear": true + }, + { + "kind": "flat", + "grid": [34, 59, "south"], + "row": 16, + "lateral": 2, + "name": "drinkStall", + "clear": true + }, + { + "kind": "flat", + "grid": [45, 59, "south"], + "row": 2, + "lateral": 2, + "name": "swingingShip", + "clear": true + }, + { + "kind": "flat", + "grid": [45, 59, "south"], + "row": 2, + "lateral": -2, + "name": "ferrisWheel", + "clear": true + }, + { + "kind": "flat", + "grid": [34, 59, "south"], + "row": 17, + "lateral": -2, + "name": "foodStall", + "clear": true + }, + { + "kind": "flat", + "grid": [45, 59, "south"], + "row": 8, + "lateral": -2, + "name": "swingingShip", + "clear": true + }, + { + "kind": "flat", + "grid": [45, 59, "south"], + "row": 9, + "lateral": 2, + "name": "ferrisWheel", "clear": true }, - { "kind": "flat", "grid": [34, 61, "south"], "row": 3, "lateral": 2, "name": "swingingShip" }, - { "kind": "flat", "grid": [34, 61, "south"], "row": 9, "lateral": 2, "name": "ferrisWheel" }, - { "kind": "flat", "grid": [34, 61, "south"], "row": 9, "lateral": -2, "name": "swingingShip" }, - { "kind": "flat", "grid": [34, 61, "south"], "row": 13, "lateral": 2, "name": "toilets" }, - { "kind": "flat", "grid": [34, 61, "south"], "row": 15, "lateral": -2, "name": "swingingShip" }, - { "kind": "flat", "grid": [45, 52, "north"], "row": 2, "lateral": 2, "name": "ferrisWheel" }, - { "kind": "flat", "grid": [45, 52, "north"], "row": 2, "lateral": -2, "name": "swingingShip" }, - { "kind": "flat", "grid": [45, 52, "north"], "row": 6, "lateral": 2, "name": "toilets" }, - { "kind": "flat", "grid": [45, 52, "north"], "row": 8, "lateral": 2, "name": "merryGoRound" }, - { "kind": "flat", "grid": [45, 52, "north"], "row": 8, "lateral": -2, "name": "swingingShip" }, - { "kind": "flat", "grid": [19, 47, "north"], "row": 2, "lateral": -2, "name": "ferrisWheel" }, - { "kind": "flat", "grid": [19, 47, "north"], "row": 4, "lateral": 2, "name": "informationKiosk" }, - { "kind": "flat", "grid": [19, 47, "north"], "row": 7, "lateral": 2, "name": "swingingShip" }, - { "kind": "flat", "grid": [19, 47, "north"], "row": 9, "lateral": -6, "name": "ferrisWheel" }, - { "kind": "flat", "grid": [19, 61, "west"], "row": 4, "lateral": 2, "name": "swingingShip" }, - { "kind": "flat", "grid": [19, 61, "west"], "row": 4, "lateral": -2, "name": "toilets" }, - { "kind": "flat", "grid": [19, 61, "west"], "row": 10, "lateral": 2, "name": "swingingShip" } + { "kind": "bins", "x": 8, "y": 36, "width": 52, "height": 28 } ] diff --git a/bench/strategy/run.ts b/bench/strategy/run.ts index 26d4d36d3..d740b1080 100644 --- a/bench/strategy/run.ts +++ b/bench/strategy/run.ts @@ -33,6 +33,8 @@ export interface RunOptions { seed: number; /** Ticks to simulate for open-ended objectives. */ horizonTicks?: number; + /** Keep the scenario's own research state instead of unlocking every ride before play. */ + realResearch?: boolean; /** Called at each month boundary, for tracing a run. */ onMonth?: (month: number, world: Simulation['world']) => void; } @@ -44,8 +46,9 @@ export function runScenario( ): RunResult { const sim = new Simulation({ seed: opts.seed, width: def.mapWidth, height: def.mapHeight }); prepareScenarioPark(sim.world, def); - // The strategy suite isolates park and economy balance from research pacing. - sim.world.research.unlocked = new Set(Object.keys(RIDE_CATALOG).map(Number)); + // The strategy suite isolates park and economy balance from research pacing unless asked not to. + if (!opts.realResearch) + sim.world.research.unlocked = new Set(Object.keys(RIDE_CATALOG).map(Number)); const builder = new ParkBuilder(sim, def); const strategy = factory(def); const world = sim.world; diff --git a/bench/strategy/site-plan.ts b/bench/strategy/site-plan.ts index fd12eeab2..4c1e34ea8 100644 --- a/bench/strategy/site-plan.ts +++ b/bench/strategy/site-plan.ts @@ -14,12 +14,14 @@ import { PREBUILT_TYPES } from '../../src/sim/scenario/scenario-prebuilt'; import type { EntranceSide } from '../../src/sim/scenario/scenario'; import type { ParkBuilder } from './builder'; import { StaffKind } from './builder'; +import type { Funding } from '../../src/sim/research/research'; import type { Strategy, StrategyFactory } from './run'; import { TICKS_PER_MONTH } from './run'; import { circuitTiles, clearScenery, flatGroundPath, + flatRideTiles, layRoute, openFlatRide, siteBounds, @@ -30,6 +32,8 @@ import type { CoasterSite } from './site'; /** Loans move in $1,000 steps. */ const LOAN_STEP_CENTS = 100_000; +/** Cash set aside for clearing the scenery under a flat ride step. */ +const CLEAR_ALLOWANCE_CENTS = 30_000; /** One build decision of a site plan; see `sitePlanStrategy`. */ export type SiteStep = @@ -39,7 +43,14 @@ export type SiteStep = * A footpath through `points`, starting beside `from` (a tile already holding a flat path) or * the end of the gate spine, clearing scenery on the way when the park allows it. */ - | { kind: 'route'; points: Array<[number, number]>; clear: boolean; from?: [number, number] } + | { + kind: 'route'; + points: Array<[number, number]>; + clear: boolean; + from?: [number, number]; + /** Put a bin on every other tile of the route. */ + bins?: boolean; + } /** A coaster at a fixed site, buying the land and rights under it and clearing its track tiles first. */ | { kind: 'coaster'; site: CoasterSite } /** @@ -52,11 +63,19 @@ export type SiteStep = row: number; lateral: number; name: string; + /** Clear scenery from the spine, frontage and footprint first. */ + clear?: boolean; } /** Buys land or rights in a rectangle. */ | { kind: 'buy'; x: number; y: number; width: number; height: number; rights: boolean } /** Clears scenery from the owned part of a rectangle with the Clear tool. */ - | { kind: 'clear'; x: number; y: number; width: number; height: number }; + | { kind: 'clear'; x: number; y: number; width: number; height: number } + /** Puts a bin on every footpath tile (not queue lines) in a rectangle. */ + | { kind: 'bins'; x: number; y: number; width: number; height: number } + /** Pays off the whole loan once the cash covers it on top of the reserve. */ + | { kind: 'repay' } + /** Holds the remaining steps until the start of `month`. */ + | { kind: 'wait'; month: number }; export interface SitePlan { steps: SiteStep[]; @@ -75,9 +94,12 @@ export interface SitePlan { borrow?: boolean; /** * Patrol areas, inclusive tile rectangles [x0, y0, x1, y1], dealt to handymen in turn so a - * spread-out park is swept everywhere rather than only around the gate. + * spread-out park is swept everywhere rather than only around the gate. A null entry leaves + * that handyman free to roam. */ - patrols?: Array<[number, number, number, number]>; + patrols?: Array<[number, number, number, number] | null>; + /** Research funding level set on the first tick; the scenario's own level when omitted. */ + researchFunding?: Funding; } /** @@ -94,7 +116,14 @@ export function sitePlanStrategy(plan: SitePlan): StrategyFactory { const strategy: Strategy = { step(b) { const tick = b.tick; - if (tick === 0) b.prices = plan.prices; + if (tick === 0) { + b.prices = plan.prices; + if (plan.researchFunding !== undefined) + b.sim.enqueue({ + type: 'research', + action: { type: 'setFunding', level: plan.researchFunding }, + }); + } if (tick >= nextAdvance) { nextAdvance = tick + 64; b.advance(); @@ -103,6 +132,7 @@ export function sitePlanStrategy(plan: SitePlan): StrategyFactory { nextDecision = tick + TICKS_PER_MONTH / 8; while (next < plan.steps.length) { const step = plan.steps[next]; + if (step.kind === 'wait' && tick < step.month * TICKS_PER_MONTH) break; const cost = costOf(b, step, plan); const l = b.sim.world.economy; if (plan.borrow && l.cash < cost + plan.reserveCents && l.loan < l.maxLoan) { @@ -135,15 +165,17 @@ export function sitePlanStrategy(plan: SitePlan): StrategyFactory { function assignPatrols( b: ParkBuilder, - areas: Array<[number, number, number, number]>, + areas: Array<[number, number, number, number] | null>, patrolled: Set, ): void { const staff = b.sim.world.staff; for (let slot = 0; slot < staff.count; slot++) { const id = staff.slotToId[slot]; if (staff.cols.kind[slot] !== StaffKind.Handyman || patrolled.has(id)) continue; - const [x0, y0, x1, y1] = areas[patrolled.size % areas.length]; + const area = areas[patrolled.size % areas.length]; patrolled.add(id); + if (!area) continue; + const [x0, y0, x1, y1] = area; for (let y = y0; y <= y1; y += 4) for (let x = x0; x <= x1; x += 4) b.sim.enqueue({ type: 'setStaffPatrolTile', staffId: id, x, y, enabled: true }); @@ -179,11 +211,21 @@ function costOf(b: ParkBuilder, step: SiteStep, plan: SitePlan): number { return 350_000 + saleCost(b, area) + area.width * area.height * 1_000 + decor; } case 'flat': - return RIDE_CATALOG[PREBUILT_TYPES[step.name]].cost + (step.row + 12) * PATH_COST_CENTS; + return ( + RIDE_CATALOG[PREBUILT_TYPES[step.name]].cost + + (step.row + 12) * PATH_COST_CENTS + + (step.clear ? CLEAR_ALLOWANCE_CENTS : 0) + ); case 'buy': return saleCost(b, step); case 'clear': return step.width * step.height * 2_000; + case 'bins': + return 0; + case 'repay': + return b.sim.world.economy.loan; + case 'wait': + return 0; } } @@ -206,6 +248,16 @@ function perform(b: ParkBuilder, step: SiteStep, plan: SitePlan): void { const tiles = waypoints([start, ...step.points]).slice(1); if (step.clear) clearScenery(sim, tiles); layRoute(sim, tiles, m.heights[m.index(start[0], start[1])]); + if (step.bins) { + for (let k = 1; k < tiles.length; k += 2) + sim.enqueue({ + type: 'setPathAddition', + x: tiles[k][0], + y: tiles[k][1], + addition: PathAddition.Bin, + }); + sim.step(); + } return; } case 'coaster': { @@ -229,6 +281,7 @@ function perform(b: ParkBuilder, step: SiteStep, plan: SitePlan): void { } case 'flat': { const grid = new ParkGrid(...step.grid); + if (step.clear) clearScenery(sim, flatRideTiles(grid, step.row, step.lateral, step.name)); for (let row = 0; row <= step.row; row++) { const [x, y] = grid.tile(row, 0); if (m.pathElement(m.index(x, y), -1) >= 0) continue; @@ -257,5 +310,20 @@ function perform(b: ParkBuilder, step: SiteStep, plan: SitePlan): void { }); sim.step(); return; + case 'bins': + for (let y = Math.max(0, step.y); y < Math.min(m.height, step.y + step.height); y++) + for (let x = Math.max(0, step.x); x < Math.min(m.width, step.x + step.width); x++) { + const i = m.index(x, y); + if (m.pathElement(i, -1) >= 0 && !m.isQueue(i)) + sim.enqueue({ type: 'setPathAddition', x, y, addition: PathAddition.Bin }); + } + sim.step(); + return; + case 'repay': + if (sim.world.economy.loan > 0) b.repay(sim.world.economy.loan); + sim.step(); + return; + case 'wait': + return; } } diff --git a/bench/strategy/site.ts b/bench/strategy/site.ts index b4a84cf23..3a5fa2528 100644 --- a/bench/strategy/site.ts +++ b/bench/strategy/site.ts @@ -17,7 +17,7 @@ import { import { PathAddition, PathResult, planPathPlacement } from '../../src/sim/map/paths'; import { COASTER_TEMPLATES, mirrored } from './coasters'; import { RideState } from '../../src/sim/rides/ride-store'; -import { validateRidePlacement } from '../../src/sim/rides/ride-footprint'; +import { rideFootprintTiles, validateRidePlacement } from '../../src/sim/rides/ride-footprint'; import { RideResult } from '../../src/sim/rides/ride-results'; import { PREBUILT_TYPES } from '../../src/sim/scenario/scenario-prebuilt'; import { rideFrontage } from '../../src/sim/scenario/park-grid'; @@ -461,6 +461,25 @@ export function openFlatRide( }; } +/** + * Tiles a flat ride or stall at (`row`, `lateral`) of `grid` uses: the spine from the grid origin + * to `row`, its queue, entrance, exit path and footprint. + */ +export function flatRideTiles( + grid: ParkGrid, + row: number, + lateral: number, + name: string, +): Array<[number, number]> { + const type = PREBUILT_TYPES[name]; + const frontage = rideFrontage(grid, row, lateral, RIDE_CATALOG[type].footprint); + const tiles: Array<[number, number]> = []; + for (let r = 0; r <= row; r++) tiles.push(grid.tile(r, 0)); + tiles.push(...frontage.queue, ...frontage.exitPath, frontage.entrance, frontage.exit); + tiles.push(...rideFootprintTiles(RIDE_CATALOG[type], ...frontage.ride, frontage.dir)); + return tiles; +} + /** * Tiles a coaster at `site` needs free of scenery: its track footprint and the tiles beside the * station for the entrance and exit. Found by building it on a copy of the park with the diff --git a/bench/strategy/strategies.ts b/bench/strategy/strategies.ts index a2015bea7..5d36a25ee 100644 --- a/bench/strategy/strategies.ts +++ b/bench/strategy/strategies.ts @@ -2,6 +2,7 @@ import type { StrategyFactory } from './run'; import { growthStrategy } from './growth'; import { SceneryItem } from '../../src/sim/map/scenery'; import { sitePlanStrategy } from './site-plan'; +import { Funding } from '../../src/sim/research/research'; import type { SiteStep } from './site-plan'; import thunderheadPlan from './plans/thunderhead-mesa.json'; import tidewaterPlan from './plans/tidewater-docks.json'; @@ -86,36 +87,59 @@ STRATEGIES['copper-ridge'] = sitePlanStrategy({ ], }); +/** + * Tidewater Docks: rides with real queues on the west quay, a bin on every footpath, the loan + * repaid as soon as the cash covers it, then (from month 20, so the new rides are still young at + * the deadline) a south-quay walk out to both finger piers lined with ships, wheels and stalls. + * Nothing needed is left to research, so research funding is switched off. + */ STRATEGIES['tidewater-docks'] = sitePlanStrategy({ steps: tidewaterPlan as SiteStep[], - reserveCents: 400_000, + reserveCents: 300_000, + researchFunding: Funding.None, patrols: [ - [8, 38, 24, 56], - [8, 52, 24, 64], - [16, 56, 64, 64], - [30, 38, 50, 62], + [8, 38, 15, 46], + [8, 47, 15, 55], + [16, 38, 23, 46], + [16, 47, 23, 55], + [8, 56, 23, 63], + [30, 38, 38, 57], + [41, 40, 49, 57], + [22, 54, 56, 62], + [8, 30, 23, 37], + [30, 38, 38, 57], + [41, 40, 49, 57], + [22, 54, 56, 62], ], prices: RIDE_PRICES, itemsPerHandyman: 1.5, - attractionsPerMechanic: 3, - repayAboveCents: 150_000, + attractionsPerMechanic: 4, }); +/** + * Thunderhead Mesa: the cliff trail first, then rides with real queues on the mesa top by the + * gate, then the west shelf below the trail, with bins along the trail and on every footpath. + * Handymen patrol the trail and the shelf; the rest roam the mesa. Research funding is off. + */ STRATEGIES['thunderhead-mesa'] = sitePlanStrategy({ steps: thunderheadPlan as SiteStep[], reserveCents: 200_000, + researchFunding: Funding.None, patrols: [ - [30, 8, 62, 28], - [30, 8, 62, 28], - [8, 46, 40, 64], - [30, 8, 62, 28], - [18, 22, 38, 52], - [58, 50, 84, 64], - [56, 26, 74, 52], + null, + [24, 24, 35, 47], + [10, 49, 36, 64], + null, + [10, 49, 36, 64], + null, + [38, 9, 56, 24], + [24, 24, 35, 47], + [10, 49, 36, 64], + null, ], prices: RIDE_PRICES, - itemsPerHandyman: 2, - attractionsPerMechanic: 3, + itemsPerHandyman: 1.5, + attractionsPerMechanic: 4, }); STRATEGIES['glacier-point'] = sitePlanStrategy({ From 206ad8c7998ef89b43a4f9f52131b431479c73d0 Mon Sep 17 00:00:00 2001 From: "nori-sessions[bot]" <264258699+nori-sessions[bot]@users.noreply.github.com> Date: Sun, 1 Nov 2026 14:02:04 +0000 Subject: [PATCH 3/4] Docs and browser proof for the Tidewater and Thunderhead wins BALANCE.md and scenario-remixes.md record the diagnosis, the demonstrated routes and the results; bench, staff, guests and e2e noridocs follow the code. hard-parks-proof.spec.ts gains a won-park block that loads the saves bench/hard-park-wins.test.ts writes. Co-authored-by: Nori --- bench/docs.md | 5 +++-- bench/hard-park-wins.test.ts | 19 +++++++++++------- docs/BALANCE.md | 24 +++++++++++++---------- docs/scenario-remixes.md | 18 ++++++++++------- e2e/docs.md | 2 +- e2e/hard-parks-proof.spec.ts | 37 +++++++++++++++++++++++++++++++++++ src/sim/guests/docs.md | 4 ++-- src/sim/staff/docs.md | 8 ++++---- src/sim/staff/staff-system.ts | 10 +++++----- 9 files changed, 89 insertions(+), 38 deletions(-) diff --git a/bench/docs.md b/bench/docs.md index 69693e6ac..2e54789a3 100644 --- a/bench/docs.md +++ b/bench/docs.md @@ -17,10 +17,11 @@ Path: @/bench - [audio.ts](audio.ts) feeds a warmed synthetic snapshot with a large guest count and many rides through [AudioEngine](../src/audio/audio.ts), using a recording Web Audio context so the benchmark measures JavaScript update and scheduling overhead without browser audio rendering. - [balance.ts](balance.ts) (`pnpm balance`) is the gameplay-balance harness: [balance-park.ts](balance-park.ts) scripts a starter park (rides take their real footprints: each side of the spine allocates rows for queue, exit and body, and late additions that no longer fit are skipped) (minimal, sensible, modest or ambitious profile) with player commands, and the runner steps one in-game year (flags `--admission DOLLARS`, `--repay-loan-month N` and `--stalls-at-value` stand in for a player who sets the gate price, prices stalls at their value and pays off the loan) and prints guest count, rating curve, cash, ride usage (including reliability, breakdown count and downtime ticks), the guest thought histogram, the ledger and the objective result. Stalls and facilities use adjacent public paths for direct access; ordinary rides use entrances, exits and queues. `balance.test.ts` pins determinism and basic health. Its year-end objective checks run default scenario seed 2026 and fixed seeds 1 to 3; the scripted park hires eight handymen and two mechanics by the time the coaster opens. The extra mechanic is assigned when the coaster is built so it can enter service with maintenance staff. Paired measurements are in [the PR proof](https://github.com/tilework-tech/opencoaster/tree/nori/pr-proofs/exterior-litter-graffiti). Results are recorded in [docs/BALANCE.md](../docs/BALANCE.md). - [finance-proof-save.ts](finance-proof-save.ts) writes a scripted starter park as a save file after a few months, for filming the Finances window ([e2e/finances.spec.ts](../e2e/finances.spec.ts)). -- [scenario-balance.ts](scenario-balance.ts) (`pnpm balance --scenario [--seeds 12] [--jobs N] [--trace]`) plays each shipped scenario with its scripted strategy over seeds 1..N, one child process per seed group, and prints the win count and per-seed outcome. [strategy/](strategy) holds the scripts: `builder.ts` places rides, stalls, and coasters on the gate-relative park grid; ordinary rides and coasters use entrance/exit and queue paths, while stalls and facilities use an adjacent public path for direct access. The builder adds bins along paths and a walkway around each coaster; `growth.ts` is the build-order strategy (cash-gated, optional per-seed imperfection); `coasters.ts` holds the searched circuits; `strategies.ts` assigns one per scenario. Parks are prepared with `prepareScenarioPark`, the same path as a new game, so the strategy plays the real map including the approach path and ambient trees (scenery near a coaster station feeds its excitement rating, so leaving trees out would skew results). The balance harness unlocks the ride catalog before play to isolate park and economy tuning from research pacing; normal scenarios still enforce their own unlocks at the simulation command boundary. `scenario-balance.test.ts` checks every scenario has a strategy that builds an open park. A have-fun scenario counts as won when, after four years, the park is solvent, rated 600 or more and holds 200 guests. -- The hard parks (rough terrain, odd-shaped land, protected trees, build limits) cannot be played by the spine-based growth strategy, so they use `sitePlanStrategy` in [strategy/site-plan.ts](strategy/site-plan.ts) with a per-park plan in [strategy/plans/](strategy/plans). A plan is an ordered list of steps (`item` on the builder's spine, `route` footpath, `coaster` at a pinned site, `flat` ride beside its own spine, `buy` land or rights, `clear` scenery); each is built in order once cash covers its estimated cost plus a reserve, optionally borrowing in $1,000 steps. The strategy also keeps handymen and mechanics in proportion to the park, deals handymen patrol rectangles in turn, can plant decoration round each coaster station, and can repay the loan above a cash margin. +- [scenario-balance.ts](scenario-balance.ts) (`pnpm balance --scenario [--seeds 12] [--jobs N] [--trace]`) plays each shipped scenario with its scripted strategy over seeds 1..N, one child process per seed group, and prints the win count and per-seed outcome. [strategy/](strategy) holds the scripts: `builder.ts` places rides, stalls, and coasters on the gate-relative park grid; ordinary rides and coasters use entrance/exit and queue paths, while stalls and facilities use an adjacent public path for direct access. The builder adds bins along paths and a walkway around each coaster; `growth.ts` is the build-order strategy (cash-gated, optional per-seed imperfection); `coasters.ts` holds the searched circuits; `strategies.ts` assigns one per scenario. Parks are prepared with `prepareScenarioPark`, the same path as a new game, so the strategy plays the real map including the approach path and ambient trees (scenery near a coaster station feeds its excitement rating, so leaving trees out would skew results). The balance harness unlocks the ride catalog before play to isolate park and economy tuning from research pacing unless `runScenario` gets `realResearch`, which keeps the scenario's own research state; normal scenarios still enforce their own unlocks at the simulation command boundary. `scenario-balance.test.ts` checks every scenario has a strategy that builds an open park. A have-fun scenario counts as won when, after four years, the park is solvent, rated 600 or more and holds 200 guests. +- The hard parks (rough terrain, odd-shaped land, protected trees, build limits) cannot be played by the spine-based growth strategy, so they use `sitePlanStrategy` in [strategy/site-plan.ts](strategy/site-plan.ts) with a per-park plan in [strategy/plans/](strategy/plans). A plan is an ordered list of steps: `item` on the builder's spine, `route` footpath (optionally a bin on every other tile), `coaster` at a pinned site, `flat` ride beside its own spine (optionally clearing scenery from the spine, frontage and footprint first, via `flatRideTiles` in site.ts), `buy` land or rights, `clear` scenery, `bins` on every non-queue footpath in a rectangle (bins are free), `repay` the whole loan, and `wait` (holds the remaining steps until a given month). Each is built in order once cash covers its estimated cost plus a reserve, optionally borrowing in $1,000 steps; `repay` waits until the cash covers the loan plus the reserve. The strategy also keeps handymen and mechanics in proportion to the park, deals handymen patrol rectangles in turn (a null entry leaves that handyman roaming), can set research funding on the first tick, can plant decoration round each coaster station, and can repay the loan above a cash margin. - [strategy/site.ts](strategy/site.ts) holds the legal-construction helpers those plans and the hard-park tests share: `buildCircuit` lays a wooden coaster template at a pinned site (supports over slopes, tunnels into ground); `layRoute` lays a footpath that keeps to the ground and otherwise climbs, descends or bridges one level per tile; `connectOnGround` finds the shortest ground-level connector to an existing path; `startCoaster`/`openCoaster` add queue and exit paths and run the test; `openFlatRide` places a flat ride beside a spine; `circuitTiles` finds the tiles a coaster actually needs by building it on a copy of the park, so only those trees are cleared. Everything goes through ordinary player commands, so ownership, terrain and scenario restrictions apply. - [hard-parks.test.ts](hard-parks.test.ts) plays each hard park's opening and its defining move (e.g. a gulch crossing, a pier bridge, a cliff descent) with the park's real cash, and checks with control runs that each park enforces the restrictions it advertises. With `HARD_PROOF_SAVES` set it also writes each built park as a save plus a focus tile, consumed by [e2e/hard-parks-proof.spec.ts](../e2e/hard-parks-proof.spec.ts). +- [hard-park-wins.test.ts](hard-park-wins.test.ts) plays Tidewater Docks and Thunderhead Mesa to their deadlines with their site plans on the new-game map (the scenario's own seed) and `realResearch`, and asserts a win at the deadline. It also checks that research starts from the scenario's set without the catalog unlocked, and (as soft checks, at month 12) that every ride placed so far is open or broken and that every queued ride has room for more than four guests, the capacity of a ride with no queue tiles. With `HARD_PROOF_SAVES` set it writes each won park as `-won.ocsave` plus `-won.json` (view tiles with their heights) for the won-park browser proof. Each park has a five-minute test timeout. - [stats.ts](stats.ts) supplies nearest-rank percentile and budget helpers used by the benchmark and its tests. ### Core Implementation diff --git a/bench/hard-park-wins.test.ts b/bench/hard-park-wins.test.ts index e6631281a..ca2090979 100644 --- a/bench/hard-park-wins.test.ts +++ b/bench/hard-park-wins.test.ts @@ -25,10 +25,16 @@ const TIMEOUT_MS = 300_000; const QUEUED_CATEGORIES = new Set(['gentle', 'thrill', 'coaster', 'water', 'transport']); -/** Tile the browser proof centres on: a busy part of each won park. */ -const FOCUS: Record = { - 'tidewater-docks': [16, 47], - 'thunderhead-mesa': [46, 16], +/** Tiles the browser proof centres on: the busiest part of each won park, then its far end. */ +const VIEWS: Record> = { + 'tidewater-docks': [ + [15, 48], + [40, 52], + ], + 'thunderhead-mesa': [ + [45, 16], + [22, 56], + ], }; function startingResearch(id: string): number[] { @@ -73,9 +79,8 @@ for (const id of ['tidewater-docks', 'thunderhead-mesa']) { const world: Simulation['world'] = finalWorld; mkdirSync(dir, { recursive: true }); writeFileSync(join(dir, `${id}-won.ocsave`), serialize(world)); - const [x, y] = FOCUS[id]; - const z = world.map.heights[world.map.index(x, y)]; - writeFileSync(join(dir, `${id}-won.json`), JSON.stringify({ focus: [x, y, z] })); + const views = VIEWS[id].map(([x, y]) => [x, y, world.map.heights[world.map.index(x, y)]]); + writeFileSync(join(dir, `${id}-won.json`), JSON.stringify({ views })); } expect(research, 'starts from the scenario research').toEqual( diff --git a/docs/BALANCE.md b/docs/BALANCE.md index cd55a43e5..2b8777886 100644 --- a/docs/BALANCE.md +++ b/docs/BALANCE.md @@ -397,23 +397,27 @@ The Challenging and Expert parks were rebuilt on irregular, rough ground ([scena The harness now prepares parks with `prepareScenarioPark`, the same path as a new game, so ambient trees are present. Ambient trees matter for coasters because scenery near a station adds up to 2.35 excitement. -Before is `main` before the remix (12 seeds, old flat-apron scripts, old maps). After is this branch's full sweep (`pnpm balance -- --scenario all --seeds 12 --jobs 3`). +Before is `main` before the remix (12 seeds, old flat-apron scripts, old maps). After is the full sweep (`pnpm balance -- --scenario all --seeds 12 --jobs 3`), except Tidewater Docks and Thunderhead Mesa, which were re-planned later and measured on seeds 1–3 plus the scenario's own seed (the map a new game generates). Under the first site plans both won 0/12 (Tidewater value $2,888–$5,302 with the loan never repaid; Thunderhead 11–330 guests). -| Park | Objective now | Before | After | After, range over seeds | -| -------------------- | --------------------------------------------------------------- | ------------------------------ | ----- | --------------------------------------------------------------------------------- | -| Copper Ridge | 5 coasters ≥ 4.60 by end of year 2 (was year 1) | 0/12 (no coaster reached 4.60) | 11/12 | 4–5 qualifying coasters; parks hold 5–25 guests, rating 0–92 | -| Glacier Point | 5 coasters ≥ 4.70 by end of year 2 (was 6 ≥ 4.90 in 1.4 months) | 0/12 | 6/12 | 4–5 qualifying coasters (ratings 5.98–6.68 when they open) | -| Tidewater Docks | repay loan, park value $5,500 by end of year 4 | 12/12 | 0/12 | value $2,888–$5,302, rating 504–852, loan never repaid (cash ends −$10k to −$15k) | -| Thunderhead Mesa | 460 guests, rating 700 by end of year 4 | 12/12 | 0/12 | 11–330 guests, rating 0–623 | -| Mossgrove Isle (new) | $350 a month ride income by end of year 3 | – | 2/12 | $247–$373 a month, 14–15 rides, no tree removed | +| Park | Objective now | Before | After | After, range over seeds | +| -------------------- | --------------------------------------------------------------- | ------------------------------ | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | +| Copper Ridge | 5 coasters ≥ 4.60 by end of year 2 (was year 1) | 0/12 (no coaster reached 4.60) | 11/12 | 4–5 qualifying coasters; parks hold 5–25 guests, rating 0–92 | +| Glacier Point | 5 coasters ≥ 4.70 by end of year 2 (was 6 ≥ 4.90 in 1.4 months) | 0/12 | 6/12 | 4–5 qualifying coasters (ratings 5.98–6.68 when they open) | +| Tidewater Docks | repay loan, park value $5,500 by end of year 4 | 12/12 | 1/3 (seeds 1–3); wins the new-game seed | seeds 1–3: value $5,042–$7,110, loan repaid; new-game seed 2202: value $6,389, rating 912, 483 guests, cash $12.5k | +| Thunderhead Mesa | 460 guests, rating 700 by end of year 4 | 12/12 | 3/3 (seeds 1–3); wins the new-game seed | seeds 1–3: 579–662 guests, rating 732–818; new-game seed 3101: 637 guests, rating 818 | +| Mossgrove Isle (new) | $350 a month ride income by end of year 3 | – | 2/12 | $247–$373 a month, 14–15 rides, no tree removed | Unchanged parks under the new harness: Bramblewood Hollow, Lantern Bay, Meadowbrook Green, Open Grounds, Riverside Fairground and Seaside Promenade all win 12/12. Notes on reading the table: - **Copper Ridge and Glacier Point show the goals can be met legally.** Their scripts only chase the coaster count: they build the opening stalls and then coasters, so the parks themselves run down. A player who also runs the park wins more easily. Glacier Point's misses are seeds where one coaster rates below 4.70 or opens late. -- **Tidewater Docks and Thunderhead Mesa keep their goals but no script wins them.** These are reported, not hidden. The hard part is upkeep in a long park: wages, breakdowns and litter outrun ride income in the scripted play. The best Tidewater seed reaches 96% of the park-value target, and Thunderhead's best seed holds 330 guests. Both are plausible for a player who prices and staffs actively, but this has not been demonstrated. -- **Mossgrove Isle's target was set from scripted play.** Its first draft target was $900 a month, while the best scripted seed made $373, so the target is $350. No tree is removed: the rule forbids it and the play test checks it. +- **Tidewater Docks and Thunderhead Mesa are won legally.** [bench/hard-park-wins.test.ts](../bench/hard-park-wins.test.ts) plays both to their deadline on the new-game map with the scenario's own research, cash and loan, and asserts the win. Research funding makes no difference to these numbers: both plans switch it off and need nothing beyond the starting research. + - Why the first plans lost: most flat rides sat two tiles from their spine, which leaves no queue tiles, so `rideQueueCapacity` was 4 and guests still walking there counted against it. Four walkers crossing the long park filled each ride, so most guests had nothing to ride (399 of 515 at Tidewater) and spent about $4 a month; income could not cover 18 staff and research. At Thunderhead overlapping placements boxed in a Ferris wheel exit, a patrol edge stranded the cliff-trail handyman, and the trail had no bins, so litter pinned the rating at 0. + - The re-laid plans give every first-year ride a real queue (capacity 8 to 20) and put bins on every footpath. Tidewater builds round the prebuilt stall and wheel on the west quay, repays the $6,000 loan (by month 4 on the new-game map), then from month 20 walks the south quay out to both finger piers and lines them with ships, wheels and stalls. Pier rides only reach capacity 4: the piers are five tiles wide and rides cannot stand on water. Park value peaks four to six months after an expansion; starting the piers at month 14 ended lower at the deadline. Thunderhead lays the cliff trail first (with bins), then rides by the gate on the mesa, then the west shelf below the trail; handymen patrol the trail and the shelf and the rest roam the mesa. + - Placements were found by trying each on a cloned world with the real commands and keeping those whose ride opened with a queue capacity of at least 8 (12 at Thunderhead) and whose exit joined the gate's network. The committed plans are fixed and played with ordinary commands and real cash. + - Three staff bugs surfaced on the way and are fixed in the simulation ([src/sim/staff/docs.md](../src/sim/staff/docs.md)): idle staff froze after picking a walkable but unreachable tile (a queue line) to wander to; every mechanic chased the same nearest breakdown, so mechanics moved as one pack; and a stuck worker was rescued onto the nearest path tile in any network, which stranded both mechanics on a cut-off path fragment so every ride stayed broken. After the fixes (`pnpm balance -- --scenario all --seeds 3 --jobs 2`) Bramblewood, Copper Ridge, Lantern Bay, Meadowbrook, Open Grounds, Riverside and Seaside win 3/3, and Glacier Point wins 1/3, as it does without the fixes on those seeds. +- **Mossgrove Isle's target was set from scripted play.** Its first draft target was $900 a month, while the best scripted seed made $373, so the target is $350. No tree is removed: the rule forbids it and the play test checks it. After the staff fixes it wins 1/12 against 2/12 before them, with mean ride income about the same ($299 against $297 a month); seed 1 fell from $367.50 to $323, and the park sits on the $350 threshold. The target was not retuned. - Each park's legal construction path (gate, stalls, first ride and the park's defining move) is checked separately in [bench/hard-parks.test.ts](../bench/hard-parks.test.ts). ## Known gaps diff --git a/docs/scenario-remixes.md b/docs/scenario-remixes.md index 79d719724..6377d94f9 100644 --- a/docs/scenario-remixes.md +++ b/docs/scenario-remixes.md @@ -31,13 +31,13 @@ source scenario does not have, the matrix says so. ## Design matrix -| Park | RCT2 idea (cited above) | OpenCoaster design | Owned land at start | Woods and clearance | Rules | Objective | A route to the goal | -| -------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Copper Ridge (Challenging, 96²) | Infernal Views' channels cutting a park apart; Grand Canyon's landscaping ban (Wacky Worlds, an expansion). | Red ridges with a dry gulch across the park. The gate bench (level 8) is reached from the south; a narrow owned trail crosses the gulch (level 5) to the west bench (level 11). East and summit benches are land for sale; the gulch and the ridge saddle are rights only. | 849 tiles: gate bench, trail and west bench (was a 2,916-tile rectangle). | Scattered boulders on the benches; no trees on the dirt ridges. Gate clearing 17×12. | No landscaping (our remix of the expansion rule). | Five coasters of 4.60+ excitement by the end of year 2 (was year 1). | Follow the trail across the gulch and fit coasters on the benches; terrain and nearby rocks lift ratings (the west-bench compact circuit rates 4.98 against 4.67 on flat ground). | -| Tidewater Docks (Challenging, 80²) | Lucky Lake's waterfront; the manual's warning that a U-shaped park confuses guests; construction rights. | An old harbour: a hook of quays round a basin with three finger piers. The basin and inlets are rights only, so they can be bridged but never filled; the third pier and the east breakwater are land for sale. | 966 tiles: west quay, south quay and two piers (was 3,136). | Woods on the banks and beyond the quays; gate clearing 13×10. | None: the shape is the challenge. | Repay the loan and reach $5,500 park value by the end of year 4 (unchanged). | Walk the south quay, buy rights over an inlet and bridge it, and stand narrow rides (a Ferris wheel fits a five-tile pier) along the piers. | -| Thunderhead Mesa (Expert, 96²) | Rainbow Summit's height limit and marketing ban; Extreme Heights' desert. | A scorched mesa top with buttes (level 16) above a dry canyon (level 4), with a narrow cliff trail down to the west shelf (11). East (13) and south (7) shelves are for sale behind steep corridors; the canyon is rights only. | 1,023 tiles: mesa top, cliff trail and west shelf (was 4,356). | Cacti and rock scatter; gate clearing 15×8. | Nothing more than 6 levels above local ground; no marketing (Rainbow Summit's rules, with OpenCoaster's own cap). | 460 guests and rating 700 by the end of year 4 (unchanged). | Build low on the mesa, take the cliff trail to the west shelf, and spread rides over the shelves; patrol handymen by area because the park is long. | -| Glacier Point (Expert, 96²) | Gravity Gardens' coaster-only roster; Alpine Adventures' mountain resort and chairlift. | Mountain shelves above a glacial lake. The gate shelf (12) sits on a saddle; a steep owned trail drops to a lake-shore shelf (6). A forested middle shelf (10) and a summit shelf (18) are for sale; the mountainside between them is rights only. | 589 tiles: gate shelf, trail and shore shelf (was 2,916). | Conifer and birch woods on the slopes and purchasable shelves; gate clearing 11×8. | Only coasters, stalls, toilets and the chairlift: gentle, thrill, water, transport rides other than the chairlift and the observation tower are forbidden (Gravity Gardens' roster is a research list, not a prohibition; here it is a rule). | Five coasters of 4.70+ excitement by the end of year 2 (was six of 4.90+ in about a month and a half). | Keep the woods round each station (nearby scenery lifts excitement), buy the forested middle shelf and clear only the track, and take the trail down to the shore for the fifth coaster; the scripted plan's five coasters rate 5.98 to 6.68. | -| Mossgrove Isle (Challenging, 72², new) | Botany Breakers' tree-covered island and monthly ride income; Fungus Woods' dense trees. | A wooded island reached by a causeway. A flat island core holds four small clearings joined by narrow trails; a protected grove on the knoll is not for sale; shallows to the south are rights only and a wooded islet is for sale. | 1,151 tiles, ellipse with a hole (bounding-box fill 65%). | About half the owned dry land is wooded; clearings of roughly 10×8. | No tree removal (our remix: Botany Breakers has no prohibitions; its trees only cost money to clear). | $350 a month in ride ticket income by the end of year 3 (set from scripted play; see BALANCE.md). | Build in the clearings along the trails, lift track above the trees, and use the shallows for water rides. | +| Park | RCT2 idea (cited above) | OpenCoaster design | Owned land at start | Woods and clearance | Rules | Objective | A route to the goal | +| -------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Copper Ridge (Challenging, 96²) | Infernal Views' channels cutting a park apart; Grand Canyon's landscaping ban (Wacky Worlds, an expansion). | Red ridges with a dry gulch across the park. The gate bench (level 8) is reached from the south; a narrow owned trail crosses the gulch (level 5) to the west bench (level 11). East and summit benches are land for sale; the gulch and the ridge saddle are rights only. | 849 tiles: gate bench, trail and west bench (was a 2,916-tile rectangle). | Scattered boulders on the benches; no trees on the dirt ridges. Gate clearing 17×12. | No landscaping (our remix of the expansion rule). | Five coasters of 4.60+ excitement by the end of year 2 (was year 1). | Follow the trail across the gulch and fit coasters on the benches; terrain and nearby rocks lift ratings (the west-bench compact circuit rates 4.98 against 4.67 on flat ground). | +| Tidewater Docks (Challenging, 80²) | Lucky Lake's waterfront; the manual's warning that a U-shaped park confuses guests; construction rights. | An old harbour: a hook of quays round a basin with three finger piers. The basin and inlets are rights only, so they can be bridged but never filled; the third pier and the east breakwater are land for sale. | 966 tiles: west quay, south quay and two piers (was 3,136). | Woods on the banks and beyond the quays; gate clearing 13×10. | None: the shape is the challenge. | Repay the loan and reach $5,500 park value by the end of year 4 (unchanged). | Fill the west quay round the prebuilt stall and wheel with rides that have real queues, bin every path and repay the loan early; late in year 2, walk the south quay out to both finger piers and line them with narrow rides (a Ferris wheel fits a five-tile pier). The scripted plan wins on the new-game map. | +| Thunderhead Mesa (Expert, 96²) | Rainbow Summit's height limit and marketing ban; Extreme Heights' desert. | A scorched mesa top with buttes (level 16) above a dry canyon (level 4), with a narrow cliff trail down to the west shelf (11). East (13) and south (7) shelves are for sale behind steep corridors; the canyon is rights only. | 1,023 tiles: mesa top, cliff trail and west shelf (was 4,356). | Cacti and rock scatter; gate clearing 15×8. | Nothing more than 6 levels above local ground; no marketing (Rainbow Summit's rules, with OpenCoaster's own cap). | 460 guests and rating 700 by the end of year 4 (unchanged). | Lay the cliff trail with bins first, then build low rides with real queues by the gate and on the west shelf below the trail; bin every path, patrol the trail and the shelf, and let the other handymen roam the mesa. The scripted plan wins on the new-game map. | +| Glacier Point (Expert, 96²) | Gravity Gardens' coaster-only roster; Alpine Adventures' mountain resort and chairlift. | Mountain shelves above a glacial lake. The gate shelf (12) sits on a saddle; a steep owned trail drops to a lake-shore shelf (6). A forested middle shelf (10) and a summit shelf (18) are for sale; the mountainside between them is rights only. | 589 tiles: gate shelf, trail and shore shelf (was 2,916). | Conifer and birch woods on the slopes and purchasable shelves; gate clearing 11×8. | Only coasters, stalls, toilets and the chairlift: gentle, thrill, water, transport rides other than the chairlift and the observation tower are forbidden (Gravity Gardens' roster is a research list, not a prohibition; here it is a rule). | Five coasters of 4.70+ excitement by the end of year 2 (was six of 4.90+ in about a month and a half). | Keep the woods round each station (nearby scenery lifts excitement), buy the forested middle shelf and clear only the track, and take the trail down to the shore for the fifth coaster; the scripted plan's five coasters rate 5.98 to 6.68. | +| Mossgrove Isle (Challenging, 72², new) | Botany Breakers' tree-covered island and monthly ride income; Fungus Woods' dense trees. | A wooded island reached by a causeway. A flat island core holds four small clearings joined by narrow trails; a protected grove on the knoll is not for sale; shallows to the south are rights only and a wooded islet is for sale. | 1,151 tiles, ellipse with a hole (bounding-box fill 65%). | About half the owned dry land is wooded; clearings of roughly 10×8. | No tree removal (our remix: Botany Breakers has no prohibitions; its trees only cost money to clear). | $350 a month in ride ticket income by the end of year 3 (set from scripted play; see BALANCE.md). | Build in the clearings along the trails, lift track above the trees, and use the shallows for water rides. | ## How the parks are validated @@ -53,5 +53,9 @@ source scenario does not have, the matrix says so. site plans (`bench/strategy/site-plan.ts`, plans in `bench/strategy/plans/`) because the old flat-apron scripts cannot fit rides on the new ground. Results are in [BALANCE.md](BALANCE.md#hard-park-remixes). +- `bench/hard-park-wins.test.ts` plays Tidewater Docks and Thunderhead Mesa to their deadlines on + the new-game map with the scenario's own research, cash and loan, and asserts the win; with + `HARD_PROOF_SAVES` set it saves the won parks for the browser proof + (`e2e/hard-parks-proof.spec.ts`). - Saves keep their own map: a park saved before the remix loads with its old land, terrain and scenery (`src/save/scenario-remix-saves.test.ts`). diff --git a/e2e/docs.md b/e2e/docs.md index ae238f5e4..a49dcce14 100644 --- a/e2e/docs.md +++ b/e2e/docs.md @@ -46,7 +46,7 @@ Path: @/e2e - [people-depth.spec.ts](people-depth.spec.ts) checks pixel ownership between a guest and flat, raised, queue and ramp paths, benches, trees and stalls, in WebGL2 and Canvas2D at all four rotations. It loads the dev-only [depth-fixture.html](../depth-fixture.html) ([src/dev/depth-fixture.ts](../src/dev/depth-fixture.ts)), which draws a hand-built map with one guest at a chosen position, and renders each case with and without the guest and on a bare map with the same camera. Pixels the guest owns are those of the bare-map render; pixels the scene owns are those of the scene-only render, so the check does not depend on the art. It asserts that a guest is not covered by the surface it stands on, is behind an object nearer the camera (only where the sprites overlap), and in front of one farther away. - [occlusion-oracle.spec.ts](occlusion-oracle.spec.ts) scores renderer occlusion against the oracle described in [src/render/docs.md](../src/render/docs.md) ("Occlusion model"). For every renderer × seed × rotation × zoom it loads the dev-only [occlusion-fixture.html](../occlusion-fixture.html) ([src/dev/occlusion-fixture.ts](../src/dev/occlusion-fixture.ts)), which renders a seeded fuzz park, captures the renderer's object-ID image and compares it with the oracle's z-buffer over the same placed sprites and terrain. It writes `.local/occlusion/