# upcbasicengine/sobrassada_engine architecture

> Architecture diagram of the GitHub repository upcbasicengine/sobrassada_engine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/upcbasicengine/sobrassada_engine
- Repository: https://github.com/upcbasicengine/sobrassada_engine

## Overview

##### Project Type and Purpose
- This is a C++ game engine with a built‐in scene editor that supports game object and component creation, asset importing, and high-quality rendering.
- The README emphasizes that the engine provides an integrated scene editor, file operations, camera controls for 3D space, and menu-driven settings. This suggests that a clear separation exists between core engine operations and the editor/UI.

##### File Structure and Determine Major Subsystems
- Engine Core:
– Located in the “SobrassadaEngine” directory with Application.cpp/h as the engine’s entry point.
– Contains the main loop and integration points for various modules.
- Modules:
– The “Modules” folder includes individual engine components such as CameraModule, InputModule, SceneModule, EditorUIModule, WindowModule, etc.
– Each module encapsulates a distinct aspect (rendering, input handling, scene management, debugging, etc.).
- Scene & Resource Management:
– The “Scene” directory holds GameObject, Components, and Scene classes (including cameras, lights, meshes, etc.).
– The “ResourceManagement” folder handles resources like materials, meshes, models, textures, and prefabs.
- File System & Asset Pipeline:
– The “FileSystem” directory (with its Config subfolders and Importers) indicates management of asset import, metadata handling, and project configuration.
– The “Game/EngineDefaults” folder further provides default assets and shaders that the engine consumes.
- External Libraries (Libs):
– The “Libs” folder includes third-party libraries such as ImGui (for UI/editor), DirectXTex (image/texture processing), SDL (window, input, and system integration), MathGeoLib (mathematical routines for geometry), Optick (profiling), RecastDetour (navigation and pathfinding), and others.
- Utility Components:
– The “Utils” directory contains timers, delegates, logging, frustum calculations, and common helper classes.
- UI/Editor Components:
– The “UI” folder and the “EngineEditors” subdirectory provide the code for the editor’s node-based interface and texture library management.

##### Relationships and Interactions
– Illustrate the Module System as an independent block subdivided further into:
- InputModule (handles user inputs and camera control).
- CameraModule (controls view and transformations).
- SceneModule (manages game objects, components, and rendering of the scene).
- ShaderModule and OpenGLModule (handle the rendering pipeline).
- EditorUIModule (provides the scene editor and menu functionality).
– Show the File System/Asset Pipeline subsystem interacting with both the Resource Management (to load assets, metadata) and the Editor UI (for asset import and scene creation).

##### Architectural Patterns and Design Principles
– Modular design: Separate modules take care of specific concerns (input, rendering, scene, etc.).
– Data-driven asset management: The FileSystem with Importers and Meta data support indicates a decoupled resource management system.
– Integration of 3rd-party libraries: External brands are used to offload functionality like UI, texture handling, and mathematical operations.
– Hierarchical scene and component system: Organize game objects in the Scene folder with associated components, reflecting an entity-component-system (ECS) or a component-based design.

##### Specific Elements
– Optionally, outline the build/dependency structure (the “Licences” and “Game/EngineDefaults” directories can be noted as repositories of default assets and configurations).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Engine Core"
        EC("Application"):::core
    end
    click EC "https://github.com/upcbasicengine/sobrassada_engine/blob/main/SobrassadaEngine/Application.cpp"
    click EC "https://github.com/upcbasicengine/sobrassada_engine/blob/main/SobrassadaEngine/Application.h"

    subgraph "Modules"
        CAM("CameraModule"):::module
        INP("InputModule"):::module
        SCN("SceneModule"):::module
        EDT("EditorUIModule"):::module
        WIN("WindowModule"):::module
    end
    click CAM "https://github.com/upcbasicengine/sobrassada_engine/tree/main/SobrassadaEngine/Modules"
    click INP "https://github.com/upcbasicengine/sobrassada_engine/tree/main/SobrassadaEngine/Modules"
    click SCN "https://github.com/upcbasicengine/sobrassada_engine/tree/main/SobrassadaEngine/Modules"
    click EDT "https://github.com/upcbasicengine/sobrassada_engine/tree/main/SobrassadaEngine/Modules"
    click WIN "https://github.com/upcbasicengine/sobrassada_engine/tree/main/SobrassadaEngine/Modules"

    subgraph "Scene & Resource Management"
        SM("Scene Management"):::scene
        RM("Resource Management"):::resource
    end
    click SM "https://github.com/upcbasicengine/sobrassada_engine/tree/main/SobrassadaEngine/Scene"
    click RM "https://github.com/upcbasicengine/sobrassada_engine/tree/main/SobrassadaEngine/ResourceManagement"

    subgraph "File System & Asset Pipeline"
        FS("File/System Operations"):::filesystem
        DA("Default Assets & Shaders"):::assets
    end
    click FS "https://github.com/upcbasicengine/sobrassada_engine/tree/main/SobrassadaEngine/FileSystem"
    click DA "https://github.com/upcbasicengine/sobrassada_engine/tree/main/Game/EngineDefaults"

    subgraph "External Libraries"
        LIB("Libs"):::lib
    end
    click LIB "https://github.com/upcbasicengine/sobrassada_engine/tree/main/SobrassadaEngine/Libs"

    subgraph "Utility Components"
        UT("Utils"):::utils
    end
    click UT "https://github.com/upcbasicengine/sobrassada_engine/tree/main/SobrassadaEngine/Utils"

    subgraph "UI/Editor Components"
        UI("Editor UI"):::ui
    end
    click UI "https://github.com/upcbasicengine/sobrassada_engine/tree/main/SobrassadaEngine/UI/EngineEditors"

    %% Relationships from Engine Core to Modules and Systems
    EC -->|"initModules"| CAM
    EC -->|"initModules"| INP
    EC -->|"initModules"| SCN
    EC -->|"initModules"| EDT
    EC -->|"initModules"| WIN
    EC -->|"initFileSystem"| FS
    EC -->|"usesUtils"| UT

    %% Modules interactions with External Libraries and Scene Management
    CAM -->|"usesLibs"| LIB
    INP -->|"usesLibs"| LIB
    WIN -->|"usesLibs"| LIB
    EDT -->|"usesLibs"| LIB
    SCN -->|"manages"| SM
    SCN -->|"manages"| RM

    %% File System feeds assets into Resource Management and UI
    FS -->|"feedsAssets"| RM
    FS -->|"feedsAssets"| UI

    %% UI interactions with Scene and Resource Management
    UI -->|"interactsWith"| SM
    UI -->|"interactsWith"| RM
    EDT -->|"connectsTo"| UI

    %% Utility supports core functionalities
    UT -->|"supportsCore"| EC

    %% Styles
    classDef core fill:#f9f,stroke:#333,stroke-width:2px;
    classDef module fill:#ccf,stroke:#333,stroke-width:2px;
    classDef scene fill:#cfc,stroke:#333,stroke-width:2px;
    classDef resource fill:#cfc,stroke:#333,stroke-width:2px;
    classDef filesystem fill:#fc9,stroke:#333,stroke-width:2px;
    classDef assets fill:#fc9,stroke:#333,stroke-width:2px;
    classDef lib fill:#cff,stroke:#333,stroke-width:2px;
    classDef utils fill:#ccc,stroke:#333,stroke-width:2px;
    classDef ui fill:#fcf,stroke:#333,stroke-width:2px;
```
