# hanaaple/techlab_week01_gamejam_7 architecture

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

- Interactive diagram: https://gitdiagram.com/hanaaple/techlab_week01_gamejam_7
- Repository: https://github.com/hanaaple/techlab_week01_gamejam_7

## Overview

##### Analyze the File Structure

- **Top-Level Directories and Files:**
- **Assets:** Contains subdirectories for `Audio` and `Texture`, indicating resource management for sounds and visuals.
- **GameObject:** Holds various game entities such as `Bullet`, `Monster`, and `Player`, suggesting an object-oriented approach to game entities.
- **Manager:** Includes managers like `AudioManager`, `GameManager`, and `UIManager`, responsible for handling different aspects of the game.
- **Scene:** Contains different game scenes (`MainGameScene`, `PresetScene`, `TitleScene`, etc.), managing various states or screens of the game.
- **ImGui:** Integration of the ImGui library for GUI components.
- **Shaders:** Contains shader programs (`.hlsl` files) for rendering.
- **UIObject & Weapon:** Manage user interface elements and weapon mechanics respectively.
- **Math:** Likely contains mathematical utilities and vector operations essential for game mechanics.
- **GlobalData, BufferCache, InputSystem, URenderer:** Handle global game data, rendering buffers, user input, and rendering processes.

- **Patterns and Architectural Choices:**
- **Object-Oriented Design (OOD):** Evident from the use of classes and inheritance (e.g., `AbstractClass/Singleton.h`).
- **Manager Pattern:** Multiple managers handling specific domains (Audio, Game, UI).
- **Scene Management:** Different scenes managing various game states.
- **Integration with External Libraries:** Use of ImGui for UI and possibly DirectX for rendering (`imgui_impl_dx11.cpp`).

##### Examine the README for Additional Insights

The README is brief but indicates:
- **Project Context:** It's part of the Krafton Jungle Game Tech Lab's first-week game jam, developed by Group 7.
- **Purpose:** While details are minimal, the project likely focuses on creating a functional prototype within a limited timeframe, emphasizing essential game mechanics and features.

**a. Identify the Main Components:**
- **Core Game Engine:**
- **Rendering Engine (`URenderer.cpp`):** Handles all rendering tasks.
- **Input System (`InputSystem.cpp`):** Manages user inputs.
- **Math Utilities (`Math`):** Provides mathematical operations and data structures.

- **Game Objects:**
- **Player, Monster, Bullet (`GameObject`):** Represents interactive entities.
- **Weapon (`Weapon`):** Manages weapon mechanics and data.

- **Managers:**
- **AudioManager:** Handles all audio-related functionalities.
- **GameManager:** Oversees game states and logic.
- **UIManager:** Manages user interface elements using ImGui.
- **ResourceManager:** Manages game assets and resources.

- **Scenes (`Scene`):**
- **TitleScene, MainGameScene, PresetScene, ResultScene:** Different game states/screens.

- **Assets:**
- **Audio (`Assets/Audio`):** Sound effects and music files.
- **Textures (`Assets/Texture`):** Visual assets for the game.

- **External Libraries:**
- **ImGui:** For GUI components.
- **Shaders (`Shaders`):** Shader programs for graphics.

**b. Determine Relationships and Interactions:**
- **GameManager** interacts with **Scene** components to switch between different game states.
- **UIManager** utilizes **ImGui** to render user interfaces within different scenes.
- **Rendering Engine** uses **Shaders** and **Textures** from the **Assets** directory to render game objects.
- **InputSystem** captures user inputs and communicates with **GameManager** and **Player** objects.
- **ResourceManager** provides necessary assets to other managers and game objects.
- **AudioManager** plays sounds based on events triggered by **GameManager** and **Game Objects**.

**c. Highlight Architectural Patterns or Design Principles:**
- **Singleton Pattern:** Likely used in managers (e.g., `Singleton.h`) to ensure only one instance exists.
- **Manager Pattern:** Separates responsibilities into different managers for modularity.
- **Scene Management:** Organized handling of different game states.
- **Modular Design:** Clear separation between different game components (e.g., GameObjects, Managers).

**d. Include Relevant Technologies, Frameworks, or Libraries:**
- **C++:** Primary programming language.
- **ImGui:** For creating graphical user interfaces.
- **DirectX 11:** Inferred from `imgui_impl_dx11.cpp` for rendering.
- **HLSL Shaders:** Used for graphics rendering.
- **External Audio Files:** Managed through `Assets/Audio`.

##### Elements

- **Clear Labels for Each Component:**
- Name each component (e.g., GameManager, UIManager, Player, Monster).

- How data moves between components (e.g., InputSystem → GameManager → Player).

##### Final Recommendations

- **Be Detailed and Comprehensive:**
- Major components and their interactions are represented.

- **Avoid Overcomplication:**

- **Maintain Consistency:**

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Nodes
    subgraph "Core Engine"
        RenderingEngine["Rendering Engine"]:::core
        InputSystem["Input System"]:::core
        MathUtilities["Math Utilities"]:::core
    end

    subgraph "Managers"
        AudioManager["AudioManager"]:::manager
        GameManager["GameManager"]:::manager
        UIManager["UIManager"]:::manager
        ResourceManager["ResourceManager"]:::manager
    end

    subgraph "Game Objects"
        Player["Player"]:::gameobject
        Monster["Monster"]:::gameobject
        Bullet["Bullet"]:::gameobject
        Weapon["Weapon Mechanics"]:::gameobject
    end

    subgraph "Scenes"
        TitleScene["TitleScene"]:::scenes
        MainGameScene["MainGameScene"]:::scenes
        PresetScene["PresetScene"]:::scenes
        ResultScene["ResultScene"]:::scenes
    end

    subgraph "Assets"
        AudioAssets["Audio Assets"]:::assets
        TextureAssets["Texture Assets"]:::assets
    end

    subgraph "External Libraries"
        ImGui["ImGui"]:::external
        Shaders["Shaders"]:::external
    end

    subgraph "Global Data"
        GlobalData["GlobalData"]:::globaldata
        BufferCache["BufferCache"]:::globaldata
    end

    %% Styles
    classDef core fill:#bfb,stroke:#333,stroke-width:2px
    classDef manager fill:#f9f,stroke:#333,stroke-width:2px
    classDef gameobject fill:#bbf,stroke:#333,stroke-width:2px
    classDef scenes fill:#ffb,stroke:#333,stroke-width:2px
    classDef assets fill:#fffb,stroke:#333,stroke-width:2px
    classDef external fill:#fbf,stroke:#333,stroke-width:2px
    classDef globaldata fill:#fbb,stroke:#333,stroke-width:2px

    %% Connections
    InputSystem -->|captures input| GameManager
    GameManager -->|manages scenes| TitleScene
    GameManager -->|manages scenes| MainGameScene
    GameManager -->|manages scenes| PresetScene
    GameManager -->|manages scenes| ResultScene
    GameManager -->|controls| Player
    GameManager -->|controls| Monster
    GameManager -->|controls| Bullet
    GameManager -->|controls| Weapon
    UIManager --> ImGui
    UIManager -->|renders UI in| TitleScene
    UIManager -->|renders UI in| MainGameScene
    UIManager -->|renders UI in| PresetScene
    UIManager -->|renders UI in| ResultScene
    RenderingEngine --> Shaders
    RenderingEngine --> TextureAssets
    ResourceManager --> AudioAssets
    ResourceManager --> TextureAssets
    ResourceManager --> Shaders
    AudioManager --> AudioAssets
    AudioManager -->|plays sounds for| GameManager
    AudioManager -->|plays sounds for| Player
    AudioManager -->|plays sounds for| Monster
    Bullet -->|uses| Weapon
    InputSystem -->|communicates with| Player
    InputSystem -->|communicates with| Monster
    RenderingEngine -->|uses| GlobalData
    RenderingEngine -->|uses| BufferCache
    InputSystem -->|uses| GlobalData
    InputSystem -->|uses| BufferCache
    GameManager -->|accesses| ResourceManager
    UIManager -->|accesses| ResourceManager

    %% Click Events
    click RenderingEngine "https://github.com/hanaaple/techlab_week01_gamejam_7/blob/main/URenderer.cpp"
    click InputSystem "https://github.com/hanaaple/techlab_week01_gamejam_7/blob/main/InputSystem.cpp"
    click MathUtilities "https://github.com/hanaaple/techlab_week01_gamejam_7/tree/main/Math/"
    click Player "https://github.com/hanaaple/techlab_week01_gamejam_7/blob/main/GameObject/Player.cpp"
    click Monster "https://github.com/hanaaple/techlab_week01_gamejam_7/blob/main/GameObject/Monster.cpp"
    click Bullet "https://github.com/hanaaple/techlab_week01_gamejam_7/tree/main/GameObject/Bullet/"
    click Weapon "https://github.com/hanaaple/techlab_week01_gamejam_7/tree/main/Weapon/"
    click AudioManager "https://github.com/hanaaple/techlab_week01_gamejam_7/blob/main/Manager/AudioManager.cpp"
    click GameManager "https://github.com/hanaaple/techlab_week01_gamejam_7/blob/main/Manager/GameManager.cpp"
    click UIManager "https://github.com/hanaaple/techlab_week01_gamejam_7/blob/main/Manager/UIManager.cpp"
    click ResourceManager "https://github.com/hanaaple/techlab_week01_gamejam_7/blob/main/Manager/ResourceManager.cpp"
    click TitleScene "https://github.com/hanaaple/techlab_week01_gamejam_7/tree/main/Scene/"
    click MainGameScene "https://github.com/hanaaple/techlab_week01_gamejam_7/tree/main/Scene/"
    click PresetScene "https://github.com/hanaaple/techlab_week01_gamejam_7/tree/main/Scene/"
    click ResultScene "https://github.com/hanaaple/techlab_week01_gamejam_7/tree/main/Scene/"
    click AudioAssets "https://github.com/hanaaple/techlab_week01_gamejam_7/tree/main/Assets/Audio/"
    click TextureAssets "https://github.com/hanaaple/techlab_week01_gamejam_7/tree/main/Assets/Texture/"
    click ImGui "https://github.com/hanaaple/techlab_week01_gamejam_7/tree/main/ImGui/"
    click Shaders "https://github.com/hanaaple/techlab_week01_gamejam_7/tree/main/Shaders/"
    click GlobalData "https://github.com/hanaaple/techlab_week01_gamejam_7/blob/main/GlobalData.cpp"
    click BufferCache "https://github.com/hanaaple/techlab_week01_gamejam_7/blob/main/BufferCache.cpp"
    %% Styles
    class RenderingEngine core
    class InputSystem core
    class MathUtilities core
    class AudioManager manager
    class GameManager manager
    class UIManager manager
    class ResourceManager manager
    class Player gameobject
    class Monster gameobject
    class Bullet gameobject
    class Weapon gameobject
    class TitleScene scenes
    class MainGameScene scenes
    class PresetScene scenes
    class ResultScene scenes
    class AudioAssets assets
    class TextureAssets assets
    class ImGui external
    class Shaders external
    class GlobalData globaldata
    class BufferCache globaldata
```
