A text adventure engine built on Rust + WebAssembly, with a React terminal UI.
Chronos is a moddable text RPG engine where the game logic runs entirely in the browser via WebAssembly — no server required to play. Worlds are defined in JSON, the engine is written in Rust (compiled to WASM), and the UI is React.
Iron & Blood is the first world: a dieselpunk war setting with factions, NPCs, branching quests, a day/night cycle, and a full main questline.
engine/
chronos-core/ — game logic: rooms, combat, quests, NPCs, abilities
chronos-wasm/ — wasm-bindgen bindings (runs in the browser)
chronos-server/ — optional WebSocket dev server (axum) for faster iteration
ui/
src/bridge/ — engine-wasm.ts (production) / engine-ws.ts (dev WS)
src/store/ — zustand game state
src/components/ — React terminal UI
worlds/
iron-and-blood/ — rooms, NPCs, quests, items, classes, lore
In production the WASM bridge bundles all world data at build time via import.meta.glob — no network requests needed. In dev you can run the Rust server over WebSocket for faster rebuild cycles.
Prerequisites: Rust, wasm-pack, Node 22+
# One-time WASM build
cd ui && npm run build:wasm
# Dev server (UI hot-reload + Rust server over WebSocket)
cd ui && npm run dev
# Or production preview (fully WASM, no server)
cd ui && npm run build && npm run preview# Rust unit tests
cd engine && cargo test
# Vitest unit tests (store, WASM bridge)
cd ui && npm test
# Playwright E2E (requires a production build)
cd ui && npm run build && npm run e2eCI runs all of the above on every PR via GitHub Actions.
Worlds live in worlds/<id>/ as plain JSON files — rooms, NPCs, items, quests, classes. The engine loads them at init time. See worlds/iron-and-blood/ for a complete example.
Active development. One world (Iron & Blood) is complete and playable. Engine supports: movement, combat, quests, dialogue, save/load, day/night, abilities, inventory, and time-travel rewind.
The Chronos engine (engine/, ui/) is MIT licensed — see LICENSE.
World content (worlds/iron-and-blood/) — lore, dialogue, quest writing, and story — is copyright © 2026 Casey Logsdon, all rights reserved. See worlds/iron-and-blood/COPYRIGHT.
Third-party assets used in this project are listed in CREDITS.md, including attribution for the parchment texture (Majcher, CC BY 4.0).