# anegostudios/vsmodexamples architecture

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

- Interactive diagram: https://gitdiagram.com/anegostudios/vsmodexamples
- Repository: https://github.com/anegostudios/vsmodexamples

## Overview

##### Main Components
a. Code Mods Framework
- Use a large container to represent the .NET 7 development environment
- Build system components (CakeBuild)
- Mod loading and integration points with the game

b. JSON Mods Framework
- Separate container for pure JSON-based modifications
- Asset management structure

##### Key Architectural Elements

**[Vintage Story Game Engine]**
- ↑

**[Mod Loading System]**
- ↙           ↘
**[Code Mods]    [JSON Mods]**

- Build System (CakeBuild)
- Mod Components:
- ModSystem Classes
- Assets
- Configuration

- Common Patterns:
- Block Modifications
- Item Systems
- UI Overlays
- Entity Behaviors

- Blue: Core game integration points
- Green: Code-based mod components
- Yellow: Asset-based components
- Orange: Build and deployment systems

##### Important Details

a. Mod Structure Pattern:
- Standard layout each mod follows:
- ModSystem class
- Assets folder
- Configuration files
- Build scripts

b. Integration Points:
- Where mods hook into the game
- Asset loading paths
- Configuration loading points

##### Implementation Patterns
- Common patterns found across mods:
- Block modifications (CustomShapeBlock, MovingBlocks)
- UI overlays (HudOverlaySample)
- Network interactions (NetworkApiTest)
- Entity behaviors (Figure mod)

##### Development Flow
- Source code → Build → Game integration
- Asset creation → Direct game loading

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph GameEngine["Vintage Story Game Engine"]
        ModLoader["Mod Loading System"]
    end

    subgraph Development["Development Environment (.NET 7)"]
        BuildSystem["Build System (CakeBuild)"]:::build
        click BuildSystem "https://github.com/anegostudios/vsmodexamples/blob/master/code_mods/*/CakeBuild/CakeBuild.csproj"
    end

    subgraph CodeMods["Code-Based Mods"]
        ModSystems["ModSystem Classes"]:::code
        
        subgraph Components["Mod Components"]
            BlockMods["Block Modifications"]:::code
            click BlockMods "https://github.com/anegostudios/vsmodexamples/blob/master/code_mods/MovingBlocks/MovingBlocks/MovingBlocksModSystem.cs"
            
            UISystem["UI Overlays"]:::code
            click UISystem "https://github.com/anegostudios/vsmodexamples/blob/master/code_mods/HudOverlaySample/HudOverlaySample/HudOverlaySampleModSystem.cs"
            
            NetworkAPI["Network API"]:::code
            click NetworkAPI "https://github.com/anegostudios/vsmodexamples/blob/master/code_mods/NetworkApiTest/NetworkApiTest/NetworkApiTestModSystem.cs"
            
            CustomShapes["Custom Shape System"]:::code
            click CustomShapes "https://github.com/anegostudios/vsmodexamples/blob/master/code_mods/CustomShapeBlock/CustomShapeBlock/CustomShapeBlockModSystem.cs"
            
            ItemSystem["Item System"]:::code
            click ItemSystem "https://github.com/anegostudios/vsmodexamples/blob/master/code_mods/MagicWand/MagicWand/ItemMagicWand.cs"
            
            HUDRenderer["HUD Renderer"]:::code
            click HUDRenderer "https://github.com/anegostudios/vsmodexamples/blob/master/code_mods/HudOverlaySample/HudOverlaySample/WeirdProgressBarRenderer.cs"
            
            BlockEntity["Block Entity System"]:::code
            click BlockEntity "https://github.com/anegostudios/vsmodexamples/blob/master/code_mods/Ticking/Ticking/TickingBlockEntity.cs"
            
            CommandSys["Command System"]:::code
            click CommandSys "https://github.com/anegostudios/vsmodexamples/blob/master/code_mods/MyFirstCommand/MyFirstCommand/MyFirstCommandModSystem.cs"
        end

        AssetMgmt["Asset Management"]:::asset
        click AssetMgmt "https://github.com/anegostudios/vsmodexamples/tree/master/code_mods/*/*/assets/"
    end

    subgraph JSONMods["JSON-Based Mods"]
        click JSONMods "https://github.com/anegostudios/vsmodexamples/tree/master/json_mods/*"
        
        EntityBehavior["Entity Behaviors"]:::json
        click EntityBehavior "https://github.com/anegostudios/vsmodexamples/blob/master/json_mods/Figure/assets/figure/entities/land/littlefigure.json"
        
        AssetLoading["Asset Loading"]:::json
    end

    %% Relationships
    GameEngine --> ModLoader
    ModLoader --> CodeMods
    ModLoader --> JSONMods
    Development --> CodeMods
    BuildSystem --> ModLoader
    ModSystems --> Components
    Components --> AssetMgmt
    JSONMods --> AssetLoading

    %% Styles
    classDef code fill:#90EE90,stroke:#333,stroke-width:2px
    classDef json fill:#FFE4B5,stroke:#333,stroke-width:2px
    classDef asset fill:#ADD8E6,stroke:#333,stroke-width:2px
    classDef build fill:#FFA07A,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        CodeComp["Code Component"]:::code
        JsonComp["JSON Component"]:::json
        AssetComp["Asset Component"]:::asset
        BuildComp["Build Component"]:::build
    end
```
