# nyx2sw/xc2recomp architecture

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

- Interactive diagram: https://gitdiagram.com/nyx2sw/xc2recomp
- Repository: https://github.com/nyx2sw/xc2recomp

## Overview

XC2Recomp is a Windows launcher and runtime for Xenoblade Chronicles 2: Switch 2 Edition. The main workflow is selecting a user-provided NUP dump, preparing the base game and included add-ons, then launching the installed game. The launcher also manages graphics and shader preparation, updates, saves, resource packs, Steam shortcuts, and play presence. The graph follows evidenced launcher wiring; several runtime and optional integration links are left unverified because their callers were not shown.

Main entry points: [`launcher/App/Backend.cs`](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/App/Backend.cs) (Command backend), [`launcher/App/Program.cs`](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/App/Program.cs) (Launcher startup), [`launcher/Core/SetupPipeline.cs`](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/SetupPipeline.cs) (Setup pipeline), [`launcher/Core/GameRunner.cs`](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/GameRunner.cs) (Game runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launcher["Launcher experience"]
  node_program["Launcher startup<br/>[Program.cs]"]
  node_webhost["WebView host<br/>[WinHost.cs]"]
  node_content["UI content<br/>[Content.cs]"]
  node_webui["Launcher UI<br/>[app.js]"]
  node_backend["Command backend<br/>[Backend.cs]"]
  node_config["Launcher config<br/>[LauncherConfig.cs]"]
end

subgraph group_setup["Game setup"]
  node_pipeline["Setup pipeline<br/>[SetupPipeline.cs]"]
  node_nup["NUP archive<br/>[NupArchive.cs]"]
  node_install["Install inspection<br/>[GameInstall.cs]"]
end

subgraph group_management["Install management"]
  node_dlss["DLSS download<br/>[DlssDownloader.cs]"]
  node_updater["Launcher updater<br/>[LauncherUpdater.cs]"]
  node_saves["Save management<br/>[SaveManager.cs]"]
  node_saveparse["Save parser<br/>[SaveParser.cs]"]
  node_mods["Resource packs<br/>[ModManager.cs]"]
  node_steam["Steam integration"]
  node_audio["Game audio<br/>[GameAudio.cs]"]
  node_artwork["Game artwork<br/>[GameArtwork.cs]"]
end

subgraph group_runtime["Game runtime"]
  node_runner["Game runner<br/>[GameRunner.cs]"]
  node_ini["Game settings<br/>[IniSettings.cs]"]
  node_nativeui["In-game PC menu<br/>[native_menu.c]"]
  node_presence["Play presence<br/>[presence.c]"]
  node_shader["Shader catalog"]
end

node_player(("Player"))
node_userdump[("User game dump")]
node_game["Installed game"]

node_player -->|"opens"| node_program
node_program -->|"creates"| node_webhost
node_program -->|"creates"| node_content
node_program -->|"creates"| node_backend
node_program -->|"checks startup"| node_updater
node_webhost -->|"serves"| node_content
node_player -.->|"configures"| node_webui
node_backend -->|"loads settings"| node_config
node_backend -->|"inspects install"| node_install
node_backend -->|"builds launch plan"| node_runner
node_backend -->|"manages saves"| node_saves
node_backend -->|"manages packs"| node_mods
node_backend -->|"discovers accounts"| node_steam
node_backend -->|"starts download"| node_dlss
node_backend -->|"prepares shaders"| node_shader
node_backend -->|"loads tracks"| node_audio
node_backend -->|"loads artwork"| node_artwork
node_player -->|"provides dump"| node_userdump
node_userdump -->|"sets up game"| node_pipeline
node_pipeline -->|"extracts packages"| node_nup
node_pipeline -->|"prepares install"| node_install
node_pipeline -->|"produces install"| node_game
node_backend -.->|"starts setup"| node_pipeline
node_runner -->|"reads settings"| node_ini
node_runner -.->|"launches"| node_game
node_game -.->|"hosts menu"| node_nativeui
node_game -.->|"reports play"| node_presence
node_backend -->|"updates install"| node_updater
node_backend -->|"imports or backs up"| node_saves
node_saves -->|"parses saves"| node_saveparse
node_backend -->|"reads pack selection"| node_ini
node_mods -->|"writes pack selection"| node_ini

click node_program "https://github.com/nyx2sw/xc2recomp/blob/main/launcher/App/Program.cs"
click node_webhost "https://github.com/nyx2sw/xc2recomp/blob/main/launcher/App/Host/WinHost.cs"
click node_content "https://github.com/nyx2sw/xc2recomp/blob/main/launcher/App/Content.cs"
click node_webui "https://github.com/nyx2sw/xc2recomp/blob/main/launcher/ui/app.js"
click node_backend "https://github.com/nyx2sw/xc2recomp/blob/main/launcher/App/Backend.cs"
click node_config "https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/LauncherConfig.cs"
click node_pipeline "https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/SetupPipeline.cs"
click node_nup "https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/NupArchive.cs"
click node_install "https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/GameInstall.cs"
click node_runner "https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/GameRunner.cs"
click node_ini "https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/IniSettings.cs"
click node_nativeui "https://github.com/nyx2sw/xc2recomp/blob/main/extensions/native_ui/native_menu.c"
click node_presence "https://github.com/nyx2sw/xc2recomp/blob/main/extensions/presence/presence.c"
click node_shader "https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/ShaderCatalogBuilder.cs"
click node_dlss "https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/DlssDownloader.cs"
click node_updater "https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/LauncherUpdater.cs"
click node_saves "https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/SaveManager.cs"
click node_saveparse "https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/SaveParser.cs"
click node_mods "https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/ModManager.cs"
click node_steam "https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/SteamIntegration.cs"
click node_audio "https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/GameAudio.cs"
click node_artwork "https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/GameArtwork.cs"

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_program,node_webhost,node_content,node_webui,node_backend,node_config toneBlue
class node_pipeline,node_nup,node_install,node_userdump toneAmber
class node_dlss,node_updater,node_saves,node_saveparse,node_mods,node_steam,node_audio,node_artwork toneMint
class node_runner,node_ini,node_nativeui,node_presence,node_shader toneRose
class node_player,node_game toneIndigo
```

## Components

### Launcher experience

- [Launcher startup](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/App/Program.cs): `launcher/App/Program.cs`
- [WebView host](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/App/Host/WinHost.cs): `launcher/App/Host/WinHost.cs`
- [UI content](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/App/Content.cs): `launcher/App/Content.cs`
- [Launcher UI](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/ui/app.js): `launcher/ui/app.js`
- [Command backend](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/App/Backend.cs): `launcher/App/Backend.cs`
- [Launcher config](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/LauncherConfig.cs): `launcher/Core/LauncherConfig.cs`

### Game setup

- [Setup pipeline](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/SetupPipeline.cs): `launcher/Core/SetupPipeline.cs`
- [NUP archive](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/NupArchive.cs): `launcher/Core/NupArchive.cs`
- [Install inspection](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/GameInstall.cs): `launcher/Core/GameInstall.cs`

### Install management

- [DLSS download](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/DlssDownloader.cs): `launcher/Core/DlssDownloader.cs`
- [Launcher updater](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/LauncherUpdater.cs): `launcher/Core/LauncherUpdater.cs`
- [Save management](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/SaveManager.cs): `launcher/Core/SaveManager.cs`
- [Save parser](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/SaveParser.cs): `launcher/Core/SaveParser.cs`
- [Resource packs](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/ModManager.cs): `launcher/Core/ModManager.cs`
- [Steam integration](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/SteamIntegration.cs): `launcher/Core/SteamIntegration.cs`
- [Game audio](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/GameAudio.cs): `launcher/Core/GameAudio.cs`
- [Game artwork](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/GameArtwork.cs): `launcher/Core/GameArtwork.cs`

### Game runtime

- [Game runner](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/GameRunner.cs): `launcher/Core/GameRunner.cs`
- [Game settings](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/IniSettings.cs): `launcher/Core/IniSettings.cs`
- [In-game PC menu](https://github.com/nyx2sw/xc2recomp/blob/main/extensions/native_ui/native_menu.c): `extensions/native_ui/native_menu.c`
- [Play presence](https://github.com/nyx2sw/xc2recomp/blob/main/extensions/presence/presence.c): `extensions/presence/presence.c`
- [Shader catalog](https://github.com/nyx2sw/xc2recomp/blob/main/launcher/Core/ShaderCatalogBuilder.cs): `launcher/Core/ShaderCatalogBuilder.cs`

### Other components

- **Player**
- **User game dump**
- **Installed game**

## Connections

- Player → Launcher startup: opens (evidence: `README.md`)
- Launcher startup → WebView host: creates (evidence: `launcher/App/Program.cs`)
- Launcher startup → UI content: creates (evidence: `launcher/App/Program.cs`)
- Launcher startup → Command backend: creates (evidence: `launcher/App/Program.cs`)
- Launcher startup → Launcher updater: checks startup (evidence: `launcher/App/Program.cs`)
- WebView host → UI content: serves (evidence: `launcher/App/Host/WinHost.cs`)
- Player → Launcher UI: configures
- Command backend → Launcher config: loads settings (evidence: `launcher/App/Backend.cs`)
- Command backend → Install inspection: inspects install (evidence: `launcher/App/Backend.cs`)
- Command backend → Game runner: builds launch plan (evidence: `launcher/App/Backend.cs`)
- Command backend → Save management: manages saves (evidence: `launcher/App/Backend.cs`)
- Command backend → Resource packs: manages packs (evidence: `launcher/App/Backend.cs`)
- Command backend → Steam integration: discovers accounts (evidence: `launcher/App/Backend.cs`)
- Command backend → DLSS download: starts download (evidence: `launcher/App/Backend.cs`)
- Command backend → Shader catalog: prepares shaders (evidence: `launcher/App/Backend.cs`)
- Command backend → Game audio: loads tracks (evidence: `launcher/App/Backend.cs`)
- Command backend → Game artwork: loads artwork (evidence: `launcher/App/Backend.cs`)
- Player → User game dump: provides dump (evidence: `README.md`)
- User game dump → Setup pipeline: sets up game (evidence: `README.md`)
- Setup pipeline → NUP archive: extracts packages (evidence: `launcher/Core/SetupPipeline.cs`)
- Setup pipeline → Install inspection: prepares install (evidence: `launcher/Core/SetupPipeline.cs`)
- Setup pipeline → Installed game: produces install (evidence: `README.md`)
- Command backend → Setup pipeline: starts setup
- Game runner → Game settings: reads settings (evidence: `launcher/Core/GameRunner.cs`)
- Game runner → Installed game: launches
- Installed game → In-game PC menu: hosts menu
- Installed game → Play presence: reports play
- Command backend → Launcher updater: updates install (evidence: `launcher/App/Backend.cs`)
- Command backend → Save management: imports or backs up (evidence: `launcher/App/Backend.cs`)
- Save management → Save parser: parses saves (evidence: `launcher/Core/SaveManager.cs`)
- Command backend → Game settings: reads pack selection (evidence: `launcher/App/Backend.cs`)
- Resource packs → Game settings: writes pack selection (evidence: `launcher/Core/ModManager.cs`)
