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:
parent
2958539514
commit
8b85282502
18 changed files with 257 additions and 4 deletions
|
|
@ -5,6 +5,7 @@ export port ThingsWorld {
|
|||
placed: fn(Thing) -> void = fn th_nothing # a Thing exists now: draw it
|
||||
removed: fn(Thing) -> void = fn th_nothing # it is gone for good: stop drawing it
|
||||
shown: fn(Thing) -> void = fn th_nothing # its `active` changed: show or hide it
|
||||
restocks: fn(float, float) -> bool = fn th_yes2 # a morning restocks here (inside a zone)
|
||||
moved: fn(Thing) -> void = fn th_nothing # it stands somewhere else now
|
||||
keeps: fn(Thing) -> bool = fn th_kind_saves # the save's section carries it
|
||||
put_down: fn(Thing) -> bool = fn th_kind_put_down # set down by someone: a restock leaves it be
|
||||
|
|
@ -12,5 +13,6 @@ export port ThingsWorld {
|
|||
}
|
||||
function th_flat(x: float, z: float) -> float { return 0.0 }
|
||||
function th_nothing(t: Thing) -> void { }
|
||||
function th_yes2(x: float, z: float) -> bool { return true }
|
||||
function th_kind_saves(t: Thing) -> bool { return thing_kind_ok(t.kind) and ThingKinds[t.kind].saved }
|
||||
function th_kind_put_down(t: Thing) -> bool { return thing_kind_ok(t.kind) and ThingKinds[t.kind].put_down }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue