Skip to content

feat(pocket3d): pocket-drive — streamed open-data city drive on PSP#132

Draft
doodlewind wants to merge 1 commit into
mainfrom
healthy-hurricane
Draft

feat(pocket3d): pocket-drive — streamed open-data city drive on PSP#132
doodlewind wants to merge 1 commit into
mainfrom
healthy-hurricane

Conversation

@doodlewind

Copy link
Copy Markdown
Collaborator

What

A new pocket3d runtime demo, Pocket Drive: a Tesla-dash-style night drive through Midtown Manhattan on PSP. Open data (OpenStreetMap buildings + streets — 4,390 footprints, 94% with surveyed heights, 822 streets around the Flatiron / Empire State corridor) is cooked into simple extruded meshes in a tiled binary pack, then streamed tile-by-tile off the memory stick around a car that follows a baked scenic route. New blocks rise from the ground as they load — the dynamic loading is the show.

orbit turn
rise avenue

How

  • cooker/cook.ts (Bun, zero deps): Overpass fetch → pinned 220 KB extract (offline, byte-deterministic cooks) → ear-clipped footprints extruded by surveyed height with baked vertex lighting (facing shade + base AO + roof rim-light lines), street ribbons by class width, all quantized to the 12-byte GE vertex (color u32, xyz i16) in 128 m tiles; route = Dijkstra legs between scenic waypoints (Flatiron → Empire State → Herald Square → Morgan Library), a 4.1 km closed loop. 2.6 MB pack total.
  • src/ (no_std EBOOT, gu-demo pattern): zero-copy .pdrv reader; streamer with a Chebyshev residency ring, one async sceIoReadAsync in flight, ahead-of-car load bias, GE-safe eviction, and a 30-frame rise animation via the per-tile model matrix; zero-triangle infinite-ground backdrop split at the computed horizon row; GE fog into the same haze color; miter-joined navigation ribbon; box-art cars (player + 16 traffic both directions) following the route by arclength with corner slowdown; orbit→chase camera; capture contract identical to gu-demo. Falls back to an embedded pack (DRIVE_PACK) with simulated load latency when no file is present.
  • scripts/pocket-drive.ts: cook → cargo psp → pack onto the emulated memstick → PPSSPPHeadless → PNGs.

Typical frame: ~35 tiles, ~10 k tris, ~80 draw calls.

Verification

  • Cook is byte-deterministic from the pinned extract (hashed twice).
  • PPSSPPHeadless (software renderer) frame captures: boot city-rise, avenue drive, 90° turns with ribbon preview + camera swing, oncoming traffic pass, and both pack sources (file streaming and embedded); streaming counters confirmed via the stats feature (121 async tile loads in the opening seconds, all polled non-blocking).
  • Desktop pocket3d workspace still cargo checks clean (new crate is workspace-excluded like gu-demo).
  • Pending: real-hardware pass over PSPLINK (same acceptance bar as gu-demo); PPSSPP e2e goldens if we want them pinned.

Map data © OpenStreetMap contributors (ODbL); the pinned extract is a derived database.

🤖 Generated with Claude Code

A new pocket3d runtime demo: Midtown Manhattan (OpenStreetMap buildings +
streets, 94% surveyed heights) cooked into a tiled .pdrv mesh pack and
streamed off the memory stick around a car following a baked scenic route —
the Tesla-dash night-drive look on real PSP hardware.

- cooker/cook.ts (Bun, zero deps): Overpass fetch → pinned extract →
  ear-clipped, extruded, vertex-lit tiles in the 12-byte GE vertex layout;
  Dijkstra waypoint route (Flatiron → Empire State → Herald Sq loop);
  byte-deterministic; SVG preview.
- src/: zero-copy .pdrv reader, async sceIo tile streamer (residency ring,
  ahead-bias, rise-from-ground animation), zero-triangle infinite-ground
  backdrop, GE fog, route ribbon, box-art cars with corner slowdown,
  orbit→chase camera, gu-demo capture contract; embedded-pack fallback.
- scripts/pocket-drive.ts: cook + cargo psp + PPSSPPHeadless + PNGs.

Verified in PPSSPPHeadless (software renderer): intro rise, avenue drive,
90-degree turns, oncoming traffic, both pack sources; ~35 tiles / ~10k tris
per frame. Real-hardware pass pending, same bar as gu-demo.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant