# gaming-with-portals/ronin architecture

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

- Interactive diagram: https://gitdiagram.com/gaming-with-portals/ronin
- Repository: https://github.com/gaming-with-portals/ronin

## Overview

RONIN is a Ninja Gaiden 4 asset browser/editor and previewer, backed by YakumoLib’s asset-format support. The documented user workflow is loading game assets, browsing them, and previewing supported types; the README also lists export and mod-patching capabilities. Sampled source confirms database reading and several preview decode paths, but not the main-window wiring, asset-library loading, exporting, or patch generation, so those links are omitted where ownership is unclear.

Main entry points: [`RONIN/Preview/AssetPreviewRegistry.cs`](https://github.com/gaming-with-portals/ronin/blob/main/RONIN/Preview/AssetPreviewRegistry.cs) (Preview registry), [`RONIN/Preview/ModelPreviewProvider.cs`](https://github.com/gaming-with-portals/ronin/blob/main/RONIN/Preview/ModelPreviewProvider.cs) (Model previews), [`YakumoLib`](https://github.com/gaming-with-portals/ronin/tree/main/YakumoLib) (Asset library), [`RONIN/Preview/TexturePreviewProvider.cs`](https://github.com/gaming-with-portals/ronin/blob/main/RONIN/Preview/TexturePreviewProvider.cs) (Texture previews)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["RONIN application"]
  node_window["Main window<br/>[MainWindow.xaml.cs]"]
  node_windowvm["Window view model"]
  node_browser["Asset browser"]
  node_editable["Asset editing"]
  node_vfsimport["VFS importer"]
  node_export["Asset export"]
  node_patch["Patch generation"]
end

subgraph group_preview["Asset previews"]
  node_registry["Preview registry"]
  node_texture["Texture previews"]
  node_atlas["Atlas previews"]
  node_model["Model previews"]
  node_table["Table previews"]
  node_otherpreviews["Other previews"]
end

subgraph group_formats["Format support"]
  node_mdlparser["MDL parser<br/>[MDLParser.cs]"]
  node_tableparser["Table parser"]
  node_imageformats["Image decoding"]
end

subgraph group_library["Asset library"]
  node_assetlibrary["Asset library"]
  node_dbreader["Database reader"]
end

node_player(("Asset editor"))
node_gamefiles[("Game assets")]

node_player -->|"uses"| node_window
node_gamefiles -->|"provides files"| node_assetlibrary
node_assetlibrary -->|"reads database"| node_dbreader
node_registry -->|"dispatches"| node_texture
node_registry -->|"dispatches"| node_atlas
node_registry -->|"dispatches"| node_model
node_registry -->|"dispatches"| node_table
node_texture -->|"decodes"| node_imageformats
node_atlas -->|"decodes"| node_imageformats
node_table -->|"parses"| node_tableparser
node_model -->|"parses"| node_mdlparser
node_model -->|"looks up assets"| node_assetlibrary
node_player -.->|"exports assets"| node_export
node_player -.->|"generates patches"| node_patch

click node_window "https://github.com/gaming-with-portals/ronin/blob/main/RONIN/MainWindow.xaml.cs"
click node_windowvm "https://github.com/gaming-with-portals/ronin/blob/main/RONIN/MainWindowViewModel.cs"
click node_browser "https://github.com/gaming-with-portals/ronin/tree/main/RONIN/Browser"
click node_editable "https://github.com/gaming-with-portals/ronin/tree/main/RONIN/Editors"
click node_vfsimport "https://github.com/gaming-with-portals/ronin/blob/main/RONIN/Panes/VFSImporter.xaml.cs"
click node_export "https://github.com/gaming-with-portals/ronin/tree/main/RONIN/Exporters"
click node_patch "https://github.com/gaming-with-portals/ronin/tree/main/RONIN/Modding"
click node_registry "https://github.com/gaming-with-portals/ronin/blob/main/RONIN/Preview/AssetPreviewRegistry.cs"
click node_texture "https://github.com/gaming-with-portals/ronin/blob/main/RONIN/Preview/TexturePreviewProvider.cs"
click node_atlas "https://github.com/gaming-with-portals/ronin/blob/main/RONIN/Preview/AtlasTexturePreviewProvider.cs"
click node_model "https://github.com/gaming-with-portals/ronin/blob/main/RONIN/Preview/ModelPreviewProvider.cs"
click node_table "https://github.com/gaming-with-portals/ronin/blob/main/RONIN/Preview/AssetTablePreviewProvider.cs"
click node_otherpreviews "https://github.com/gaming-with-portals/ronin/tree/main/RONIN/Preview"
click node_mdlparser "https://github.com/gaming-with-portals/ronin/blob/main/RONIN/Formats/MDLParser.cs"
click node_tableparser "https://github.com/gaming-with-portals/ronin/blob/main/RONIN/Formats/AssetTableParser.cs"
click node_imageformats "https://github.com/gaming-with-portals/ronin/tree/main/RONIN/Formats"
click node_assetlibrary "https://github.com/gaming-with-portals/ronin/tree/main/YakumoLib"
click node_dbreader "https://github.com/gaming-with-portals/ronin/blob/main/YakumoLib/Database/AssetDatabaseReader.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_window,node_windowvm,node_browser,node_editable,node_vfsimport,node_export,node_patch toneBlue
class node_registry,node_texture,node_atlas,node_model,node_table,node_otherpreviews,node_gamefiles toneAmber
class node_mdlparser,node_tableparser,node_imageformats toneMint
class node_assetlibrary,node_dbreader toneRose
class node_player toneIndigo
```

## Components

### RONIN application

- [Main window](https://github.com/gaming-with-portals/ronin/blob/main/RONIN/MainWindow.xaml.cs): `RONIN/MainWindow.xaml.cs`
- [Window view model](https://github.com/gaming-with-portals/ronin/blob/main/RONIN/MainWindowViewModel.cs): `RONIN/MainWindowViewModel.cs`
- [Asset browser](https://github.com/gaming-with-portals/ronin/tree/main/RONIN/Browser): `RONIN/Browser`
- [Asset editing](https://github.com/gaming-with-portals/ronin/tree/main/RONIN/Editors): `RONIN/Editors`
- [VFS importer](https://github.com/gaming-with-portals/ronin/blob/main/RONIN/Panes/VFSImporter.xaml.cs): `RONIN/Panes/VFSImporter.xaml.cs`
- [Asset export](https://github.com/gaming-with-portals/ronin/tree/main/RONIN/Exporters): `RONIN/Exporters`
- [Patch generation](https://github.com/gaming-with-portals/ronin/tree/main/RONIN/Modding): `RONIN/Modding`

### Asset previews

- [Preview registry](https://github.com/gaming-with-portals/ronin/blob/main/RONIN/Preview/AssetPreviewRegistry.cs): `RONIN/Preview/AssetPreviewRegistry.cs`
- [Texture previews](https://github.com/gaming-with-portals/ronin/blob/main/RONIN/Preview/TexturePreviewProvider.cs): `RONIN/Preview/TexturePreviewProvider.cs`
- [Atlas previews](https://github.com/gaming-with-portals/ronin/blob/main/RONIN/Preview/AtlasTexturePreviewProvider.cs): `RONIN/Preview/AtlasTexturePreviewProvider.cs`
- [Model previews](https://github.com/gaming-with-portals/ronin/blob/main/RONIN/Preview/ModelPreviewProvider.cs): `RONIN/Preview/ModelPreviewProvider.cs`
- [Table previews](https://github.com/gaming-with-portals/ronin/blob/main/RONIN/Preview/AssetTablePreviewProvider.cs): `RONIN/Preview/AssetTablePreviewProvider.cs`
- [Other previews](https://github.com/gaming-with-portals/ronin/tree/main/RONIN/Preview): `RONIN/Preview`

### Format support

- [MDL parser](https://github.com/gaming-with-portals/ronin/blob/main/RONIN/Formats/MDLParser.cs): `RONIN/Formats/MDLParser.cs`
- [Table parser](https://github.com/gaming-with-portals/ronin/blob/main/RONIN/Formats/AssetTableParser.cs): `RONIN/Formats/AssetTableParser.cs`
- [Image decoding](https://github.com/gaming-with-portals/ronin/tree/main/RONIN/Formats): `RONIN/Formats`

### Asset library

- [Asset library](https://github.com/gaming-with-portals/ronin/tree/main/YakumoLib): `YakumoLib`
- [Database reader](https://github.com/gaming-with-portals/ronin/blob/main/YakumoLib/Database/AssetDatabaseReader.cs): `YakumoLib/Database/AssetDatabaseReader.cs`

### Other components

- **Asset editor**
- **Game assets**

## Connections

- Asset editor → Main window: uses
- Game assets → Asset library: provides files
- Asset library → Database reader: reads database
- Preview registry → Texture previews: dispatches
- Preview registry → Atlas previews: dispatches
- Preview registry → Model previews: dispatches
- Preview registry → Table previews: dispatches
- Texture previews → Image decoding: decodes
- Atlas previews → Image decoding: decodes
- Table previews → Table parser: parses
- Model previews → MDL parser: parses
- Model previews → Asset library: looks up assets
- Asset editor → Asset export: exports assets
- Asset editor → Patch generation: generates patches
