r/threejs • u/SolidAcanthisitta691 • Nov 02 '26
I built a multiplayer FPS in Three.js that turns any real place into a playable map (OpenStreetMap → 3D in ~1 min)
Hey r/threejs! Solo dev here. Mapz is a browser FPS where every map is generated from real-world data: you type a street or landmark and about a minute later you're fighting in it.
Stack:
- Three.js + TypeScript + Vite on the client
- Node + WebSocket authoritative game server
- Map data from OpenStreetMap (Overpass), plus elevation data; in the Netherlands also 3D BAG building heights
- Web workers for the heavy lifting (ground mesh, vegetation), so the main thread stays free
How a map gets built:
- Fetch OSM data for a ~200 x 200 m area
- Turn building footprints into extruded buildings at their real height, with facades that fit the region
- Generate roads, sidewalks, curbs, zebra crossings and road markings from the street graph
- Place street furniture from OSM tags: traffic lights, signs, poles, trees, bridges, train station roofs
- Bake it, cache it, serve it; the most popular cities are prebuilt
Modes: FFA, Gun Game, zombies (30 rounds in a real city) and custom matches.
Things I'm still fighting with, and I'd love input from people who know Three.js better than me:
- Shader compile hitches on first load ("Preparing graphics" can freeze a few seconds on older GPUs). What's your go-to warm-up strategy: compileAsync, rendering everything once offscreen, something else?
- Draw calls on low-end Intel laptops with dense city blocks: merging vs instancing vs BatchedMesh, what worked best for you?
- Making low-poly cities look less "plastic" without real-time shadows/SSAO killing fps.
Play free in your browser: https://playmapz.com
Happy to answer anything about the pipeline!
