fix(character, physics, vehicles, wildlife): fact records made at the start (64) with a free list of room for all, as ludic.npc's
A frame holding a new peak of facts made a record and grew the free list; now nothing is made until 64 are held at once. The two record-count tests hold the 64. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7f973f9a4f
commit
c8c230449e
14 changed files with 72 additions and 12 deletions
14
packages/ludic.character/fact_pool.ludic
Normal file
14
packages/ludic.character/fact_pool.ludic
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# ludic.character/fact_pool.ludic - the facts' records made at the start (CHARACTERFACTS of them) with a free list
|
||||
# of room for all, so a frame holding a new peak of facts makes nothing until that many are held
|
||||
const CHR_FACTS: int = 64
|
||||
|
||||
function chr_fpool_new() -> []CharacterFact {
|
||||
let l = new []CharacterFact
|
||||
for i in 0 .. CHR_FACTS { push(l, new CharacterFact) }
|
||||
return l
|
||||
}
|
||||
function chr_ffree_new() -> []CharacterFact {
|
||||
let l = chr_fpool_new()
|
||||
List.clear(l)
|
||||
return l
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ numbers float
|
|||
import "ludic.base"
|
||||
import "rules.ludic"
|
||||
import "ports.ludic"
|
||||
import "fact_pool.ludic"
|
||||
import "state.ludic"
|
||||
import "queries.ludic"
|
||||
import "ground.ludic"
|
||||
|
|
|
|||
|
|
@ -104,8 +104,8 @@ export state CharacterState {
|
|||
chr_safe_x: float = 0.0
|
||||
chr_safe_z: float = 0.0
|
||||
chr_fact_q: Queue<CharacterFact> = chr_fact_q__new()
|
||||
chr_fpool: []CharacterFact = new []CharacterFact # every fact record made, reused once no drain holds it
|
||||
chr_ffree: []CharacterFact = new []CharacterFact
|
||||
chr_fpool: []CharacterFact = chr_fpool_new() # every fact record made, reused once no drain holds it
|
||||
chr_ffree: []CharacterFact = chr_ffree_new()
|
||||
chr_fnext: int = 0
|
||||
}
|
||||
function chr__top_plain(x: float, z: float, r: float, from_y: float, step: float, base: float) -> float { return base }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue