# miguelrg14/ecs_engine architecture

> Architecture diagram of the GitHub repository miguelrg14/ecs_engine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/miguelrg14/ecs_engine
- Repository: https://github.com/miguelrg14/ecs_engine

## Overview

ECS Engine is a small C++ game engine with a playable arena demo. The user starts the game, whose scene creates entities and attaches components and scripts; the engine then runs ordered per-frame systems to process input, gameplay, transforms, collisions and events before rendering and presenting the frame. The graph includes the ECS, task kernel, resource and debug-tool capabilities documented in the README. Most internal calls were not sampled, so edges chiefly reflect documented frame order and explicit ownership; unsampled subsystem links are omitted.

Main entry points: [`Engine/code/headers/core/Kernel.hpp`](https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/headers/core/Kernel.hpp) (Task kernel), [`Engine/code/headers/ecs/Registry.hpp`](https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/headers/ecs/Registry.hpp) (Entity registry), [`Engine/code/headers/core/Application.hpp`](https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/headers/core/Application.hpp) (Application), [`Game/code/Demo_Scene.cpp`](https://github.com/miguelrg14/ecs_engine/blob/main/Game/code/Demo_Scene.cpp) (Demo scene)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Game and lifecycle"]
  node_game_entry["Game entry<br/>[main.cpp]"]
  node_demo_scene["Demo scene<br/>[Demo_Scene.cpp]"]
  node_application["Application<br/>[Application.hpp]"]
end

subgraph group_ecs["ECS and simulation"]
  node_registry[("Entity registry<br/>[Registry.hpp]")]
  node_components["Components<br/>[components.hpp]"]
  node_scripts["Gameplay scripts"]
  node_movement["Movement system"]
  node_transforms["Transform system"]
  node_collision["Collision system"]
end

subgraph group_runtime["Runtime services"]
  node_kernel["Task kernel<br/>[Kernel.hpp]"]
  node_input["Input<br/>[Input.hpp]"]
  node_events["Typed event bus<br/>[Event_Bus.hpp]"]
end

subgraph group_graphics["Rendering and tools"]
  node_resources[("Resource manager")]
  node_model_loader["Model loader<br/>[Model_Loader.cpp]"]
  node_render_system["Render system<br/>[Render_System.hpp]"]
  node_renderer["OpenGL renderer<br/>[Renderer.cpp]"]
  node_debug_ui["Debug tools"]
  node_present["Frame presentation<br/>[Present_System.hpp]"]
end

node_player(("Player"))

node_player -->|"starts"| node_game_entry
node_game_entry -->|"enters scene"| node_demo_scene
node_demo_scene -->|"creates entities"| node_registry
node_demo_scene -->|"loads assets"| node_resources
node_application -->|"runs tasks"| node_kernel
node_application -->|"owns"| node_registry
node_application -->|"owns"| node_resources
node_application -->|"owns"| node_renderer
node_input -.->|"input system updates"| node_registry
node_registry -->|"stores"| node_components
node_scripts -->|"publishes"| node_events
node_kernel -->|"runs first"| node_input
node_kernel -->|"runs second"| node_scripts
node_kernel -->|"runs third"| node_movement
node_kernel -->|"runs fourth"| node_transforms
node_kernel -->|"runs fifth"| node_collision
node_kernel -->|"dispatches sixth"| node_events
node_kernel -->|"runs seventh"| node_render_system
node_kernel -->|"runs eighth"| node_debug_ui
node_kernel -->|"runs last"| node_present
node_collision -->|"queues triggers"| node_events
node_resources -->|"loads meshes"| node_model_loader
node_render_system -->|"submits scene"| node_renderer
node_debug_ui -->|"inspects scene"| node_registry
node_present -->|"presents frame"| node_player

click node_game_entry "https://github.com/miguelrg14/ecs_engine/blob/main/Game/code/main.cpp"
click node_demo_scene "https://github.com/miguelrg14/ecs_engine/blob/main/Game/code/Demo_Scene.cpp"
click node_application "https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/headers/core/Application.hpp"
click node_kernel "https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/headers/core/Kernel.hpp"
click node_input "https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/headers/core/Input.hpp"
click node_registry "https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/headers/ecs/Registry.hpp"
click node_components "https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/headers/components.hpp"
click node_scripts "https://github.com/miguelrg14/ecs_engine/blob/main/Game/code/scripts/Player_Controller.cpp"
click node_movement "https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/sources/systems/Movement_System.cpp"
click node_transforms "https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/sources/systems/Transform_System.cpp"
click node_collision "https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/sources/systems/Collision_System.cpp"
click node_events "https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/headers/events/Event_Bus.hpp"
click node_resources "https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/sources/resources/Resource_Manager.cpp"
click node_model_loader "https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/sources/renderer/Model_Loader.cpp"
click node_render_system "https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/headers/systems/Render_System.hpp"
click node_renderer "https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/sources/renderer/Renderer.cpp"
click node_debug_ui "https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/sources/systems/Debug_UI_System.cpp"
click node_present "https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/headers/systems/Present_System.hpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_game_entry,node_demo_scene,node_application toneBlue
class node_registry,node_components,node_scripts,node_movement,node_transforms,node_collision toneAmber
class node_kernel,node_input,node_events toneMint
class node_resources,node_model_loader,node_render_system,node_renderer,node_debug_ui,node_present toneRose
class node_player toneIndigo
```

## Components

### Game and lifecycle

- [Game entry](https://github.com/miguelrg14/ecs_engine/blob/main/Game/code/main.cpp): `Game/code/main.cpp`
- [Demo scene](https://github.com/miguelrg14/ecs_engine/blob/main/Game/code/Demo_Scene.cpp): `Game/code/Demo_Scene.cpp`
- [Application](https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/headers/core/Application.hpp): `Engine/code/headers/core/Application.hpp`

### ECS and simulation

- [Entity registry](https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/headers/ecs/Registry.hpp): `Engine/code/headers/ecs/Registry.hpp`
- [Components](https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/headers/components.hpp): `Engine/code/headers/components.hpp`
- [Gameplay scripts](https://github.com/miguelrg14/ecs_engine/blob/main/Game/code/scripts/Player_Controller.cpp): `Game/code/scripts/Player_Controller.cpp`
- [Movement system](https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/sources/systems/Movement_System.cpp): `Engine/code/sources/systems/Movement_System.cpp`
- [Transform system](https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/sources/systems/Transform_System.cpp): `Engine/code/sources/systems/Transform_System.cpp`
- [Collision system](https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/sources/systems/Collision_System.cpp): `Engine/code/sources/systems/Collision_System.cpp`

### Runtime services

- [Task kernel](https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/headers/core/Kernel.hpp): `Engine/code/headers/core/Kernel.hpp`
- [Input](https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/headers/core/Input.hpp): `Engine/code/headers/core/Input.hpp`
- [Typed event bus](https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/headers/events/Event_Bus.hpp): `Engine/code/headers/events/Event_Bus.hpp`

### Rendering and tools

- [Resource manager](https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/sources/resources/Resource_Manager.cpp): `Engine/code/sources/resources/Resource_Manager.cpp`
- [Model loader](https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/sources/renderer/Model_Loader.cpp): `Engine/code/sources/renderer/Model_Loader.cpp`
- [Render system](https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/headers/systems/Render_System.hpp): `Engine/code/headers/systems/Render_System.hpp`
- [OpenGL renderer](https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/sources/renderer/Renderer.cpp): `Engine/code/sources/renderer/Renderer.cpp`
- [Debug tools](https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/sources/systems/Debug_UI_System.cpp): `Engine/code/sources/systems/Debug_UI_System.cpp`
- [Frame presentation](https://github.com/miguelrg14/ecs_engine/blob/main/Engine/code/headers/systems/Present_System.hpp): `Engine/code/headers/systems/Present_System.hpp`

### Other components

- **Player**

## Connections

- Player → Game entry: starts
- Game entry → Demo scene: enters scene (evidence: `Game/code/main.cpp`)
- Demo scene → Entity registry: creates entities (evidence: `Game/code/Demo_Scene.cpp`)
- Demo scene → Resource manager: loads assets (evidence: `Game/code/Demo_Scene.cpp`)
- Application → Task kernel: runs tasks (evidence: `Engine/code/headers/core/Application.hpp`)
- Application → Entity registry: owns (evidence: `Engine/code/headers/core/Application.hpp`)
- Application → Resource manager: owns (evidence: `Engine/code/headers/core/Application.hpp`)
- Application → OpenGL renderer: owns (evidence: `Engine/code/headers/core/Application.hpp`)
- Input → Entity registry: input system updates
- Entity registry → Components: stores
- Gameplay scripts → Typed event bus: publishes
- Task kernel → Input: runs first
- Task kernel → Gameplay scripts: runs second
- Task kernel → Movement system: runs third
- Task kernel → Transform system: runs fourth
- Task kernel → Collision system: runs fifth
- Task kernel → Typed event bus: dispatches sixth
- Task kernel → Render system: runs seventh
- Task kernel → Debug tools: runs eighth
- Task kernel → Frame presentation: runs last
- Collision system → Typed event bus: queues triggers
- Resource manager → Model loader: loads meshes (evidence: `Engine/code/sources/resources/Resource_Manager.cpp`)
- Render system → OpenGL renderer: submits scene
- Debug tools → Entity registry: inspects scene
- Frame presentation → Player: presents frame
