[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-75410":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":5,"homepage":8,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":9,"pushedAt":9,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":15,"starSnapshotCount":15,"syncStatus":32,"lastSyncTime":33,"discoverSource":34},75410,"tiny-world-builder","jasonkneen\u002Ftiny-world-builder","jasonkneen","https:\u002F\u002Ftinyworld.build",null,"JavaScript",844,126,6,1,0,7,83,721,21,94.31,"GNU Affero General Public License v3.0",false,"main",true,[26,27,28],"build","minecraft","voxel","2026-06-12 04:01:18","# Tiny World Builder\n\n\u003Cimg width=\"1324\" height=\"1016\" alt=\"Screenshot 2026-05-11 at 07 09 24\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F1b19a5f7-def5-42bf-b85f-01714f502afa\" \u002F>\n\n## Run\n\n```bash\nnpm run dev\n# serves http:\u002F\u002Flocalhost:3000\u002Ftiny-world-builder\n# use another port with: npm run dev -- 3001\n\n# or open directly\nopen tiny-world-builder.html\n```\n\n## Deploy\n\nThe app deploys as a static site on Vercel or Netlify. Both host configs run\n`.\u002Fpublish.sh` and serve the generated `dist\u002F` directory. Three.js r128 and\nGLTFLoader are self-hosted from `vendor\u002Fthree\u002F` so deploys do not depend on\nruntime CDNs.\n\n```bash\nnpm test\nnpm run build\n\n# Vercel\nvercel deploy\n\n# Netlify\nnetlify deploy --build\n# or connect the repo in Netlify; netlify.toml supplies build\u002Fpublish settings\n```\n\n## Controls\n\n| Action            | Input                                  |\n| ----------------- | -------------------------------------- |\n| Place             | click a cell                           |\n| Erase             | `E` then click, or pick the eraser     |\n| Orbit             | drag                                   |\n| Zoom              | scroll wheel                           |\n| Stack\u002Fenhance item | click the same object tool on an existing object (max 8) |\n| Raise\u002Flower terrain | `R` \u002F `F` over the hovered cell      |\n| Switch tool       | `1`–`9`, then letter shortcuts shown in the toolbar |\n| Toggle camera     | `P` or `I` (isometric ⇄ soft ⇄ perspective) |\n| Reset to preset   | reset button                           |\n| Clear to grass    | `C`                                    |\n\n## Vehicle runtime (Road AI)\n\nShareable seeded demo:\n\n```text\nhttp:\u002F\u002Flocalhost:3000\u002F\n# redirects to \u002Ftiny-world-builder?demo=vehicles&seed=tide-ridge-428 in the local dev server\n# \u002Ftiny-world-builder with no query redirects there too\n```\n\nDirect seeded URL:\n\n```text\nhttp:\u002F\u002Flocalhost:3000\u002Ftiny-world-builder?demo=vehicles&seed=tide-ridge-428\n```\n\nLarge-scale route stress URL:\n\n```text\nhttp:\u002F\u002Flocalhost:3000\u002Ftiny-world-builder?demo=vehicles-large&seed=metro-culdesac-48&stats=1\n```\n\nLarge demo URL params:\n\n- `size=` \u002F `mapSize=` \u002F `grid=` \u002F `gridSize=` — rounded to the nearest valid demo grid size from `12` through `48` (`12`, `16`, `20`, `32`, `48`).\n- `cars=` \u002F `carCount=` \u002F `vehicles=` \u002F `vehicleCount=` — clamped to `1..120` and capped by available unique route endpoints.\n\nExample:\n\n```text\nhttp:\u002F\u002Flocalhost:3000\u002Ftiny-world-builder?demo=vehicles-large&seed=ridge-loop-917&size=48&cars=18&stats=1\n```\n\nThe large route defaults to a deterministic 48×48 map with arterial roads,\nring roads, bridge crossings, cul-de-sac endpoints, and 36 runtime vehicles\nretargeting through long paths. Use it for route planner \u002F traffic scale checks;\nthe default bare-port redirect still opens the smaller watchable demo.\n\nLoading either URL creates the map, places delivery bots, assigns targets, and starts\nvehicles driving. The seed is deterministic; change the `seed=` value to get the\nsame road layout with different deterministic scenery.\n\nYou can also drive runtime vehicles through the same relay\u002FAPI path used by `send-command.js`.\n\n- `vehicle-spawn --x \u003Cn> --z \u003Cn> --mode auto|manual --goalX \u003Cn> --goalZ \u003Cn>`\n- `vehicle-goal --id \u003Cid> --x \u003Cn> --z \u003Cn>`\n- `vehicle-controls --id \u003Cid> [--forward] [--reverse] [--left] [--right]`\n- `vehicle-remove --id \u003Cid|all>`\n- `vehicle-clear`\n\nVehicles only move on `path` cells (or bridge cells used as road bridges). Placed objects on paths become live traffic blockers, so dropping a rock\u002Ftree\u002Fhouse\u002Ffence onto a road makes active cars reroute around that cell or stop if no alternate path exists. Runtime traffic checks also keep cars from passing through each other: vehicles brake\u002Fyield inside the collision envelope and, when blocked long enough, reroute around occupied road cells if the network has an alternate path.\n\nFor live telemetry in the browser console:\n\n```js\nwindow.__getVehicleRuntimeSnapshot()\n```\n\n## Tools\n\n`Grass` · `Path` · `Dirt` · `Water` · `Stone` · `Lava` · `Sand` · `Snow` ·\n`House` · `Tree` · `Fence` · `Rock` · `Bridge` · `Crop` · `Corn` · `Wheat` ·\n`Pumpkin` · `Carrot` · `Sunflower` · `Tuft` · `Flower` · `Bush` · `Cow` ·\n`Sheep` · `Erase`.\n\nTerrain\u002Fobject rules are normalized by the renderer: crops force dirt\nunderneath, bridges force water, and ordinary objects do not float on water.\nPaths, shorelines, water foam, bridges, fences, castle walls, houses, and\nrocks are adjacency-aware — placing a neighbor re-renders surrounding cells\nso roads join, rivers get banks, bridge direction updates, fence walls connect,\nhouse clusters form L\u002FT\u002F+\u002Fsquare buildings, and rock cells grow into craggy\noutcrops.\n\n## Architecture\n\nSingle `\u003Cscript>` block, currently ~16k lines of vanilla JS, organised by section\ncomments (`\u002F\u002F -------- xyz --------`). The model is split cleanly:\n\n- **`world[x][z]`** — intent: `{ terrain, kind, floors }` per cell.\n- **`cellMeshes['x,z']`** — rendered Three.js groups for each cell.\n- **`setCell(x, z, opts)`** — single mutation entry point. Updates `world`,\n  rebuilds the cell's tile\u002Fobject meshes, and re-renders any neighbors that\n  care about adjacency (fence\u002Fhouse clusters).\n\nHouse clusters use BFS (`bfsHouseCluster`) plus `tryComposite` (L\u002FT\u002F+) and\n`trySquare` to decide whether a group of house cells should render as a\nunified structure or stretched rectangles.\n\nA shared `dropAnims` queue ease-outs new tiles\u002Fobjects into place. Other\nper-frame animations (tree sway, crop bob, smoke origin) check\n`obj.userData.landing` so they yield while a piece is still falling in.\n\nNewer systems are still routed through that same contract:\n\n- **Preview boards** lazily generate surrounding boards as the camera pans; preview distance\u002Fwindow\u002Fopacity settings auto-scale from board size but remain user-adjustable.\n- **AI generation \u002F Auto** validate sparse v4 worlds against the embedded schema.\n- **Local world slots** keep multiple named saves in browser storage.\n- **Weather, time, clouds, and crop duster** are decorative scene systems layered on the same renderer.\n- **Command palette** indexes tools, views, settings, and terrain raise\u002Flower actions.\n\n## Validation\n\n```bash\nnpm test        # syntax, schema parity, local assets, static smoke checks\nnpm run build   # publish checks + dist generation\n```\n\nManual browser smoke checklist after visual changes: page loads with no console\nerrors; place\u002Ferase works; `C`, `P`\u002F`I`, `R`\u002F`F`, and tool shortcuts respond;\nfence neighbors update; cloud shadow at 0% still leaves visible clouds.\n\nSee [AGENTS.md](.\u002FAGENTS.md) for guidance on extending the codebase.\n\n## Files\n\n```\ntiny-world-builder.html          the app\nREADME.md                        this file\nAGENTS.md                        guidance for AI coding agents\nworld.schema.json                import\u002Fexport schema mirrored into the app\ntools\u002Fcheck.js                   static syntax\u002Fschema\u002Fasset check\ntools\u002Fsmoke-static.js            no-browser smoke guard for key app contracts\nvendor\u002Fthree\u002F                    self-hosted Three.js r128 runtime files\n```\n","Tiny World Builder 是一个基于网页的3D体素世界构建工具。它利用HTML和Three.js技术，让用户能够通过简单的点击和拖拽操作来创建、编辑体素环境，支持放置物体、擦除、调整地形高度等核心功能，并且内置了一个车辆运行时系统（Road AI），用于模拟交通流动。项目特别适合需要快速原型设计或教育目的的场景使用，比如游戏开发中的关卡设计预览或是教学活动中向学生展示基本的城市规划概念。此外，由于其部署简便性，无论是本地运行还是通过Vercel、Netlify这样的平台发布都非常方便。",2,"2026-06-11 03:52:41","CREATED_QUERY"]