# ruslanmv/bot-mmorpg-ai architecture

> Architecture diagram of the GitHub repository ruslanmv/bot-mmorpg-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ruslanmv/bot-mmorpg-ai
- Repository: https://github.com/ruslanmv/bot-mmorpg-ai

## Overview

BOT-MMORPG-AI is a desktop-oriented game-learning bot: users record gameplay, train a model, select it in ModelHub, and run autonomous play. The graph covers that workflow plus setup, configuration, controller/input capture, diagnostics, and background jobs. Several relationships are documented rather than directly shown in sampled implementation; those edges cite the README or the relevant caller. Unsampled source is represented only where the README or SOURCE INDEX establishes the capability.

Main entry points: [`launcher/launcher.py`](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/launcher/launcher.py) (Launcher UI), [`modelhub/tauri.py`](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/modelhub/tauri.py) (ModelHub API), [`src/bot_mmorpg/scripts/train_model.py`](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/src/bot_mmorpg/scripts/train_model.py) (Model training), [`src/bot_mmorpg/scripts/collect_data.py`](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/src/bot_mmorpg/scripts/collect_data.py) (Data collector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Desktop experience"]
  node_launcher["Launcher UI<br/>[launcher.py]"]
  node_setup["Setup wizard"]
  node_desktop_shell["Desktop shell<br/>[main.rs]"]
  node_config["Game configuration"]
end

subgraph group_capture["Gameplay capture"]
  node_dataset_store[("Dataset files<br/>[session_manager.py]")]
  node_input_record["Input recorder<br/>[recorded_macro.py]"]
  node_video_record["Video recorder<br/>[recording.py]"]
  node_collector["Data collector<br/>[collect_data.py]"]
end

subgraph group_learning["Model learning"]
  node_trainer["Model training<br/>[train_model.py]"]
  node_curriculum["Curriculum training<br/>[curriculum.py]"]
  node_model_arch["PyTorch models<br/>[models_pytorch.py]"]
end

subgraph group_runtime["Bot runtime"]
  node_bridge["Bot command handlers<br/>[handlers.py]"]
  node_inference["Inference engine<br/>[engine.py]"]
  node_screen["Game screen<br/>[grabscreen.py]"]
end

subgraph group_operations["ModelHub operations"]
  node_sidecar["ModelHub API<br/>[tauri.py]"]
  node_session["Session manager<br/>[session_manager.py]"]
  node_model_registry["Model registry<br/>[registry.py]"]
  node_local_models[("Local model store<br/>[local_store.py]")]
  node_diagnostics["Diagnostics<br/>[routes.py]"]
  node_jobs["Background jobs<br/>[routes.py]"]
  node_job_runner["Job runner<br/>[runner.py]"]
end

node_gamer(("Player"))
node_game(("Game"))

node_gamer -->|"uses"| node_launcher
node_launcher -->|"opens"| node_setup
node_launcher -->|"manages sessions"| node_session
node_gamer -->|"records play"| node_input_record
node_gamer -.->|"records play"| node_video_record
node_input_record -.->|"captures actions"| node_collector
node_video_record -.->|"captures frames"| node_collector
node_collector -->|"saves dataset"| node_dataset_store
node_launcher -->|"starts collection"| node_collector
node_launcher -->|"starts training"| node_trainer
node_dataset_store -->|"provides data"| node_trainer
node_trainer -->|"trains with"| node_curriculum
node_trainer -->|"creates model"| node_model_arch
node_trainer -->|"saves model"| node_local_models
node_launcher -->|"selects model"| node_model_registry
node_launcher -->|"configures game"| node_config
node_gamer -->|"starts bot"| node_bridge
node_bridge -->|"runs inference"| node_inference
node_inference -->|"uses model"| node_model_arch
node_inference -.->|"reads frames"| node_screen
node_screen -.->|"captures display"| node_game
node_bridge -.->|"sends actions"| node_game
node_desktop_shell -->|"calls API"| node_sidecar
node_sidecar -->|"manages sessions"| node_session
node_sidecar -->|"uses registry"| node_model_registry
node_sidecar -->|"scans models"| node_local_models
node_sidecar -->|"mounts routes"| node_diagnostics
node_sidecar -->|"mounts routes"| node_jobs
node_jobs -->|"submits jobs"| node_job_runner

click node_launcher "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/launcher/launcher.py"
click node_setup "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/launcher/wizard/wizard_controller.py"
click node_desktop_shell "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/src-tauri/src/main.rs"
click node_sidecar "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/modelhub/tauri.py"
click node_session "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/modelhub/session_manager.py"
click node_dataset_store "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/modelhub/session_manager.py"
click node_input_record "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/frontend/input_record/recorded_macro.py"
click node_video_record "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/frontend/video_record/recording.py"
click node_collector "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/src/bot_mmorpg/scripts/collect_data.py"
click node_trainer "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/src/bot_mmorpg/scripts/train_model.py"
click node_curriculum "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/src/bot_mmorpg/training/curriculum.py"
click node_model_arch "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/src/bot_mmorpg/scripts/models_pytorch.py"
click node_model_registry "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/modelhub/registry.py"
click node_local_models "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/modelhub/local_store.py"
click node_config "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/src/bot_mmorpg/config/settings_manager.py"
click node_bridge "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/src/bot_mmorpg/bridge/handlers.py"
click node_inference "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/src/bot_mmorpg/inference/engine.py"
click node_screen "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/src/bot_mmorpg/scripts/grabscreen.py"
click node_diagnostics "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/modelhub/diagnostics/routes.py"
click node_jobs "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/modelhub/jobs/routes.py"
click node_job_runner "https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/modelhub/jobs/runner.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_launcher,node_setup,node_desktop_shell,node_config toneBlue
class node_dataset_store,node_input_record,node_video_record,node_collector toneAmber
class node_trainer,node_curriculum,node_model_arch toneMint
class node_bridge,node_inference,node_screen toneRose
class node_sidecar,node_session,node_model_registry,node_local_models,node_diagnostics,node_jobs,node_job_runner,node_gamer,node_game toneIndigo
```

## Components

### Desktop experience

- [Launcher UI](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/launcher/launcher.py): `launcher/launcher.py`
- [Setup wizard](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/launcher/wizard/wizard_controller.py): `launcher/wizard/wizard_controller.py`
- [Desktop shell](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/src-tauri/src/main.rs): `src-tauri/src/main.rs`
- [Game configuration](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/src/bot_mmorpg/config/settings_manager.py): `src/bot_mmorpg/config/settings_manager.py`

### Gameplay capture

- [Dataset files](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/modelhub/session_manager.py): `modelhub/session_manager.py`
- [Input recorder](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/frontend/input_record/recorded_macro.py): `frontend/input_record/recorded_macro.py`
- [Video recorder](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/frontend/video_record/recording.py): `frontend/video_record/recording.py`
- [Data collector](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/src/bot_mmorpg/scripts/collect_data.py): `src/bot_mmorpg/scripts/collect_data.py`

### Model learning

- [Model training](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/src/bot_mmorpg/scripts/train_model.py): `src/bot_mmorpg/scripts/train_model.py`
- [Curriculum training](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/src/bot_mmorpg/training/curriculum.py): `src/bot_mmorpg/training/curriculum.py`
- [PyTorch models](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/src/bot_mmorpg/scripts/models_pytorch.py): `src/bot_mmorpg/scripts/models_pytorch.py`

### Bot runtime

- [Bot command handlers](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/src/bot_mmorpg/bridge/handlers.py): `src/bot_mmorpg/bridge/handlers.py`
- [Inference engine](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/src/bot_mmorpg/inference/engine.py): `src/bot_mmorpg/inference/engine.py`
- [Game screen](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/src/bot_mmorpg/scripts/grabscreen.py): `src/bot_mmorpg/scripts/grabscreen.py`

### ModelHub operations

- [ModelHub API](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/modelhub/tauri.py): `modelhub/tauri.py`
- [Session manager](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/modelhub/session_manager.py): `modelhub/session_manager.py`
- [Model registry](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/modelhub/registry.py): `modelhub/registry.py`
- [Local model store](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/modelhub/local_store.py): `modelhub/local_store.py`
- [Diagnostics](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/modelhub/diagnostics/routes.py): `modelhub/diagnostics/routes.py`
- [Background jobs](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/modelhub/jobs/routes.py): `modelhub/jobs/routes.py`
- [Job runner](https://github.com/ruslanmv/bot-mmorpg-ai/blob/master/modelhub/jobs/runner.py): `modelhub/jobs/runner.py`

### Other components

- **Player**
- **Game**

## Connections

- Player → Launcher UI: uses (evidence: `README.md`)
- Launcher UI → Setup wizard: opens
- Launcher UI → Session manager: manages sessions (evidence: `launcher/launcher.py`)
- Player → Input recorder: records play (evidence: `README.md`)
- Player → Video recorder: records play
- Input recorder → Data collector: captures actions
- Video recorder → Data collector: captures frames
- Data collector → Dataset files: saves dataset (evidence: `README.md`)
- Launcher UI → Data collector: starts collection (evidence: `launcher/launcher.py`)
- Launcher UI → Model training: starts training (evidence: `launcher/launcher.py`)
- Dataset files → Model training: provides data (evidence: `README.md`)
- Model training → Curriculum training: trains with
- Model training → PyTorch models: creates model
- Model training → Local model store: saves model
- Launcher UI → Model registry: selects model (evidence: `launcher/launcher.py`)
- Launcher UI → Game configuration: configures game
- Player → Bot command handlers: starts bot (evidence: `README.md`)
- Bot command handlers → Inference engine: runs inference (evidence: `src/bot_mmorpg/bridge/handlers.py`)
- Inference engine → PyTorch models: uses model (evidence: `src/bot_mmorpg/inference/engine.py`)
- Inference engine → Game screen: reads frames
- Game screen → Game: captures display
- Bot command handlers → Game: sends actions
- Desktop shell → ModelHub API: calls API (evidence: `modelhub/tauri.py`)
- ModelHub API → Session manager: manages sessions (evidence: `modelhub/tauri.py`)
- ModelHub API → Model registry: uses registry (evidence: `modelhub/tauri.py`)
- ModelHub API → Local model store: scans models (evidence: `modelhub/tauri.py`)
- ModelHub API → Diagnostics: mounts routes (evidence: `modelhub/tauri.py`)
- ModelHub API → Background jobs: mounts routes (evidence: `modelhub/tauri.py`)
- Background jobs → Job runner: submits jobs (evidence: `modelhub/jobs/routes.py`)
