# velaron/cs16-client architecture

> Architecture diagram of the GitHub repository velaron/cs16-client, 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/velaron/cs16-client
- Repository: https://github.com/velaron/cs16-client

## Overview

CS16Client is a reverse-engineered Counter-Strike 1.6 client for Xash3D, including mobile and other unsupported platforms. The player’s main loop is to provide input, drive shared player movement and weapon behavior, then see game state through rendered effects and the HUD; menus and spectator/voice interfaces support adjacent play flows. The tree and excerpts establish client entry points, input, movement, weapons, HUD, and rendering interfaces. Several connections between these subsystems are conventional but not visible in the sampled implementation, so those links are marked unverified.

Main entry points: [`cl_dll/hud.h`](https://github.com/velaron/cs16-client/blob/main/cl_dll/hud.h) (HUD framework), [`cl_dll/VGUI/counterstrikeviewport.cpp`](https://github.com/velaron/cs16-client/blob/main/cl_dll/VGUI/counterstrikeviewport.cpp) (Game menus), [`cl_dll/input/input_sdl.cpp`](https://github.com/velaron/cs16-client/blob/main/cl_dll/input/input_sdl.cpp) (Input handling), [`pm_shared/pm_shared.cpp`](https://github.com/velaron/cs16-client/blob/main/pm_shared/pm_shared.cpp) (Player movement)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_host["Platform and engine"]
  node_android["Android host<br/>[MainActivity.java]"]
  node_engine["Xash3D engine"]
  node_client_api["Client DLL API<br/>[cl_dll.h]"]
end

subgraph group_gameplay["Gameplay simulation"]
  node_input["Input handling<br/>[input_sdl.cpp]"]
  node_movement["Player movement<br/>[pm_shared.cpp]"]
  node_weapon_logic["Weapon logic<br/>[cs_weapons.cpp]"]
  node_weapon_events["Weapon events<br/>[ev_cs16.cpp]"]
end

subgraph group_presentation["Rendering and HUD"]
  node_effects["Particle effects<br/>[CBaseParticle.cpp]"]
  node_model_render["Model rendering"]
  node_hud_core["HUD framework<br/>[hud.h]"]
  node_hud_radar["Radar<br/>[radar.cpp]"]
  node_hud_score["Scoreboard<br/>[scoreboard.cpp]"]
  node_spectator["Spectator view<br/>[hud_spectator.cpp]"]
  node_spectator_gui["Spectator GUI<br/>[spectator_gui.cpp]"]
end

subgraph group_interface["Menus and social"]
  node_menu["Game menus"]
  node_buy_menu["Buy menus<br/>[buymenu.cpp]"]
  node_localization["Localization<br/>[vgui_parser.cpp]"]
  node_voice_hud["Voice HUD"]
end

node_player(("Player"))

node_player -->|"provides input"| node_input
node_engine -.->|"loads client"| node_client_api
node_android -.->|"launches game"| node_engine
node_input -.->|"supplies commands"| node_movement
node_movement -.->|"updates gameplay"| node_weapon_logic
node_weapon_logic -.->|"emits events"| node_weapon_events
node_weapon_events -.->|"creates effects"| node_effects
node_engine -.->|"provides rendering"| node_model_render
node_engine -.->|"provides client state"| node_hud_core
node_hud_core -.->|"hosts HUD element"| node_hud_radar
node_hud_core -.->|"hosts HUD element"| node_hud_score
node_hud_core -->|"hosts GUI"| node_spectator_gui
node_spectator -.->|"supports spectator view"| node_spectator_gui
node_player -.->|"opens menus"| node_menu
node_menu -.->|"opens buy menu"| node_buy_menu
node_menu -.->|"uses localized text"| node_localization
node_engine -->|"provides voice status"| node_voice_hud

click node_android "https://github.com/velaron/cs16-client/blob/main/android/app/src/main/java/su/xash/cs16client/MainActivity.java"
click node_client_api "https://github.com/velaron/cs16-client/blob/main/cl_dll/include/cl_dll.h"
click node_input "https://github.com/velaron/cs16-client/blob/main/cl_dll/input/input_sdl.cpp"
click node_movement "https://github.com/velaron/cs16-client/blob/main/pm_shared/pm_shared.cpp"
click node_weapon_logic "https://github.com/velaron/cs16-client/blob/main/cl_dll/cs_wpn/cs_weapons.cpp"
click node_weapon_events "https://github.com/velaron/cs16-client/blob/main/cl_dll/events/ev_cs16.cpp"
click node_effects "https://github.com/velaron/cs16-client/blob/main/cl_dll/particleman/CBaseParticle.cpp"
click node_model_render "https://github.com/velaron/cs16-client/blob/main/cl_dll/GameStudioModelRenderer.cpp"
click node_hud_core "https://github.com/velaron/cs16-client/blob/main/cl_dll/hud.h"
click node_hud_radar "https://github.com/velaron/cs16-client/blob/main/cl_dll/hud/radar.cpp"
click node_hud_score "https://github.com/velaron/cs16-client/blob/main/cl_dll/hud/scoreboard.cpp"
click node_spectator "https://github.com/velaron/cs16-client/blob/main/cl_dll/hud_spectator.cpp"
click node_spectator_gui "https://github.com/velaron/cs16-client/blob/main/cl_dll/hud/spectator_gui.cpp"
click node_menu "https://github.com/velaron/cs16-client/blob/main/cl_dll/VGUI/counterstrikeviewport.cpp"
click node_buy_menu "https://github.com/velaron/cs16-client/blob/main/cl_dll/VGUI/buymenu.cpp"
click node_localization "https://github.com/velaron/cs16-client/blob/main/cl_dll/vgui_parser.cpp"
click node_voice_hud "https://github.com/velaron/cs16-client/blob/main/game_shared/voice_status_hud.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_android,node_engine,node_client_api toneBlue
class node_input,node_movement,node_weapon_logic,node_weapon_events toneAmber
class node_effects,node_model_render,node_hud_core,node_hud_radar,node_hud_score,node_spectator,node_spectator_gui toneMint
class node_menu,node_buy_menu,node_localization,node_voice_hud toneRose
class node_player toneIndigo
```

## Components

### Platform and engine

- [Android host](https://github.com/velaron/cs16-client/blob/main/android/app/src/main/java/su/xash/cs16client/MainActivity.java): `android/app/src/main/java/su/xash/cs16client/MainActivity.java`
- **Xash3D engine**
- [Client DLL API](https://github.com/velaron/cs16-client/blob/main/cl_dll/include/cl_dll.h): `cl_dll/include/cl_dll.h`

### Gameplay simulation

- [Input handling](https://github.com/velaron/cs16-client/blob/main/cl_dll/input/input_sdl.cpp): `cl_dll/input/input_sdl.cpp`
- [Player movement](https://github.com/velaron/cs16-client/blob/main/pm_shared/pm_shared.cpp): `pm_shared/pm_shared.cpp`
- [Weapon logic](https://github.com/velaron/cs16-client/blob/main/cl_dll/cs_wpn/cs_weapons.cpp): `cl_dll/cs_wpn/cs_weapons.cpp`
- [Weapon events](https://github.com/velaron/cs16-client/blob/main/cl_dll/events/ev_cs16.cpp): `cl_dll/events/ev_cs16.cpp`

### Rendering and HUD

- [Particle effects](https://github.com/velaron/cs16-client/blob/main/cl_dll/particleman/CBaseParticle.cpp): `cl_dll/particleman/CBaseParticle.cpp`
- [Model rendering](https://github.com/velaron/cs16-client/blob/main/cl_dll/GameStudioModelRenderer.cpp): `cl_dll/GameStudioModelRenderer.cpp`
- [HUD framework](https://github.com/velaron/cs16-client/blob/main/cl_dll/hud.h): `cl_dll/hud.h`
- [Radar](https://github.com/velaron/cs16-client/blob/main/cl_dll/hud/radar.cpp): `cl_dll/hud/radar.cpp`
- [Scoreboard](https://github.com/velaron/cs16-client/blob/main/cl_dll/hud/scoreboard.cpp): `cl_dll/hud/scoreboard.cpp`
- [Spectator view](https://github.com/velaron/cs16-client/blob/main/cl_dll/hud_spectator.cpp): `cl_dll/hud_spectator.cpp`
- [Spectator GUI](https://github.com/velaron/cs16-client/blob/main/cl_dll/hud/spectator_gui.cpp): `cl_dll/hud/spectator_gui.cpp`

### Menus and social

- [Game menus](https://github.com/velaron/cs16-client/blob/main/cl_dll/VGUI/counterstrikeviewport.cpp): `cl_dll/VGUI/counterstrikeviewport.cpp`
- [Buy menus](https://github.com/velaron/cs16-client/blob/main/cl_dll/VGUI/buymenu.cpp): `cl_dll/VGUI/buymenu.cpp`
- [Localization](https://github.com/velaron/cs16-client/blob/main/cl_dll/vgui_parser.cpp): `cl_dll/vgui_parser.cpp`
- [Voice HUD](https://github.com/velaron/cs16-client/blob/main/game_shared/voice_status_hud.cpp): `game_shared/voice_status_hud.cpp`

### Other components

- **Player**

## Connections

- Player → Input handling: provides input (evidence: `cl_dll/input/input_sdl.cpp`)
- Xash3D engine → Client DLL API: loads client (evidence: `README.md`)
- Android host → Xash3D engine: launches game (evidence: `README.md`)
- Input handling → Player movement: supplies commands
- Player movement → Weapon logic: updates gameplay
- Weapon logic → Weapon events: emits events
- Weapon events → Particle effects: creates effects
- Xash3D engine → Model rendering: provides rendering
- Xash3D engine → HUD framework: provides client state
- HUD framework → Radar: hosts HUD element
- HUD framework → Scoreboard: hosts HUD element
- HUD framework → Spectator GUI: hosts GUI (evidence: `cl_dll/hud/spectator_gui.cpp`)
- Spectator view → Spectator GUI: supports spectator view
- Player → Game menus: opens menus
- Game menus → Buy menus: opens buy menu
- Game menus → Localization: uses localized text
- Xash3D engine → Voice HUD: provides voice status (evidence: `game_shared/voice_status_hud.cpp`)
