Repository navigation
Description
Time-boxed spike. One question: can a full game run offline on iOS, using the unchanged TypeScript sim inside the app, Apple's RealityKit drawing the models, and SQLite holding saves? Say the answer in the PR, even if it's no.
Why Park Hide & Seek
The game already has the seam this spike needs. src/ui/session.ts LocalSession runs the Room (src/room.ts) right in the page against bots, and src/hunt/ plus room.ts import nothing from outside the game. On iOS, the same Room runs in JavaScriptCore instead of in the page. The decision is in this conversation: Park Hide & Seek, the TS sim run in JavaScriptCore, built by a worker.
Steps
- Bundle the room. A script in the app,
bun buildof a small entry file, packsRoominto one JS file and exposes three functions:create(seed, opts),handle(msg)andtick(now)→ that player'sViewas JSON. Weather stays offline: pass a fixed or hand-picked weather in place offetchWeather. Swift runs the bundle in JavaScriptCore atTICK_MS. Measure the cost of one tick on the simulator. - Draw it with RealityKit. One SwiftUI screen.
- Terrain: build a mesh from a bundled surveyed zone (Yosemite or Yellowstone data in
src/parks/data) with RealityKit'sMeshResource. Flat colours, with fog in the sky's horizon colour like the poster look. - People:
public/models/characters.glb→bun run usdz park-hide-seek(from bun run usdz: the games' glTF models as USDZ for native iOS #2890) → move the entities from theView. Joints can stay rigid for the spike. - Plants: these are built in code (
@rustybuns/modelsflora), so they have no GLB. Use placeholder cones for the spike; the real export is USDZ for native iOS: procedural three.js models and beast rigs #2891.
- Terrain: build a mesh from a bundled surveyed zone (Yosemite or Yellowstone data in
- Controls. A thumbstick, plus Run and Crouch buttons, sent as the same
MsgsLocalSessionsends. - Save in SQLite. On-device SQLite holds the camper look, the settings now in
localStorage(phs.*), and a round-results table. Write it as oneschema.sqlthat D1 could run as is. - Write up in the PR: tick cost, frame rate, app size, what felt bad, and a yes or no on each of the three questions.
Where
A second target in native/ios beside the WebView shell (project.yml). Simulator only, so no signing (#2441 stays parked). One PR against main, marked as a spike. Swift tests via swift test in native/ios for any plain logic.
Out of scope
Online play and sync with the Worker, eqosys sign-in, animated joints and plants (#2891), the 61 parks fetched over the network, audio, App Store.
Done when
In the simulator in airplane mode, a round runs from drop through hide and hunt to results against bots, and the PR has the write-up.
Activity
Park Hide & Seek on iOS: offline play with the TS room in JavaScriptC…