# painfulexistence/atmosphericengine architecture

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

- Interactive diagram: https://gitdiagram.com/painfulexistence/atmosphericengine
- Repository: https://github.com/painfulexistence/atmosphericengine

## Overview

##### Project type and purpose
- The project is a game engine aimed at 3D graphics, physics, audio, and more. It is structured as a full‐engine core (located in the AtmosphericEngine directory) with several example applications (HelloWorld, Terrain, MazeWorld, Breakout2D) demonstrating its use.
- The README emphasizes graphics programming, PBR texturing, dynamic terrain tessellation, job system, and debug UIs, indicating that the engine subsystems are tightly coupled yet modular.

##### File structure to pinpoint the main architectural components
- The AtmosphericEngine folder holds the core engine code. Within this folder, you have headers and source files for major subsystems such as:
- Application (application.cpp/.hpp)
- Asset Manager (asset_manager.cpp/.hpp)
- Audio Manager (audio_manager.cpp/.hpp)
- Graphics/Rendering (camera, shader, graphics_server, renderable, window)
- Physics (physics_server, bullet_*, physics_debug_drawer)
- Input (input.cpp/.hpp, keyboard.hpp)
- ECS (ecs_server, entity, component, and integration of the external entt library)
- Job system (job_system.cpp/.hpp)
- Miscellaneous systems like messaging (messagable#, message_bus, message) and debugging/console
- Utility modules (file handling, math utilities such as frustum, etc.)
- There is also a “default_assets” folder for shaders, textures, and other built-in assets.
- The external folder includes third-party dependencies (entt, imgui, nlohmann, raudio, sol2, stb) that the engine uses to power various subsystems.

##### External components and build configuration
- CMake files, the vcpkg directory, and Docker-related files indicate an emphasis on cross-platform support and containerized/devcontainer-based setups.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Engine Architecture Subgraph
    subgraph "Engine Architecture"
        A["Application"]:::engine
        AM["Asset Manager"]:::engine
        AuM["Audio Manager"]:::engine
        GS["Graphics Server"]:::engine
        C["Camera"]:::subsystem
        S["Shader"]:::subsystem
        W["Window"]:::subsystem
        DSA["Default Shaders Assets"]:::subsystem
        PS["Physics Server"]:::engine
        BC["Bullet Collision"]:::subsystem
        BD["Bullet Dynamics"]:::subsystem
        BLM["Bullet Linear Math"]:::subsystem
        PD["Physics Debug Drawer"]:::subsystem
        IM["Input Manager"]:::engine
        ECS["ECS Server"]:::engine
        E["Entity"]:::subsystem
        ET["EnTT Integration"]:::subsystem
        JS["Job System"]:::engine
        MS["Messaging System"]:::engine
        DC["Debug Console"]:::engine
        UM["Utility Modules"]:::engine
    end

    %% External Libraries Subgraph
    subgraph "External Libraries"
        entt["entt"]:::external
        imgui["imgui"]:::external
        nlohmann["nlohmann JSON"]:::external
        raudio["raudio"]:::external
        sol2["sol2"]:::external
        stb["stb"]:::external
    end

    %% Example Applications Subgraph
    subgraph "Example Applications"
        EH["Example_HelloWorld"]:::example
        EM["Example_MazeWorld"]:::example
        ETer["Example_Terrain"]:::example
        EB["Example_Breakout2D"]:::example
    end

    %% Connections from Application to Subsystems
    A -->|"init"| AM
    A -->|"init"| AuM
    A -->|"init"| GS
    A -->|"init"| PS
    A -->|"input"| IM
    A -->|"init"| ECS
    A -->|"taskScheduling"| JS
    A -->|"debugMsgs"| MS
    A -->|"utils"| UM

    %% Graphics Subsystem Connections
    GS -->|"uses"| C
    GS -->|"manages"| S
    GS -->|"rendersOn"| W
    GS -->|"loads"| DSA

    %% Physics Subsystem Connections
    PS -->|"integrates"| BC
    PS -->|"integrates"| BD
    PS -->|"integrates"| BLM
    PS -->|"debugDraw"| PD

    %% ECS Connections
    ECS -->|"manages"| E
    ECS -->|"integrates"| ET

    %% Messaging Connections
    MS -->|"displays"| DC

    %% Input Feedback
    IM -->|"controls"| A

    %% ECS and Job System Interaction
    ECS -->|"schedules"| JS

    %% External Libraries Integration
    entt -->|"supports"| ET
    imgui -->|"powers"| DC
    raudio -->|"backends"| AuM
    nlohmann -->|"configures"| AM
    stb -->|"textures"| GS
    sol2 -->|"scripting"| A

    %% Example Applications using the Engine
    EH -->|"uses"| A
    EM -->|"uses"| A
    ETer -->|"uses"| A
    EB -->|"uses"| A

    %% Click Events for Engine Architecture Components
    click A "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/application.cpp"
    click AM "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/asset_manager.cpp"
    click AuM "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/audio_manager.cpp"
    click GS "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/graphics_server.cpp"
    click C "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/camera.cpp"
    click S "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/shader.cpp"
    click W "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/window.cpp"
    click DSA "https://github.com/painfulexistence/atmosphericengine/tree/main/AtmosphericEngine/default_assets/shaders/"
    click PS "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/physics_server.cpp"
    click BC "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/bullet_collision.hpp"
    click BD "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/bullet_dynamics.hpp"
    click BLM "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/bullet_linear_math.hpp"
    click PD "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/physics_debug_drawer.cpp"
    click IM "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/input.cpp"
    click ECS "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/ecs_server.cpp"
    click E "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/entity.cpp"
    click ET "https://github.com/painfulexistence/atmosphericengine/tree/main/AtmosphericEngine/external/entt/"
    click JS "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/job_system.cpp"
    click MS "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/messagable.cpp"
    click DC "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/console.cpp"
    click UM "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/utility/file.cpp"

    %% Click Events for External Libraries
    click entt "https://github.com/painfulexistence/atmosphericengine/tree/main/AtmosphericEngine/external/entt/"
    click imgui "https://github.com/painfulexistence/atmosphericengine/tree/main/AtmosphericEngine/external/imgui/"
    click nlohmann "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/external/nlohmann/json.hpp"
    click raudio "https://github.com/painfulexistence/atmosphericengine/tree/main/AtmosphericEngine/external/raudio/"
    click sol2 "https://github.com/painfulexistence/atmosphericengine/tree/main/AtmosphericEngine/external/sol2/"
    click stb "https://github.com/painfulexistence/atmosphericengine/blob/main/AtmosphericEngine/external/stb/stb_image.h"

    %% Click Events for Example Applications
    click EH "https://github.com/painfulexistence/atmosphericengine/tree/main/Example_HelloWorld/"
    click EM "https://github.com/painfulexistence/atmosphericengine/tree/main/Example_MazeWorld/"
    click ETer "https://github.com/painfulexistence/atmosphericengine/tree/main/Example_Terrain/"
    click EB "https://github.com/painfulexistence/atmosphericengine/tree/main/Example_Breakout2D/"

    %% Styles
    classDef engine fill:#ADD8E6,stroke:#0000FF,stroke-width:2px
    classDef subsystem fill:#B0E0E6,stroke:#0000FF,stroke-width:2px
    classDef external fill:#90EE90,stroke:#006400,stroke-width:2px
    classDef example fill:#FFDEAD,stroke:#FF8C00,stroke-width:2px
```
