Skip to content

feat: OpenStreetMap → walkable PSP streetscapes (city3d) + adventure3d floor fix#14

Draft
doodlewind wants to merge 2 commits into
mainfrom
feat/osm-streetscape-psp
Draft

feat: OpenStreetMap → walkable PSP streetscapes (city3d) + adventure3d floor fix#14
doodlewind wants to merge 2 commits into
mainfrom
feat/osm-streetscape-psp

Conversation

@doodlewind

Copy link
Copy Markdown
Owner

What

A toolchain to bake any real-world location from OpenStreetMap into a textured, walkable PSP 3D scene, plus a fix for a related "black faces" rendering bug in adventure3d.

Built on the existing g3d retained-mesh pipeline — no engine changes; it's all baker + game + assets.

OSM streetscape (feat(city3d))

  • framework/bake/fetch-osm.ts — pure-Bun Overpass downloader (multi-endpoint fallback) that vendors the raw JSON under assets/vendor/osm/ (the ODbL source extract, kept for reproducibility + ODbL §4.6).
  • framework/bake/bake-osm.ts — projects lat/lon → metres, extrudes building footprints (height from height/building:levels) into window-textured walls + ear-clipped roofs, road ribbons and parks, merged into an N×N chunk grid split by texture (facade / pavement / untextured). Emits a base64 assets-osm-*.ts module + per-building collision AABBs + a street spawn + two procedural REPEAT-wrapping textures.
  • framework/games/city3d.js — loads the sub-meshes as static, culled Node3Ds (one shared Material per texture), sun + fog, an optional hand-modeled hero landmark, and a skinned soldier with camera-relative movement (the model turns to face the way it walks) + AABB collision. The ground + skybox are small, camera-following tessellated meshes so the PSP GE guard band never drops a huge triangle.
  • Locations: Paris / Place de l'Étoile (Arc de Triomphe hero), Shanghai / Lujiazui (the supertall trio — current default), plus Times Square + Shibuya configs. Swap location by changing one import line.
  • docs/osm-streetscape-research.md — survey of non-commercial 3D/geo data sources (raw OSM is the only legal offline path; photoreal 3D tiles are streaming-only).

adventure3d floor fix (fix(adventure3d))

The 38 m arena floor was one finite static slab; the chase camera sits 7 m behind the soldier, so near an edge the camera ends off the floor → black void in the foreground. Replaced it with the same camera-following tessellated ground.

Verification

  • Runs on PPSSPP at ~60 FPS (Shanghai supertalls with tiled window facades; soldier walks + turns; no black faces).
  • bun run test22 passed, 0 failed (new city3d golden; adventure3d golden regenerated).
  • bun run typecheck clean.
  • Builds on the latest normalized-PSP-SDK toolchain (main @ a3597e8).

Notes / follow-ups

  • Draft: this is an initial proof-of-concept of the import pipeline.
  • mipsel-sony-psp/ SDK and runtime/target/ stay gitignored.
  • fps3d's 20 m room box is a latent case of the same finite-floor issue; not touched here.

🤖 Generated with Claude Code

doodlewind and others added 2 commits June 20, 2026 04:41
Turn a real place on Earth into a textured, walkable PSP 3D scene from OSM:
- fetch-osm.ts (pure Bun) downloads Overpass data + vendors the ODbL source extract
- bake-osm.ts projects lat/lon -> metres, extrudes building footprints (height from
  height/building:levels) into window-textured walls + earcut roofs, road ribbons and
  parks, merged into an NxN chunk grid split by texture (facade / pavement / flat) with
  two procedural REPEAT-wrapping textures, per-building collision AABBs and a spawn point
- city3d.js loads it as static culled sub-meshes (one Material per texture), a sun + fog,
  an optional hand-modeled hero landmark, and a skinned soldier with camera-relative
  movement (the model turns to face the way it walks) + AABB collision
- camera-following tessellated ground + skybox so the PSP GE guard band never drops a
  huge triangle (the "random black faces" bug)
- locations: Paris/Etoile (Arc de Triomphe hero), Shanghai/Lujiazui (default), plus
  Times Square + Shibuya configs; swap by changing one import line
- docs/osm-streetscape-research.md surveys the non-commercial data sources

Verified on PPSSPP at ~60 FPS; bun run test 22/22 (city3d golden added).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e arena

The 38 m arena floor was one finite static slab; the chase camera sits 7 m behind
the soldier, so near an edge the camera ends off the floor and the foreground had no
geometry -> black void. Replace the static floor with the same camera-following
tessellated ground city3d uses (one mesh, 8 m guard-band-safe tiles, edge past fog.far),
so there is always floor under the view.

Verified on PPSSPP at 60 FPS; golden regenerated, bun run test 22/22.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@doodlewind doodlewind force-pushed the feat/osm-streetscape-psp branch from 5c6a85f to 5248c26 Compare June 19, 2026 22:37
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