Skip to content

Spike: Park Hide & Seek offline on native iOS (TS sim in JavaScriptCore, RealityKit, SQLite) #2897

Closed

Description

@QuinnsCode

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

  1. Bundle the room. A script in the app, bun build of a small entry file, packs Room into one JS file and exposes three functions: create(seed, opts), handle(msg) and tick(now) → that player's View as JSON. Weather stays offline: pass a fixed or hand-picked weather in place of fetchWeather. Swift runs the bundle in JavaScriptCore at TICK_MS. Measure the cost of one tick on the simulator.
  2. Draw it with RealityKit. One SwiftUI screen.
  3. Controls. A thumbstick, plus Run and Crouch buttons, sent as the same Msgs LocalSession sends.
  4. Save in SQLite. On-device SQLite holds the camper look, the settings now in localStorage (phs.*), and a round-results table. Write it as one schema.sql that D1 could run as is.
  5. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions