The map canvas now fills its panel and draws through a view transform,
so it stays sharp at every zoom level. The wheel zooms around the
pointer, dragging with the middle button pans, and right click clears
the selection. The wheel listener is attached natively and non-passive
because Leptos delegates `wheel` to the document, where browsers ignore
`preventDefault`.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The map draws markets, workplaces coloured by trade, carts, merchants,
crop fields that turn gold when ripe, every home and dashed shard
borders. The side panel lists each person's job and coins and shows
economy and employment statistics. The server includes `crop_ripe` in
the state.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace lossy casts with checked tile/canvas helpers, use map_or_else and
infallible conversions, and switch the build script to assert!.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collapse nested ifs, use is_multiple_of, pass the editor apply callback
directly, and make dropping the actor system shutdown future explicit so
`cargo clippy --workspace --all-targets -- -D warnings` passes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Starting values and tuning constants are now `pub const` items in a
single Rune file, config.rn, alongside the `person`, `rabbit` and `wolf`
behaviour functions. The behaviours read the constants directly. At
startup the server loads the file from SIM_CONFIG (default: config.rn),
reads and checks every constant, and test-runs each behaviour, so a bad
or missing value stops startup with an error that names it.
- Map width and height can now be configured and are stored in
snapshots.
- The UI's edit limits (max speed, stock, inventory, hunger, energy,
resource amounts) come from the config.
- The in-browser script editor now edits config.rn. Applied edits update
behaviours and tuning values immediately; map size, initial population
and calendar defaults apply on reset.
- The Docker image includes config.rn, and Compose mounts the
repository's copy read-only.
- Documents the config file and how it works in the README.
BREAKING CHANGE: src/behavior.rn has been removed; behaviours now live
in config.rn. The server will not start without a valid config file.
Snapshots no longer store the behaviour script: on restart, config.rn
from disk replaces any edits made in the browser editor.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Enable Picard's stats and tracing features, publish actor counters to the UI, and initialize configurable tracing output.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Poll the state endpoint while the WebSocket is not open so browsers that fail to establish the socket still receive initial state and continue updating the UI. Retain WebSocket streaming as the primary transport.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Show each person's life stage, age, and partner in the inspector. Add per-stage fertility toggles and document the life cycle and birth conditions.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Persist calendar units and inclusive life-stage duration ranges, expose them in the UI, and preserve defaults when loading legacy snapshots. Date formatting now derives from calendar settings.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>