ludic/packages/ludic.things/index.ludic
Orkuncakilkaya f3fec88888 feat(ecs): chunks as a grouping - IntIndex takes sparse values; ludic.things' chunk column and things_drop_chunk
A streamed world loads and lets go of a chunk's entities together, so a chunk is a first-class
group: chunk_of(x, z, size) packs a chunk's cell into an int, tb_remove_all(tb, ix, v) removes every
row an index files under one value (the observers told of each). IntIndex kept one list per value
up to the largest, which a packed chunk number (hundreds of millions) turned into hundreds of
millions of empty lists and a 12 GB test run; a value past 1024 now gets its slot through an IntMap,
so a sparse value costs one list.

ludic.things files every Thing under its 256 m chunk (TH_CHUNK), kept by every move;
things_chunk_count and things_drop_chunk (the port and the facts told of each removal, as
thing_remove tells them) are what the memory budget's streamed chunks ask. The moves are their own
file (moves.ludic). Tests: ludic.base 35, ludic.things 8, all under a 2 GB cap (24 MB peak).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 22:07:26 +03:00

15 lines
480 B
Text

# ludic.things - things placed in a world (a tent, a fire ring, a branch on the ground): the game
# names the kinds and draws them; the package keeps them, answers where they are, and saves them
module ludic_things uses ludic_base
numbers float
import "ludic.base"
import "kinds.ludic"
import "port.ludic"
import "store.ludic"
import "verbs.ludic"
import "moves.ludic"
import "queries.ludic"
import "near.ludic"
import "chunks.ludic"
import "dispatch.ludic"
import "system.ludic"