# elyar-jamali/topdown_stealth_game architecture

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

- Interactive diagram: https://gitdiagram.com/elyar-jamali/topdown_stealth_game
- Repository: https://github.com/elyar-jamali/topdown_stealth_game

## Overview

TopDown Stealth Game is a Godot 4 stealth game. The main player workflow is navigation and movement, interaction with the world, and combat or takedowns, while guards patrol, perceive, and respond; the HUD and tactical map present gameplay state. Supporting capabilities include reusable character animation and appearance systems, NPC recovery and ragdolls, localization, themes, and editor tools for patrol routes and appearance previews. Relationships shown here are limited to those explicitly described in the README; no source excerpts were available, so unsampled implementation links are omitted.

Main entry points: [`scripts/Characters/player.gd`](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/Characters/player.gd) (Player Controller), [`scripts/NPC/NPC.gd`](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/NPC/NPC.gd) (NPC Behavior), [`scripts/Characters/FemaleVisual.gd`](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/Characters/FemaleVisual.gd) (Character Visuals), [`scripts/UI/HUD.gd`](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/UI/HUD.gd) (Gameplay HUD)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Player Gameplay"]
  node_player["Player Controller<br/>[player.gd]"]
  node_movement["Navigation Movement<br/>[DetourPlanner.gd]"]
  node_interaction["Interaction System"]
  node_combat["Firearm Combat<br/>[player.gd]"]
  node_takedowns["Stealth Takedowns<br/>[player.gd]"]
  node_weapon_preview["Weapon Preview<br/>[WeaponPreview.gd]"]
end

subgraph group_world["World and NPCs"]
  node_doors["Interactive Doors<br/>[door.gd]"]
  node_npc["NPC Behavior<br/>[NPC.gd]"]
  node_patrol["NPC Patrol<br/>[PatrolRoute.gd]"]
  node_vision["Guard Vision"]
  node_ragdoll["NPC Ragdolls<br/>[RagdollDriver.gd]"]
end

subgraph group_characters["Character Systems"]
  node_animation["Animation Controller"]
  node_visuals["Character Visuals<br/>[FemaleVisual.gd]"]
end

subgraph group_interface["UI and Presentation"]
  node_hud["Gameplay HUD<br/>[HUD.gd]"]
  node_map["Tactical Map<br/>[HUD.tscn]"]
  node_cursor["Cursor and Hover<br/>[CursorManager.gd]"]
  node_dialogue["Dialogue UI<br/>[DialogueSystem.gd]"]
  node_menus["Menus and Settings<br/>[MainMenu.gd]"]
  node_localization["Localization"]
  node_themes["UI Themes<br/>[ThemeManager.gd]"]
end

subgraph group_authoring["Editor Tools"]
  node_waypoint_tool["Waypoint Painter"]
  node_appearance_tool["Appearance Preview"]
end

node_player_actor(("Player"))

node_player_actor -->|"controls"| node_player
node_player -->|"navigates by"| node_movement
node_player -->|"interacts through"| node_interaction
node_player -->|"aims and fires"| node_combat
node_player -->|"performs"| node_takedowns
node_combat -->|"previews trajectory"| node_weapon_preview
node_interaction -->|"interacts with"| node_doors
node_npc -->|"uses patrol routes"| node_patrol
node_npc -->|"uses guard vision"| node_vision
node_npc -->|"falls into"| node_ragdoll
node_player -->|"shares animations"| node_animation
node_npc -->|"shares animations"| node_animation
node_npc -->|"uses character visuals"| node_visuals
node_player -->|"uses character visuals"| node_visuals
node_hud -->|"integrates map"| node_map
node_hud -->|"provides dialogue access"| node_dialogue
node_menus -->|"offers theme selection"| node_themes
node_menus -->|"uses localized UI"| node_localization
node_waypoint_tool -->|"creates patrol routes"| node_patrol
node_appearance_tool -->|"previews appearances"| node_visuals

click node_player "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/Characters/player.gd"
click node_movement "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/AI/DetourPlanner.gd"
click node_interaction "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/interaction/InteractionSystem.gd"
click node_combat "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/Characters/player.gd"
click node_takedowns "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/Characters/player.gd"
click node_weapon_preview "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/Characters/WeaponPreview.gd"
click node_doors "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/Entities/door.gd"
click node_npc "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/NPC/NPC.gd"
click node_patrol "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/NPC/PatrolRoute.gd"
click node_vision "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/AI/vision_component.gd"
click node_ragdoll "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/NPC/RagdollDriver.gd"
click node_animation "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/Characters/CharacterAnimationController.gd"
click node_visuals "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/Characters/FemaleVisual.gd"
click node_hud "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/UI/HUD.gd"
click node_map "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scenes/menus/HUD.tscn"
click node_cursor "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/UI/CursorManager.gd"
click node_dialogue "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/UI/DialogueSystem.gd"
click node_menus "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/UI/MainMenu.gd"
click node_localization "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/UI/LocalizationManager.gd"
click node_themes "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/UI/ThemeManager.gd"
click node_waypoint_tool "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/addons/waypoint_painter/waypoint_painter.gd"
click node_appearance_tool "https://github.com/elyar-jamali/topdown_stealth_game/blob/main/addons/npc_visual_preview/npc_visual_inspector.gd"

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_movement,node_interaction,node_combat,node_takedowns,node_weapon_preview toneBlue
class node_doors,node_npc,node_patrol,node_vision,node_ragdoll toneAmber
class node_animation,node_visuals toneMint
class node_hud,node_map,node_cursor,node_dialogue,node_menus,node_localization,node_themes toneRose
class node_waypoint_tool,node_appearance_tool,node_player_actor toneIndigo
```

## Components

### Player Gameplay

- [Player Controller](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/Characters/player.gd): `scripts/Characters/player.gd`
- [Navigation Movement](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/AI/DetourPlanner.gd): `scripts/AI/DetourPlanner.gd`
- [Interaction System](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/interaction/InteractionSystem.gd): `scripts/interaction/InteractionSystem.gd`
- [Firearm Combat](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/Characters/player.gd): `scripts/Characters/player.gd`
- [Stealth Takedowns](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/Characters/player.gd): `scripts/Characters/player.gd`
- [Weapon Preview](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/Characters/WeaponPreview.gd): `scripts/Characters/WeaponPreview.gd`

### World and NPCs

- [Interactive Doors](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/Entities/door.gd): `scripts/Entities/door.gd`
- [NPC Behavior](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/NPC/NPC.gd): `scripts/NPC/NPC.gd`
- [NPC Patrol](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/NPC/PatrolRoute.gd): `scripts/NPC/PatrolRoute.gd`
- [Guard Vision](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/AI/vision_component.gd): `scripts/AI/vision_component.gd`
- [NPC Ragdolls](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/NPC/RagdollDriver.gd): `scripts/NPC/RagdollDriver.gd`

### Character Systems

- [Animation Controller](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/Characters/CharacterAnimationController.gd): `scripts/Characters/CharacterAnimationController.gd`
- [Character Visuals](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/Characters/FemaleVisual.gd): `scripts/Characters/FemaleVisual.gd`

### UI and Presentation

- [Gameplay HUD](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/UI/HUD.gd): `scripts/UI/HUD.gd`
- [Tactical Map](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scenes/menus/HUD.tscn): `scenes/menus/HUD.tscn`
- [Cursor and Hover](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/UI/CursorManager.gd): `scripts/UI/CursorManager.gd`
- [Dialogue UI](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/UI/DialogueSystem.gd): `scripts/UI/DialogueSystem.gd`
- [Menus and Settings](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/UI/MainMenu.gd): `scripts/UI/MainMenu.gd`
- [Localization](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/UI/LocalizationManager.gd): `scripts/UI/LocalizationManager.gd`
- [UI Themes](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/scripts/UI/ThemeManager.gd): `scripts/UI/ThemeManager.gd`

### Editor Tools

- [Waypoint Painter](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/addons/waypoint_painter/waypoint_painter.gd): `addons/waypoint_painter/waypoint_painter.gd`
- [Appearance Preview](https://github.com/elyar-jamali/topdown_stealth_game/blob/main/addons/npc_visual_preview/npc_visual_inspector.gd): `addons/npc_visual_preview/npc_visual_inspector.gd`

### Other components

- **Player**

## Connections

- Player → Player Controller: controls (evidence: `README.md`)
- Player Controller → Navigation Movement: navigates by (evidence: `README.md`)
- Player Controller → Interaction System: interacts through (evidence: `README.md`)
- Player Controller → Firearm Combat: aims and fires (evidence: `README.md`)
- Player Controller → Stealth Takedowns: performs (evidence: `README.md`)
- Firearm Combat → Weapon Preview: previews trajectory (evidence: `README.md`)
- Interaction System → Interactive Doors: interacts with (evidence: `README.md`)
- NPC Behavior → NPC Patrol: uses patrol routes (evidence: `README.md`)
- NPC Behavior → Guard Vision: uses guard vision (evidence: `README.md`)
- NPC Behavior → NPC Ragdolls: falls into (evidence: `README.md`)
- Player Controller → Animation Controller: shares animations (evidence: `README.md`)
- NPC Behavior → Animation Controller: shares animations (evidence: `README.md`)
- NPC Behavior → Character Visuals: uses character visuals (evidence: `README.md`)
- Player Controller → Character Visuals: uses character visuals (evidence: `README.md`)
- Gameplay HUD → Tactical Map: integrates map (evidence: `README.md`)
- Gameplay HUD → Dialogue UI: provides dialogue access (evidence: `README.md`)
- Menus and Settings → UI Themes: offers theme selection (evidence: `README.md`)
- Menus and Settings → Localization: uses localized UI (evidence: `README.md`)
- Waypoint Painter → NPC Patrol: creates patrol routes (evidence: `README.md`)
- Appearance Preview → Character Visuals: previews appearances (evidence: `README.md`)
