# hugolgs-dev/ptcg-live-files architecture

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

- Interactive diagram: https://gitdiagram.com/hugolgs-dev/ptcg-live-files
- Repository: https://github.com/hugolgs-dev/ptcg-live-files

## Overview

##### Project Type and Purpose
- Project Type: A Unity game application (Pokemon TCG Live) combined with an updater component.
- Purpose: Investigation and exploration of how a Unity game is structured (its executable, game data, runtime libraries like MonoBleedingEdge, and updater files). Although the README is minimal, the file tree shows clear indicators (e.g., “Pokemon TCG Live.exe”, “UnityCrashHandler64.exe”, “Pokemon TCG Live_Data”) that this is a game distribution rather than a typical full-stack application.

##### File Structure
- Main executable and assets:
– “Pokemon TCG Live.exe” is the primary game executable.
– “Pokemon TCG Live_Data” holds Unity assets (resources, levels, shared assets) and compiled assemblies (Managed, Plugins directories). Note the “VuplexWebViewChromium” plugin integrated into the plugins, which adds an external component (a native web view) to the game.
- Mono Runtime and Configurations:
– The “MonoBleedingEdge” folder (and its subdirectories under “Updater” as well) contains runtime libraries, configuration files (machine.config, web.config, etc.), and browser compatibility settings. This shows that the game, being Unity-based, uses the Mono runtime to execute managed .NET code.
- Updater Component:
– The “Updater” directory suggests there’s a separate update mechanism, likely a process or a module that handles patching or updating the game. This updater mirrors much of the structure found in the game directory (it also contains its own MonoBleedingEdge and updater binaries like “Updater.exe”).
- Crash Handling:
– “UnityCrashHandler64.exe” signifies the inclusion of Unity’s default crash handling mechanism.

##### Main Components
a. Game Executable & Engine:
– Label “Pokemon TCG Live.exe” as the entry point.
– Connect it to the “Game Engine (Unity)” component.
– Indicate that Unity uses the Mono runtime (from MonoBleedingEdge) to run the game’s managed code.
b. Mono Runtime:
– Add a separate block representing the Mono runtime environment, including subcomponents/configuration files (machine.config, settings.map, etc.).
– Show that this runtime is embedded both in the main game and the updater.
c. Assets and Resource Management:
– Represent “Pokemon TCG Live_Data” as a dedicated storage of assets/resources.
– Inside this block, list subcomponents such as “Managed”, “Plugins” (highlight integration of VuplexWebViewChromium), “Resources”, and multi-level shared assets.
d. Updater Component:
– Include its own bundled Mono runtime (embedded MonoBleedingEdge) and its assets/data.
– Indicate that this updater interacts with the main game process (for instance, triggering updates or patching resources).
e. Crash Handling:
– Include a block for “UnityCrashHandler64.exe” to represent error handling within the engine.

##### Relationships and Interactions
- The Crash Handler block should link to the Game Engine, indicating that it intercepts and handles errors during runtime.

##### Architectural Patterns and Design Principles
- Modular separation:
– The clear separation between executable/engine logic and the updater.
– The integration of a runtime engine (Unity with Mono), a plug-in system (Vuplex WebView), and asset/resource management.
- That, while this isn’t a traditional “full-stack” web or enterprise architecture, it follows a layered design where the runtime, game logic, asset management, and update process are clearly demarcated.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A("Pokemon TCG Live.exe"):::engine
    B("Unity Engine"):::engine
    C("Mono Runtime (Main Game)"):::runtime

    subgraph "Assets & Resources"
        D("Pokemon TCG Live_Data"):::asset
        D1("Plugins (VuplexWebViewChromium)"):::asset
    end

    E("Updater Component (Updater.exe)"):::updater
    F("Mono Runtime (Updater)"):::runtime
    G("Crash Handler (UnityCrashHandler64.exe)"):::crash

    A -->|"initializes"| B
    B -->|"uses"| C
    B -->|"loads-assets"| D
    D -->|"contains"| D1
    E <-->|"updates"| A
    E -->|"uses"| F
    E -->|"loads-assets"| D
    G -->|"handles"| B

    click A "https://github.com/hugolgs-dev/ptcg-live-files/blob/master/Pokemon TCG Live.exe"
    click D "https://github.com/hugolgs-dev/ptcg-live-files/tree/master/Pokemon TCG Live_Data"
    click C "https://github.com/hugolgs-dev/ptcg-live-files/tree/master/MonoBleedingEdge"
    click E "https://github.com/hugolgs-dev/ptcg-live-files/blob/master/Updater/1.4.1/Updater.exe"
    click G "https://github.com/hugolgs-dev/ptcg-live-files/blob/master/UnityCrashHandler64.exe"
    click D1 "https://github.com/hugolgs-dev/ptcg-live-files/tree/master/Pokemon TCG Live_Data/Plugins/x86_64/VuplexWebViewChromium"

    classDef engine fill:#FFCC00,stroke:#333,stroke-width:2px;
    classDef runtime fill:#66CCFF,stroke:#333,stroke-width:2px;
    classDef updater fill:#FF6666,stroke:#333,stroke-width:2px;
    classDef asset fill:#99FF99,stroke:#333,stroke-width:2px;
    classDef crash fill:#FF99CC,stroke:#333,stroke-width:2px;
```
