# ioquake/ioq3 architecture

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

- Interactive diagram: https://gitdiagram.com/ioquake/ioq3
- Repository: https://github.com/ioquake/ioq3

## Overview

ioquake3 is a Quake III engine for playing Quake III: Arena, Team Arena, and mods, with both client and dedicated-server runtime roles. The player-facing path is input and console commands through the client, networked game state and simulation, then rendered and audible output; dedicated servers run the game without that presentation path. The repository also includes bot navigation/AI, UI, and optional media, download, and voice capabilities. Arrows are limited to relationships stated in the README or visible in the supplied excerpts/index; other runtime wiring is omitted or marked unverified.

Main entry points: [`code/client/cl_main.c`](https://github.com/ioquake/ioq3/blob/main/code/client/cl_main.c) (Client runtime), [`code/server/sv_main.c`](https://github.com/ioquake/ioq3/blob/main/code/server/sv_main.c) (Server runtime), [`code/game/g_client.c`](https://github.com/ioquake/ioq3/blob/main/code/game/g_client.c) (Game simulation), [`code/cgame/cg_main.c`](https://github.com/ioquake/ioq3/blob/main/code/cgame/cg_main.c) (Client game)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_engine["Engine services"]
  node_server_app["Server runtime<br/>[sv_main.c]"]
  node_common["Common protocol<br/>[qcommon.h]"]
  node_filesystem[("Virtual filesystem<br/>[files.c]")]
end

subgraph group_gameplay["Gameplay runtime"]
  node_game_module["Game simulation<br/>[g_client.c]"]
  node_shared_movement["Shared movement<br/>[bg_pmove.c]"]
end

subgraph group_client["Client experience"]
  node_client_app["Client runtime<br/>[cl_main.c]"]
  node_cgame["Client game<br/>[cg_main.c]"]
  node_ui["Game UI<br/>[ui_main.c]"]
  node_renderer_gl1["OpenGL 1 renderer<br/>[tr_main.c]"]
  node_renderer_gl2["OpenGL 2 renderer<br/>[tr_main.c]"]
  node_sound["Sound system<br/>[snd_main.c]"]
end

subgraph group_integrations["Platform integrations"]
  node_sdl_input["SDL input<br/>[sdl_input.c]"]
  node_http_downloads["HTTP downloads<br/>[cl_http_curl.c]"]
  node_voice["Voice and Mumble<br/>[libmumblelink.c]"]
end

subgraph group_bots["Bot AI"]
  node_botlib["Bot navigation<br/>[be_aas_reach.c]"]
  node_bot_ai["Bot decision and movement<br/>[be_ai_move.c]"]
end

node_player(("Player"))

node_player -->|"plays through"| node_client_app
node_client_app -.->|"exchanges game state"| node_server_app
node_server_app -.->|"runs game logic"| node_game_module
node_client_app -->|"uses shared protocol"| node_common
node_server_app -->|"uses shared protocol"| node_common
node_common -->|"exposes file APIs"| node_filesystem
node_player -->|"provides controls"| node_sdl_input
node_sdl_input -->|"forwards input"| node_client_app
node_client_app -.->|"loads client game"| node_cgame
node_cgame -.->|"submits scenes"| node_renderer_gl1
node_cgame -.->|"submits scenes"| node_renderer_gl2
node_player -.->|"uses menus"| node_ui
node_client_app -.->|"plays audio"| node_sound
node_client_app -->|"downloads game data"| node_http_downloads
node_client_app -->|"supports voice chat"| node_voice
node_game_module -.->|"shares movement rules"| node_shared_movement
node_game_module -.->|"supports bot gameplay"| node_bot_ai
node_bot_ai -.->|"uses navigation data"| node_botlib

click node_client_app "https://github.com/ioquake/ioq3/blob/main/code/client/cl_main.c"
click node_server_app "https://github.com/ioquake/ioq3/blob/main/code/server/sv_main.c"
click node_common "https://github.com/ioquake/ioq3/blob/main/code/qcommon/qcommon.h"
click node_filesystem "https://github.com/ioquake/ioq3/blob/main/code/qcommon/files.c"
click node_game_module "https://github.com/ioquake/ioq3/blob/main/code/game/g_client.c"
click node_shared_movement "https://github.com/ioquake/ioq3/blob/main/code/game/bg_pmove.c"
click node_cgame "https://github.com/ioquake/ioq3/blob/main/code/cgame/cg_main.c"
click node_ui "https://github.com/ioquake/ioq3/blob/main/code/ui/ui_main.c"
click node_renderer_gl1 "https://github.com/ioquake/ioq3/blob/main/code/renderergl1/tr_main.c"
click node_renderer_gl2 "https://github.com/ioquake/ioq3/blob/main/code/renderergl2/tr_main.c"
click node_sound "https://github.com/ioquake/ioq3/blob/main/code/client/snd_main.c"
click node_sdl_input "https://github.com/ioquake/ioq3/blob/main/code/sdl/sdl_input.c"
click node_http_downloads "https://github.com/ioquake/ioq3/blob/main/code/client/cl_http_curl.c"
click node_voice "https://github.com/ioquake/ioq3/blob/main/code/client/libmumblelink.c"
click node_botlib "https://github.com/ioquake/ioq3/blob/main/code/botlib/be_aas_reach.c"
click node_bot_ai "https://github.com/ioquake/ioq3/blob/main/code/botlib/be_ai_move.c"

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_server_app,node_common,node_filesystem toneBlue
class node_game_module,node_shared_movement toneAmber
class node_client_app,node_cgame,node_ui,node_renderer_gl1,node_renderer_gl2,node_sound toneMint
class node_sdl_input,node_http_downloads,node_voice toneRose
class node_botlib,node_bot_ai,node_player toneIndigo
```

## Components

### Engine services

- [Server runtime](https://github.com/ioquake/ioq3/blob/main/code/server/sv_main.c): `code/server/sv_main.c`
- [Common protocol](https://github.com/ioquake/ioq3/blob/main/code/qcommon/qcommon.h): `code/qcommon/qcommon.h`
- [Virtual filesystem](https://github.com/ioquake/ioq3/blob/main/code/qcommon/files.c): `code/qcommon/files.c`

### Gameplay runtime

- [Game simulation](https://github.com/ioquake/ioq3/blob/main/code/game/g_client.c): `code/game/g_client.c`
- [Shared movement](https://github.com/ioquake/ioq3/blob/main/code/game/bg_pmove.c): `code/game/bg_pmove.c`

### Client experience

- [Client runtime](https://github.com/ioquake/ioq3/blob/main/code/client/cl_main.c): `code/client/cl_main.c`
- [Client game](https://github.com/ioquake/ioq3/blob/main/code/cgame/cg_main.c): `code/cgame/cg_main.c`
- [Game UI](https://github.com/ioquake/ioq3/blob/main/code/ui/ui_main.c): `code/ui/ui_main.c`
- [OpenGL 1 renderer](https://github.com/ioquake/ioq3/blob/main/code/renderergl1/tr_main.c): `code/renderergl1/tr_main.c`
- [OpenGL 2 renderer](https://github.com/ioquake/ioq3/blob/main/code/renderergl2/tr_main.c): `code/renderergl2/tr_main.c`
- [Sound system](https://github.com/ioquake/ioq3/blob/main/code/client/snd_main.c): `code/client/snd_main.c`

### Platform integrations

- [SDL input](https://github.com/ioquake/ioq3/blob/main/code/sdl/sdl_input.c): `code/sdl/sdl_input.c`
- [HTTP downloads](https://github.com/ioquake/ioq3/blob/main/code/client/cl_http_curl.c): `code/client/cl_http_curl.c`
- [Voice and Mumble](https://github.com/ioquake/ioq3/blob/main/code/client/libmumblelink.c): `code/client/libmumblelink.c`

### Bot AI

- [Bot navigation](https://github.com/ioquake/ioq3/blob/main/code/botlib/be_aas_reach.c): `code/botlib/be_aas_reach.c`
- [Bot decision and movement](https://github.com/ioquake/ioq3/blob/main/code/botlib/be_ai_move.c): `code/botlib/be_ai_move.c`

### Other components

- **Player**

## Connections

- Player → Client runtime: plays through (evidence: `README.md`)
- Client runtime → Server runtime: exchanges game state
- Server runtime → Game simulation: runs game logic
- Client runtime → Common protocol: uses shared protocol
- Server runtime → Common protocol: uses shared protocol
- Common protocol → Virtual filesystem: exposes file APIs (evidence: `code/qcommon/qcommon.h`)
- Player → SDL input: provides controls (evidence: `README.md`)
- SDL input → Client runtime: forwards input (evidence: `code/sdl/sdl_input.c`)
- Client runtime → Client game: loads client game
- Client game → OpenGL 1 renderer: submits scenes
- Client game → OpenGL 2 renderer: submits scenes
- Player → Game UI: uses menus
- Client runtime → Sound system: plays audio
- Client runtime → HTTP downloads: downloads game data (evidence: `README.md`)
- Client runtime → Voice and Mumble: supports voice chat (evidence: `README.md`)
- Game simulation → Shared movement: shares movement rules
- Game simulation → Bot decision and movement: supports bot gameplay
- Bot decision and movement → Bot navigation: uses navigation data
