# legend-of-dragoon-modding/severed-chains architecture

> Architecture diagram of the GitHub repository legend-of-dragoon-modding/severed-chains, 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/legend-of-dragoon-modding/severed-chains
- Repository: https://github.com/legend-of-dragoon-modding/severed-chains

## Overview

##### Relationships and Interactions
- A high-level flow from Initialization to Runtime Loop:
– Input events (from platform/input) flowing into the Game Engine.
– Calls to the Graphics (RenderEngine, Gpu, ShaderManager) and Audio subsystems for output.
- Integration point of the Modding API:
– This component intercepts or augments game events using its own event bus (modding events, configuration updates).
- Dependency on external tools:
– Note Gradle (build.gradle and gradlew) orchestrates builds and dependency management.

##### Architectural Patterns & Principles
- Layered/Modular Structure – The system splits between low-level subsystems (graphics, audio, input) and high-level game logic.
- Event-Driven Design – The game and modding API use events extensively (as seen by the presence of many “Event” classes in modding and debugger packages).

##### Relevant Technologies & Frameworks
- Java (Java 21 is required) is the basic language.
- Gradle for build automation.
- Modding API and reflection/event dispatching mechanisms enabling dynamic behavior.
- Supporting libraries such as LWJGL for low-level system and possibly log4j2 for logging (log4j2.xml is present).

##### Final Steps
- Gradually decompose the system into its layers (initialization, engine core, subsystems, modding API).
- Be as detailed as possible; include even the modules you think are “auxiliary” (debugger, UI screens, etc.) since capturing them can help mod developers and maintainers understand integration points.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Initialization"
        A1("Asset Unpacker"):::init
        A2("Asset Directories"):::init
    end

    subgraph "Engine Bootstrapping"
        B1("Game Engine Core"):::core
    end

    subgraph "Main Game Loop"
        subgraph "Input/Platform Layer"
            C1("Platform"):::subsystem
            C2("Platform Input"):::subsystem
        end
        subgraph "Game Domain"
            D1("Game & Domain Logic"):::subsystem
        end
        subgraph "Graphics & Rendering"
            E1("GPU Module"):::subsystem
            E2("OpenGL Module"):::subsystem
        end
        subgraph "Audio"
            F1("Audio Subsystem"):::subsystem
        end
        subgraph "Modding & Events"
            G1("Modding API"):::subsystem
        end
    end

    subgraph "Build & Infrastructure"
        H1("Gradle Build"):::infra
        H2("CI/CD Workflows"):::infra
    end

    %% Data Flow and Interactions
    A1 --> B1
    A2 --> B1
    C1 --> B1
    C2 --> B1
    B1 --> D1
    B1 --> E1
    B1 --> E2
    B1 --> F1
    B1 <--> G1
    D1 --> G1

    H1 --> B1
    H2 --> H1

    %% Click Events
    click A1 "https://github.com/legend-of-dragoon-modding/severed-chains/tree/main/src/main/java/legend/game/unpacker"
    click A2 "https://github.com/legend-of-dragoon-modding/severed-chains/tree/main/isos"
    click B1 "https://github.com/legend-of-dragoon-modding/severed-chains/tree/main/src/main/java/legend/core"
    click C1 "https://github.com/legend-of-dragoon-modding/severed-chains/tree/main/src/main/java/legend/core/platform"
    click C2 "https://github.com/legend-of-dragoon-modding/severed-chains/tree/main/src/main/java/legend/core/platform/input"
    click D1 "https://github.com/legend-of-dragoon-modding/severed-chains/tree/main/src/main/java/legend/game"
    click E1 "https://github.com/legend-of-dragoon-modding/severed-chains/tree/main/src/main/java/legend/core/gpu"
    click E2 "https://github.com/legend-of-dragoon-modding/severed-chains/tree/main/src/main/java/legend/core/opengl"
    click F1 "https://github.com/legend-of-dragoon-modding/severed-chains/tree/main/src/main/java/legend/core/audio"
    click G1 "https://github.com/legend-of-dragoon-modding/severed-chains/tree/main/src/main/java/legend/game/modding"
    click H1 "https://github.com/legend-of-dragoon-modding/severed-chains/blob/main/build.gradle"
    click H2 "https://github.com/legend-of-dragoon-modding/severed-chains/tree/main/.github/workflows"

    %% Styles
    classDef init fill:#ccffcc,stroke:#333,stroke-width:2px;
    classDef core fill:#ffcc00,stroke:#333,stroke-width:2px;
    classDef subsystem fill:#99ccff,stroke:#333,stroke-width:2px;
    classDef infra fill:#ff9999,stroke:#333,stroke-width:2px;
```
