H5小游戏 活跃维护

thehumanbox

1homsi/thehumanbox

在你的浏览器中体验文明沙盒。部落创造自己的语言、文化和战争,从石器时代到计算机时代。使用 Rust 和 WebAssembly 构建,完全在你的设备上运行。

153
Stars 标星
15
Forks 分支
2
Watchers 关注
7
Open Issues
Rust
主要语言
MIT
开源协议
59.4 MB
仓库大小
1 小时前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:1homsi/thehumanbox
git clone https://github.com/1homsi/thehumanbox.git
git clone git@github.com:1homsi/thehumanbox.git
README.md main

英文原文正文为项目原始 README(英文),本站后续会翻译为中文,当前仅剔除图片与无关章节并统一排版。

The Human Box

A free browser sim where Stone Age tribes invent, fight and evolve. No install needed.

▶ Play in your browser

If the tribes made you smile, a star helps more people find it. ★ Star the repo

Desktop app  ·  How it works  ·  FAQ

Autonomous people learn, form tribes, develop language, build cities, found religions, declare wars, sign treaties, invent computers and pass culture across generations, through 45 eras. Watch, or play god: answer their prayers, reshape the land, send blessings, plagues and disasters.

The whole simulation is Rust compiled to WebAssembly and runs on your device, with nothing to sign up for. Every thought, conversation and chronicle is written by the simulation itself. Your world saves locally and can be exported.

Structure

thehumanbox/
├── apps/
│   ├── web/        React/Vite frontend; the pixel map is drawn with xipjs (WebGL2)
│   ├── desktop/    Electron app that wraps the web client and the native simulation
│   └── server/     Rust WebSocket server around the engine (what the desktop app runs)
├── crates/
│   ├── sim-core/   The simulation engine (native + WebAssembly)
│   └── headless/   Deterministic headless runs: sweeps, perf gate
├── scripts/        Dev and CI helpers, and the published desktop installer
└── docs/           Architecture, development guide, how to add actions, art direction

Working on the code

  • docs/FAQ.md: how the language works (what words do, grammar, abstract words) and what tribes, states and wars are.
  • docs/ARCHITECTURE.md: what runs where, how a tick and a decision work, where each kind of change goes.
  • docs/DEVELOPMENT.md: setup, the checks CI runs, profiling and proving a change is behaviour-neutral.
  • docs/ADDING_ACTIONS.md: a new action is one file and one line.
  • docs/ART_DIRECTION.md: the rules the map's art follows (one pixel size, light from the top left, an earthy palette).

Desktop app

macOS one-liner (downloads the latest release and strips the quarantine flag so the unsigned app opens normally):

curl -fsSL https://raw.githubusercontent.com/1homsi/thehumanbox/main/scripts/install-desktop.sh | bash

Windows + Linux: grab the installer from Releases. Windows users click "More info → Run anyway" on the SmartScreen prompt, Linux users chmod +x the AppImage or install the .deb.

The app is not code-signed yet, which is why the bypass step is needed. Source: apps/desktop/.

Quick start

You need Rust (stable) with wasm-pack, and Node 24 with pnpm.

Client (Vite):

make install   # pnpm install for web and desktop, cargo fetch
make wasm      # build the simulation to WebAssembly for the browser
make client    # Vite dev server

Starts a private WebAssembly world, persists it in the browser, and never contacts a hosted simulation API.

Simulation server (Rust, the one the desktop app bundles):

cd apps/server
cp .env.example .env        # optional: tick rate, memory limits, CORS, logging
cargo run --release --bin simulation-rs

Listens on ws://0.0.0.0:8000 (PORT changes it). make help lists every other target, and docs/DEVELOPMENT.md the checks CI runs.

What's in the world

Humans are born with traits mixed from both parents and learn through reinforcement. Each inherits a slightly mutated copy of their mother's Q-table, her vocabulary and her attitudes to other tribes, and then they get to live.

The world they live in

  • 800×400 tile grid of ten biomes: grassland, forest, jungle, savanna, wetland, desert, badlands, taiga, tundra, volcanic. Elevation, rivers, lakes, weather, four seasons.
  • 45 historical eras from PreStone through Stone, Bronze, Iron, Classical, Medieval, Renaissance, Industrial, Modern, Information, and onward to Atomic, Space, Digital, Quantum, Solar, Fusion, Genetic, Orbital, Lunar, Martian, Cyber, Neural, Posthuman, Interstellar, Singularity, Galactic, Dyson, Kardashev2/3, and sixteen speculative endgame eras, from Stellar to Omega and Rebirth. Lineages reach each era when their discoveries and the living world's civilization capacity cross the threshold; late-era gates scale to the chosen local world size so the full ladder remains reachable.
  • About 5,000 distinct actions an organism can choose, in over a hundred categories: agriculture, seafaring, textiles, distillation, journalism, fashion, retail, cafe work, tech_devops, theology, warfare, diplomacy, governance, childhood, elder life, and many more. Each gates on real preconditions: era, discoveries, age, specialty.
  • Real economy. Goods are produced (mash → wash → spirit → aged or bottled), traded within and across lineages, and priced per era. Barter, then currency that changes with the era (shells and beads, coins, florins, dollars, credits and stranger things), banks that pay the merchants near them, and governments with treasuries.
  • Religions found themselves, split into sects, gain adherents, cross milestones, and fade. Followers near their temple feel it. Governments form matching the lineage's era, population and literacy: tribal, chiefdom, monarchy, theocracy, republic, democracy, federation, empire, corporate.
  • Cross-lineage contact at borders: trade and knowledge transfer flow where two tribes touch, and caravans run trade routes between them. Overcrowded lineages spawn breakaway colonies that carry parent tech to new biomes.
  • Each home is unique. Humans choose their own furniture over their lifetime based on era, traits, wealth, and specialty: a brewer collects a wine jug, a scholar fills bookshelves, a programmer ends up with a monitor and a smart speaker.
  • Buildings are not props. Living near a Library raises your literacy. Living near a Hospital lowers your infection. Apprenticing near a Workshop routes you into the matching trade.

The minds inside

What an organism thinks and says is built from its own state: needs, memories, relationships, the words it has learned. The text is generated by the simulation itself, so a world reads the same on every machine, offline, and across a replay of the same seed.

What you can do

  • Play god from the dock along the bottom: about 160 tools in five categories (life, nature, resources, deadly, world). Drop people, monsters and animals; raise land, change biomes, call the sky and miracles; place resources and buildings; send plagues and disasters; give whole tribes food and tools, or force them to migrate.
  • Set the pace with one time control: pause, or anything from ½× to 5000×.
  • Watch the live 2D map and follow anyone. Tap a person for their card: story, traits, relations, kin, beliefs, wealth, memories, recent thoughts and their own language, with their whole life log and family tree a click away.
  • Open civ for every lineage's government and leader, religion, conflicts, diplomacy, buildings, settlements, goods, books, artworks, trade network and headlines; read the chronicles of the world.
  • Click a home to see how its owner has furnished it, or step into a tribe's tavern or temple from the civ screen and see who's there.
  • Look at the world through 13 map layers: borders, towns, people, danger, routes, history, trade, fertile, age, threat, food, wealth and moods.
  • Photo mode, hide the interface (H), or let the camera follow random people. Press ? for every key, and / to find any tool.
  • Your world saves in the browser (or on disk in the desktop app), and Settings exports it.
本站来源与版权声明
  • 本文标题:thehumanbox - 在你的浏览器中体验文明沙盒
  • 本文链接:https://www.cn121.com/h5game/1homsi-thehumanbox.html
  • 原项目:1homsi/thehumanbox 版权归原作者 1homsi 及贡献者所有
  • 收录信息:本站于 2026-12-03 收录本项目,本页所列协议与仓库指标均为收录当时的状态;该日期之后原项目的版本更新与协议变更,本页不作同步。
  • 开源协议:收录时本项目采用 MIT(查看 LICENSE 原文),本站转载其原始文档(未改动文字,仅剔除图片与无关章节);使用、修改、分发请以该仓库 LICENSE 原文为准。
  • 站点出处:本文首发于 OneTwoOne,收录自 GitHub 开源项目 1homsi/thehumanbox。
  • 内容说明:本页正文为原项目 README 原文(英文),本站后续会翻译为中文(当前尚未译出),仅剔除了图片与赞助等无关章节、并把相对链接改为绝对地址;页首简介为机器翻译自仓库描述。
  • 引用声明:商业转载、第三方聚合或 AI 检索训练引用时,请务必保留以上来源出处、本文永久链接,以及原项目的版权声明与许可信息。
  • 下架通道:若原项目此后变更或收紧了许可协议、或作者/权利人认为本站的收录方式(译文、排版适配、简介翻译等)超出其授权范围,请通过 xyd3302001@163.com 发送下架通知,并附上项目地址与本页链接。本站核实后将第一时间删除本页内容,或改为不复制原文的目录性收录;署名更正等其他要求可一并提出。