# thefocusman/shiny-engine-fnf architecture

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

- Interactive diagram: https://gitdiagram.com/thefocusman/shiny-engine-fnf
- Repository: https://github.com/thefocusman/shiny-engine-fnf

## Overview

Shiny Engine FNF is a C# Friday Night Funkin’ game engine. Its apparent user workflow is choosing songs or story weeks, then playing a rhythm-chart session; chart editing and dialogue are additional capabilities indicated by the source tree. The graph includes the WPF rendering, timing, audio, and asset layer. Several relationships are supported only by the SOURCE INDEX’s reference lists, and unsampled subsystems are represented at their existing directory paths rather than inferred in detail.

Main entry points: [`Shiny Engine FNF Code/States/PlayState/PlayState.Initaize.cs`](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/States/PlayState/PlayState.Initaize.cs) (Play Initialization), [`Shiny Engine FNF Code/Paths.cs`](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/Paths.cs) (Asset Paths), [`Shiny Engine FNF Code/States/StoryMenuState.xaml.cs`](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/States/StoryMenuState.xaml.cs) (Story Menu), [`Shiny Engine FNF Code/FunkinLua.cs`](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/FunkinLua.cs) (Lua Scripts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application and Menus"]
  node_app["WPF App<br/>[App.xaml.cs]"]
  node_mainmenu["Main Menu"]
  node_storymenu["Story Menu"]
  node_freeplay["Freeplay"]
  node_charteditor["Chart Editor"]
  node_discord["Discord RPC<br/>[DiscordClient.cs]"]
end

subgraph group_play["Rhythm Gameplay"]
  node_playstate["Play State<br/>[PlayState.xaml.cs]"]
  node_playinit["Play Initialization"]
  node_notes["Notes<br/>[Note.cs]"]
  node_conductor["Beat Timing<br/>[Conductor.cs]"]
  node_beatstate["Beat State<br/>[MusicBeatState.cs]"]
end

subgraph group_content["Game Data and Scripting"]
  node_weekdata["Week Data<br/>[WeekData.cs]"]
  node_datafile["Game Data<br/>[DataFile.cs]"]
  node_songdata["Song Data<br/>[Song.cs]"]
  node_lua["Lua Scripts<br/>[FunkinLua.cs]"]
  node_paths["Asset Paths<br/>[Paths.cs]"]
  node_coolutil["Game Utilities<br/>[CoolUtil.cs]"]
end

subgraph group_engine["WPF Game Runtime"]
  node_sprite["Sprite Rendering<br/>[Sprite.cs]"]
  node_canvas["Game Canvas"]
  node_display["Display<br/>[Display.cs]"]
  node_sound["Audio<br/>[Sound.cs]"]
  node_timer["Frame Timer<br/>[StaticTimer.cs]"]
  node_tween["Tweens<br/>[Tween.cs]"]
  node_mathf["Math Utilities<br/>[Mathf.cs]"]
  node_cache["Asset Cache<br/>[CacheKiller.cs]"]
end

node_player(("Player"))

node_app -->|"initializes"| node_discord
node_storymenu -->|"loads weeks"| node_weekdata
node_storymenu -->|"reads data"| node_datafile
node_storymenu -->|"updates presence"| node_discord
node_storymenu -->|"resolves assets"| node_paths
node_storymenu -->|"uses utilities"| node_coolutil
node_charteditor -->|"uses notes"| node_notes
node_playstate -.->|"initializes"| node_playinit
node_playinit -->|"configures timing"| node_conductor
node_playinit -->|"loads week"| node_weekdata
node_playinit -->|"resolves assets"| node_paths
node_playinit -->|"loads scripts"| node_lua
node_playinit -->|"creates visuals"| node_sprite
node_playinit -->|"uses canvas"| node_canvas
node_playinit -->|"loads audio"| node_sound
node_beatstate -->|"reads beat timing"| node_conductor
node_conductor -->|"judges timing"| node_notes
node_lua -->|"reads timing"| node_conductor
node_lua -->|"reads week data"| node_weekdata
node_lua -->|"reads dimensions"| node_display
node_weekdata -->|"resolves content"| node_paths
node_songdata -->|"resolves content"| node_paths
node_paths -->|"creates atlases"| node_sprite
node_paths -->|"resolves audio"| node_sound
node_paths -->|"uses cache"| node_cache
node_sprite -->|"uses cache"| node_cache
node_tween -->|"uses math"| node_mathf
node_tween -->|"uses timer"| node_timer

click node_app "https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF/App.xaml.cs"
click node_mainmenu "https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/States/MainMenuState.xaml.cs"
click node_storymenu "https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/States/StoryMenuState.xaml.cs"
click node_freeplay "https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/States/FreeplayState.xaml.cs"
click node_charteditor "https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/States/Editors/ChartingState.xaml.cs"
click node_discord "https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/Controls/DiscordClient.cs"
click node_playstate "https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/States/PlayState/PlayState.xaml.cs"
click node_playinit "https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/States/PlayState/PlayState.Initaize.cs"
click node_notes "https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/Controls/Note.cs"
click node_conductor "https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/FridayNightFunkinDataBase/Conductor.cs"
click node_beatstate "https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/MusicBeatState.cs"
click node_weekdata "https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/FridayNightFunkinDataBase/WeekData.cs"
click node_datafile "https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/FridayNightFunkinDataBase/DataFile.cs"
click node_songdata "https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/FridayNightFunkinDataBase/Song.cs"
click node_lua "https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/FunkinLua.cs"
click node_paths "https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/Paths.cs"
click node_coolutil "https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/CoolUtil.cs"
click node_sprite "https://github.com/thefocusman/shiny-engine-fnf/blob/master/WPF%20Game%20Helpers%20By%20TheFocusMan/Controls/Sprite.cs"
click node_canvas "https://github.com/thefocusman/shiny-engine-fnf/blob/master/WPF%20Game%20Helpers%20By%20TheFocusMan/Controls/CanvasWithMargarin.cs"
click node_display "https://github.com/thefocusman/shiny-engine-fnf/blob/master/WPF%20Game%20Helpers%20By%20TheFocusMan/Display.cs"
click node_sound "https://github.com/thefocusman/shiny-engine-fnf/blob/master/WPF%20Game%20Helpers%20By%20TheFocusMan/Sound.cs"
click node_timer "https://github.com/thefocusman/shiny-engine-fnf/blob/master/WPF%20Game%20Helpers%20By%20TheFocusMan/StaticTimer.cs"
click node_tween "https://github.com/thefocusman/shiny-engine-fnf/blob/master/WPF%20Game%20Helpers%20By%20TheFocusMan/Tween.cs"
click node_mathf "https://github.com/thefocusman/shiny-engine-fnf/blob/master/WPF%20Game%20Helpers%20By%20TheFocusMan/Mathf.cs"
click node_cache "https://github.com/thefocusman/shiny-engine-fnf/blob/master/WPF%20Game%20Helpers%20By%20TheFocusMan/CacheKiller.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_app,node_mainmenu,node_storymenu,node_freeplay,node_charteditor,node_discord toneBlue
class node_playstate,node_playinit,node_notes,node_conductor,node_beatstate toneAmber
class node_weekdata,node_datafile,node_songdata,node_lua,node_paths,node_coolutil toneMint
class node_sprite,node_canvas,node_display,node_sound,node_timer,node_tween,node_mathf,node_cache toneRose
class node_player toneIndigo
```

## Components

### Application and Menus

- [WPF App](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF/App.xaml.cs): `Shiny Engine FNF/App.xaml.cs`
- [Main Menu](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/States/MainMenuState.xaml.cs): `Shiny Engine FNF Code/States/MainMenuState.xaml.cs`
- [Story Menu](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/States/StoryMenuState.xaml.cs): `Shiny Engine FNF Code/States/StoryMenuState.xaml.cs`
- [Freeplay](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/States/FreeplayState.xaml.cs): `Shiny Engine FNF Code/States/FreeplayState.xaml.cs`
- [Chart Editor](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/States/Editors/ChartingState.xaml.cs): `Shiny Engine FNF Code/States/Editors/ChartingState.xaml.cs`
- [Discord RPC](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/Controls/DiscordClient.cs): `Shiny Engine FNF Code/Controls/DiscordClient.cs`

### Rhythm Gameplay

- [Play State](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/States/PlayState/PlayState.xaml.cs): `Shiny Engine FNF Code/States/PlayState/PlayState.xaml.cs`
- [Play Initialization](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/States/PlayState/PlayState.Initaize.cs): `Shiny Engine FNF Code/States/PlayState/PlayState.Initaize.cs`
- [Notes](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/Controls/Note.cs): `Shiny Engine FNF Code/Controls/Note.cs`
- [Beat Timing](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/FridayNightFunkinDataBase/Conductor.cs): `Shiny Engine FNF Code/FridayNightFunkinDataBase/Conductor.cs`
- [Beat State](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/MusicBeatState.cs): `Shiny Engine FNF Code/MusicBeatState.cs`

### Game Data and Scripting

- [Week Data](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/FridayNightFunkinDataBase/WeekData.cs): `Shiny Engine FNF Code/FridayNightFunkinDataBase/WeekData.cs`
- [Game Data](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/FridayNightFunkinDataBase/DataFile.cs): `Shiny Engine FNF Code/FridayNightFunkinDataBase/DataFile.cs`
- [Song Data](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/FridayNightFunkinDataBase/Song.cs): `Shiny Engine FNF Code/FridayNightFunkinDataBase/Song.cs`
- [Lua Scripts](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/FunkinLua.cs): `Shiny Engine FNF Code/FunkinLua.cs`
- [Asset Paths](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/Paths.cs): `Shiny Engine FNF Code/Paths.cs`
- [Game Utilities](https://github.com/thefocusman/shiny-engine-fnf/blob/master/Shiny%20Engine%20FNF%20Code/CoolUtil.cs): `Shiny Engine FNF Code/CoolUtil.cs`

### WPF Game Runtime

- [Sprite Rendering](https://github.com/thefocusman/shiny-engine-fnf/blob/master/WPF%20Game%20Helpers%20By%20TheFocusMan/Controls/Sprite.cs): `WPF Game Helpers By TheFocusMan/Controls/Sprite.cs`
- [Game Canvas](https://github.com/thefocusman/shiny-engine-fnf/blob/master/WPF%20Game%20Helpers%20By%20TheFocusMan/Controls/CanvasWithMargarin.cs): `WPF Game Helpers By TheFocusMan/Controls/CanvasWithMargarin.cs`
- [Display](https://github.com/thefocusman/shiny-engine-fnf/blob/master/WPF%20Game%20Helpers%20By%20TheFocusMan/Display.cs): `WPF Game Helpers By TheFocusMan/Display.cs`
- [Audio](https://github.com/thefocusman/shiny-engine-fnf/blob/master/WPF%20Game%20Helpers%20By%20TheFocusMan/Sound.cs): `WPF Game Helpers By TheFocusMan/Sound.cs`
- [Frame Timer](https://github.com/thefocusman/shiny-engine-fnf/blob/master/WPF%20Game%20Helpers%20By%20TheFocusMan/StaticTimer.cs): `WPF Game Helpers By TheFocusMan/StaticTimer.cs`
- [Tweens](https://github.com/thefocusman/shiny-engine-fnf/blob/master/WPF%20Game%20Helpers%20By%20TheFocusMan/Tween.cs): `WPF Game Helpers By TheFocusMan/Tween.cs`
- [Math Utilities](https://github.com/thefocusman/shiny-engine-fnf/blob/master/WPF%20Game%20Helpers%20By%20TheFocusMan/Mathf.cs): `WPF Game Helpers By TheFocusMan/Mathf.cs`
- [Asset Cache](https://github.com/thefocusman/shiny-engine-fnf/blob/master/WPF%20Game%20Helpers%20By%20TheFocusMan/CacheKiller.cs): `WPF Game Helpers By TheFocusMan/CacheKiller.cs`

### Other components

- **Player**

## Connections

- WPF App → Discord RPC: initializes (evidence: `Shiny Engine FNF/App.xaml.cs`)
- Story Menu → Week Data: loads weeks (evidence: `Shiny Engine FNF Code/States/StoryMenuState.xaml.cs`)
- Story Menu → Game Data: reads data (evidence: `Shiny Engine FNF Code/States/StoryMenuState.xaml.cs`)
- Story Menu → Discord RPC: updates presence (evidence: `Shiny Engine FNF Code/States/StoryMenuState.xaml.cs`)
- Story Menu → Asset Paths: resolves assets (evidence: `Shiny Engine FNF Code/States/StoryMenuState.xaml.cs`)
- Story Menu → Game Utilities: uses utilities (evidence: `Shiny Engine FNF Code/States/StoryMenuState.xaml.cs`)
- Chart Editor → Notes: uses notes (evidence: `Shiny Engine FNF Code/States/Editors/ChartingState.xaml.cs`)
- Play State → Play Initialization: initializes
- Play Initialization → Beat Timing: configures timing (evidence: `Shiny Engine FNF Code/States/PlayState/PlayState.Initaize.cs`)
- Play Initialization → Week Data: loads week (evidence: `Shiny Engine FNF Code/States/PlayState/PlayState.Initaize.cs`)
- Play Initialization → Asset Paths: resolves assets (evidence: `Shiny Engine FNF Code/States/PlayState/PlayState.Initaize.cs`)
- Play Initialization → Lua Scripts: loads scripts (evidence: `Shiny Engine FNF Code/States/PlayState/PlayState.Initaize.cs`)
- Play Initialization → Sprite Rendering: creates visuals (evidence: `Shiny Engine FNF Code/States/PlayState/PlayState.Initaize.cs`)
- Play Initialization → Game Canvas: uses canvas (evidence: `Shiny Engine FNF Code/States/PlayState/PlayState.Initaize.cs`)
- Play Initialization → Audio: loads audio (evidence: `Shiny Engine FNF Code/States/PlayState/PlayState.Initaize.cs`)
- Beat State → Beat Timing: reads beat timing (evidence: `Shiny Engine FNF Code/MusicBeatState.cs`)
- Beat Timing → Notes: judges timing (evidence: `Shiny Engine FNF Code/FridayNightFunkinDataBase/Conductor.cs`)
- Lua Scripts → Beat Timing: reads timing (evidence: `Shiny Engine FNF Code/FunkinLua.cs`)
- Lua Scripts → Week Data: reads week data (evidence: `Shiny Engine FNF Code/FunkinLua.cs`)
- Lua Scripts → Display: reads dimensions (evidence: `Shiny Engine FNF Code/FunkinLua.cs`)
- Week Data → Asset Paths: resolves content (evidence: `Shiny Engine FNF Code/FridayNightFunkinDataBase/WeekData.cs`)
- Song Data → Asset Paths: resolves content (evidence: `Shiny Engine FNF Code/FridayNightFunkinDataBase/Song.cs`)
- Asset Paths → Sprite Rendering: creates atlases (evidence: `Shiny Engine FNF Code/Paths.cs`)
- Asset Paths → Audio: resolves audio (evidence: `Shiny Engine FNF Code/Paths.cs`)
- Asset Paths → Asset Cache: uses cache (evidence: `Shiny Engine FNF Code/Paths.cs`)
- Sprite Rendering → Asset Cache: uses cache (evidence: `WPF Game Helpers By TheFocusMan/Controls/Sprite.cs`)
- Tweens → Math Utilities: uses math (evidence: `WPF Game Helpers By TheFocusMan/Tween.cs`)
- Tweens → Frame Timer: uses timer (evidence: `WPF Game Helpers By TheFocusMan/Tween.cs`)
