sim/CHANGELOG.md

3.2 KiB
Raw Blame History

Changelog

Notable changes to this project are documented here.

[Unreleased]

Added

  • Add an HTTP Basic Auth-protected /admin path with a random password persisted in the app data volume.
  • Add an About dialog explaining the simulation, shards, actors, and persistence.
  • Docker Compose runs the gateway and each shard in its own container, with one persistent SQLite volume per shard.
  • Public clients are view-only: the UI hides editing controls and the server rejects remote writes; localhost clients retain editing access.
  • Expose the Picard actor console over the /api/actors/ws WebSocket endpoint.
  • The world can be split into shards that each own a strip of columns. People and animals that walk across a shard border are transferred with their inventory and stay reachable at the same address.
  • Jobs and trading: every shard founds markets, farms, woodcutters, quarries, hunters, toolmakers and cartwrights. Adults are hired, commute to their job site each day, work their shift, sell the goods at the market, get paid and go home.
  • Markets are actors with their own coins and stock; prices follow local supply and demand, and buyers and sellers haggle.
  • Farmers sow fields that ripen into crops; gatherers fell trees, quarry stone and hunt; crafters buy materials and make tools and carts.
  • Carts are actors that add carrying capacity, wear out and can be bought at the market.
  • Merchants carry their market's surplus to markets on other shards and bring back bargains.
  • People earn and spend coins; workers buy tools, meals and food for the village.
  • The server runs as a gateway that starts SIM_SHARDS (default 3) shard processes, steps them in lockstep and shows them to the UI as one world. Shards exchange entities and messages directly over WebSockets.
  • Every shard keeps its own database, configured with SHARD_DATABASE_URL (default sqlite://sim-shard-{shard}.db?mode=rwc).
  • The Picard console reaches the actors of the other shards as @shard-N (peers, @shard-1 actors, send @shard-1 PATH JSON); /api/actors/ws?shard=N connects to shard N directly.
  • The UI draws markets, workplaces, carts, merchants, crop fields (gold when ripe), all homes and the shard borders, and shows each person's job and coins plus economy and employment statistics.
  • The map fills its panel: the mouse wheel zooms around the pointer, dragging with the middle button pans, and right click clears the selection.

Changed

  • Cache native and Wasm dependencies with cargo-chef in Docker builds to speed up source-only rebuilds.
  • Terminate shard processes when their simulation thread fails, so Docker can restart them instead of leaving an unresponsive shard and a repeatedly restarting gateway.
  • People, rabbits, wolves, and partnerships are Picard actors that own their state; the world only reaches them through messages. Actors are named person-<id>, rabbit-<id>, wolf-<id>, and partnership-<id> instead of entity-<id>.
  • Rabbits killed by hunters no longer move or breed later in the same tick.
  • Update Picard to f88b9cb.
  • The default world is larger: 192×128 tiles with 180 people, 1200 rabbits, 80 wolves, and twice the food and houses.
  • DATABASE_URL is replaced by SHARD_DATABASE_URL; existing sim.db snapshots are not migrated.