Plan 43 — Boundary zones (jurisdiction, security, worker logistics)
Goal
Author rectangular boundary overlays on world segments that define:
- Jurisdiction — logical town/yard id for “same area” rules (worker food/storage, later justice).
- Security / PvP placeholders —
security_tier,pvp_mode,crime_enabled,guard_responsestored now; wired when plan 14 justice lands. - Worker logistics — when
worker_logistics: true, hired workers in the same jurisdiction may use employer placed containers and town_storage vaults in that jurisdiction for survival care (meals/rest supplies).
Data model
Segment YAML (boundary_zones):
| Field | Purpose |
|---|---|
id |
Zone id |
rects |
One or more axis-aligned rects (map editor uses single rect → x0/y0/x1/y1 or rects[]) |
z_order |
Higher wins overlaps |
label |
Designer-facing name |
jurisdiction_id |
Shared key for logistics; defaults to zone id if omitted |
worker_logistics |
Enable jurisdiction-scoped worker care (default true) |
security_tier |
wild | patrolled | civilized |
pvp_mode |
disabled | normal | free_for_all |
crime_enabled |
Plan 14 |
guard_response |
Plan 14 |
Sim: WorldSegment::boundary_zone_at, crates/sim/src/boundary_zones.rs.
Protocol: BoundaryZoneView on world/AOI views (client overlay later).
Admin
- Map layout tab: layer boundary_zones, draw tool, property panel, duplicate/delete/lock/marquee like biome zones.
- Save via existing map layout API → segment YAML.
Runtime (this plan)
- Worker care:
try_worker_care_from_employer_jurisdictionin worker tick when worker needs survival care; samejurisdiction_idviaboundary_zone_at+worker_logistics. - Not in scope: crime recording, guard AI, PvP damage rules.
Example
starter-plains — clovis_town_boundary around Clovis town core (jurisdiction_id: clovis).
Follow-ups
- Gfx client draw of
boundary_zonesfrom world view (debug/designer). - Justice plan 14 consumes security fields.
- Multi-rect authoring UI in map editor (today: one rect per zone row; YAML supports
rects[]).