backup: 2026-06-19 18:09
This commit is contained in:
@@ -6,25 +6,27 @@
|
||||
#+filetags: :project: :knowledge:
|
||||
|
||||
** Architecture
|
||||
Static site (no backend). ~index.html~ + ~life.js~ + ~schedule.js~ as ES modules. Three.js + onnxruntime-web from CDN.
|
||||
Static site (no backend). ~index.html~ + ~life.js~ + ~schedule.js~ + ~locations.js~ as ES modules. Three.js + onnxruntime-web from CDN.
|
||||
Served by Caddy via ~nix run~ on port 8080. Built by ~nix build~ (includes model weights in ~$out/model/~).
|
||||
|
||||
Domains:
|
||||
- *Life generation*: ~life.js~ — deterministic 36,500-day procedural simulation → [[id:9465af82-4383-466c-bf09-5be19c328f0b][trmn/life]]
|
||||
- *Life generation*: ~life.js~ — deterministic 36,500-day procedural simulation → [[id:9465af82-4383-406c-bf09-5be19c328f0b][trmn/life]]
|
||||
- *NPC people*: family tree + tracked friends/children, each with deterministic PersonRecord → [[id:423cac95-a80d-4db6-8bef-14297fb38437][trmn/people]]
|
||||
- *Daily schedule*: ~schedule.js~ — 96-slot day, 68 scenes, deterministic from (masterSeed, currentDay) → [[id:ff8aa6b7-61ff-444c-9301-c0b666b0b573][trmn/schedule]]
|
||||
- *Rendering*: Three.js low-poly 3D scenes, flat shading, cinematic 2.39:1 viewport
|
||||
- *LLM dialogue*: TinyStories-8M ONNX INT8 bundled in ~/model/TinyStories-8M/~ → [[id:4b44cf43-6106-4498-81a3-b23ebb25dabf][trmn/llm]]
|
||||
- *Assets*: SVG face sprites + GLB objects → [[id:4d5e6bc8-32eb-469f-a69f-84b14458c55b][trmn/assets]]
|
||||
- *Assets*: SVG face sprites + GLB objects + Blender location scenes → [[id:4d5e6bc8-32eb-469f-a69f-84b14458c55b][trmn/assets]]
|
||||
|
||||
~window.__life~ exposes ~{traits, buf, eventLog, people, today, currentDay, masterSeed, schedule}~.
|
||||
~window.__sceneLoader~ exposes ~{ loadAndShow(locationId, props) }~ for the debug panel.
|
||||
|
||||
** Conventions
|
||||
- Determinism: ALL randomness seeded from absolute time, never ~Math.random()~; use ~makeRng(masterSeed, day)~
|
||||
- Low-poly aesthetic: ~MeshLambertMaterial~ with ~flatShading: true~, BoxGeometry for characters
|
||||
- Cinematic viewport: ~aspect-ratio: 2.39/1~, FOV 26°, vignette via CSS ~::after~
|
||||
- Scene background via CSS gradient on ~#stage~ div; canvas is ~alpha: true~
|
||||
- Static assets: copy to ~$out/assets/~ in flake installPhase; generated assets built via Node.js in buildPhase
|
||||
- Static assets: copy to ~$out/assets/~ in flake installPhase; generated assets built via Node.js/Blender in buildPhase
|
||||
- ~.blend~ files are source of truth for location scenes; GLBs are build artifacts never committed
|
||||
|
||||
** Gotchas
|
||||
- ~header Content-Type text/html~ in Caddyfile is wrong for multi-asset setups — omit it
|
||||
@@ -36,16 +38,18 @@ Domains:
|
||||
- All ONNX build/inference gotchas → [[id:4b44cf43-6106-4498-81a3-b23ebb25dabf][trmn/llm]]
|
||||
|
||||
** Key Files
|
||||
- ~index.html~ — Three.js scene + LLM inference + life simulation bootstrap (three inline module scripts)
|
||||
- ~index.html~ — 4 inline module scripts: life sim bootstrap, Three.js scene (+ pack loader + debug exposure), debug panel UI, LLM inference
|
||||
- ~life.js~ — full life simulation: PRNG, 31 events, 36,501-day loop, NPC people system
|
||||
- ~schedule.js~ — daily schedule: 68-scene catalog, 10 life stages, forced-event overrides
|
||||
- ~locations.js~ — ~generateLocationProps(locationId, masterSeed, playerState, eventLog?)~; wall/floor palettes + conditional mesh sets
|
||||
- ~schedule-debug.mjs~ — CLI debug tool; ~nix run .#schedule -- [flags]~
|
||||
- ~stats.mjs~ — aggregate stats across 1000 lives; ~nix run .#stats~
|
||||
- ~flake.nix~ — build + Caddy server + ~tinyStoriesOnnx~ sub-derivation + ~stats~ + ~schedule~ apps
|
||||
- ~flake.nix~ — build + Caddy server + ~tinyStoriesOnnx~ sub-derivation + ~stats~ + ~schedule~ apps; ~pkgs.blender~ in nativeBuildInputs
|
||||
- ~ASSETS.md~ — authoring guide: location ID→file mapping, mesh naming conventions, Blender setup, build/test workflow
|
||||
|
||||
** Subnodes
|
||||
- [[id:4b44cf43-6106-4498-81a3-b23ebb25dabf][trmn/llm]] — ONNX build pipeline, in-browser inference, TinyStories-8M gotchas
|
||||
- [[id:9465af82-4383-466c-bf09-5be19c328f0b][trmn/life]] — life simulation: PRNG, state schema, event catalog, packed buffer layout
|
||||
- [[id:4d5e6bc8-32eb-469f-a69f-84b14458c55b][trmn/assets]] — SVG sprite pipeline, GLB generation, face compositing
|
||||
- [[id:9465af82-4383-406c-bf09-5be19c328f0b][trmn/life]] — life simulation: PRNG, state schema, event catalog, packed buffer layout
|
||||
- [[id:4d5e6bc8-32eb-469f-a69f-84b14458c55b][trmn/assets]] — location scene pipeline: Blender→GLB→scenes.pack, naming conventions, debug panel, PRNG offsets
|
||||
- [[id:423cac95-a80d-4db6-8bef-14297fb38437][trmn/people]] — NPC system: family tree, PersonRecord, PRNG isolation, post-apply hooks
|
||||
- [[id:ff8aa6b7-61ff-444c-9301-c0b666b0b573][trmn/schedule]] — daily schedule: slot layout, scene catalog, life stages, forced events, debug CLI
|
||||
|
||||
Reference in New Issue
Block a user