Expand description
Implements Khora’s custom Chunked Relational Page ECS (CRPECS).
This module contains the complete implementation of the engine’s Entity-Component-System, which is the heart of the [D]ata layer in the CLAD architecture.
The CRPECS is designed from the ground up to enable the Adaptive Game Data Flows (AGDF) concept from the SAA philosophy. Its key architectural feature is the dissociation of an entity’s identity from the physical storage of its component data, which allows for extremely fast structural changes (adding/removing components).
The primary entry point for interacting with the ECS is the World struct.
Re-exports§
pub use component::Component;pub use maintenance::EcsMaintenance;pub use soa::FieldSoaColumn;pub use soa::SoaLayout;pub use system::DataSystemRegistration;pub use system::TickPhase;
Modules§
- component
- Component
- layout
- Adaptive-layout learner — the decision core of online memory-layout adaptation.
- maintenance
- ECS maintenance subsystem — page compaction (orphan-row reclamation).
- soa
- Field-split (Structure-of-Arrays) component storage — the physical layout the AGDF compute kernels want.
- system
DataSystem— invariant systems of the Data layer.- systems
- Invariant systems of the Data layer (Substrate Pass).
Structs§
- Access
Counters - Online access-pattern counters for one component type.
- Active
Events - Indicates that an entity should receive collision events. By default, the physics engine does not report collisions for every entity to save on performance. Adding this component enables reporting for this entity.
- Audio
Listener - An ECS component that defines the point of audition in the scene.
- Audio
Source - An ECS component that makes an entity an emitter of sound.
- Camera
- A component that defines a camera’s projection parameters.
- Children
- A component that lists the direct children of an entity.
- Collider
- Component representing a collider attached to an entity.
- Collision
Events - A component that stores collision events for the current frame. Typically attached to a singleton entity or used as a resource.
- Component
Domain Registration - Inventory entry submitted by
#[derive(Component)]when the type carries a#[component(domain = ...)]attribute. - Component
Page - A page of memory that stores the component data for multiple entities in a Structure of Arrays (SoA) layout.
- Component
Registry - A registry that maps component types to their semantic domains.
- Domain
Bitset - A simple bitset wrapped around a
Vec<u64>. - Domain
Stats - Simple statistics for a semantic domain.
- Entity
Metadata - Represents the central record for an entity, acting as a “table of contents”
that points to the physical location of its component data across various
ComponentPages. - Global
Transform - A component that stores the final, calculated, world-space transformation of an entity.
- Handle
Component - A generic ECS component that associates an entity with a shared asset resource. It holds both a handle to the loaded data and the asset’s unique identifier.
- Kinematic
Character Controller - Component for kinematic character movement. It provides high-level movement resolution (slopes, steps, etc.) that is more suitable for player characters than raw rigid-body physics.
- Light
- A component that adds a light source to an entity.
- Material
Registration - Registration entry for a serializable material type.
- Name
- A component providing a human-readable name for an entity.
- Page
Index - A logical address pointing to an entity’s component data within a specific
ComponentPage. - Parent
- A component that establishes a parent-child relationship.
- Physics
Debug Data - Component that holds debug rendering data for the physics simulation.
- Physics
Material - Defines the physical properties of a collider surface.
- Playback
State - The internal playback state of an active sound.
This will be managed by the
AudioMixingLane. - Prefab
- Marks an entity as having been instantiated from a
.kprefabasset in the project’s VFS. Thesourcefield stores the forward-slash relative path under<project>/assets/so the editor can offer “open prefab”, “revert overrides” and “spawn another” actions. - Query
- An iterator that yields the results of a
WorldQuery. - Query
Mut - An iterator that yields the results of a mutable
WorldQuery. - Query
Plan - A pre-calculated execution strategy for a specific set of component types.
- Rigid
Body - Component representing a rigid body in the physics simulation.
- Serializable
Material Data - A serializable wrapper for a material that stores the type name and binary data.
- Soa
- A query that reads a field-SoA component by value.
- Tag
- Free-form string tags attached to an entity for grouping and querying.
- Transform
- A component that describes an entity’s position, rotation, and scale
relative to its
Parent. If the entity has noParent, this is relative to the world origin. - Type
Registry - A registry that provides reflection data, like type names.
- Without
- A
WorldQueryfilter that matches entities that do NOT have componentT. - World
- The central container for the entire ECS, holding all entities, components, and metadata.
Enums§
- AddComponent
Error - Errors that can occur when adding a component to an entity.
- Component
Provenance - Who is allowed to write a component — the axis orthogonal to
SemanticDomain. - Deserialize
Archetype Error - Errors that can occur while reconstructing a
Worldfrom a raw archetype memory snapshot inWorld::deserialize_archetype. - Layout
Policy - How a component column is physically laid out in memory.
- Material
Ref - Authored reference to a material — the only serialized material form.
- MeshRef
- Authored reference to a mesh — the only serialized mesh form.
- Procedural
Mesh Kind - Identifies a known procedural mesh primitive.
- Projection
Type - Defines the type of camera projection.
- Query
Mode - Defines whether a query can be executed “natively” or requires a transversal join.
- Remove
Component Error - Errors that can occur when removing a single component from an entity.
- Semantic
Domain - Defines the semantic domains a component can belong to.
- SetFrom
Bytes Error - Error returned when raw column bytes fail validation in
AnyVec::set_from_bytes.
Constants§
- MAX_
COLUMN_ PAYLOAD_ BYTES - Upper bound on the byte payload accepted by
AnyVec::set_from_bytesfor a single component column.
Traits§
- AnyVec
- An internal helper trait to perform vector operations on a type-erased
Box<dyn Any>. - Component
Bundle - A trait for any collection of components that can be spawned together as a single unit.
- World
Query - A trait implemented by types that can be used to query data from the
World.
Functions§
- create_
cube - Builds an axis-aligned cube primitive of the given size, centered at origin.
- create_
plane - Builds a flat XZ plane primitive of the given size at height
y. - create_
sphere - Builds a UV sphere primitive of the given radius, segments and rings.
- deserialize_
material_ component - Deserializes a
(handle, uuid)material pair from binary data. - entities_
with_ all_ tags - Returns every entity that carries all the given tags (logical AND).
An empty
tagsslice matches every entity that has anyTagcomponent at all (vacuous truth). - entities_
with_ any_ tag - Returns every entity that carries any of the given tags (logical OR).
An empty
tagsslice yields an empty result. - entities_
with_ tag - Returns every entity that carries the given tag.
- material_
from_ json - Reconstructs a
(handle, uuid)pair from a JSON object produced bymaterial_to_json. Thetype_nameselects the matching registration; thematerialsub-value is decoded by that registration’sdeserialize_json. - material_
to_ json - Serializes a material into an editable serde-JSON object of the form
{ "type_name": <name>, "material": <concrete material> }, matching the(type_name, data)split thatserialize_material_componentuses for bincode. ReturnsNoneif no registration claims the material. - reconstruct_
procedural_ mesh - Reconstructs a procedural [
Mesh] from its kind and parameters. - serialize_
material_ component - Serializes a
dyn Materialby finding the matchingMaterialRegistrationand encoding the material data with its type name.
Type Aliases§
- Material
Deserialize Fn - Function pointer that decodes binary data into a boxed
dyn Material. - Material
Handle - Runtime-only resolved material: a shared handle to the type-erased material
data plus its identifying
AssetUUID. Produced by the resolver, consumed by the GPU material projection. A readable alias for call sites.