Engine Internals
The manual describes the engine from a game developer’s seat. This section describes it from the inside: the C++ subsystems, the threading model, the render pipeline, and the tooling that generates half of the code you will read.
It assumes you have written C++ engine code before and are new to this codebase. It does not re-explain what a command buffer or an ECS is; it explains what Lumina’s version of them does differently and why.
Reading order
Section titled “Reading order”If you are landing in the repository for the first time, read these in order.
- Application Lifecycle, from
WinMainto the first rendered frame, and back out through shutdown. - Threading Model, which threads exist, what each may touch, and where the hand-offs are.
- The Object System,
CObject, classes, packages, and object lifetime. Almost every asset and settings type is one. - Reflection and Code Generation, the
Clang-based Reflector that produces
.generated.hfiles and C# bindings. - RHI and Frame Pipeline, the rendering half.
Subsystem map
Section titled “Subsystem map”LuminaMain (Launch.cpp) FApplicationGlobalState threading + logging FCommandLine, FConfig FEngine / FEditorEngine the engine singleton (GEngine) FApplication::Run window creation, then the main loop FEngine::Init subsystems come up here while (!exit) FWindow::ProcessMessages GLFW event pump FEngine::Update one frame, six update stages FEngine::ShutdownFEngine::Update drives everything else:
FEngine::Update FWorldManager::WaitForPhysics join last frame's physics FWorldManager::UpdateWorlds per stage: FrameStart .. FrameEnd CWorld::Update entity systems, scripts, transforms CWorld::Extract game -> render snapshot (FrameEnd) FRenderManager::FrameEnd enqueue the render-thread pipeline FWorldManager::KickPhysics fire physics for next frameand the render side:
FRenderThread drain (a job on a pool worker) RHI::Core::BeginFrame(slot) wait the frame timeline, recycle lists IRenderScene::PrepareRender serial, device-wide reconciliation IRenderScene::RenderView per scene, records + submits ImGui / RmlUi composite RHI::Core::Present acquire, blit, presentThe pieces, by directory
Section titled “The pieces, by directory”| Directory | What lives there |
|---|---|
Engine/Source/Runtime/Core | Object system, reflection runtime, serialization, delegates, math, threading primitives, console variables, profilers |
Engine/Source/Runtime/Containers | EASTL aliases, FString, FName, and the engine-specific container types |
Engine/Source/Runtime/Memory | Allocator facade over rpmalloc, frame and linear allocators, memory tracking |
Engine/Source/Runtime/TaskSystem | Fiber job scheduler, ParallelFor, task graph, futures, fiber-aware sync |
Engine/Source/Runtime/Renderer | RHI declaration, Vulkan backend, shader compiler and cache, material manager, render thread |
Engine/Source/Runtime/World | CWorld, the EnTT registry facade, entity systems, and the render scene |
Engine/Source/Runtime/Assets | Asset registry, asset manager, asset types |
Engine/Source/Runtime/Scripting | .NET host, interop surface, script structs |
Engine/Source/Runtime/Physics | Physics facade and the Jolt backend |
Engine/Source/Runtime/UI | RmlUi integration |
Engine/Source/Runtime/Tools | ImGui plumbing, importers, transactions, primitives, fonts |
Engine/Editor | Everything editor-only: tools, panels, property grid, node graphs |
Engine/Applications/Lumina | The executable entry point |
Engine/Applications/Reflector | The code generator |
Engine/Source/LuminaSharp | The managed (C#) engine API |
Engine/Tools/LuminaBuildTool | The build tool: rules compilation, the module graph, the reflection step, project generation |
Engine/Build | Shared build rules (*.BuildRules.cs) and BuildConfiguration.json |
What this section covers
Section titled “What this section covers”| Page | Subject |
|---|---|
| Application Lifecycle | Startup, the main loop, update stages, shutdown |
| Modules and Plugins | Module manager, DLL boundaries, plugin load phases |
| Threading Model | Threads, ownership rules, hand-off points |
| Task System | Fiber scheduler, counters, ParallelFor, task graph |
| Memory | Allocators, frame arenas, tracking |
| Math and Containers | The in-house math library, SIMD, EASTL aliases, FName |
| Delegates and Events | Delegates, reentrancy, core delegates, input events |
| Configuration and Settings | FConfig, developer settings classes, live refresh |
| The Object System | CObject, CClass, packages, handles, lifetime |
| Reflection and Code Generation | Reflector, generated headers, C# binding emission |
| Serialization | Archives, package format, the phased loader |
| Assets | Registry, manager, VFS, cooking |
| ECS Internals | Registry facade, systems, execution and validation |
| Physics Internals | Jolt facade, bodies, constraints, queries, the job bridge |
| Animation Internals | Poses, the graph VM, the task system, root motion, notifies |
| Networking Internals | Transport, net GUIDs, the replication graph, the wire protocol |
| Audio Internals | The audio context, command queue, voices, buses, spatialization |
| RHI | The graphics abstraction |
| Vulkan Backend | Device, queues, memory, descriptors, swapchain |
| Frame Pipeline | Render thread, extract, frames in flight |
| Render Passes | The scene renderer, pass by pass |
| Shaders | Slang compilation, cache, conventions |
| Scripting Host | CoreCLR hosting and interop |
| Editor Architecture | Editor engine, tools, panels, transactions |
| Platform Layer | Windowing, input, filesystem, process, crash handling |
| Diagnostics | Logging, console variables, profilers, GPU debugging |
| Build System | LuminaBuildTool, targets, modules, plugins, rules files |
Conventions used in the code
Section titled “Conventions used in the code”Fprefix for plain structs and classes (FEngine,FRenderManager).Cprefix for reflectedCObjectclasses (CWorld,CTexture).Sprefix for reflected non-object structs (SPostProcessSettings).Eprefix for enums,Iprefix for interfaces.Gprefix for globals (GEngine,GRenderManager,GWorldManager).- Allman braces, PascalCase members, no Hungarian notation beyond the prefixes
above except
bfor booleans. _GameThread/_RenderThreadsuffixes mark functions with a hard thread affinity.