ludic.zones: a disc per player from their fog, merged into clusters; the simulating packages ask whether a place is simulated

zones_set / zones_clear / zones_merge, zones_contains / zones_nearest and the clusters' bounding circles,
over fixed arrays of ZONES_MAX (16). WildlifeWorld.active freezes an animal outside (no state change, no
dice), NpcWorld.active a walker (and no birth outside), VehicleWorld.active a moored boat, and
ThingsWorld.restocks keeps a morning's restock inside; every default is "everywhere", so an unbound game
is unchanged. Tests: the merge (near players one cluster, far two, a player leaving splits a chain),
contains, nearest, the radius; wildlife, npc, vehicles and things pass as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-29 15:53:23 +03:00
parent 2958539514
commit 8b85282502
18 changed files with 257 additions and 4 deletions

View file

@ -38,6 +38,7 @@ export port WildlifeWorld {
taught: fn() -> bool = fn wl_no0 # food carries further, feeders mind less
about: fn(WildAnimal) -> int = fn wl_about # WILD_ABOUT, _AWAY or _GONE
ranges: fn(int) -> int = fn wl_two # ranges a species gets on this map
active: fn(float, float) -> bool = fn wl_yes2 # simulated here: outside, an animal is frozen
per_range: fn(int) -> int = fn wl_three # and how many live in each
spot: fn(WildAnimal, bool, WildSpot) -> bool = fn wl_no_spot # water (true) or forage for it
lures: fn() -> int = fn wl_none0 # how many things to ask `lure` about
@ -62,6 +63,7 @@ function wl_no0() -> bool { return false }
function wl_no1(p: int) -> bool { return false }
function wl_no2(x: float, z: float) -> bool { return false }
function wl_yes1(u: int) -> bool { return true }
function wl_yes2(x: float, z: float) -> bool { return true }
function wl_clear(ax: float, ay: float, az: float, bx: float, by: float, bz: float) -> bool { return true }
function wl_no_push(x: float, z: float, r: float, y0: float, y1: float) -> bool { return false }
function wl_asked_x(wildlife_st: WildlifeState) -> float { return wildlife_st.wl_ask_x }