# erkkon/openaimtrainer architecture

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

- Interactive diagram: https://gitdiagram.com/erkkon/openaimtrainer
- Repository: https://github.com/erkkon/openaimtrainer

## Overview

##### Project type and purpose
- Open Aim Trainer is a single-player desktop game built with the Godot Engine. It’s not a client-server web app but a self-contained interactive application (2D & 3D).

##### File structure
- Top-level files:
- project.godot (Godot project descriptor)
- README.md, LICENSE, .gitignore
- Directories:
- assets/ (fonts, images, themes, text translations)
- scenes/ (node trees for ui, characters, levels)
- scripts/ (GDScript modules for ui, character logic, level logic, global state, data manager)
- web/ (index.html – a minimal launcher page or documentation stub)
- other/ (tools, spreadsheets, build artifacts – not part of runtime)

##### README for additional insights
- Confirms Godot engine usage, project modules (assets, scenes, scripts).
- Features and modes (static vs. moving targets) map onto scene files (Target.tscn, World.tscn) and corresponding scripts.
- Basic structure section in README mirrors the file tree.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Engine Layer
    subgraph "Godot Engine" 
        direction TB
        GE["Engine Core"]:::engine
        Input["Input Subsystem"]:::engine
        Physics["Physics Subsystem"]:::engine
        Rendering["Rendering Subsystem"]:::engine
        Audio["Audio Subsystem"]:::engine
        GE --> Input
        GE --> Physics
        GE --> Rendering
        GE --> Audio
        GE --> SceneMgr["Scene Manager"]:::engine
    end

    %% Project Descriptor
    GP["project.godot"]:::engine
    click GP "https://github.com/erkkon/openaimtrainer/blob/main/project.godot"
    GP --> GE

    %% Scenes and Scripts
    subgraph "Scenes & Graph" 
        direction TB
        SG["Scene Graph"]:::engine
        SceneMgr --> SG
        SG --> Assets["Assets & Resources"]:::asset
        click Assets "https://github.com/erkkon/openaimtrainer/tree/main/assets/"
    end

    %% UI Layer
    subgraph "UI Scenes" 
        direction TB
        UIMain["MainScreen.tscn"]:::scenes
        UIOpt["Options.tscn"]:::scenes
        UIMain --> MainScript["MainScreen.gd"]:::script
        UIOpt --> OptScript["Options.gd"]:::script
        CrossScript["Crosshair.gd"]:::script
        BulletScript["Bullet.gd"]:::script
        SG --> UIMain
        SG --> UIOpt
        SG --> CrossScript
        SG --> BulletScript
    end
    click UIMain "https://github.com/erkkon/openaimtrainer/blob/main/scenes/ui/MainScreen.tscn"
    click MainScript "https://github.com/erkkon/openaimtrainer/blob/main/scripts/ui/MainScreen.gd"
    click UIOpt "https://github.com/erkkon/openaimtrainer/blob/main/scenes/ui/Options.tscn"
    click OptScript "https://github.com/erkkon/openaimtrainer/blob/main/scripts/ui/Options.gd"
    click CrossScript "https://github.com/erkkon/openaimtrainer/blob/main/scripts/ui/Crosshair.gd"
    click BulletScript "https://github.com/erkkon/openaimtrainer/blob/main/scripts/ui/Bullet.gd"

    %% Gameplay Layer
    subgraph "Level Scenes" 
        direction TB
        WorldScene["World.tscn"]:::scenes
        WorldShader["World.gdshader"]:::asset
        WorldScene --> LevelScript["World.gd"]:::script
        WorldScene --> WorldShader
        PauseScript["Pause.gd"]:::script
        SG --> WorldScene
        SG --> PauseScript
    end
    click WorldScene "https://github.com/erkkon/openaimtrainer/blob/main/scenes/levels/World.tscn"
    click WorldShader "https://github.com/erkkon/openaimtrainer/blob/main/scenes/levels/World.gdshader"
    click LevelScript "https://github.com/erkkon/openaimtrainer/blob/main/scripts/levels/World.gd"
    click PauseScript "https://github.com/erkkon/openaimtrainer/blob/main/scripts/levels/Pause.gd"

    subgraph "Character Scenes"
        direction TB
        TargetScene["target.tscn"]:::scenes
        TargetScene --> TargetLogic["target.gd"]:::script
        CharBody["CharacterBody3D"]:::scenes
        CharBody --> CharLogic["CharacterBody3D.gd"]:::script
        SG --> TargetScene
        SG --> CharBody
    end
    click TargetScene "https://github.com/erkkon/openaimtrainer/blob/main/scenes/characters/target.tscn"
    click TargetLogic "https://github.com/erkkon/openaimtrainer/blob/main/scripts/characters/target.gd"
    click CharLogic "https://github.com/erkkon/openaimtrainer/blob/main/scripts/characters/CharacterBody3D.gd"

    %% Data Layer
    subgraph "Data & Global"
        direction TB
        Global["global.gd"]:::script
        DataMgr["data_manager.gd"]:::script
        SG --> Global
        SG --> DataMgr
        Assets --> FontRes["100_outline.tres"]:::asset
        Assets --> ImgRes["3d_F1FE.tmp"]:::asset
        Assets --> ThemeRes["theme.tres"]:::asset
        Assets --> HoverRes["hover.tres"]:::asset
        Assets --> NormalRes["normal.tres"]:::asset
        Assets --> TransRes["translations.csv"]:::asset
        DataMgr --> TransRes
        DataMgr --> ThemeRes
    end
    click Global "https://github.com/erkkon/openaimtrainer/blob/main/scripts/global.gd"
    click DataMgr "https://github.com/erkkon/openaimtrainer/blob/main/scripts/data_manager.gd"
    click FontRes "https://github.com/erkkon/openaimtrainer/blob/main/assets/fonts/100_outline.tres"
    click ImgRes "https://github.com/erkkon/openaimtrainer/blob/main/assets/images/games/3d_F1FE.tmp"
    click ThemeRes "https://github.com/erkkon/openaimtrainer/blob/main/assets/themes/theme.tres"
    click HoverRes "https://github.com/erkkon/openaimtrainer/blob/main/assets/themes/hover.tres"
    click NormalRes "https://github.com/erkkon/openaimtrainer/blob/main/assets/themes/normal.tres"
    click TransRes "https://github.com/erkkon/openaimtrainer/blob/main/assets/text/translations.csv"

    %% Interactions
    Input --> MainScript
    Input --> OptScript
    Input --> TargetLogic
    Physics <--> CharBody
    Physics <--> TargetScene

    %% Packaging
    Web["Web Launcher"]:::external
    click Web "https://github.com/erkkon/openaimtrainer/blob/main/web/index.html"
    Web --> GE

    %% Styles
    classDef engine fill:#ADD8E6,stroke:#000
    classDef scenes fill:#90EE90,stroke:#000
    classDef script fill:#FFFF99,stroke:#000
    classDef asset fill:#FFA500,stroke:#000
    classDef external fill:#D3D3D3,stroke:#000
```
