# Engine source and licenses Engine: OpenRCT2 v0.5.3-49-g9de2d43fb6, exact upstream commit `9de2d43fb6e7d6a6213336125a4afbddf8cc167c`, GPL-3.0-or-later. Full upstream source is included at `preservation/openrct2-source.tar.gz`. Engine bytes, wrapper patch and source-build provenance are from Parkworks commit `39ad35833005eb8490ead5fc357a67561de44110` (GPL-3.0-or-later). Preserve upstream credits and notices. Use `scripts/rebuild-engine.ps1` (PowerShell 7, Git, Node and Docker) to reproduce the low-memory build. It fetches the exact commit, applies `scripts/engine-lite.patch`, builds in the digest-pinned official OpenRCT2 build image, and applies `scripts/patch-engine.mjs`. The native patch reduces initial WASM memory from 2 GiB to 512 MiB, maximum from 4 GiB to 2 GiB, and the worker pool from 120 to four. The JS patch allows the wrapper to choose 1–4 workers; this edition chooses four. No native gameplay modifications were made here. ```powershell ./scripts/rebuild-engine.ps1 -OutputDirectory .engine-rebuild/output -VerifyContract ``` The script expects `public/engine` by default when verifying the imported manifest; run `node scripts/verify-engine.mjs web/engine` for this repository’s shipped files. Build outputs are under `.engine-rebuild/output`; use the supplied lock manifest to compare hashes. Exact output hashes may depend on upstream build metadata; `-VerifyContract` checks the memory/worker contract. Retain the archived source and both patches beside your distributed engine, with GPL-3.0 text and build instructions. The browser JS filesystem and backup wrappers are derived from Parkworks and modified in `src/`. The custom UI and touch adapter use GPL-3.0-or-later too. Open engine data (`web/engine/assets.zip`) retains upstream OpenRCT2 notices: objects and title sequences CC BY 4.0, OpenMusic CC BY-SA 4.0 / per-file exceptions, bundled fonts and dependencies per their notices. JSZip 3.10.1 is MIT. Include its LICENSE from npm distribution with redistributed bundles. Caddy is Apache 2.0, Go is BSD; their source/module checksums and Caddy license are under `deploy/server`. The server is built with pure Go and current pinned inputs reused from the existing preservation stack. Original RCT2 artwork/audio/scenarios/track designs are separate proprietary material from the user-supplied disc. They are not relicensed under GPL. The runtime’s license is not permission to distribute those assets publicly. This is private preservation packaging, not a license clearance claim. ## Y2K Pixels browser bridge patch After the Parkworks build, run `node scripts/patch-y2k-engine.mjs PATH_TO/openrct2.js`. This caps the JS logical-core bridge at one so nested native JobPools fit inside four preallocated workers. A pool capped only in the Emscripten loader can deadlock when a park creates a native job pool synchronously. The patch also replaces the native save/load/reset JS bridges with same-page events. The shell persists completed native `.park` snapshots under `/y2kpixels-rct2/user/save` and provides local saved-park selection; the original bridge only wrote `/save.park` and opened browser download/file dialogs. Native gameplay code and WASM bytes remain unchanged. The shipped adjusted JS hash is in `scripts/engine-manifest.json`; the original imported manifest is retained in `preservation/engine-manifest.json`. Source archive SHA-256: `ce23a891ce929ae01f393771f862f332b21968df906b10e7cbc88e0e892389f0`. For production distributions, the Docker image includes source and license files at `/source/` as well as the runtime. This keeps corresponding source available from the same static host. The fixed same-origin player frame and Pointer Events adapter are in `web/player.html` and `src/main.ts`. Native canvas text input is bridged through a parent HTML form. Automatic device-pixel-ratio inference is disabled for the fixed screen. The backup wrapper copies file bytes into the parent realm before ZIP export. These browser compatibility changes do not modify WASM gameplay code. The loader enables native verbose diagnostics to receive the `TitleScene::Load() finished` readiness signal, filters diagnostic noise from the console, and gates the saved-park picker until that real native milestone. It does not infer readiness from a timeout or from the WASM factory resolving. ## Prepared asset bundles The loader uses fflate 0.8.2 (MIT, `preservation/LICENSE.fflate`) as a fallback where native gzip decompression is unavailable. `scripts/build-asset-packs.py` uses Python's standard library to create deterministic gzip bundles from the unchanged original manifest and upstream asset ZIP. Each raw bundle consists of a 4-byte little-endian JSON-header length, a JSON array of `[relativePath, byteLength]` entries, and the concatenated original bytes. Its full SHA-256 is embedded in the frozen URL. The generated catalog records sizes, file counts and hashes. `python3 scripts/verify-asset-packs.py` checks every mounted byte against the original sources. `src/asset-worker.ts` streams decompression and verifies SHA-256 before committing a Blob to the separate `y2kpixels-rct2-assets-v1` database. `src/asset-loader.ts` transfers those buffers to MEMFS with bounded prefetch and validates directory entries. The worker prunes obsolete prepared-asset records only; saved parks retain the existing IDBFS database. Optional soundtrack files keep their original bytes and hash-qualified URLs without a second large prepared cache. No WASM or gameplay rules change. Rebuild with Node 22+, `npm ci`, optionally `npm run build:assets`, `npm run verify:assets`, then `npm run build`. The generated worker filename contains the SHA-256 of its source bundle. Retain published hashed URLs unchanged alongside releases so old tabs and rollbacks keep working. The Docker image includes the catalogs, builder, browser source and dependency lockfile under `/source/`.