ludic.compass: the marks' pools made with the state (512), compass_at's empty mark kept; ludic.base imap_clear in place; ludic.things' kept lists through kept_push; ludic.net's once-per-room and STUN log lines declared

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-28 16:22:48 +03:00
parent 8dfcccad41
commit d3911d4ba8
11 changed files with 40 additions and 19 deletions

View file

@ -29,6 +29,6 @@ export function things_changed(things_st: ThingsState, since: int, rows: words,
List.clear(out)
let tb = things_st.th.tab
let n = tb_changed_since(tb, since, rows)
for k in 0 .. n { push(out, tb.rec[rows[k]]) }
for k in 0 .. n { kept_push(out, tb.rec[rows[k]]) }
return n
}

View file

@ -54,7 +54,7 @@ export function things_tick(things_st: mut ThingsState, hours: float) -> void {
for k in 0 .. TH_COUNT {
if ThingKinds[k].tick == null { continue }
let rows = ix_rows(things_st.th.kinds, k)
for i in 0 .. len(rows) { push(hs, tb.ent[rows[i]]) }
for i in 0 .. len(rows) { kept_push(hs, tb.ent[rows[i]]) }
}
for i in 0 .. len(hs) {
let r = tb_row(tb, hs[i])

View file

@ -9,7 +9,10 @@ function th_fact(things_st: mut ThingsState, what: int, t: Thing) -> void {
}
var pool = things_st.th_fact_a
if things_st.th_fact_on_b { pool = things_st.th_fact_b }
if things_st.th_fact_n >= len(pool) { push(pool, new ThingFact) }
if things_st.th_fact_n >= len(pool) {
@alloc_ok("a pool miss: past the most facts in one drain only, then kept")
push(pool, new ThingFact)
}
let f = pool[things_st.th_fact_n]
things_st.th_fact_n += 1
f.what = what

View file

@ -4,7 +4,7 @@
# uid change long after the removal; everything else about it is set back as new
const TH_SPARE_LAG: int = 32
function th_spare_put(things_st: mut ThingsState, t: Thing) -> void { push(things_st.th_spare, t) }
function th_spare_put(things_st: mut ThingsState, t: Thing) -> void { kept_push(things_st.th_spare, t) }
# a record for a Thing about to be placed: the oldest spare past the lag, or a new one
function th_record(things_st: mut ThingsState) -> Thing {
@ -69,5 +69,8 @@ export function thing_slot(t: Thing) -> int {
# spare records made now, up to `n` waiting: a world that will place Things in play takes them
# from the first placement instead of making new ones until enough have been removed
export function things_spare_warm(things_st: mut ThingsState, n: int) -> void {
while things_spare_count(things_st) < n { push(things_st.th_spare, new Thing) }
while things_spare_count(things_st) < n {
@alloc_ok("at a world's start: the spare records it will place in play")
push(things_st.th_spare, new Thing)
}
}