# vnnc1/mk8-online architecture

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

- Interactive diagram: https://gitdiagram.com/vnnc1/mk8-online
- Repository: https://github.com/vnnc1/mk8-online

## Overview

MK8-online combines a Windows launcher and preparation pipeline with a locally compiled native game runtime and developing multiplayer rooms. The principal workflow is user setup and game-file selection, import/runtime preparation, AArch64 translation and Windows build, then game launch. The graph also preserves updates, diagnostics, language, online-room capabilities, and major graphics-toolchain components. Some subsystems are represented at their documented directory level because their implementation files were not sampled; edges reflect README statements or shown calls, not inferred module relationships.

Main entry points: [`toolchain/host.py`](https://github.com/vnnc1/mk8-online/blob/master/toolchain/host.py) (Runtime Build), [`apps/launcher/src/server.rs`](https://github.com/vnnc1/mk8-online/blob/master/apps/launcher/src/server.rs) (Local API), [`crates/session/src/lib.rs`](https://github.com/vnnc1/mk8-online/blob/master/crates/session/src/lib.rs) (Room Gateway), [`apps/launcher/src/game_session.rs`](https://github.com/vnnc1/mk8-online/blob/master/apps/launcher/src/game_session.rs) (Game Lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launcher["Launcher and Setup"]
  node_launcher["Launcher UI<br/>[main.rs]"]
  node_api["Local API<br/>[server.rs]"]
  node_setup["Setup Installer<br/>[installer.rs]"]
  node_language["Language Settings<br/>[language.rs]"]
  node_updates["Update Manager<br/>[update.rs]"]
  node_reports["Diagnostic Reports<br/>[report.rs]"]
  node_game_lifecycle["Game Lifecycle<br/>[game_session.rs]"]
end

subgraph group_pipeline["Preparation and Build"]
  node_build_manager["Build Supervisor<br/>[supervisor.rs]"]
  node_source_import["Game Preparation<br/>[prepare.py]"]
  node_translation["AArch64 Translation<br/>[generate.py]"]
  node_runtime_build["Runtime Build<br/>[host.py]"]
end

subgraph group_runtime["Game Runtime"]
  node_game_runtime["Native Game Runtime"]
  node_async_submit["Async Submission<br/>[async_submit.py]"]
  node_bc_render["BC Rendering<br/>[bc_render.py]"]
  node_compute_flush["Compute Flush<br/>[compute_flush.py]"]
  node_native_patches["Native Patches<br/>[native.py]"]
  node_occlusion["Occlusion<br/>[occlusion.py]"]
  node_texture_lifetime["Texture Lifetime"]
  node_texture_pool["Texture Pool<br/>[texture_pool.py]"]
  node_vram_trace["VRAM Tracing<br/>[vram_trace.py]"]
end

subgraph group_multiplayer["Multiplayer"]
  node_room_gateway["Room Gateway<br/>[lib.rs]"]
  node_transport["Room Transport<br/>[lib.rs]"]
  node_relay["Internet Relay<br/>[mk8-relay.rs]"]
end

node_player(("Player"))

node_player -->|"uses"| node_launcher
node_launcher -->|"serves UI"| node_api
node_api -->|"starts setup"| node_setup
node_api -->|"manages language"| node_language
node_api -->|"checks updates"| node_updates
node_api -->|"handles reports"| node_reports
node_api -->|"starts builds"| node_build_manager
node_api -->|"manages rooms"| node_room_gateway
node_api -->|"starts game"| node_game_lifecycle
node_game_lifecycle -->|"launches game"| node_setup
node_build_manager -->|"runs preparation"| node_source_import
node_source_import -->|"prepares translation"| node_translation
node_translation -->|"generates C"| node_runtime_build
node_runtime_build -->|"builds runtime"| node_game_runtime
node_game_lifecycle -->|"launches game"| node_game_runtime
node_runtime_build -->|"integrates patches"| node_async_submit
node_runtime_build -->|"integrates patches"| node_bc_render
node_runtime_build -->|"integrates patches"| node_compute_flush
node_runtime_build -->|"integrates patches"| node_native_patches
node_runtime_build -->|"integrates patches"| node_occlusion
node_runtime_build -->|"integrates patches"| node_texture_lifetime
node_runtime_build -->|"integrates patches"| node_texture_pool
node_runtime_build -.->|"integrates patches"| node_vram_trace
node_player -->|"joins rooms"| node_room_gateway
node_room_gateway -->|"uses transport"| node_transport
node_room_gateway -.->|"connects relay"| node_relay

click node_launcher "https://github.com/vnnc1/mk8-online/blob/master/apps/launcher/src/main.rs"
click node_api "https://github.com/vnnc1/mk8-online/blob/master/apps/launcher/src/server.rs"
click node_setup "https://github.com/vnnc1/mk8-online/blob/master/apps/launcher/src/installer.rs"
click node_language "https://github.com/vnnc1/mk8-online/blob/master/apps/launcher/src/language.rs"
click node_updates "https://github.com/vnnc1/mk8-online/blob/master/apps/launcher/src/update.rs"
click node_reports "https://github.com/vnnc1/mk8-online/blob/master/apps/launcher/src/report.rs"
click node_game_lifecycle "https://github.com/vnnc1/mk8-online/blob/master/apps/launcher/src/game_session.rs"
click node_build_manager "https://github.com/vnnc1/mk8-online/blob/master/crates/build-manager/src/supervisor.rs"
click node_source_import "https://github.com/vnnc1/mk8-online/blob/master/runtime/prepare.py"
click node_translation "https://github.com/vnnc1/mk8-online/blob/master/toolchain/recompiler/generate.py"
click node_runtime_build "https://github.com/vnnc1/mk8-online/blob/master/toolchain/host.py"
click node_game_runtime "https://github.com/vnnc1/mk8-online/tree/master/runtime/mk8"
click node_async_submit "https://github.com/vnnc1/mk8-online/blob/master/toolchain/async_submit.py"
click node_bc_render "https://github.com/vnnc1/mk8-online/blob/master/toolchain/bc_render.py"
click node_compute_flush "https://github.com/vnnc1/mk8-online/blob/master/toolchain/compute_flush.py"
click node_native_patches "https://github.com/vnnc1/mk8-online/blob/master/toolchain/native.py"
click node_occlusion "https://github.com/vnnc1/mk8-online/blob/master/toolchain/occlusion.py"
click node_texture_lifetime "https://github.com/vnnc1/mk8-online/blob/master/toolchain/texture_lifetime.py"
click node_texture_pool "https://github.com/vnnc1/mk8-online/blob/master/toolchain/texture_pool.py"
click node_vram_trace "https://github.com/vnnc1/mk8-online/blob/master/toolchain/vram_trace.py"
click node_room_gateway "https://github.com/vnnc1/mk8-online/blob/master/crates/session/src/lib.rs"
click node_transport "https://github.com/vnnc1/mk8-online/blob/master/crates/transport/src/lib.rs"
click node_relay "https://github.com/vnnc1/mk8-online/blob/master/crates/session/src/bin/mk8-relay.rs"

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_api,node_setup,node_language,node_updates,node_reports,node_game_lifecycle toneBlue
class node_build_manager,node_source_import,node_translation,node_runtime_build toneAmber
class node_game_runtime,node_async_submit,node_bc_render,node_compute_flush,node_native_patches,node_occlusion,node_texture_lifetime,node_texture_pool,node_vram_trace toneMint
class node_room_gateway,node_transport,node_relay toneRose
class node_player toneIndigo
```

## Components

### Launcher and Setup

- [Launcher UI](https://github.com/vnnc1/mk8-online/blob/master/apps/launcher/src/main.rs): `apps/launcher/src/main.rs`
- [Local API](https://github.com/vnnc1/mk8-online/blob/master/apps/launcher/src/server.rs): `apps/launcher/src/server.rs`
- [Setup Installer](https://github.com/vnnc1/mk8-online/blob/master/apps/launcher/src/installer.rs): `apps/launcher/src/installer.rs`
- [Language Settings](https://github.com/vnnc1/mk8-online/blob/master/apps/launcher/src/language.rs): `apps/launcher/src/language.rs`
- [Update Manager](https://github.com/vnnc1/mk8-online/blob/master/apps/launcher/src/update.rs): `apps/launcher/src/update.rs`
- [Diagnostic Reports](https://github.com/vnnc1/mk8-online/blob/master/apps/launcher/src/report.rs): `apps/launcher/src/report.rs`
- [Game Lifecycle](https://github.com/vnnc1/mk8-online/blob/master/apps/launcher/src/game_session.rs): `apps/launcher/src/game_session.rs`

### Preparation and Build

- [Build Supervisor](https://github.com/vnnc1/mk8-online/blob/master/crates/build-manager/src/supervisor.rs): `crates/build-manager/src/supervisor.rs`
- [Game Preparation](https://github.com/vnnc1/mk8-online/blob/master/runtime/prepare.py): `runtime/prepare.py`
- [AArch64 Translation](https://github.com/vnnc1/mk8-online/blob/master/toolchain/recompiler/generate.py): `toolchain/recompiler/generate.py`
- [Runtime Build](https://github.com/vnnc1/mk8-online/blob/master/toolchain/host.py): `toolchain/host.py`

### Game Runtime

- [Native Game Runtime](https://github.com/vnnc1/mk8-online/tree/master/runtime/mk8): `runtime/mk8`
- [Async Submission](https://github.com/vnnc1/mk8-online/blob/master/toolchain/async_submit.py): `toolchain/async_submit.py`
- [BC Rendering](https://github.com/vnnc1/mk8-online/blob/master/toolchain/bc_render.py): `toolchain/bc_render.py`
- [Compute Flush](https://github.com/vnnc1/mk8-online/blob/master/toolchain/compute_flush.py): `toolchain/compute_flush.py`
- [Native Patches](https://github.com/vnnc1/mk8-online/blob/master/toolchain/native.py): `toolchain/native.py`
- [Occlusion](https://github.com/vnnc1/mk8-online/blob/master/toolchain/occlusion.py): `toolchain/occlusion.py`
- [Texture Lifetime](https://github.com/vnnc1/mk8-online/blob/master/toolchain/texture_lifetime.py): `toolchain/texture_lifetime.py`
- [Texture Pool](https://github.com/vnnc1/mk8-online/blob/master/toolchain/texture_pool.py): `toolchain/texture_pool.py`
- [VRAM Tracing](https://github.com/vnnc1/mk8-online/blob/master/toolchain/vram_trace.py): `toolchain/vram_trace.py`

### Multiplayer

- [Room Gateway](https://github.com/vnnc1/mk8-online/blob/master/crates/session/src/lib.rs): `crates/session/src/lib.rs`
- [Room Transport](https://github.com/vnnc1/mk8-online/blob/master/crates/transport/src/lib.rs): `crates/transport/src/lib.rs`
- [Internet Relay](https://github.com/vnnc1/mk8-online/blob/master/crates/session/src/bin/mk8-relay.rs): `crates/session/src/bin/mk8-relay.rs`

### Other components

- **Player**

## Connections

- Player → Launcher UI: uses
- Launcher UI → Local API: serves UI (evidence: `apps/launcher/src/main.rs`)
- Local API → Setup Installer: starts setup (evidence: `apps/launcher/src/main.rs`)
- Local API → Language Settings: manages language (evidence: `apps/launcher/src/main.rs`)
- Local API → Update Manager: checks updates (evidence: `apps/launcher/src/main.rs`)
- Local API → Diagnostic Reports: handles reports (evidence: `apps/launcher/src/main.rs`)
- Local API → Build Supervisor: starts builds (evidence: `apps/launcher/src/server.rs`)
- Local API → Room Gateway: manages rooms (evidence: `apps/launcher/src/server.rs`)
- Local API → Game Lifecycle: starts game (evidence: `apps/launcher/src/server.rs`)
- Game Lifecycle → Setup Installer: launches game (evidence: `apps/launcher/src/game_session.rs`)
- Build Supervisor → Game Preparation: runs preparation
- Game Preparation → AArch64 Translation: prepares translation
- AArch64 Translation → Runtime Build: generates C
- Runtime Build → Native Game Runtime: builds runtime
- Game Lifecycle → Native Game Runtime: launches game
- Runtime Build → Async Submission: integrates patches (evidence: `toolchain/host.py`)
- Runtime Build → BC Rendering: integrates patches (evidence: `toolchain/host.py`)
- Runtime Build → Compute Flush: integrates patches (evidence: `toolchain/host.py`)
- Runtime Build → Native Patches: integrates patches (evidence: `toolchain/host.py`)
- Runtime Build → Occlusion: integrates patches (evidence: `toolchain/host.py`)
- Runtime Build → Texture Lifetime: integrates patches (evidence: `toolchain/host.py`)
- Runtime Build → Texture Pool: integrates patches (evidence: `toolchain/host.py`)
- Runtime Build → VRAM Tracing: integrates patches (evidence: `toolchain/host.py`)
- Player → Room Gateway: joins rooms
- Room Gateway → Room Transport: uses transport
- Room Gateway → Internet Relay: connects relay
