
Games 2026
Cairn
A data-oriented game engine for C3, built on raylib.
Cairn is a data-oriented game engine for C3 on top of raylib. raylib provides the window, input, audio, and drawing; Cairn adds the parts a game needs to stay organised: an entity-component system, an application loop with stages and states, and plugins that can be added or replaced.
The name is the metaphor: a cairn is a stack of stones that marks the path.

The ECS
Components live in sparse sets with dense storage, so iteration is cache-friendly and lookup is constant time. Entities are generational ids: a handle kept after despawn stays dead instead of pointing at a recycled slot. Queries iterate from the smallest store and accept with, without, changed, and added filters. Commands queue structural changes until the end of a stage, and typed messages give systems a one-to-many channel.
Relationships, transform hierarchies, hooks on add/replace/remove, and observers are part of the core rather than an add-on crate.

The loop
Systems are plain functions registered to a stage: STARTUP once, then FIXED_UPDATE at a steady 60 Hz, UPDATE per frame, and DRAW. States are enum values with their own systems and enter/exit hooks. Run conditions let a system depend on a resource or a state without an if at the top of every function.
Plugins, not a framework
Input, gamepads, camera controllers, audio, assets, UI (Clay), focus navigation, gizmos, animation, motion, rollback networking, jobs, snapshots, and devtools are separate plugins. A small game adds the handful it needs. Barrow, an action RPG, is the test case: it uses Cairn the way a real game would, and the gaps it finds become engine work.