Add a router that delivers actor messages locally or to the shard that
currently hosts the entity. People and animals that leave their shard's
columns depart with their full state, forward messages while in flight
and are re-admitted on the destination shard. Enlarge the default world.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
People, rabbits, wolves and partnerships are now Picard actors that own
their state and apply their own rules (ageing, hunger and meals,
starvation, energy, breeding costs, death, birth intervals). The world
no longer keeps mirrored Vecs that were read from and written back to
generic entity actors every step; it only reaches entities through
typed messages and replies, correlated by request id through a single
inbox actor.
World-level state (terrain, resources, stockpile, houses, calendar, the
world random stream) stays in the world, and behaviour decisions stay
on the simulation thread because the Rune VM is not Send. Replies are
processed in entity order and each person has its own persisted random
stream, so runs and snapshot restores stay deterministic.
Rabbits killed by hunters no longer move or breed later in the same
tick.
BREAKING CHANGE: Picard actors are named person-<id>, rabbit-<id>,
wolf-<id> and partnership-<id> instead of entity-<id>, which changes
the paths used with the actor console.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The defaults in config.rn changed (90 initial people, fertile teens and
older adults), but the tests still hard-coded the previous 9-person
village. Tests now override Rune constants by name and compute expected
counts from the loaded configuration.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update Picard and forward console/serde features, serialize actor messages, and route console requests through the simulation thread.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Replace signed coordinate round-trips with checked offset helpers
- Use From/try_from conversions and clamp helpers in the edit parser
- Isolate exact RNG, noise and day-fraction float casts in documented helpers
- Split long functions (validate, world creation, apply, state_json, tick_person)
- Pass run_sim shared state by reference and tidy remaining style lints
Simulation behaviour and RNG sequences are unchanged.
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>
Use terrain-aware pathfinding for travel toward home and resources so settlers do not get stranded against blocked terrain. Add a startup food reserve, slow hunger accumulation, let villagers return for food sooner, ensure available food is consumed before starvation, and make the first birth check available at the first weekly boundary.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Raise starter settlement capacity above its initial population and allow eligible partnerships one birth opportunity per week instead of a 20% monthly roll. Preserve food and housing constraints and cover both initial growth and per-week births in tests.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore pre-life-cycle snapshots with working-age villagers and keep dependents near the shared food stock. Add regression coverage for legacy saves, child return-home behavior, and newborn placement.
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>