ECS overview
insomni-ecs is a standalone Entity-Component-System for building
simulations and data-driven scenes on top of the insomni
renderer. It is independent of insomni-plot —
plot compiles a declarative grammar straight into renderer layers and does not
use ECS. Reach for insomni-ecs when you have many entities with per-frame
behavior (agents, particles, physics) rather than a static chart spec.
Core pieces
Section titled “Core pieces”World— owns entities and components, runs registered systems each step.EntityManager— creates and recycles entity ids.- Components — typed Structure-of-Arrays storage; describe a component with a
ComponentDescriptorand read/write it through dense column storage. Query— iterates the entities that match a set of components, withwithout/anyfilters and incrementally-maintained membership.System— a function run against matching entities everyworld.step(dt).CommandBuffer— defers structural changes (spawn/despawn/attach) so they apply safely at a frame boundary.ResourceMap— singleton, world-scoped state keyed byresourceKey.uploadComponent— one-shot dirty-range upload of a component column into a GPU buffer for instanced draws.
Examples
Section titled “Examples”- Damage-tracked rendering — moving, pulsing, and
highlighted entities drive the renderer’s automatic
damage: "auto"partial-redraw detection. - Boids flocking — Reynolds cohesion / alignment / separation implemented as custom systems over hundreds of agents.