Prisma Engine organizes all game objects using an Entity Component System. Instead of inheriting from a monolithicDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Excurs1ons/PrismaEngine/llms.txt
Use this file to discover all available pages before exploring further.
GameObject base class, you compose behavior by attaching lightweight data components to entities and writing systems that operate on those components every frame. This keeps game logic decoupled, cache-friendly, and straightforward to extend.
The ECS implementation is currently at approximately 80% completion. The core types —
World, ISystem, EntityID, and Component — are stable and used in production. Component pools and advanced queries are still being finalized.Core types
| Type | Defined in | Purpose |
|---|---|---|
EntityID | engine/core/ECS.h | A uint32_t handle that identifies an entity. INVALID_ENTITY (0) is the null value. |
World | engine/core/ECS.h | Singleton that owns all systems and drives per-frame updates. |
ISystem | engine/core/ECS.h | Abstract base every system must inherit from. |
Component | engine/core/Component.h | Base class for all attachable data components. |
Prisma::Core::ECS namespace:
Entities
An entity is just an integer ID. You do not construct or destroy a class instance — you ask theWorld to allocate an ID and then attach components to it.
Components
Component is the base class for all data attached to an entity. Override the lifecycle hooks you need:
Built-in component types
Prisma Engine ships several ready-to-use components:ScriptComponent
ScriptComponent
Attaches C# scripting logic to an entity. Inherits from
Component. The scripting system (Mono/CoreCLR) is not yet fully implemented.ButtonComponent
ButtonComponent
CanvasComponent
CanvasComponent
A 2D UI container that groups child
UIComponent instances and controls how they render.Systems
Every system inherits fromISystem and implements at minimum the Update method:
Initialize() is called once when the system is added to the World. Update() is called every frame, receiving a Timestep that wraps the frame delta time. Set enabled = false to pause a system without removing it.
Writing a custom system
Built-in systems
The engine provides a set of systems inengine/core/Systems.h:
| System | TYPE_ID | Responsibility |
|---|---|---|
TransformSystem | 6 | Maintains parent-child hierarchy and world matrix cache |
RenderSystem | 1 | Collects renderable entities and submits opaque/transparent queues |
PhysicsSystem | 2 | Fixed-timestep simulation with gravity and collision resolution |
AnimationSystem | 3 | Drives AnimationComponent state machines each frame |
AudioSystem | 4 | Syncs AudioSourceComponent 3D positions with the audio backend |
ScriptSystem | 5 | Calls into the Mono/CoreCLR scripting runtime |
LightSystem | 7 | Collects active lights and manages ambient light |
CameraSystem | 8 | Computes view and projection matrices for the active camera |
TransformSystem is particularly important. Call TransformSystem::SetParent(child, parent) to build scene hierarchies; the system propagates dirty flags and recalculates world matrices efficiently each frame:
The World singleton
World is a singleton that owns the system list and drives the per-frame update loop.
Accessing the World
Engine instance, which is the recommended approach from within application code:
Adding systems
UseWorld::AddSystem<T>() to register a system. The method constructs the system, injects the World pointer into m_world, and calls Initialize():
TransformSystem before RenderSystem.
Per-frame update
World::Update() iterates the system list and calls Update(ts) on every enabled system: