ludic/packages/ludic.base/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

24 lines
733 B
Text

# ludic.base - what a mechanic may use and nothing else: the frame it is handed, the phases
# that order it, queues for the facts it reports, its own dice, its save section, its system
module ludic_base uses
numbers float
import "tick.ludic"
import "queue.ludic"
import "rng.ludic"
import "save.ludic"
import "save_fields.ludic"
import "system.ludic"
import "ecs_table.ludic"
import "ecs_hooks.ludic"
import "ecs_table_remove.ludic"
import "ecs_table_set.ludic"
import "ecs_grid.ludic"
import "ecs_grid_file.ludic"
import "ecs_grid_query.ludic"
import "ecs_grid_within.ludic"
import "ecs_grid_where.ludic"
import "ecs_index.ludic"
import "ecs_index_slot.ludic"
import "ecs_map.ludic"
import "ecs_plan.ludic"
import "ecs_group.ludic"