# triforcex/jediknightplus architecture

> Architecture diagram of the GitHub repository triforcex/jediknightplus, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/triforcex/jediknightplus
- Repository: https://github.com/triforcex/jediknightplus

## Overview

Key Components to Include:

##### Core Game Engine Layer
- MVSDK (Multiversion SDK) integration
- Version compatibility (1.02, 1.03, 1.04)

##### Main Mod Components (Middle Layer)
- Game Module (code/game)
- Core gameplay mechanics
- Server-side features
- Physics and combat systems
- CGame Module (code/cgame)
- Client-side game logic
- Visual effects and rendering
- UI Module (code/ui)
- Menu systems
- HUD elements
- User interface components

##### JKMod Custom Features (Top Layer)
- Client Plugin System
- Server Management System
- Dimension System
- Custom Features (emotes, teleports, etc.)

**[Client Layer]**

- UI System (jkmod/ui) ──────┐
- Custom Menus          │

- Client Plugin             │    [Asset System]
- Visual Effects        │    ├─ Models
- HUD Enhancements      ├────┤ Textures
- Custom Controls       │    ├─ Sounds
- Configs
**[Game Logic Layer]              │**

- CGame (jkmod/cgame) ──────┤
- Rendering            │
- Client Prediction    │

- Game (jkmod/game)         │
- Server Logic         │
- Physics             │
- Combat System       │

**[Core Engine Layer]             │**

- MVSDK Integration ────────┘
- Version Compatibility

Important Elements to Highlight:

##### Component Labels
- Version numbers
- Critical systems
- Plugin integration points

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        UI["UI System"]
        CustomMenus["Custom Menus"]
        ClientPlugin["Client Plugin System"]
        VFX["Visual Effects"]
        HUD["HUD Enhancements"]
        Controls["Custom Controls"]
    end

    subgraph Assets
        Models["Models & Textures"]
        Sounds["Sound Assets"]
        Configs["Configurations"]
    end

    subgraph GameLogic
        CGame["CGame Module"]
        Rendering["Rendering System"]
        Prediction["Client Prediction"]
        Game["Game Module"]
        ServerLogic["Server Logic"]
        Physics["Physics System"]
        Combat["Combat System"]
        Dimensions["Dimension System"]
        Emotes["Emotes System"]
        SvrMgmt["Server Management"]
    end

    subgraph CoreEngine
        MVSDK["MVSDK Integration"]
        VersionCompat["Version Compatibility"]
    end

    %% Connections
    UI --> CustomMenus
    UI --> CGame
    ClientPlugin --> VFX
    ClientPlugin --> HUD
    ClientPlugin --> Controls
    
    CGame --> Rendering
    CGame --> Prediction
    
    Game --> ServerLogic
    Game --> Physics
    Game --> Combat
    Game --> Dimensions
    Game --> Emotes
    Game --> SvrMgmt
    
    MVSDK --> Game
    MVSDK --> CGame
    MVSDK --> UI
    
    VersionCompat --> MVSDK

    %% Asset Connections
    Models --> VFX
    Models --> Rendering
    Sounds --> Game
    Configs --> ServerLogic

    %% Click Events
    click MVSDK "https://github.com/triforcex/jediknightplus/blob/master/code/api/mvapi.h"
    click Game "https://github.com/triforcex/jediknightplus/tree/master/code/game/"
    click CGame "https://github.com/triforcex/jediknightplus/tree/master/code/cgame/"
    click UI "https://github.com/triforcex/jediknightplus/tree/master/code/ui/"
    click Dimensions "https://github.com/triforcex/jediknightplus/blob/master/jkmod/game/jk_dimensions.c"
    click Emotes "https://github.com/triforcex/jediknightplus/blob/master/jkmod/game/jk_emotes.c"
    click ClientPlugin "https://github.com/triforcex/jediknightplus/blob/master/jkmod/cgame/jk_cg_main.c"
    click SvrMgmt "https://github.com/triforcex/jediknightplus/blob/master/jkmod/game/jk_svcmds.c"
    click CustomMenus "https://github.com/triforcex/jediknightplus/tree/master/assets/client/ui/jk2mp/"
    click Models "https://github.com/triforcex/jediknightplus/tree/master/assets/client/gfx/"
    click Configs "https://github.com/triforcex/jediknightplus/tree/master/assets/server/configs/"
    click VersionCompat "https://github.com/triforcex/jediknightplus/blob/master/code/game/bg_multiversion.c"

    %% Styling
    classDef client fill:#a8d1ff,stroke:#333,stroke-width:2px
    classDef server fill:#90EE90,stroke:#333,stroke-width:2px
    classDef shared fill:#FFE5B4,stroke:#333,stroke-width:2px
    classDef core fill:#E6E6FA,stroke:#333,stroke-width:2px
    classDef assets fill:#FFB6C1,stroke:#333,stroke-width:2px

    class UI,CustomMenus,ClientPlugin,VFX,HUD,Controls client
    class Game,ServerLogic,SvrMgmt server
    class CGame,Rendering,Prediction,Physics,Combat,Dimensions,Emotes shared
    class MVSDK,VersionCompat core
    class Models,Sounds,Configs assets
```
