# sriharichincholi/unbound architecture

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

- Interactive diagram: https://gitdiagram.com/sriharichincholi/unbound
- Repository: https://github.com/sriharichincholi/unbound

## Overview

This repository is a browser-based 3D action game, with hero and enemy combat, story progression, dialogue, and persistent saves. The runtime begins at bootstrap, which creates the engine, save manager, and React UI; the engine initializes and runs rendering, frame updates, and adaptive resolution. The UI displays player/story state and can request a progress reset. Audio, quests, AI, physics, and graphics subsystems represent additional game capabilities. Evidence is limited to the supplied excerpts and source-index references; uncertain wiring is omitted.

Main entry points: [`src/engine/Engine.ts`](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/engine/Engine.ts) (Engine), [`src/ui/app/AppUI.tsx`](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/ui/app/AppUI.tsx) (Game UI), [`src/dialogue/DialogueManager.ts`](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/dialogue/DialogueManager.ts) (Dialogue Manager), [`src/core/events/EventBus.ts`](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/core/events/EventBus.ts) (Event Bus)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game Runtime"]
  node_bootstrap["Bootstrap<br/>[bootstrap.ts]"]
  node_engine["Engine<br/>[Engine.ts]"]
  node_events["Event Bus<br/>[EventBus.ts]"]
  node_game_state[("Game State<br/>[GameStore.ts]")]
end

subgraph group_play["Gameplay Systems"]
  node_player_state[("Player State<br/>[PlayerState.ts]")]
  node_story_state[("Story State<br/>[StoryState.ts]")]
  node_ai["Enemy AI<br/>[EnemyBrain.ts]"]
  node_behavior["Behavior Tree<br/>[BehaviorTree.ts]"]
  node_combat["Damage System<br/>[DamageSystem.ts]"]
  node_physics["Physics World<br/>[PhysicsWorld.ts]"]
  node_controller["Character Controller"]
  node_quests["Quest Manager<br/>[QuestManager.ts]"]
  node_quest["Quest<br/>[Quest.ts]"]
  node_objective["Objective<br/>[Objective.ts]"]
end

subgraph group_presentation["Presentation"]
  node_ui["Game UI<br/>[AppUI.tsx]"]
  node_scene["Scene Manager<br/>[SceneManager.ts]"]
  node_renderer["WebGPU Renderer<br/>[WebGPURenderer.ts]"]
  node_render_loop["Render Loop<br/>[RenderLoop.ts]"]
  node_resolution["Adaptive Resolution"]
  node_fps["FPS Monitor<br/>[FPSMonitor.ts]"]
  node_audio["Audio Manager<br/>[AudioManager.ts]"]
  node_music["Music Manager<br/>[MusicManager.ts]"]
  node_sfx["Sound Effects<br/>[SoundEffects.ts]"]
  node_voice["Voice Manager<br/>[VoiceManager.ts]"]
  node_foliage["Instanced Foliage"]
  node_wind["Wind System<br/>[WindSystem.ts]"]
end

subgraph group_persistence["State and Saves"]
  node_save_manager["Save Manager<br/>[SaveManager.ts]"]
end

subgraph group_content["Game Content"]
  node_heroes["Playable Heroes<br/>[Hero.ts]"]
  node_enemies["Enemy Types<br/>[Enemies.ts]"]
  node_dialogue["Dialogue Manager<br/>[DialogueManager.ts]"]
  node_priority["Priority Queue<br/>[PriorityQueue.ts]"]
  node_subtitles["Subtitle Queue<br/>[SubtitleQueue.ts]"]
  node_dialogue_audio["Dialogue Audio Queue<br/>[AudioQueue.ts]"]
end

node_player(("Player"))

node_player -.->|"uses"| node_ui
node_bootstrap -->|"creates"| node_engine
node_bootstrap -->|"mounts"| node_ui
node_bootstrap -->|"creates"| node_save_manager
node_engine -->|"initializes"| node_renderer
node_engine -->|"creates"| node_scene
node_engine -->|"creates"| node_render_loop
node_engine -->|"updates"| node_fps
node_engine -->|"updates"| node_resolution
node_engine -->|"reads"| node_game_state
node_resolution -->|"adjusts"| node_renderer
node_resolution -->|"reads"| node_fps
node_fps -->|"emits"| node_events
node_ui -->|"reads"| node_player_state
node_ui -->|"reads"| node_story_state
node_ui -->|"reads"| node_game_state
node_ui -->|"resets through"| node_save_manager
node_ai -->|"uses"| node_behavior
node_ai -->|"emits"| node_events
node_quests -->|"uses"| node_quest
node_quests -->|"emits"| node_events
node_quest -->|"uses"| node_objective
node_dialogue -->|"queues"| node_priority
node_dialogue -->|"sets subtitles"| node_subtitles
node_dialogue -->|"plays audio"| node_dialogue_audio
node_dialogue -->|"emits"| node_events
node_audio -->|"uses"| node_music
node_audio -->|"uses"| node_sfx
node_audio -->|"uses"| node_voice
node_foliage -->|"uses"| node_wind

click node_bootstrap "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/bootstrap.ts"
click node_engine "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/engine/Engine.ts"
click node_events "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/core/events/EventBus.ts"
click node_game_state "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/core/state/GameStore.ts"
click node_ui "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/ui/app/AppUI.tsx"
click node_scene "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/renderer/SceneManager.ts"
click node_renderer "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/renderer/WebGPURenderer.ts"
click node_render_loop "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/renderer/RenderLoop.ts"
click node_resolution "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/graphics/drs/DynamicResolutionScaler.ts"
click node_fps "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/graphics/drs/FPSMonitor.ts"
click node_player_state "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/core/state/PlayerState.ts"
click node_story_state "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/core/state/StoryState.ts"
click node_heroes "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/game/characters/common/Hero.ts"
click node_enemies "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/game/enemies/Enemies.ts"
click node_ai "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/systems/ai/EnemyBrain.ts"
click node_behavior "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/systems/ai/BehaviorTree.ts"
click node_combat "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/systems/combat/DamageSystem.ts"
click node_physics "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/physics/PhysicsWorld.ts"
click node_controller "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/physics/CharacterController.ts"
click node_quests "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/quests/QuestManager.ts"
click node_quest "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/quests/Quest.ts"
click node_objective "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/quests/Objective.ts"
click node_dialogue "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/dialogue/DialogueManager.ts"
click node_priority "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/dialogue/PriorityQueue.ts"
click node_subtitles "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/dialogue/SubtitleQueue.ts"
click node_dialogue_audio "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/dialogue/AudioQueue.ts"
click node_audio "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/audio/AudioManager.ts"
click node_music "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/audio/MusicManager.ts"
click node_sfx "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/audio/SoundEffects.ts"
click node_voice "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/audio/VoiceManager.ts"
click node_foliage "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/graphics/foliage/InstancedFoliage.ts"
click node_wind "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/graphics/foliage/WindSystem.ts"
click node_save_manager "https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/save/SaveManager.ts"

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_bootstrap,node_engine,node_events,node_game_state toneBlue
class node_player_state,node_story_state,node_ai,node_behavior,node_combat,node_physics,node_controller,node_quests,node_quest,node_objective toneAmber
class node_ui,node_scene,node_renderer,node_render_loop,node_resolution,node_fps,node_audio,node_music,node_sfx,node_voice,node_foliage,node_wind toneMint
class node_save_manager toneRose
class node_heroes,node_enemies,node_dialogue,node_priority,node_subtitles,node_dialogue_audio,node_player toneIndigo
```

## Components

### Game Runtime

- [Bootstrap](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/bootstrap.ts): `src/bootstrap.ts`
- [Engine](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/engine/Engine.ts): `src/engine/Engine.ts`
- [Event Bus](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/core/events/EventBus.ts): `src/core/events/EventBus.ts`
- [Game State](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/core/state/GameStore.ts): `src/core/state/GameStore.ts`

### Gameplay Systems

- [Player State](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/core/state/PlayerState.ts): `src/core/state/PlayerState.ts`
- [Story State](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/core/state/StoryState.ts): `src/core/state/StoryState.ts`
- [Enemy AI](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/systems/ai/EnemyBrain.ts): `src/systems/ai/EnemyBrain.ts`
- [Behavior Tree](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/systems/ai/BehaviorTree.ts): `src/systems/ai/BehaviorTree.ts`
- [Damage System](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/systems/combat/DamageSystem.ts): `src/systems/combat/DamageSystem.ts`
- [Physics World](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/physics/PhysicsWorld.ts): `src/physics/PhysicsWorld.ts`
- [Character Controller](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/physics/CharacterController.ts): `src/physics/CharacterController.ts`
- [Quest Manager](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/quests/QuestManager.ts): `src/quests/QuestManager.ts`
- [Quest](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/quests/Quest.ts): `src/quests/Quest.ts`
- [Objective](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/quests/Objective.ts): `src/quests/Objective.ts`

### Presentation

- [Game UI](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/ui/app/AppUI.tsx): `src/ui/app/AppUI.tsx`
- [Scene Manager](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/renderer/SceneManager.ts): `src/renderer/SceneManager.ts`
- [WebGPU Renderer](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/renderer/WebGPURenderer.ts): `src/renderer/WebGPURenderer.ts`
- [Render Loop](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/renderer/RenderLoop.ts): `src/renderer/RenderLoop.ts`
- [Adaptive Resolution](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/graphics/drs/DynamicResolutionScaler.ts): `src/graphics/drs/DynamicResolutionScaler.ts`
- [FPS Monitor](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/graphics/drs/FPSMonitor.ts): `src/graphics/drs/FPSMonitor.ts`
- [Audio Manager](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/audio/AudioManager.ts): `src/audio/AudioManager.ts`
- [Music Manager](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/audio/MusicManager.ts): `src/audio/MusicManager.ts`
- [Sound Effects](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/audio/SoundEffects.ts): `src/audio/SoundEffects.ts`
- [Voice Manager](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/audio/VoiceManager.ts): `src/audio/VoiceManager.ts`
- [Instanced Foliage](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/graphics/foliage/InstancedFoliage.ts): `src/graphics/foliage/InstancedFoliage.ts`
- [Wind System](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/graphics/foliage/WindSystem.ts): `src/graphics/foliage/WindSystem.ts`

### State and Saves

- [Save Manager](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/save/SaveManager.ts): `src/save/SaveManager.ts`

### Game Content

- [Playable Heroes](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/game/characters/common/Hero.ts): `src/game/characters/common/Hero.ts`
- [Enemy Types](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/game/enemies/Enemies.ts): `src/game/enemies/Enemies.ts`
- [Dialogue Manager](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/dialogue/DialogueManager.ts): `src/dialogue/DialogueManager.ts`
- [Priority Queue](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/dialogue/PriorityQueue.ts): `src/dialogue/PriorityQueue.ts`
- [Subtitle Queue](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/dialogue/SubtitleQueue.ts): `src/dialogue/SubtitleQueue.ts`
- [Dialogue Audio Queue](https://github.com/sriharichincholi/unbound/blob/feature/unbound-engine-implementation-9788373148748763214/src/dialogue/AudioQueue.ts): `src/dialogue/AudioQueue.ts`

### Other components

- **Player**

## Connections

- Player → Game UI: uses
- Bootstrap → Engine: creates (evidence: `src/bootstrap.ts`)
- Bootstrap → Game UI: mounts (evidence: `src/bootstrap.ts`)
- Bootstrap → Save Manager: creates (evidence: `src/bootstrap.ts`)
- Engine → WebGPU Renderer: initializes (evidence: `src/engine/Engine.ts`)
- Engine → Scene Manager: creates (evidence: `src/engine/Engine.ts`)
- Engine → Render Loop: creates (evidence: `src/engine/Engine.ts`)
- Engine → FPS Monitor: updates (evidence: `src/engine/Engine.ts`)
- Engine → Adaptive Resolution: updates (evidence: `src/engine/Engine.ts`)
- Engine → Game State: reads (evidence: `src/engine/Engine.ts`)
- Adaptive Resolution → WebGPU Renderer: adjusts (evidence: `src/graphics/drs/DynamicResolutionScaler.ts`)
- Adaptive Resolution → FPS Monitor: reads (evidence: `src/graphics/drs/DynamicResolutionScaler.ts`)
- FPS Monitor → Event Bus: emits (evidence: `src/graphics/drs/FPSMonitor.ts`)
- Game UI → Player State: reads (evidence: `src/ui/app/AppUI.tsx`)
- Game UI → Story State: reads (evidence: `src/ui/app/AppUI.tsx`)
- Game UI → Game State: reads (evidence: `src/ui/app/AppUI.tsx`)
- Game UI → Save Manager: resets through (evidence: `src/ui/app/AppUI.tsx`)
- Enemy AI → Behavior Tree: uses (evidence: `src/systems/ai/EnemyBrain.ts`)
- Enemy AI → Event Bus: emits (evidence: `src/systems/ai/EnemyBrain.ts`)
- Quest Manager → Quest: uses (evidence: `src/quests/QuestManager.ts`)
- Quest Manager → Event Bus: emits (evidence: `src/quests/QuestManager.ts`)
- Quest → Objective: uses (evidence: `src/quests/Quest.ts`)
- Dialogue Manager → Priority Queue: queues (evidence: `src/dialogue/DialogueManager.ts`)
- Dialogue Manager → Subtitle Queue: sets subtitles (evidence: `src/dialogue/DialogueManager.ts`)
- Dialogue Manager → Dialogue Audio Queue: plays audio (evidence: `src/dialogue/DialogueManager.ts`)
- Dialogue Manager → Event Bus: emits (evidence: `src/dialogue/DialogueManager.ts`)
- Audio Manager → Music Manager: uses (evidence: `src/audio/AudioManager.ts`)
- Audio Manager → Sound Effects: uses (evidence: `src/audio/AudioManager.ts`)
- Audio Manager → Voice Manager: uses (evidence: `src/audio/AudioManager.ts`)
- Instanced Foliage → Wind System: uses (evidence: `src/graphics/foliage/InstancedFoliage.ts`)
