wip(ecs): ludic.wildlife on a Table<WildAnimal> - UNBUILT

Written while builds are held (agents share 16 GB; no build or run until the user lifts it), so
it has not been compiled or tested. The animals are rows of a ludic.base Table: x, z, species and
alive as columns, a 32 m grid over the living, the living by species, and a nid map.
wildlife_by_nid is a map lookup instead of a scan of every animal ever made, wildlife_count walks
only its species, wildlife_nearest asks the grid, wildlife_set_alive writes the flag and the row
together, and wildlife_refile files the tick's moves once after it (wildlife_verify holds the
columns to the records). A guest puts its whole table away and brings it back. A test case covers
them; to run once builds are allowed: ludic test packages/ludic.wildlife.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-27 21:21:29 +03:00
parent ab34f8229b
commit 5ac3d488a4
8 changed files with 142 additions and 15 deletions

View file

@ -34,7 +34,7 @@ export property WildSpecies {
export state WildlifeState {
wl_facts: Queue<WildFact> = wl_facts__new()
wl_own: []WildAnimal = null
wl_own: WildTable = null # a guest's own animals, put away whole while it draws the host's
wl_px: float = 0.0
wl_pz: float = 0.0
wl_ask: WildLure = new WildLure
@ -53,7 +53,7 @@ export state WildlifeState {
wl_fed_any: bool = false
wl_near_i: int = 0
wl_species: []WildSpecies = new []WildSpecies
wl_list: []WildAnimal = new []WildAnimal
wl: WildTable = wl__new()
wl_keys: int = 0
wl_dice: Rng = rng_new(97)
wl_hold: bool = false # staged: nobody thinks, everybody keeps their speed