Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 68 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,78 @@
# OpenCoaster

An open-source, browser-based, clean-room theme-park management game inspired by the gameplay of 1999–2004 era roller-coaster tycoon games.
**Build roller coasters, run a theme park, and keep your guests happy, right in your browser.**

Status: playable end-to-end prototype (private until a maintainer approves going public). Original generated world art, UI icons, and animated ride sprites, with procedural fallbacks. This clean-room project is not affiliated with or endorsed by the publishers of any commercial game and contains none of their assets or code.
OpenCoaster is an open-source, clean-room theme-park management game inspired by the gameplay of 1999–2004 era roller-coaster tycoon games. Lay out paths, build coasters with lift hills, loops and corkscrews, hire staff, set prices and watch thousands of simulated guests decide whether your park is worth the ticket.

## Quick start
### [▶ Play now at opencoaster.noriagentic.com](https://opencoaster.noriagentic.com/)

No install, no account. It runs on desktop and on phones, and works offline once loaded.

![A busy daytime park in OpenCoaster: crowds of guests walk stall-lined avenues between merry-go-rounds, Ferris wheels, a spiral slide, an observation tower and other flat rides.](docs/screenshots/readme/park-overview.png)

| | |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![A blue-and-white steel looping coaster with a tall lift hill, a vertical loop and a corkscrew rising over an autumn forest beside a busy midway.](docs/screenshots/readme/steel-coaster.png) | ![A riverside fairground at nightfall, with glowing path lamps along the river, a merry-go-round, a Ferris wheel and guests out for the evening.](docs/screenshots/readme/riverside-night.png) |
| A steel looping coaster: lift hill, drop, vertical loop and corkscrew. | Riverside Fairground at dusk, with the path lamps lit. |

## What you can do

- **Design coasters piece by piece.** Stations, flat track, 25° and 60° slopes, small to large curves (flat, banked and sloped), vertical loops, corkscrews, S-bends, helices, tunnels, chain lifts, brakes, block brakes and launch sections. Each finished circuit gets a test run that measures speed, G-forces, drops, inversions and airtime to produce excitement, intensity and nausea ratings.
- **Run 19 rides and 13 stalls and facilities.** Wooden, Steel Looping, Junior and Wild Mouse coasters; a log flume and river rapids; a miniature railway, monorail and chairlift; flat rides from the Merry-Go-Round and Ferris Wheel to the Top Spin and Enterprise; food, drink, souvenir and balloon stalls, information kiosks and toilets. Stalls rotate to face the path and sell items guests carry around the park.
- **Watch guests think for themselves.** Every guest tracks hunger, thirst, toilet needs, energy, nausea and happiness, has a thrill preference and a budget, judges ride and ticket prices, queues single file, sits on benches, drops litter and tells you what they think.
- **Hire and manage staff.** Handymen sweep, mow, water and empty bins; mechanics inspect and repair rides as they wear down and break; security guards deter vandals; entertainers cheer guests up. Assign patrol areas and work orders.
- **Shape the land.** Raise, lower, flatten and smooth terrain, raise and lower water, buy land and construction rights, lay footpaths, queues, ramps and raised bridges, and decorate with trees, flower beds, fountains, statues, fences, benches, bins and lamps.
- **Balance the books.** Choose an entry fee or pay-per-ride, take and repay loans, fund research to unlock new ride types, and run marketing campaigns. Finance windows chart cash, park value and weekly profit, and your park can win (or lose) awards.
- **Play scenarios or a sandbox.** Eleven original scenarios from beginner to expert, each with its own map and climate. Most set a deadline goal (guests and park rating, park value, repaying the loan, ride income, food profit, or a set of excellent coasters); one is just for fun. There is also an unrestricted sandbox.
- **Live with the weather.** Sun, cloud, rain and storms change what guests want to do, and the park shifts from day to night with lamps that light up after dusk.
- **Save anywhere.** Save to in-browser slots, or export and import `.ocsave` files.

Everything runs locally: the simulation is deterministic and runs in a Web Worker, the world draws with WebGL2 (with a Canvas2D fallback), and all art, music and sound effects are original or procedurally generated.

### What's not there yet

OpenCoaster is a playable game, not a finished remake. The ride catalog is smaller than the games that inspired it, research unlocks rides but not scenery, there are four weather types rather than a full forecast system, and some rating and guest-behaviour formulas are still being tuned. Open gaps are tracked in [docs/mechanics/gap-audit.md](docs/mechanics/gap-audit.md) and [docs/fidelity/](docs/fidelity/).

## Built with Nori Projects

OpenCoaster was built by AI coding agents running on [Nori](https://noriagentic.com), working as one Nori Project with people steering along the way.

- **It started as a goal.** The owner gave the project one goal: an efficient, open-source browser game in the spirit of the classic coaster tycoon games, built by researching how each game mechanic works, parallelizing aggressively, and alternating between Anthropic and OpenAI models.
- **A coordinator broke it up.** A persistent project coordinator kept the goal and shared context, split the work into mechanics research and implementation tasks, and handed each one to its own cloud subworker.
- **Many agents worked in parallel.** Subworkers ran side by side on separate branches, mixing Anthropic Claude and OpenAI Codex models. Mechanics research was written up with public sources in [docs/mechanics/](docs/mechanics/) before code was written against it.
- **Work was checked, not just merged.** Each change came in as a pull request with tests, and UI and art changes carried browser screenshots that were reviewed before merging. Proof captures live on the repository's `nori/pr-proofs` branch.
- **Playtests fed back into the work.** Agents played the live build through a real browser and wrote up what broke (see [docs/playtest/](docs/playtest/)). The owner played builds too and sent feedback, such as lamps that turn on after dark, queue lines that stay single file, and harder scenarios with awkward terrain, and the coordinator turned that feedback into new tasks.

The commit history, pull requests and [docs/DECISIONS.md](docs/DECISIONS.md) record how the game came together.

## Run it locally

You need Node.js 20.19+ or 22.12+ and pnpm 10 (`corepack enable` provides the pinned version).

```sh
git clone https://github.com/tilework-tech/opencoaster.git
cd opencoaster
pnpm install
pnpm dev # http://localhost:5173
pnpm check # lint, format, typecheck, test, build
pnpm bench # sim ms/tick with 5000 guests
pnpm e2e # headless Chromium playtest; screenshots go to .local/playwright-results/
pnpm dev # Vite dev server at http://localhost:5173
```

Docs: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md), [CONTRIBUTING.md](CONTRIBUTING.md) (clean-room rules), [AGENTS.md](AGENTS.md). Mechanics research lives in `docs/mechanics/`.
The first `pnpm dev` or `pnpm build` generates the sprite pages from the art sources, which takes a few minutes.

Checks:

```sh
pnpm check # lint, format, typecheck, unit tests and production build (what CI runs)
pnpm e2e:quick # desktop Playwright subset for UI changes
pnpm e2e # full Playwright suite, desktop and Pixel 8
pnpm bench # simulation benchmark
```

Pushes to `main` deploy to GitHub Pages at [opencoaster.noriagentic.com](https://opencoaster.noriagentic.com/) ([docs/deploy/README.md](docs/deploy/README.md)).

## Contributing

Contributions are welcome. Please read [CONTRIBUTING.md](CONTRIBUTING.md) first: the clean-room rules are mandatory, so never use original game assets, decompiled code or code from incompatibly licensed projects. Then see [AGENTS.md](AGENTS.md) for commands and conventions and [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for how the simulation, worker and renderers fit together.

## License

License: MIT.
[MIT](LICENSE). This clean-room project is not affiliated with or endorsed by the publishers of any commercial game, and contains none of their assets or code. All art and audio are original or procedurally generated.
19 changes: 9 additions & 10 deletions docs/deploy/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# GitHub Pages deploy

The game is served from a project-site subpath: https://tilework-tech.github.io/opencoaster/
The game is served at https://opencoaster.noriagentic.com/ over HTTPS. `public/CNAME` names that domain, and GitHub Pages redirects both https://tilework-tech.github.io/opencoaster/ and plain HTTP to it.

## What is ready
## Workflow

- `docs/deploy/pages.yml` is a ready-to-install workflow. It runs `pnpm build` and deploys `dist/` with `actions/upload-pages-artifact@v3` and `actions/deploy-pages@v4` on every push to `main`.
- Production builds use a relative Vite base (`./`) by default, so `dist/` works at the site root or under `/opencoaster/`. Set `OC_BASE` (e.g. `OC_BASE=/opencoaster/ pnpm build`) to pin an absolute base instead.
- `pnpm smoke:subpath` builds `dist/`, serves it under `/opencoaster/` with no cross-origin isolation headers (`tools/serve-subpath.mjs`), and runs the smoke suite against it. GitHub Pages sends no COOP/COEP headers, so this is the production configuration.
- [.github/workflows/pages.yml](../../.github/workflows/pages.yml) is installed and deploys on every push to `main` and on manual `workflow_dispatch`. It runs `pnpm build`, uploads `dist/` with `actions/upload-pages-artifact`, and publishes it with `actions/deploy-pages`.
- After deploying, an "Ensure custom domain" step sets the Pages custom domain back to `opencoaster.noriagentic.com` if it has been cleared. The step is allowed to fail without failing the deploy.
- Pages Source in the repository settings is "GitHub Actions".
- [pages.yml](pages.yml) in this folder is a historical copy from before the workflow was installed and has drifted from it. Edit the installed workflow, not this copy.

## Installing the workflow
## Base path

The GitHub session token cannot push `.github/workflows/` files, so the workflow lives here until an admin installs it:

1. Copy `docs/deploy/pages.yml` to `.github/workflows/pages.yml` and merge it.
2. In the repository settings, open Pages and set Source to "GitHub Actions".
- Production builds use a relative Vite base (`./`) by default, so `dist/` works at the domain root and under a subpath such as `/opencoaster/`. Set `OC_BASE` (e.g. `OC_BASE=/opencoaster/ pnpm build`) to pin an absolute base instead.
- `pnpm smoke:subpath` builds `dist/`, serves it under `/opencoaster/` with no cross-origin isolation headers (`tools/serve-subpath.mjs`), and runs the smoke suite against it. GitHub Pages sends no COOP/COEP headers, so this matches production.

Dev and preview builds keep the root base and the COOP/COEP headers the Vite dev server sends.
Binary file added docs/screenshots/readme/park-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/readme/riverside-night.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/readme/steel-coaster.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions e2e/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ Path: @/e2e
- [p1-ui-fidelity.spec.ts](p1-ui-fidelity.spec.ts) requires the desktop canvas to use WebGL2, checks populated ride windows avoid status bar and pointer overlap, validates compact coaster controls, builds while paused, checks the 2× construction cap and ride preview, verifies saved desktop window placement, and exercises ownership UI. The ride-access Pixel 8 scenario checks the construction controls fit the mobile viewport and uses touch to build.
- [ride-breakdown-proof.spec.ts](ride-breakdown-proof.spec.ts) captures both a forced breakdown with a mechanic en route and a separate naturally rolled breakdown. The natural seeded scene in [support/breakdown-scene.ts](support/breakdown-scene.ts) advances until reliability has fallen and rolling downtime is nonzero; its Maintenance screenshot documents those live values.
- [scenario-selection.spec.ts](scenario-selection.spec.ts) checks scenario tabs and previews, plus persistence of completed-park status across reloads.
- [title-source-link.spec.ts](title-source-link.spec.ts) checks the title screen's "Source on GitHub" link on desktop and Pixel 8: it is inside the viewport, opens the repository in a new tab with `noopener noreferrer`, is reachable with Tab, does not overlap the menu buttons, and returns after Back from a sub-view.
- [readme-screenshots.spec.ts](readme-screenshots.spec.ts) captures the README images in [docs/screenshots/readme](../docs/screenshots/readme) and runs only when `README_SHOT_DIR` is set (`README_SHOTS` limits it to named parks). [support/readme-parks.ts](support/readme-parks.ts) builds developed parks in Node with the real simulation and integration fixtures, serializes them, and the spec imports each through Import save file, lets it run briefly, then frames and captures each view with WebGL2. Regenerate with `README_SHOT_DIR=docs/screenshots/readme pnpm exec playwright test --config=playwright.e2e.config.ts e2e/readme-screenshots.spec.ts`.
- [footpath-tool.spec.ts](footpath-tool.spec.ts) drives the Footpaths window through the UI: a dragged run previews its tiles and cost and lays them on release, a refused run shows red tiles with the reason, right-click and long-press remove a footpath with a refund, piece mode builds and removes at the cursor, and the hint shows once. Shared helpers are in [footpath-helpers.ts](footpath-helpers.ts).
- [scenery-catalog.spec.ts](scenery-catalog.spec.ts) browses the grouped Scenery menu on desktop and Pixel 8, checks tooltips, places, refuses and shift-removes new decorations. [scenery-proof.spec.ts](scenery-proof.spec.ts) (`@art-review`, set `SCENERY_PROOF_DIR`) photographs every decoration at four rotations and facings, its ghost, the menu and a decorated park in both renderers.
- [wall-edge-placement.spec.ts](wall-edge-placement.spec.ts) exercises wall scenery through the browser tool in WebGL2 and forced Canvas2D: it places edge walls, rotates the camera, and drag-places a continuous fence run. It complements simulation tests for per-edge occupancy and wall-blocked path links.
Expand Down Expand Up @@ -64,6 +66,7 @@ Path: @/e2e
- `pnpm e2e` runs against the Vite development server and does not build the app. The Starter Park save round-trip completes without advancing a full year; set `E2E_RUN_YEAR=1` to opt into the longer year-one objective outcome run.
- Manual browser contexts must use `createTestContext`; the shared auto fixture closes registered contexts between tests. This prevents contexts and their WebGL resources from accumulating across the single-worker suite.
- Repository screenshots captured by the UI flow are stored in [docs/screenshots](../docs/screenshots). The Starter Park ride-access runs attach their screenshots to the Playwright report; those attachment files are test artifacts rather than committed repository assets. P1 construction and ride-window before/after images are committed in [docs/playtest/assets](../docs/playtest/assets).
- The README screenshot spec launches Chromium with `--disable-accelerated-2d-canvas` and `--disable-gpu-rasterization`: a developed park loads every flat-ride sprite page, which otherwise exhausts browser memory.
- Mobile profiles and SwiftShader are browser emulation; their screenshots and FPS samples verify the browser integration path but do not characterize physical phone GPU performance.
- [queue-lines.spec.ts](queue-lines.spec.ts) runs on desktop and emulated Pixel 8 against Open Grounds, building everything through the controls (a walkway, a Merry-Go-Round with its entrance and exit, the queue line dragged out from the highlighted entrance, and an exit path). It reads the live sim through the dev-only `window.__sim` hook, spawns a crowd from the Game options menu, and checks that the prompt opens Footpaths with Queue line on, that the ghost says the line links to the entrance and the path, that guests queue one per tile in joining order, that wanderers never stand on a queue tile, and that a queue length limit of 3 caps the line and turns guests away with the "queue is too long" thought. Phones place paths with CDP touch drags.
- [icon-names.spec.ts](icon-names.spec.ts) opens every tabbed window from the toolbar and asserts each toolbar button and tab has a non-empty accessible name and tooltip.
Expand Down
Loading
Loading