2026-10-08 06:44:30 +00:00
|
|
|
services:
|
|
|
|
|
app:
|
2026-10-12 19:39:01 +00:00
|
|
|
cpus: 2
|
2026-10-08 06:44:30 +00:00
|
|
|
build: .
|
|
|
|
|
environment:
|
|
|
|
|
SIM_ADDR: 0.0.0.0:7878
|
feat(sim)!: move simulation settings and behaviours into config.rn
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>
2026-10-11 18:42:29 +00:00
|
|
|
SIM_CONFIG: /etc/sim/config.rn
|
2026-10-12 18:43:11 +00:00
|
|
|
SIM_SHARDS: "3"
|
2026-10-13 15:18:15 +00:00
|
|
|
SIM_SHARD_ADDRS: shard-0:9000,shard-1:9000,shard-2:9000
|
|
|
|
|
SIM_CLUSTER_TOKEN: ${SIM_CLUSTER_TOKEN:-compose-dev-token}
|
2026-10-13 15:07:26 +00:00
|
|
|
SIM_TRUST_PROXY_HEADERS: "1"
|
feat(sim)!: move simulation settings and behaviours into config.rn
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>
2026-10-11 18:42:29 +00:00
|
|
|
volumes:
|
|
|
|
|
- ./config.rn:/etc/sim/config.rn:ro
|
2026-10-08 06:44:30 +00:00
|
|
|
ports:
|
2026-10-13 15:07:26 +00:00
|
|
|
- "127.0.0.1:7878:7878"
|
2026-10-08 06:44:30 +00:00
|
|
|
depends_on:
|
2026-10-13 15:18:15 +00:00
|
|
|
shard-0:
|
|
|
|
|
condition: service_started
|
|
|
|
|
shard-1:
|
|
|
|
|
condition: service_started
|
|
|
|
|
shard-2:
|
|
|
|
|
condition: service_started
|
2026-10-08 06:44:30 +00:00
|
|
|
restart: unless-stopped
|
|
|
|
|
|
2026-10-13 15:18:15 +00:00
|
|
|
shard-0:
|
|
|
|
|
build: .
|
2026-10-13 15:24:59 +00:00
|
|
|
command: ["sim", "shard", "--index", "0", "--count", "3", "--seed", "42", "--listen", "0.0.0.0:9000"]
|
2026-10-08 06:44:30 +00:00
|
|
|
environment:
|
2026-10-13 15:18:15 +00:00
|
|
|
SIM_CONFIG: /etc/sim/config.rn
|
|
|
|
|
SIM_CLUSTER_TOKEN: ${SIM_CLUSTER_TOKEN:-compose-dev-token}
|
|
|
|
|
SIM_REMOTING_BIND: 0.0.0.0:9001
|
|
|
|
|
SIM_REMOTING_ADVERTISE: ws://shard-0:9001/remoting
|
|
|
|
|
SHARD_DATABASE_URL: sqlite:///data/shard-0.db?mode=rwc
|
|
|
|
|
volumes:
|
|
|
|
|
- ./config.rn:/etc/sim/config.rn:ro
|
|
|
|
|
- shard_0_data:/data
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
|
|
shard-1:
|
|
|
|
|
build: .
|
2026-10-13 15:24:59 +00:00
|
|
|
command: ["sim", "shard", "--index", "1", "--count", "3", "--seed", "42", "--listen", "0.0.0.0:9000"]
|
2026-10-13 15:18:15 +00:00
|
|
|
environment:
|
|
|
|
|
SIM_CONFIG: /etc/sim/config.rn
|
|
|
|
|
SIM_CLUSTER_TOKEN: ${SIM_CLUSTER_TOKEN:-compose-dev-token}
|
|
|
|
|
SIM_REMOTING_BIND: 0.0.0.0:9001
|
|
|
|
|
SIM_REMOTING_ADVERTISE: ws://shard-1:9001/remoting
|
|
|
|
|
SHARD_DATABASE_URL: sqlite:///data/shard-1.db?mode=rwc
|
2026-10-08 06:44:30 +00:00
|
|
|
volumes:
|
2026-10-13 15:18:15 +00:00
|
|
|
- ./config.rn:/etc/sim/config.rn:ro
|
|
|
|
|
- shard_1_data:/data
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
|
|
shard-2:
|
|
|
|
|
build: .
|
2026-10-13 15:24:59 +00:00
|
|
|
command: ["sim", "shard", "--index", "2", "--count", "3", "--seed", "42", "--listen", "0.0.0.0:9000"]
|
2026-10-13 15:18:15 +00:00
|
|
|
environment:
|
|
|
|
|
SIM_CONFIG: /etc/sim/config.rn
|
|
|
|
|
SIM_CLUSTER_TOKEN: ${SIM_CLUSTER_TOKEN:-compose-dev-token}
|
|
|
|
|
SIM_REMOTING_BIND: 0.0.0.0:9001
|
|
|
|
|
SIM_REMOTING_ADVERTISE: ws://shard-2:9001/remoting
|
|
|
|
|
SHARD_DATABASE_URL: sqlite:///data/shard-2.db?mode=rwc
|
|
|
|
|
volumes:
|
|
|
|
|
- ./config.rn:/etc/sim/config.rn:ro
|
|
|
|
|
- shard_2_data:/data
|
2026-10-08 06:44:30 +00:00
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
|
|
volumes:
|
2026-10-13 15:18:15 +00:00
|
|
|
shard_0_data:
|
|
|
|
|
shard_1_data:
|
|
|
|
|
shard_2_data:
|