10

threadweaver

Compose a living city. Paint the sky. Talk to NPCs. Learn their story as though it mattered. A sunset‑drenched Three.js world with first‑person exploration and OpenAI‑powered, personality‑driven NPC chat.

Why this exists

Threadweaver is a tiny love‑letter to the characters games overlook. “NPC” began as a design term, but slang sometimes reduces people to background noise. Threadweaver flips that: the city is woven from background lives. Gossip matters. Rent is late. A speakeasy is brewing. You listen, tease, solve a riddle — and a life moves one step.

Features

  • Cinematic Three.js city with a default pink/orange sunset mood
  • First‑person movement (WASD + Space) with a visible hand
  • Raycast chat: look toward a pedestrian and press E
  • Live world controls (toggle with the gear button or H):
    • Sky color, fog, ambient/sun, neon accents
    • City ⇄ Nature mix, building density, tree density
    • People/car density, streetlight density, road spacing, world size
  • NPCs with personality and arcs
    • Mood, family status, partner name (sometimes), hobby, stress, pet, favorites, and a gossip thread
    • First line is short and sometimes abrupt (“Busy. What?”)
    • Replies are concise (1–2 lines), unpredictable in tone, and may end with a tiny hook/riddle
    • Small arc progression on each turn (in‑memory)
  • Real‑time chat powered by the OpenAI Responses API (not Chat Completions)

Stack

  • Frontend: HTML/CSS + Three.js (PointerLock, raycasting, world controls)
  • Backend: Node.js + Express
  • Realtime: OpenAI Responses API POST /v1/responses
  • State: in‑memory NPC arcs (swap to file/SQLite for persistence)

Source code: https://github.com/J0YY/threadweaver