Skip to content
Emanuel edited this page Dec 15, 2025 · 3 revisions

Welcome to another-dunkan-engine Wiki

A high-performance Vulkan-based game engine featuring a sophisticated Entity-Component-System (ECS) architecture, physically-based rendering (PBR), deferred shading, and advanced post-processing effects.

🎯 Core Features

  • Custom ECS Implementation - Cache-coherent entity management with template metaprogramming
  • Slotmap Data Structure - Generational indices for safe, efficient component storage
  • Compile-time Type Safety - Template-driven component system with zero runtime overhead
  • Vulkan Renderer - Modern graphics API with deferred rendering and SSAO
  • Modular Architecture - Clean separation between engine systems and game logic

πŸ“š Documentation Structure

Getting Started

  • Usage Guide - Practical examples and best practices for using the ECS

Core Systems

Advanced Topics

πŸ—οΈ Architecture Overview

graph TB
    subgraph "Game Layer"
        Game[Game Code]
        Systems[Game Systems]
    end
    
    subgraph "ECS Core"
        EM[EntityManager]
        Entity[Entity]
        CS[ComponentStorage]
    end
    
    subgraph "Data Structures"
        SM1[Slotmap<PhysicsComponent>]
        SM2[Slotmap<RenderComponent>]
        SM3[Slotmap<LightComponent>]
        Singleton[Singleton Components]
    end
    
    subgraph "Template Layer"
        TL[Typelist]
        Traits[Component Traits]
        Meta[Metaprogramming Utils]
    end
    
    Game --> EM
    Systems --> EM
    EM --> Entity
    EM --> CS
    Entity --> CS
    CS --> SM1
    CS --> SM2
    CS --> SM3
    CS --> Singleton
    
    CS -.compile-time.-> TL
    CS -.compile-time.-> Traits
    Traits -.compile-time.-> Meta
    TL -.compile-time.-> Meta
    
    style Game fill:#e1f5ff
    style Systems fill:#e1f5ff
    style EM fill:#ffe1e1
    style Entity fill:#ffe1e1
    style CS fill:#ffe1e1
    style TL fill:#fff4e1
    style Traits fill:#fff4e1
    style Meta fill:#fff4e1
Loading

πŸ”‘ Key Concepts

Entity-Component-System (ECS)

An architectural pattern that separates data (Components) from behavior (Systems) and identity (Entities). This engine uses a custom implementation optimized for cache coherency and type safety.

Slotmap

A cache-friendly container that provides stable handles (generational indices) to stored data. It combines the benefits of sparse sets and packed arrays for O(1) insertion, deletion, and lookup.

Template Metaprogramming

Compile-time code generation using C++ templates. The engine leverages typelists, type traits, and template transformations to build type-safe, zero-overhead abstractions.

πŸš€ Quick Start Example

// Define your component types
using Components = ADE::META_TYPES::Typelist<
    PhysicsComponent, 
    RenderComponent, 
    LightComponent
>;

using SingletonComponents = ADE::META_TYPES::Typelist<
    CameraComponent
>;

// Create entity manager
using EntityManager = ADE::EntityManager<Components, SingletonComponents, Tags, 1024>;
EntityManager entity_manager;

// Create entity with components
auto& entity = entity_manager.create_entity();
entity_manager.add_component<PhysicsComponent>(entity, 0.0f, 0.0f, 0.0f);
entity_manager.add_component<RenderComponent>(entity, /* ... */);

// Iterate over entities with specific components
entity_manager.foreach<
    META_TYPES::Typelist<PhysicsComponent, RenderComponent>,
    META_TYPES::Typelist<>
>([](Entity& entity, PhysicsComponent& physics, RenderComponent& render) {
    // Process entities with both physics and render components
});

πŸ“– Recommended Reading Order

  1. Start with Entity-Component-System to understand the overall architecture
  2. Read Slotmap Implementation to learn how components are stored efficiently
  3. Explore Template Metaprogramming to understand the compile-time magic
  4. Review Component System for component management details
  5. Reference Usage Guide for practical patterns and examples

πŸ› οΈ System Requirements

  • C++20 compiler (GCC 10+, Clang 11+, MSVC 2019+)
  • CMake 3.10 or later
  • Vulkan SDK 1.4.328.1 or later

πŸ“Š Performance Characteristics

Operation Time Complexity Cache Performance
Entity Creation O(1) Excellent
Component Addition O(1) Excellent
Component Lookup O(1) Excellent
Component Iteration O(n) Excellent (packed array)
Entity Deletion O(1) Good

🀝 Contributing

When extending the engine:

  • Add new components to the appropriate typelist in game/types.hpp
  • Follow the existing component structure patterns
  • Ensure components are POD-like for optimal performance
  • Update this documentation for any architectural changes

πŸ“ License

GNU GPLv3


Next Steps: Begin with the Entity-Component-System documentation to understand the core architecture.