# khanmaytok/plagueis architecture

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

- Interactive diagram: https://gitdiagram.com/khanmaytok/plagueis
- Repository: https://github.com/khanmaytok/plagueis

## Overview

##### Main Components
- Mod Descriptor & Workspace:
- Descriptor File: The descriptor.mod file serves as the entry point that informs the game of this mod’s content.
- Workspace File: The acs_plagueis.code-workspace file indicates a development configuration for editors like Visual Studio Code.
- Configuration Files (Common):
- “common” Directory: Contains various subdirectories like character_interactions, court_positions, landed_titles, men_at_arms_types, messages, modifiers, on_action, scripted_character_templates, scripted_effects, and traits. These files are critical for defining game rules, scripted interactions, and gameplay modifiers.
- Event Scripts:
- “events” Directory: Holds event definition scripts (like acs_game_start.txt and acs_periodic_events.txt) that control in-game event flows.
- Graphical Assets:
- History and Localization:
- “history” Directory: Includes files that add depth to the lore (characters and titles).
- “localization” Directory: Offers language-specific files (English, French, German, etc.) to localize mod content.
- Additional Scripts/Configuration:
- Individual files like buffer.lua and other markdowns (e.g., MOD_REFERENCES.md) may provide additional logic or documentation reference.

##### Relationships and Interactions
- Core Game Rule Configurations:
- The “common” directory files collectively provide the rules, templates, and behavior modifications. They influence how events are triggered, interactions resolved, and the overall gameplay experience.
- Event Handling:
- The “events” files interact with the game engine by listening for or triggering specific actions. They likely reference or are triggered by the scripts in the “common” directory.
- Graphical Representation:
- Localization & History:
- The “history” files provide context and narrative background, often referenced in both game events and user interface elements.

##### Architectural Patterns and Design Principles
- Separation of Concerns: There is a clear separation between configuration (common rules), event handling (events), visual assets (gfx), and narrative (history/localization).
- Dependency Injection through Configuration: The mod relies on configuration-based extensions where changes to files in the “common” or “events” directories drive and modify game behavior without code recompilation.
- Modularity: Each subdirectory handles a discrete set of functions (e.g., character interactions, court positions, or modifiers), which highlights modular design.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A("Descriptor.mod"):::modDescriptor
    B("Workspace Config"):::modDescriptor
    C("Common – Game Rules"):::configuration
    D("Events – In-Game Triggers"):::events
    E("GFX – Visual Assets"):::gfx
    F("History – Lore Files"):::narrative
    G("Localization – Language Support"):::narrative
    H("Buffer Script"):::documentation
    I("Documentation"):::documentation

    A -->|"informs"| C
    A -->|"triggers"| D
    A -->|"references"| H
    A -->|"references"| I
    C -->|"calls"| E
    C -->|"feeds"| F
    C -->|"feeds"| G
    D -->|"updates"| F
    D -->|"updates"| G

    click A "https://github.com/khanmaytok/plagueis/blob/master/descriptor.mod"
    click B "https://github.com/khanmaytok/plagueis/blob/master/acs_plagueis.code-workspace"
    click C "https://github.com/khanmaytok/plagueis/tree/master/common/"
    click D "https://github.com/khanmaytok/plagueis/tree/master/events/"
    click E "https://github.com/khanmaytok/plagueis/tree/master/gfx/"
    click F "https://github.com/khanmaytok/plagueis/tree/master/history/"
    click G "https://github.com/khanmaytok/plagueis/tree/master/localization/"
    click H "https://github.com/khanmaytok/plagueis/blob/master/buffer.lua"
    click I "https://github.com/khanmaytok/plagueis/blob/master/MOD_REFERENCES.md"

    classDef modDescriptor fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef configuration fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef events fill:#FFA07A,stroke:#000,stroke-width:2px;
    classDef gfx fill:#DDA0DD,stroke:#000,stroke-width:2px;
    classDef narrative fill:#FFFF99,stroke:#000,stroke-width:2px;
    classDef documentation fill:#D3D3D3,stroke:#000,stroke-width:2px;
```
