# zerratar/ravenfall-legacy architecture

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

- Interactive diagram: https://gitdiagram.com/zerratar/ravenfall-legacy
- Repository: https://github.com/zerratar/ravenfall-legacy

## Overview

This repository is the Unity client for Ravenfall, a Twitch-integrated idle RPG. The tree shows gameplay systems for player progression, gathering and crafting, combat, dungeons, raids, arenas, inventory, and Twitch events, plus world/UI presentation. The README identifies the website/game server and Twitch ecosystem as separate projects; sampled source is limited to an unrelated appearance-code generator, so client-to-service wiring is not evidenced and is omitted.

Main entry points: [`Assets/Scripts/Game/Player/PlayerController.cs`](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Player/PlayerController.cs) (Player control), [`Assets/Scripts/Game/Inventory/Inventory.cs`](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Inventory/Inventory.cs) (Inventory and equipment), [`Assets/Scripts/Game/Handlers/CombatHandler.cs`](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Handlers/CombatHandler.cs) (Combat simulation), [`Assets/Scripts/Game/Managers/GameManager.cs`](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Managers/GameManager.cs) (Game runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Player Gameplay"]
  node_player["Player control"]
  node_progression["Skills and stats<br/>[Skills.cs]"]
  node_inventory["Inventory and equipment<br/>[Inventory.cs]"]
  node_items["Item resolution<br/>[ItemResolver.cs]"]
end

subgraph group_world["World Activities"]
  node_gather["Gathering skills"]
  node_crafting["Crafting<br/>[CraftingManager.cs]"]
  node_island["Island activities"]
end

subgraph group_encounters["Combat and Events"]
  node_dungeon["Dungeon runs"]
  node_raid["Raids<br/>[RaidManager.cs]"]
  node_arena["Arena and duels<br/>[ArenaHandler.cs]"]
  node_combat["Combat simulation<br/>[CombatHandler.cs]"]
  node_drops["Item drops<br/>[ItemDropHandler.cs]"]
  node_twitch["Twitch events"]
end

subgraph group_client["Client Runtime"]
  node_events["Game event dispatch"]
  node_handlers["Event handlers"]
  node_runtime["Game runtime<br/>[GameManager.cs]"]
  node_hud["HUD presentation<br/>[HUDController.cs]"]
  node_overlay["Overlay presentation<br/>[Overlay.cs]"]
end

node_playeractor(("Player"))
node_streamer(("Twitch audience"))

node_playeractor -->|"controls"| node_player
node_player -->|"advances"| node_progression
node_player -->|"manages"| node_inventory
node_inventory -->|"resolves items"| node_items
node_player -->|"performs tasks"| node_gather
node_gather -->|"grants progress"| node_progression
node_player -->|"crafts items"| node_crafting
node_crafting -->|"creates items"| node_inventory
node_player -->|"explores"| node_island
node_player -->|"joins runs"| node_dungeon
node_player -->|"joins raids"| node_raid
node_player -->|"joins matches"| node_arena
node_dungeon -->|"runs encounters"| node_combat
node_raid -->|"runs encounters"| node_combat
node_arena -->|"resolves fights"| node_combat
node_combat -->|"produces rewards"| node_drops
node_drops -->|"adds items"| node_inventory
node_streamer -.->|"triggers events"| node_twitch
node_twitch -->|"publishes events"| node_events
node_events -->|"dispatches events"| node_handlers
node_runtime -->|"manages events"| node_events
node_runtime -->|"updates display"| node_hud
node_runtime -->|"updates display"| node_overlay

click node_player "https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Player/PlayerController.cs"
click node_progression "https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Player/Skills.cs"
click node_inventory "https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Inventory/Inventory.cs"
click node_items "https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/ItemResolver.cs"
click node_gather "https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Skills/Woodcutting/GatherController.cs"
click node_crafting "https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Skills/Crafting/CraftingManager.cs"
click node_island "https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Controllers/IslandController.cs"
click node_dungeon "https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Controllers/DungeonController.cs"
click node_raid "https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Managers/RaidManager.cs"
click node_arena "https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Handlers/ArenaHandler.cs"
click node_combat "https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Handlers/CombatHandler.cs"
click node_drops "https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Handlers/ItemDropHandler.cs"
click node_twitch "https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Managers/TwitchEventManager.cs"
click node_events "https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Managers/GameEventManager.cs"
click node_handlers "https://github.com/zerratar/ravenfall-legacy/tree/master/Assets/Scripts/Game/GameEventHandlers"
click node_runtime "https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Managers/GameManager.cs"
click node_hud "https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/HUDController.cs"
click node_overlay "https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Managers/Overlay.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_player,node_progression,node_inventory,node_items toneBlue
class node_gather,node_crafting,node_island toneAmber
class node_dungeon,node_raid,node_arena,node_combat,node_drops,node_twitch toneMint
class node_events,node_handlers,node_runtime,node_hud,node_overlay toneRose
class node_playeractor,node_streamer toneIndigo
```

## Components

### Player Gameplay

- [Player control](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Player/PlayerController.cs): `Assets/Scripts/Game/Player/PlayerController.cs`
- [Skills and stats](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Player/Skills.cs): `Assets/Scripts/Game/Player/Skills.cs`
- [Inventory and equipment](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Inventory/Inventory.cs): `Assets/Scripts/Game/Inventory/Inventory.cs`
- [Item resolution](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/ItemResolver.cs): `Assets/Scripts/ItemResolver.cs`

### World Activities

- [Gathering skills](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Skills/Woodcutting/GatherController.cs): `Assets/Scripts/Game/Skills/Woodcutting/GatherController.cs`
- [Crafting](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Skills/Crafting/CraftingManager.cs): `Assets/Scripts/Game/Skills/Crafting/CraftingManager.cs`
- [Island activities](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Controllers/IslandController.cs): `Assets/Scripts/Game/Controllers/IslandController.cs`

### Combat and Events

- [Dungeon runs](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Controllers/DungeonController.cs): `Assets/Scripts/Game/Controllers/DungeonController.cs`
- [Raids](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Managers/RaidManager.cs): `Assets/Scripts/Game/Managers/RaidManager.cs`
- [Arena and duels](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Handlers/ArenaHandler.cs): `Assets/Scripts/Game/Handlers/ArenaHandler.cs`
- [Combat simulation](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Handlers/CombatHandler.cs): `Assets/Scripts/Game/Handlers/CombatHandler.cs`
- [Item drops](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Handlers/ItemDropHandler.cs): `Assets/Scripts/Game/Handlers/ItemDropHandler.cs`
- [Twitch events](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Managers/TwitchEventManager.cs): `Assets/Scripts/Game/Managers/TwitchEventManager.cs`

### Client Runtime

- [Game event dispatch](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Managers/GameEventManager.cs): `Assets/Scripts/Game/Managers/GameEventManager.cs`
- [Event handlers](https://github.com/zerratar/ravenfall-legacy/tree/master/Assets/Scripts/Game/GameEventHandlers): `Assets/Scripts/Game/GameEventHandlers`
- [Game runtime](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Managers/GameManager.cs): `Assets/Scripts/Game/Managers/GameManager.cs`
- [HUD presentation](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/HUDController.cs): `Assets/Scripts/HUDController.cs`
- [Overlay presentation](https://github.com/zerratar/ravenfall-legacy/blob/master/Assets/Scripts/Game/Managers/Overlay.cs): `Assets/Scripts/Game/Managers/Overlay.cs`

### Other components

- **Player**
- **Twitch audience**

## Connections

- Player → Player control: controls
- Player control → Skills and stats: advances
- Player control → Inventory and equipment: manages
- Inventory and equipment → Item resolution: resolves items
- Player control → Gathering skills: performs tasks
- Gathering skills → Skills and stats: grants progress
- Player control → Crafting: crafts items
- Crafting → Inventory and equipment: creates items
- Player control → Island activities: explores
- Player control → Dungeon runs: joins runs
- Player control → Raids: joins raids
- Player control → Arena and duels: joins matches
- Dungeon runs → Combat simulation: runs encounters
- Raids → Combat simulation: runs encounters
- Arena and duels → Combat simulation: resolves fights
- Combat simulation → Item drops: produces rewards
- Item drops → Inventory and equipment: adds items
- Twitch audience → Twitch events: triggers events
- Twitch events → Game event dispatch: publishes events
- Game event dispatch → Event handlers: dispatches events
- Game runtime → Game event dispatch: manages events
- Game runtime → HUD presentation: updates display
- Game runtime → Overlay presentation: updates display
