# waelhasnaoui1/gta-3-source-code architecture

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

- Interactive diagram: https://gitdiagram.com/waelhasnaoui1/gta-3-source-code
- Repository: https://github.com/waelhasnaoui1/gta-3-source-code

## Overview

re3 is a playable reimplementation of Grand Theft Auto III: it loads the game’s assets, runs the game world and its actors, and presents the result through rendering and audio backends. The main runtime source and README establish the game and its platform/rendering/audio scope; the sampled references also support several subsystem connections. Many feature implementations were not sampled, so the graph keeps those capabilities visible without guessing their call paths.

Main entry points: [`src/core/main.cpp`](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/core/main.cpp) (Game runtime), [`src/peds/Ped.h`](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/peds/Ped.h) (Pedestrians), [`src/audio/AudioManager.cpp`](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/audio/AudioManager.cpp) (Audio manager), [`src/core/World.h`](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/core/World.h) (World simulation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime and world"]
  node_world["World simulation<br/>[World.h]"]
  node_collision["Collision system<br/>[Collision.cpp]"]
  node_animation["Animation system<br/>[AnimManager.cpp]"]
  node_models["Model information"]
  node_streaming["Asset streaming<br/>[Streaming.cpp]"]
  node_runtime_entry["Game runtime<br/>[main.cpp]"]
end

subgraph group_actors["Actors and gameplay"]
  node_player["Player controls<br/>[Pad.h]"]
  node_player_ped["Player character<br/>[PlayerPed.h]"]
  node_ped_system["Pedestrians<br/>[Ped.h]"]
  node_vehicles["Vehicles<br/>[Vehicle.h]"]
  node_weapons["Weapons and combat<br/>[Weapon.cpp]"]
  node_gameplay_control["Missions and gameplay"]
end

subgraph group_presentation["Presentation"]
  node_camera["Camera<br/>[Camera.h]"]
  node_renderer["Rendering<br/>[Renderer.cpp]"]
  node_hud["HUD and text<br/>[Hud.cpp]"]
  node_particles["Particles and effects<br/>[Particle.h]"]
end

subgraph group_media["Audio"]
  node_audio_manager["Audio manager<br/>[AudioManager.cpp]"]
  node_music["Music and radio<br/>[MusicManager.cpp]"]
  node_audio_backend["Audio backends<br/>[sampman.h]"]
end

subgraph group_persistence["Persistence"]
  node_save["Save and load"]
end

node_game_assets["GTA III assets"]
node_player_actor(("Player"))
node_render_backend["RenderWare or librw"]
node_audio_provider["MSS or OpenAL"]

node_player -->|"configures"| node_player_ped
node_player_ped -.->|"extends"| node_ped_system
node_ped_system -->|"uses"| node_animation
node_ped_system -->|"uses"| node_collision
node_weapons -->|"requests audio"| node_audio_manager
node_world -->|"uses"| node_collision
node_runtime_entry -->|"uses"| node_renderer
node_runtime_entry -->|"uses"| node_hud
node_runtime_entry -.->|"uses"| node_streaming
node_streaming -.->|"loads"| node_game_assets
node_game_assets -->|"required input"| node_runtime_entry
node_models -.->|"model references"| node_runtime_entry
node_renderer -->|"renders through"| node_render_backend
node_hud -->|"reads camera state"| node_camera
node_particles -.->|"runtime integration"| node_runtime_entry
node_audio_manager -->|"uses"| node_music
node_audio_manager -->|"uses"| node_audio_backend
node_audio_backend -->|"selects"| node_audio_provider
node_player_actor -.->|"provides input"| node_player
node_save -.->|"loads game state"| node_runtime_entry
node_gameplay_control -.->|"gameplay interaction"| node_world
node_vehicles -.->|"world participation"| node_world

click node_player "https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/core/Pad.h"
click node_player_ped "https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/peds/PlayerPed.h"
click node_ped_system "https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/peds/Ped.h"
click node_vehicles "https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/vehicles/Vehicle.h"
click node_weapons "https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/weapons/Weapon.cpp"
click node_gameplay_control "https://github.com/waelhasnaoui1/gta-3-source-code/tree/master/src/control"
click node_world "https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/core/World.h"
click node_collision "https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/collision/Collision.cpp"
click node_animation "https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/animation/AnimManager.cpp"
click node_models "https://github.com/waelhasnaoui1/gta-3-source-code/tree/master/src/modelinfo"
click node_streaming "https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/core/Streaming.cpp"
click node_runtime_entry "https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/core/main.cpp"
click node_camera "https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/core/Camera.h"
click node_renderer "https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/renderer/Renderer.cpp"
click node_hud "https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/renderer/Hud.cpp"
click node_particles "https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/renderer/Particle.h"
click node_audio_manager "https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/audio/AudioManager.cpp"
click node_music "https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/audio/MusicManager.cpp"
click node_audio_backend "https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/audio/sampman.h"
click node_save "https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/save/GenericGameStorage.cpp"

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_world,node_collision,node_animation,node_models,node_streaming,node_runtime_entry toneBlue
class node_player,node_player_ped,node_ped_system,node_vehicles,node_weapons,node_gameplay_control toneAmber
class node_camera,node_renderer,node_hud,node_particles toneMint
class node_audio_manager,node_music,node_audio_backend toneRose
class node_save,node_game_assets,node_player_actor,node_render_backend,node_audio_provider toneIndigo
```

## Components

### Runtime and world

- [World simulation](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/core/World.h): `src/core/World.h`
- [Collision system](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/collision/Collision.cpp): `src/collision/Collision.cpp`
- [Animation system](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/animation/AnimManager.cpp): `src/animation/AnimManager.cpp`
- [Model information](https://github.com/waelhasnaoui1/gta-3-source-code/tree/master/src/modelinfo): `src/modelinfo`
- [Asset streaming](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/core/Streaming.cpp): `src/core/Streaming.cpp`
- [Game runtime](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/core/main.cpp): `src/core/main.cpp`

### Actors and gameplay

- [Player controls](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/core/Pad.h): `src/core/Pad.h`
- [Player character](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/peds/PlayerPed.h): `src/peds/PlayerPed.h`
- [Pedestrians](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/peds/Ped.h): `src/peds/Ped.h`
- [Vehicles](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/vehicles/Vehicle.h): `src/vehicles/Vehicle.h`
- [Weapons and combat](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/weapons/Weapon.cpp): `src/weapons/Weapon.cpp`
- [Missions and gameplay](https://github.com/waelhasnaoui1/gta-3-source-code/tree/master/src/control): `src/control`

### Presentation

- [Camera](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/core/Camera.h): `src/core/Camera.h`
- [Rendering](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/renderer/Renderer.cpp): `src/renderer/Renderer.cpp`
- [HUD and text](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/renderer/Hud.cpp): `src/renderer/Hud.cpp`
- [Particles and effects](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/renderer/Particle.h): `src/renderer/Particle.h`

### Audio

- [Audio manager](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/audio/AudioManager.cpp): `src/audio/AudioManager.cpp`
- [Music and radio](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/audio/MusicManager.cpp): `src/audio/MusicManager.cpp`
- [Audio backends](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/audio/sampman.h): `src/audio/sampman.h`

### Persistence

- [Save and load](https://github.com/waelhasnaoui1/gta-3-source-code/blob/master/src/save/GenericGameStorage.cpp): `src/save/GenericGameStorage.cpp`

### Other components

- **GTA III assets**
- **Player**
- **RenderWare or librw**
- **MSS or OpenAL**

## Connections

- Player controls → Player character: configures (evidence: `src/core/ControllerConfig.cpp`)
- Player character → Pedestrians: extends
- Pedestrians → Animation system: uses (evidence: `src/peds/Ped.h`)
- Pedestrians → Collision system: uses (evidence: `src/peds/Ped.h`)
- Weapons and combat → Audio manager: requests audio (evidence: `src/weapons/Weapon.cpp`)
- World simulation → Collision system: uses (evidence: `src/core/World.h`)
- Game runtime → Rendering: uses (evidence: `src/core/main.cpp`)
- Game runtime → HUD and text: uses (evidence: `src/core/main.cpp`)
- Game runtime → Asset streaming: uses
- Asset streaming → GTA III assets: loads
- GTA III assets → Game runtime: required input
- Model information → Game runtime: model references
- Rendering → RenderWare or librw: renders through
- HUD and text → Camera: reads camera state (evidence: `src/renderer/Hud.cpp`)
- Particles and effects → Game runtime: runtime integration (evidence: `src/core/main.cpp`)
- Audio manager → Music and radio: uses (evidence: `src/audio/AudioManager.cpp`)
- Audio manager → Audio backends: uses (evidence: `src/audio/AudioManager.cpp`)
- Audio backends → MSS or OpenAL: selects
- Player → Player controls: provides input
- Save and load → Game runtime: loads game state
- Missions and gameplay → World simulation: gameplay interaction (evidence: `src/control/Garages.cpp`)
- Vehicles → World simulation: world participation
