# dprlive/raid4 architecture

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

- Interactive diagram: https://gitdiagram.com/dprlive/raid4
- Repository: https://github.com/dprlive/raid4

## Overview

RAID 4 is a UE5, 1–4 player third-person multiplayer boss-raid game. The principal flow is players joining a LAN session, selecting a character, then entering combat against AI-controlled enemies. The source tree also shows data-driven character stats, skills, buffs, detection, animation, and HUD systems. The graph combines documented capabilities with relationships visible in the supplied source index and excerpts; unsampled gameplay wiring is left dashed or omitted.

Main entry points: [`Source/Raid4/Character/R4CharacterBase.h`](https://github.com/dprlive/raid4/blob/master/Source/Raid4/Character/R4CharacterBase.h) (Characters), [`Source/Raid4/Game/R4GameInstance.cpp`](https://github.com/dprlive/raid4/blob/master/Source/Raid4/Game/R4GameInstance.cpp) (Game instance), [`Source/Raid4/Controller/R4AIController.cpp`](https://github.com/dprlive/raid4/blob/master/Source/Raid4/Controller/R4AIController.cpp) (AI controller), [`Source/Raid4/AI/BTService/BTService_CalculateAggro.cpp`](https://github.com/dprlive/raid4/blob/master/Source/Raid4/AI/BTService/BTService_CalculateAggro.cpp) (Aggro service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lobby["Lobby and Match"]
  node_menu["Main menu"]
  node_sessions["Session entry"]
  node_game_instance["Game instance<br/>[R4GameInstance.cpp]"]
  node_lobby_mode["Lobby game mode<br/>[R4LobbyGameMode.h]"]
  node_picker["Character picker"]
  node_player_controller["Player controller"]
  node_pick_mode["Pick game mode"]
  node_game_mode["Raid game mode<br/>[R4GameMode.h]"]
end

subgraph group_combat["Combat Systems"]
  node_characters["Characters<br/>[R4CharacterBase.h]"]
  node_player_skills["Player skills"]
  node_enemy_skills["Enemy skills"]
  node_buffs["Buff system"]
  node_detection["Combat detection"]
  node_animation_skills["Animation skills"]
  node_hud["In-game HUD"]
  node_damage_interface["Damage interface"]
  node_animation_interface["Animation interface"]
  node_animation_util["Animation utilities<br/>[UtilAnimation.h]"]
end

subgraph group_ai["Enemy AI"]
  node_ai_controller["AI controller<br/>[R4AIController.cpp]"]
  node_aggro_service["Aggro service"]
  node_ai_tasks["Behavior tasks"]
  node_ai_interface["Character AI interface"]
end

subgraph group_data["Data and Runtime"]
  node_data_tables[("Data tables")]
  node_character_rows["Character rows"]
  node_object_pool["Object pool<br/>[ObjectPool.cpp]"]
end

node_players(("Players"))

node_players -.->|"browse"| node_menu
node_menu -.->|"show sessions"| node_sessions
node_sessions -->|"use session"| node_game_instance
node_players -.->|"choose character"| node_picker
node_picker -.->|"request pick"| node_player_controller
node_player_controller -->|"routes request"| node_pick_mode
node_lobby_mode -.->|"lobby lifecycle"| node_game_instance
node_game_mode -.->|"spawn for combat"| node_characters
node_characters -.->|"use skills"| node_player_skills
node_characters -.->|"use skills"| node_enemy_skills
node_characters -.->|"receive buffs"| node_buffs
node_characters -.->|"detect targets"| node_detection
node_animation_skills -->|"uses"| node_animation_interface
node_animation_skills -->|"uses"| node_animation_util
node_characters -.->|"update status"| node_hud
node_ai_controller -->|"binds death event"| node_damage_interface
node_aggro_service -->|"reads aggro"| node_ai_interface
node_aggro_service -->|"checks targets"| node_characters
node_ai_controller -.->|"runs behavior tree"| node_aggro_service
node_ai_controller -.->|"runs behavior tree"| node_ai_tasks
node_game_instance -->|"initializes"| node_data_tables
node_game_instance -->|"initializes"| node_object_pool
node_data_tables -->|"loads rows"| node_character_rows

click node_menu "https://github.com/dprlive/raid4/blob/master/Source/Raid4/UI/MainMenu/R4MainMenuWidget.cpp"
click node_sessions "https://github.com/dprlive/raid4/blob/master/Source/Raid4/UI/MainMenu/R4SessionEntryWidget.cpp"
click node_game_instance "https://github.com/dprlive/raid4/blob/master/Source/Raid4/Game/R4GameInstance.cpp"
click node_lobby_mode "https://github.com/dprlive/raid4/blob/master/Source/Raid4/Game/R4LobbyGameMode.h"
click node_picker "https://github.com/dprlive/raid4/blob/master/Source/Raid4/UI/CharacterPick/R4CharacterPickerWidget.cpp"
click node_player_controller "https://github.com/dprlive/raid4/blob/master/Source/Raid4/Controller/R4PlayerController.cpp"
click node_pick_mode "https://github.com/dprlive/raid4/blob/master/Source/Raid4/Game/R4CharacterPickGameModeInterface.h"
click node_game_mode "https://github.com/dprlive/raid4/blob/master/Source/Raid4/Game/R4GameMode.h"
click node_characters "https://github.com/dprlive/raid4/blob/master/Source/Raid4/Character/R4CharacterBase.h"
click node_player_skills "https://github.com/dprlive/raid4/tree/master/Source/Raid4/Skill/Player"
click node_enemy_skills "https://github.com/dprlive/raid4/tree/master/Source/Raid4/Skill/NonPlayer"
click node_buffs "https://github.com/dprlive/raid4/blob/master/Source/Raid4/Buff/R4BuffManageComponent.cpp"
click node_detection "https://github.com/dprlive/raid4/tree/master/Source/Raid4/Detect/Detector"
click node_animation_skills "https://github.com/dprlive/raid4/blob/master/Source/Raid4/Skill/R4AnimSkillBase.cpp"
click node_hud "https://github.com/dprlive/raid4/blob/master/Source/Raid4/UI/HUD/R4InGameHUDWidget.cpp"
click node_ai_controller "https://github.com/dprlive/raid4/blob/master/Source/Raid4/Controller/R4AIController.cpp"
click node_aggro_service "https://github.com/dprlive/raid4/blob/master/Source/Raid4/AI/BTService/BTService_CalculateAggro.cpp"
click node_ai_tasks "https://github.com/dprlive/raid4/tree/master/Source/Raid4/AI/BTTask"
click node_data_tables "https://github.com/dprlive/raid4/blob/master/Source/Raid4/Manager/DataTableManager.cpp"
click node_character_rows "https://github.com/dprlive/raid4/tree/master/Source/Raid4/Data/Character"
click node_object_pool "https://github.com/dprlive/raid4/blob/master/Source/Raid4/Core/ObjectPool/ObjectPool.cpp"
click node_damage_interface "https://github.com/dprlive/raid4/blob/master/Source/Raid4/Damage/R4DamageReceiveInterface.h"
click node_ai_interface "https://github.com/dprlive/raid4/blob/master/Source/Raid4/AI/R4CharacterAIInterface.h"
click node_animation_interface "https://github.com/dprlive/raid4/blob/master/Source/Raid4/Animation/R4AnimationInterface.h"
click node_animation_util "https://github.com/dprlive/raid4/blob/master/Source/Raid4/Util/UtilAnimation.h"

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_menu,node_sessions,node_game_instance,node_lobby_mode,node_picker,node_player_controller,node_pick_mode,node_game_mode toneBlue
class node_characters,node_player_skills,node_enemy_skills,node_buffs,node_detection,node_animation_skills,node_hud,node_damage_interface,node_animation_interface,node_animation_util toneAmber
class node_ai_controller,node_aggro_service,node_ai_tasks,node_ai_interface toneMint
class node_data_tables,node_character_rows,node_object_pool toneRose
class node_players toneIndigo
```

## Components

### Lobby and Match

- [Main menu](https://github.com/dprlive/raid4/blob/master/Source/Raid4/UI/MainMenu/R4MainMenuWidget.cpp): `Source/Raid4/UI/MainMenu/R4MainMenuWidget.cpp`
- [Session entry](https://github.com/dprlive/raid4/blob/master/Source/Raid4/UI/MainMenu/R4SessionEntryWidget.cpp): `Source/Raid4/UI/MainMenu/R4SessionEntryWidget.cpp`
- [Game instance](https://github.com/dprlive/raid4/blob/master/Source/Raid4/Game/R4GameInstance.cpp): `Source/Raid4/Game/R4GameInstance.cpp`
- [Lobby game mode](https://github.com/dprlive/raid4/blob/master/Source/Raid4/Game/R4LobbyGameMode.h): `Source/Raid4/Game/R4LobbyGameMode.h`
- [Character picker](https://github.com/dprlive/raid4/blob/master/Source/Raid4/UI/CharacterPick/R4CharacterPickerWidget.cpp): `Source/Raid4/UI/CharacterPick/R4CharacterPickerWidget.cpp`
- [Player controller](https://github.com/dprlive/raid4/blob/master/Source/Raid4/Controller/R4PlayerController.cpp): `Source/Raid4/Controller/R4PlayerController.cpp`
- [Pick game mode](https://github.com/dprlive/raid4/blob/master/Source/Raid4/Game/R4CharacterPickGameModeInterface.h): `Source/Raid4/Game/R4CharacterPickGameModeInterface.h`
- [Raid game mode](https://github.com/dprlive/raid4/blob/master/Source/Raid4/Game/R4GameMode.h): `Source/Raid4/Game/R4GameMode.h`

### Combat Systems

- [Characters](https://github.com/dprlive/raid4/blob/master/Source/Raid4/Character/R4CharacterBase.h): `Source/Raid4/Character/R4CharacterBase.h`
- [Player skills](https://github.com/dprlive/raid4/tree/master/Source/Raid4/Skill/Player): `Source/Raid4/Skill/Player`
- [Enemy skills](https://github.com/dprlive/raid4/tree/master/Source/Raid4/Skill/NonPlayer): `Source/Raid4/Skill/NonPlayer`
- [Buff system](https://github.com/dprlive/raid4/blob/master/Source/Raid4/Buff/R4BuffManageComponent.cpp): `Source/Raid4/Buff/R4BuffManageComponent.cpp`
- [Combat detection](https://github.com/dprlive/raid4/tree/master/Source/Raid4/Detect/Detector): `Source/Raid4/Detect/Detector`
- [Animation skills](https://github.com/dprlive/raid4/blob/master/Source/Raid4/Skill/R4AnimSkillBase.cpp): `Source/Raid4/Skill/R4AnimSkillBase.cpp`
- [In-game HUD](https://github.com/dprlive/raid4/blob/master/Source/Raid4/UI/HUD/R4InGameHUDWidget.cpp): `Source/Raid4/UI/HUD/R4InGameHUDWidget.cpp`
- [Damage interface](https://github.com/dprlive/raid4/blob/master/Source/Raid4/Damage/R4DamageReceiveInterface.h): `Source/Raid4/Damage/R4DamageReceiveInterface.h`
- [Animation interface](https://github.com/dprlive/raid4/blob/master/Source/Raid4/Animation/R4AnimationInterface.h): `Source/Raid4/Animation/R4AnimationInterface.h`
- [Animation utilities](https://github.com/dprlive/raid4/blob/master/Source/Raid4/Util/UtilAnimation.h): `Source/Raid4/Util/UtilAnimation.h`

### Enemy AI

- [AI controller](https://github.com/dprlive/raid4/blob/master/Source/Raid4/Controller/R4AIController.cpp): `Source/Raid4/Controller/R4AIController.cpp`
- [Aggro service](https://github.com/dprlive/raid4/blob/master/Source/Raid4/AI/BTService/BTService_CalculateAggro.cpp): `Source/Raid4/AI/BTService/BTService_CalculateAggro.cpp`
- [Behavior tasks](https://github.com/dprlive/raid4/tree/master/Source/Raid4/AI/BTTask): `Source/Raid4/AI/BTTask`
- [Character AI interface](https://github.com/dprlive/raid4/blob/master/Source/Raid4/AI/R4CharacterAIInterface.h): `Source/Raid4/AI/R4CharacterAIInterface.h`

### Data and Runtime

- [Data tables](https://github.com/dprlive/raid4/blob/master/Source/Raid4/Manager/DataTableManager.cpp): `Source/Raid4/Manager/DataTableManager.cpp`
- [Character rows](https://github.com/dprlive/raid4/tree/master/Source/Raid4/Data/Character): `Source/Raid4/Data/Character`
- [Object pool](https://github.com/dprlive/raid4/blob/master/Source/Raid4/Core/ObjectPool/ObjectPool.cpp): `Source/Raid4/Core/ObjectPool/ObjectPool.cpp`

### Other components

- **Players**

## Connections

- Players → Main menu: browse
- Main menu → Session entry: show sessions
- Session entry → Game instance: use session (evidence: `Source/Raid4/UI/MainMenu/R4SessionEntryWidget.cpp`)
- Players → Character picker: choose character
- Character picker → Player controller: request pick
- Player controller → Pick game mode: routes request (evidence: `Source/Raid4/Controller/R4PlayerController.cpp`)
- Lobby game mode → Game instance: lobby lifecycle (evidence: `Source/Raid4/Game/R4GameInstance.cpp`)
- Raid game mode → Characters: spawn for combat
- Characters → Player skills: use skills
- Characters → Enemy skills: use skills
- Characters → Buff system: receive buffs
- Characters → Combat detection: detect targets
- Animation skills → Animation interface: uses (evidence: `Source/Raid4/Skill/R4AnimSkillBase.cpp`)
- Animation skills → Animation utilities: uses (evidence: `Source/Raid4/Skill/R4AnimSkillBase.cpp`)
- Characters → In-game HUD: update status
- AI controller → Damage interface: binds death event (evidence: `Source/Raid4/Controller/R4AIController.cpp`)
- Aggro service → Character AI interface: reads aggro (evidence: `Source/Raid4/AI/BTService/BTService_CalculateAggro.cpp`)
- Aggro service → Characters: checks targets (evidence: `Source/Raid4/AI/BTService/BTService_CalculateAggro.cpp`)
- AI controller → Aggro service: runs behavior tree
- AI controller → Behavior tasks: runs behavior tree
- Game instance → Data tables: initializes (evidence: `Source/Raid4/Game/R4GameInstance.cpp`)
- Game instance → Object pool: initializes (evidence: `Source/Raid4/Game/R4GameInstance.cpp`)
- Data tables → Character rows: loads rows (evidence: `Source/Raid4/Manager/DataTableManager.cpp`)
