[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-116145":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"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":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":9,"pushedAt":25,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":15,"starSnapshotCount":15,"syncStatus":16,"lastSyncTime":29,"discoverSource":30},116145,"trainsworld","circularsquare\u002Ftrainsworld","circularsquare","A railway building game on a map of the whole world. Runs in the browser.",null,"TypeScript",61,27,1,9,0,2,6,8,51.94,"GNU Affero General Public License v3.0",false,"main",true,[],"2026-11-21 04:12:23","2026-11-23 18:14:28","# trainsworld\n\nA railway building game on a map of the whole world. You lay track and stations, set up lines, and\nthe game works out who rides your trains and who takes the car. It runs in the browser.\n\nThe game is at https:\u002F\u002Fanita.garden\u002Ftrainsworld\u002F. This repository is its source.\n\nMost of the code was written by Claude (Anthropic's AI model), working with Anita, who designs the game, plays it\nand reviews the changes. The docs and this README were written by Claude too.\n\nThe page is TypeScript with MapLibre and Preact. The simulation and the demand model are Rust compiled to\nWebAssembly. The city data is built by Python scripts, and the game fetches the built data when it runs.\n\nEverything is in the `trainworld\u002F` folder (the game was called trainworld while it was built), and the docs write\npaths from this repo's root, so `node trainworld\u002Fchecks\u002Fsmoke.mjs` means what it says.\n\n## Run it\n\nYou need Node 22 or newer, Rust (stable) with the `wasm32-unknown-unknown` target, and wasm-pack 0.15.\n\n```\nrustup target add wasm32-unknown-unknown\ncargo install wasm-pack\ncd trainworld\u002Fapp\nnpm install\nnpm run wasm\nnpm run dev\n```\n\nOpen the address Vite prints (http:\u002F\u002Flocalhost:5173\u002F). `npm run wasm` takes a few minutes the first time. Run it\nagain when anything in `trainworld\u002Fsim\u002F` changes. `npm run check` type-checks the page.\n\n## Data\n\nThe game needs city packs, terrain, outlines and real rail networks, about 6 GB in all. They are not in this repo.\nWith no `trainworld\u002Fdata\u002Fpacks` folder, the dev server fetches the files the page asks for from\nhttps:\u002F\u002Fdata.anita.garden\u002Ftrainworld\u002F. A first session downloads tens of MB. The published version it reads is\nnamed in `trainworld\u002Fdata-version.txt`. To pin another one, run `TW_DATA_VERSION=\u003Cfolder> npm run dev`. To stay\noffline, run `TW_DATA=off npm run dev` and fill `trainworld\u002Fdata\u002F` yourself.\n\nThe basemap tiles come from OpenFreeMap and need no key.\n\nA fork you host on your own site can read the same published data straight from\nhttps:\u002F\u002Fdata.anita.garden\u002Ftrainworld\u002F\u003Cversion>\u002F (the data host allows any site to read it). A build names its data\naddress in `index.html` (`tw-data`). Please keep to the published versions, and if your fork gets a lot of players,\nhost your own copy of the data.\n\nYou can build packs yourself with the scripts in `trainworld\u002Fpipeline\u002F`, but a world run needs 30 GB of raw\ndownloads (OpenStreetMap extracts, GHSL, national censuses) and hours of compute. Treat the pipeline as a\nreference for how the numbers are made unless you are adding a place. `trainworld\u002Fdocs\u002Fadding-a-country.md` and\n`trainworld\u002Fdocs\u002Fworld-run.md` explain the process. Parts of it name private tooling (an AWS account, a cores\nledger) that is not in this repo.\n\nThe game's account, leaderboard, community and feedback features talk to a server that is not part of this repo.\nThey stay off on localhost unless you run your own server and add `?acct=local`. The game plays fully without them.\n\nThe four building sounds are not included (see `NOTICE.md`). The game plays without them.\n\n## Where things are\n\n- `trainworld\u002FSPEC.md` says what the game is and how it works.\n- `trainworld\u002Fdocs\u002F` has the rules in detail, one file per area. `docs\u002Fcode-map.md` says where each module lives.\n- `trainworld\u002Fapp\u002F` is the page, `trainworld\u002Fsim\u002F` the Rust crate, `trainworld\u002Fpipeline\u002F` the data scripts.\n- `trainworld\u002Fchecks\u002F` has the browser and Node checks. `checks\u002Fsmoke.mjs` runs the main ones against a dev server\n  that has data. Set `TW_CORES=3` to limit the cores a check's Chrome uses. Some older checks use paths from the\n  author's machine.\n- `trainworld\u002Fwiki\u002F` has pages that explain the mechanics to players.\n\n## Licence\n\nThe code is under the GNU Affero General Public License 3.0 (`LICENSE`). If you run a modified copy as a website,\nyou have to offer its source to the people using it.\n\nThe data is under the ODbL, and the fonts, flags and libraries keep their own licences. `NOTICE.md` lists each, with\nthe credits the data needs. The name \"trainsworld\" is not covered by the code licence.\n\nSettings has links to the author's Ko-fi page and Discord, and the page has privacy and terms files that name\nanita.garden. If you host a fork, replace them.\n\n## Contributing\n\nSee `CONTRIBUTING.md`. Issues and pull requests are welcome.\n","trainsworld 是一款基于全球地图的网页端铁路建设模拟游戏。玩家可在真实地理背景下铺设轨道、建设车站、规划列车线路，系统通过 WebAssembly 运行的 Rust 模拟引擎动态计算乘客出行需求与交通方式选择（如火车或汽车）。项目采用 TypeScript + Preact 前端框架，集成 MapLibre 地图渲染，数据由 Python 脚本预处理生成并按需加载。适合地理教育、交通规划教学、城市系统建模兴趣实践及轻量级策略模拟类场景使用。","2026-11-24 04:52:58","CREATED_QUERY"]