# maciejszybiak/q2unity architecture

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

- Interactive diagram: https://gitdiagram.com/maciejszybiak/q2unity
- Repository: https://github.com/maciejszybiak/q2unity

## Overview

q2unity is a Unity game project that recreates Quake II movement on BSP maps. The documented user workflow is to configure the Quake II game and mod folders, start the game, select a map, and play. Its main runtime domains are resource/map loading, BSP-based world rendering and collision, player movement, and a limited set of entities. The tree supports these subsystem boundaries, but no source excerpts were available, so internal call wiring is omitted where the README does not establish it.

Main entry points: [`Assets/Scripts/System/ResourceManagement/ResourceLoader.cs`](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/System/ResourceManagement/ResourceLoader.cs) (Resource Loading), [`Assets/Scripts/Physics/PlayerMove.cs`](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/Physics/PlayerMove.cs) (Movement Physics), [`Assets/Scripts/System/Loading/Loader.cs`](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/System/Loading/Loader.cs) (Map Loading), [`Assets/Scripts/Menu/MenuManager.cs`](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/Menu/MenuManager.cs) (Menu Flow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Game Setup"]
  node_settings["Folder Settings<br/>[MapPanel.cs]"]
  node_menu["Menu Flow<br/>[MenuManager.cs]"]
end

subgraph group_world["Map Runtime"]
  node_resources["Resource Loading<br/>[ResourceLoader.cs]"]
  node_pak["PAK Access<br/>[PakFile.cs]"]
  node_maploader["Map Loading<br/>[Loader.cs]"]
  node_bsp["BSP Parsing<br/>[BSPFile.cs]"]
  node_textures["Texture Loading<br/>[TextureLoader.cs]"]
  node_lightmaps["Lightmap Data<br/>[LightmapAtlas.cs]"]
end

subgraph group_play["Gameplay"]
  node_movement["Movement Physics<br/>[PlayerMove.cs]"]
  node_physics["Movement Core<br/>[Pmove.cs]"]
  node_collision["Trace Queries<br/>[Trace.cs]"]
  node_entities["Entity Runtime<br/>[EntitySpawn.cs]"]
  node_entityevents["Entity Events<br/>[EntityThink.cs]"]
  node_weapons["Weapons<br/>[Weapon.cs]"]
  node_projectiles["Projectiles<br/>[Projectile.cs]"]
end

subgraph group_support["Game Services"]
  node_config["Configuration<br/>[ConfigManager.cs]"]
  node_console["Console Commands<br/>[CommandManager.cs]"]
  node_audio["Audio<br/>[AudioManager.cs]"]
end

node_player(("Player"))
node_gamefiles["Quake II Files"]

node_player -->|"configures folders"| node_settings
node_player -->|"starts and selects"| node_menu
node_menu -->|"selects map"| node_maploader
node_gamefiles -->|"provides files"| node_resources
node_resources -->|"reads archives"| node_pak
node_resources -->|"supplies assets"| node_maploader
node_maploader -->|"loads BSP"| node_bsp
node_player -->|"moves in game"| node_movement
node_movement -->|"runs movement"| node_physics
node_movement -->|"queries collision"| node_collision
node_weapons -->|"fires"| node_projectiles
node_entities -->|"updates entities"| node_entityevents

click node_settings "https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/Menu/MapPanel.cs"
click node_menu "https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/Menu/MenuManager.cs"
click node_resources "https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/System/ResourceManagement/ResourceLoader.cs"
click node_pak "https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/System/ResourceManagement/PakFile.cs"
click node_maploader "https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/System/Loading/Loader.cs"
click node_bsp "https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/BSPFile/BSPFile.cs"
click node_textures "https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/TextureManagement/TextureLoader.cs"
click node_lightmaps "https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/TextureManagement/LightmapAtlas.cs"
click node_movement "https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/Physics/PlayerMove.cs"
click node_physics "https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/Physics/Pmove.cs"
click node_collision "https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/Physics/Trace.cs"
click node_entities "https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/Entities/EntitySpawn.cs"
click node_entityevents "https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/Entities/EntityThink.cs"
click node_weapons "https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/Game/Weapon.cs"
click node_projectiles "https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/Game/Projectile.cs"
click node_config "https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/System/Configuration/ConfigManager.cs"
click node_console "https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/System/Console/CommandManager.cs"
click node_audio "https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/System/AudioManager.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_settings,node_menu toneBlue
class node_resources,node_pak,node_maploader,node_bsp,node_textures,node_lightmaps toneAmber
class node_movement,node_physics,node_collision,node_entities,node_entityevents,node_weapons,node_projectiles toneMint
class node_config,node_console,node_audio toneRose
class node_player,node_gamefiles toneIndigo
```

## Components

### Game Setup

- [Folder Settings](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/Menu/MapPanel.cs): `Assets/Scripts/Menu/MapPanel.cs`
- [Menu Flow](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/Menu/MenuManager.cs): `Assets/Scripts/Menu/MenuManager.cs`

### Map Runtime

- [Resource Loading](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/System/ResourceManagement/ResourceLoader.cs): `Assets/Scripts/System/ResourceManagement/ResourceLoader.cs`
- [PAK Access](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/System/ResourceManagement/PakFile.cs): `Assets/Scripts/System/ResourceManagement/PakFile.cs`
- [Map Loading](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/System/Loading/Loader.cs): `Assets/Scripts/System/Loading/Loader.cs`
- [BSP Parsing](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/BSPFile/BSPFile.cs): `Assets/Scripts/BSPFile/BSPFile.cs`
- [Texture Loading](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/TextureManagement/TextureLoader.cs): `Assets/Scripts/TextureManagement/TextureLoader.cs`
- [Lightmap Data](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/TextureManagement/LightmapAtlas.cs): `Assets/Scripts/TextureManagement/LightmapAtlas.cs`

### Gameplay

- [Movement Physics](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/Physics/PlayerMove.cs): `Assets/Scripts/Physics/PlayerMove.cs`
- [Movement Core](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/Physics/Pmove.cs): `Assets/Scripts/Physics/Pmove.cs`
- [Trace Queries](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/Physics/Trace.cs): `Assets/Scripts/Physics/Trace.cs`
- [Entity Runtime](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/Entities/EntitySpawn.cs): `Assets/Scripts/Entities/EntitySpawn.cs`
- [Entity Events](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/Entities/EntityThink.cs): `Assets/Scripts/Entities/EntityThink.cs`
- [Weapons](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/Game/Weapon.cs): `Assets/Scripts/Game/Weapon.cs`
- [Projectiles](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/Game/Projectile.cs): `Assets/Scripts/Game/Projectile.cs`

### Game Services

- [Configuration](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/System/Configuration/ConfigManager.cs): `Assets/Scripts/System/Configuration/ConfigManager.cs`
- [Console Commands](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/System/Console/CommandManager.cs): `Assets/Scripts/System/Console/CommandManager.cs`
- [Audio](https://github.com/maciejszybiak/q2unity/blob/master/Assets/Scripts/System/AudioManager.cs): `Assets/Scripts/System/AudioManager.cs`

### Other components

- **Player**
- **Quake II Files**

## Connections

- Player → Folder Settings: configures folders
- Player → Menu Flow: starts and selects
- Menu Flow → Map Loading: selects map
- Quake II Files → Resource Loading: provides files
- Resource Loading → PAK Access: reads archives
- Resource Loading → Map Loading: supplies assets
- Map Loading → BSP Parsing: loads BSP
- Player → Movement Physics: moves in game
- Movement Physics → Movement Core: runs movement
- Movement Physics → Trace Queries: queries collision
- Weapons → Projectiles: fires
- Entity Runtime → Entity Events: updates entities
