capacities (25.5a): @max on Physics' bounded lists - every fact pool and free list (1024), the walker slots (64), the shape and body-owner tables (262144), npc's walkers and posts (64)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-28 16:49:58 +03:00
parent 3205408290
commit 2fca1056c6
8 changed files with 22 additions and 22 deletions

View file

@ -104,8 +104,8 @@ export state CharacterState {
chr_safe_x: float = 0.0 chr_safe_x: float = 0.0
chr_safe_z: float = 0.0 chr_safe_z: float = 0.0
chr_fact_q: Queue<CharacterFact> = chr_fact_q__new() chr_fact_q: Queue<CharacterFact> = chr_fact_q__new()
chr_fpool: []CharacterFact = chr_fpool_new() # every fact record made, reused once no drain holds it @max(1024) chr_fpool: []CharacterFact = chr_fpool_new() # every fact record made, reused once no drain holds it
chr_ffree: []CharacterFact = chr_ffree_new() @max(1024) chr_ffree: []CharacterFact = chr_ffree_new()
chr_fnext: int = 0 chr_fnext: int = 0
} }
function chr__top_plain(x: float, z: float, r: float, from_y: float, step: float, base: float) -> float { return base } function chr__top_plain(x: float, z: float, r: float, from_y: float, step: float, base: float) -> float { return base }

View file

@ -25,8 +25,8 @@ export state FishingState {
fishing_run_next: float = 0.0 fishing_run_next: float = 0.0
fishing_dice: Rng = null fishing_dice: Rng = null
fishing_fact_q: Queue<FishingFact> = fishing_fact_q__new() fishing_fact_q: Queue<FishingFact> = fishing_fact_q__new()
fishing_fpool: []FishingFact = fishing_fpool_new() # every fact record made, reused once no drain holds it (facts.ludic) @max(1024) fishing_fpool: []FishingFact = fishing_fpool_new() # every fact record made, reused once no drain holds it (facts.ludic)
fishing_ffree: []FishingFact = fishing_ffree_new() @max(1024) fishing_ffree: []FishingFact = fishing_ffree_new()
fishing_fnext: []int = words(1) fishing_fnext: []int = words(1)
fishing_n: int = 0 # the record: caught, the biggest (cm), a legend landed fishing_n: int = 0 # the record: caught, the biggest (cm), a legend landed
fishing_big: int = 0 fishing_big: int = 0

View file

@ -22,8 +22,8 @@ export state JobsState {
jobs__seed: int = 1000 jobs__seed: int = 1000
jobs__dice: Rng = rng_new(1000) jobs__dice: Rng = rng_new(1000)
jobs__q: Queue<JobsFact> = jobs__q__new() jobs__q: Queue<JobsFact> = jobs__q__new()
jobs__fpool: []JobsFact = new []JobsFact # every fact record made, reused once no drain holds it (facts.ludic) @max(1024) jobs__fpool: []JobsFact = new []JobsFact # every fact record made, reused once no drain holds it (facts.ludic)
jobs__ffree: []JobsFact = new []JobsFact @max(1024) jobs__ffree: []JobsFact = new []JobsFact
jobs__fnext: []int = words(1) jobs__fnext: []int = words(1)
} }

View file

@ -8,14 +8,14 @@ export state NpcState {
np_clock: float = 0.0 np_clock: float = 0.0
np_recent: []string = np_recent_new() # the last few names that left, a ring np_recent: []string = np_recent_new() # the last few names that left, a ring
np_rnext: int = 0 np_rnext: int = 0
np_walkers: []NpcPerson = new []NpcPerson @max(64) np_walkers: []NpcPerson = new []NpcPerson
np_posts: []NpcPerson = new []NpcPerson @max(64) np_posts: []NpcPerson = new []NpcPerson
np_max: int = 10 # walkers at most np_max: int = 10 # walkers at most
np_n: int = 0 # walkers about np_n: int = 0 # walkers about
np_dice: Rng = rng_new(20260925) np_dice: Rng = rng_new(20260925)
np_facts: Queue<NpcFact> = np_facts__new() np_facts: Queue<NpcFact> = np_facts__new()
np_fpool: []NpcFact = np_pool_new() # every fact record made, reused once no drain holds it @max(1024) np_fpool: []NpcFact = np_pool_new() # every fact record made, reused once no drain holds it
np_ffree: []NpcFact = np_list_sized() @max(1024) np_ffree: []NpcFact = np_list_sized()
np_fnext: int = 0 np_fnext: int = 0
np_next_h: float = 0.0 # the hour the census is next looked at np_next_h: float = 0.0 # the hour the census is next looked at
np_hold: bool = false # held where they stand (a shot of their poses) np_hold: bool = false # held where they stand (a shot of their poses)

View file

@ -36,9 +36,9 @@ export const PH_CAP: int = 512 # contacts drained a step, queries' buffer
export state PhysicsState { export state PhysicsState {
ph_world: pointer = null ph_world: pointer = null
ph_shapes: []pointer = new []pointer # a shape id is its place here; null once freed @max(262144) ph_shapes: []pointer = new []pointer # a shape id is its place here; null once freed
ph_spare: []int = new []int # the freed places, handed out again (shape_ids.ludic) @max(262144) ph_spare: []int = new []int # the freed places, handed out again (shape_ids.ludic)
ph_own: []int = new []int # by a body's index: the shape it owns, freed with it (owned.ludic) @max(262144) ph_own: []int = new []int # by a body's index: the shape it owns, freed with it (owned.ludic)
ph_step: float = 0.016666668 # seconds a step ph_step: float = 0.016666668 # seconds a step
ph_sub: int = 1 # collision steps in each ph_sub: int = 1 # collision steps in each
ph_max_steps: int = 4 # a slow frame catches up this far and no further ph_max_steps: int = 4 # a slow frame catches up this far and no further
@ -51,12 +51,12 @@ export state PhysicsState {
ph_nf: int = 0 ph_nf: int = 0
ph_rx: float = 0.0 # where the last phys_resolve put a body ph_rx: float = 0.0 # where the last phys_resolve put a body
ph_rz: float = 0.0 ph_rz: float = 0.0
ph_walkers: []pointer = new []pointer # a walker id is its place here; null once removed @max(64) ph_walkers: []pointer = new []pointer # a walker id is its place here; null once removed
ph_ids: []int = words(PH_CAP * 2) ph_ids: []int = words(PH_CAP * 2)
ph_vals: []float = floats(PH_CAP * 4) ph_vals: []float = floats(PH_CAP * 4)
ph_facts: Queue<PhysFact> = ph_facts__new() ph_facts: Queue<PhysFact> = ph_facts__new()
ph_fpool: []PhysFact = ph_fpool_new() # every fact record made, reused once no drain holds it @max(1024) ph_fpool: []PhysFact = ph_fpool_new() # every fact record made, reused once no drain holds it
ph_ffree: []PhysFact = ph_ffree_new() @max(1024) ph_ffree: []PhysFact = ph_ffree_new()
ph_fnext: int = 0 ph_fnext: int = 0
} }

View file

@ -68,8 +68,8 @@ export state TelemetryState {
telemetry__props: TelemetryProps = telemetry__props_new() telemetry__props: TelemetryProps = telemetry__props_new()
telemetry__out: StrBuf = null # a batch or the file, written here telemetry__out: StrBuf = null # a batch or the file, written here
telemetry__url: string = "" # host and path, joined once at the config telemetry__url: string = "" # host and path, joined once at the config
telemetry__fpool: []TelemetryFact = new []TelemetryFact # fact records, reused once no drain holds one @max(1024) telemetry__fpool: []TelemetryFact = new []TelemetryFact # fact records, reused once no drain holds one
telemetry__ffree: []TelemetryFact = new []TelemetryFact @max(1024) telemetry__ffree: []TelemetryFact = new []TelemetryFact
telemetry__fnext: []int = words(1) telemetry__fnext: []int = words(1)
telemetry__dirty: bool = false # the ring differs from the file telemetry__dirty: bool = false # the ring differs from the file
telemetry__h: int = -1 # the batch in flight telemetry__h: int = -1 # the batch in flight

View file

@ -63,8 +63,8 @@ export state VehiclesState {
ve_ly: float = 0.0 ve_ly: float = 0.0
ve_lz: float = 0.0 ve_lz: float = 0.0
ve_fact_q: Queue<VehicleFact> = ve_fact_q__new() ve_fact_q: Queue<VehicleFact> = ve_fact_q__new()
ve_fpool: []VehicleFact = ve_fpool_new() # every fact record made, reused once no drain holds it @max(1024) ve_fpool: []VehicleFact = ve_fpool_new() # every fact record made, reused once no drain holds it
ve_ffree: []VehicleFact = ve_ffree_new() @max(1024) ve_ffree: []VehicleFact = ve_ffree_new()
ve_fnext: int = 0 ve_fnext: int = 0
} }
function ve__dry(x: float, z: float) -> float { return -10000.0 } function ve__dry(x: float, z: float) -> float { return -10000.0 }

View file

@ -35,8 +35,8 @@ export property WildSpecies {
export state WildlifeState { export state WildlifeState {
wl_facts: Queue<WildFact> = wl_facts__new() wl_facts: Queue<WildFact> = wl_facts__new()
wl_fpool: []WildFact = wl_fpool_new() # every fact record made, reused once no drain holds it @max(1024) wl_fpool: []WildFact = wl_fpool_new() # every fact record made, reused once no drain holds it
wl_ffree: []WildFact = wl_ffree_new() # of those, the ones free at the last look @max(1024) wl_ffree: []WildFact = wl_ffree_new() # of those, the ones free at the last look
wl_fnext: []int = words(1) # the next of them to hand out wl_fnext: []int = words(1) # the next of them to hand out
wl_own: WildTable = null # a guest's own animals, put away whole while it draws the host's wl_own: WildTable = null # a guest's own animals, put away whole while it draws the host's
wl_host: WildTable = wl__new() # the table the host's are drawn into: made once, cleared per join wl_host: WildTable = wl__new() # the table the host's are drawn into: made once, cleared per join