# thesuperhackers/generalsgamecode architecture

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

- Interactive diagram: https://gitdiagram.com/thesuperhackers/generalsgamecode
- Repository: https://github.com/thesuperhackers/generalsgamecode

## Overview

GeneralsGameCode is the C++ runtime for Command & Conquer: Generals and Zero Hour: a player interacts with the client, the engine coordinates simulation and presentation, and the client renders the resulting game state. The repository also contains scripting, replay, audio, and multiplayer systems. The README documents these product capabilities; sampled source confirms engine subsystem initialization, platform-specific engine delegation, scripting state, and GameSpy persistence behavior. Some feature wiring is not shown in the excerpts, so those relationships are intentionally left unspecified.

Main entry points: [`Core/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp`](https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp) (Game logic), [`GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp`](https://github.com/thesuperhackers/generalsgamecode/blob/main/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp) (Game engine), [`Core/GameEngine/Source/GameClient/ClientInstance.cpp`](https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameClient/ClientInstance.cpp) (Game client), [`Core/GameEngineDevice/Source/Win32Device/Common/Win32GameEngine.cpp`](https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngineDevice/Source/Win32Device/Common/Win32GameEngine.cpp) (Win32 engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Engine runtime"]
  node_win_engine["Win32 engine"]
  node_game_engine["Game engine<br/>[GameEngine.cpp]"]
  node_filesystem["File systems<br/>[FileSystem.cpp]"]
  node_ini["INI data<br/>[INI.cpp]"]
  node_audio["Audio<br/>[GameAudio.cpp]"]
end

subgraph group_simulation["Game simulation"]
  node_logic["Game logic"]
  node_scripts["Mission scripts<br/>[ScriptEngine.cpp]"]
  node_pathfinding["AI pathfinding<br/>[AIPathfind.cpp]"]
  node_terrain["Terrain logic<br/>[TerrainLogic.cpp]"]
  node_damage["Damage system<br/>[Damage.cpp]"]
  node_replay["Replay simulation"]
end

subgraph group_client["Player client"]
  node_client["Game client<br/>[ClientInstance.cpp]"]
  node_input["Input handling<br/>[Keyboard.cpp]"]
  node_gui["Game UI"]
  node_render["Display<br/>[Display.cpp]"]
  node_effects["Visual effects<br/>[ParticleSys.cpp]"]
end

subgraph group_network["Multiplayer"]
  node_networking["Network transport"]
  node_lan["LAN multiplayer<br/>[LANAPI.cpp]"]
  node_lobby["GameSpy lobby<br/>[LobbyUtils.cpp]"]
  node_persistent["Player persistence"]
end

node_player(("Player"))
node_gamespy_service{{"GameSpy services"}}

node_player -->|"drives"| node_win_engine
node_win_engine -->|"delegates updates"| node_game_engine
node_game_engine -->|"initializes"| node_logic
node_game_engine -->|"initializes"| node_client
node_game_engine -->|"initializes"| node_filesystem
node_game_engine -->|"loads settings"| node_ini
node_game_engine -->|"initializes"| node_audio
node_logic -->|"runs scripts"| node_scripts
node_logic -->|"uses"| node_pathfinding
node_logic -->|"uses"| node_terrain
node_logic -->|"uses"| node_damage
node_player -->|"provides input"| node_input
node_client -->|"processes"| node_input
node_client -->|"updates interface"| node_gui
node_client -->|"presents game"| node_render
node_client -->|"updates effects"| node_effects
node_logic -->|"records playback"| node_replay
node_logic -->|"exchanges game data"| node_networking
node_networking -->|"supports LAN play"| node_lan
node_lobby -.->|"uses"| node_gamespy_service
node_persistent -.->|"reads and writes stats"| node_gamespy_service

click node_win_engine "https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngineDevice/Source/Win32Device/Common/Win32GameEngine.cpp"
click node_game_engine "https://github.com/thesuperhackers/generalsgamecode/blob/main/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp"
click node_filesystem "https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/Common/System/FileSystem.cpp"
click node_ini "https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/Common/INI/INI.cpp"
click node_audio "https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/Common/Audio/GameAudio.cpp"
click node_logic "https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp"
click node_scripts "https://github.com/thesuperhackers/generalsgamecode/blob/main/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp"
click node_pathfinding "https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp"
click node_terrain "https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp"
click node_damage "https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameLogic/System/Damage.cpp"
click node_replay "https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/Common/ReplaySimulation.cpp"
click node_client "https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameClient/ClientInstance.cpp"
click node_input "https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameClient/Input/Keyboard.cpp"
click node_gui "https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp"
click node_render "https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameClient/Display.cpp"
click node_effects "https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameClient/System/ParticleSys.cpp"
click node_networking "https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameNetwork/ConnectionManager.cpp"
click node_lan "https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameNetwork/LANAPI.cpp"
click node_lobby "https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp"
click node_persistent "https://github.com/thesuperhackers/generalsgamecode/blob/main/Generals/Code/GameEngine/Source/GameNetwork/GameSpyPersistentStorage.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_win_engine,node_game_engine,node_filesystem,node_ini,node_audio toneBlue
class node_logic,node_scripts,node_pathfinding,node_terrain,node_damage,node_replay toneAmber
class node_client,node_input,node_gui,node_render,node_effects toneMint
class node_networking,node_lan,node_lobby,node_persistent toneRose
class node_player,node_gamespy_service toneIndigo
```

## Components

### Engine runtime

- [Win32 engine](https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngineDevice/Source/Win32Device/Common/Win32GameEngine.cpp): `Core/GameEngineDevice/Source/Win32Device/Common/Win32GameEngine.cpp`
- [Game engine](https://github.com/thesuperhackers/generalsgamecode/blob/main/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp): `GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp`
- [File systems](https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/Common/System/FileSystem.cpp): `Core/GameEngine/Source/Common/System/FileSystem.cpp`
- [INI data](https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/Common/INI/INI.cpp): `Core/GameEngine/Source/Common/INI/INI.cpp`
- [Audio](https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/Common/Audio/GameAudio.cpp): `Core/GameEngine/Source/Common/Audio/GameAudio.cpp`

### Game simulation

- [Game logic](https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp): `Core/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp`
- [Mission scripts](https://github.com/thesuperhackers/generalsgamecode/blob/main/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp): `GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp`
- [AI pathfinding](https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp): `Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp`
- [Terrain logic](https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp): `Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp`
- [Damage system](https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameLogic/System/Damage.cpp): `Core/GameEngine/Source/GameLogic/System/Damage.cpp`
- [Replay simulation](https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/Common/ReplaySimulation.cpp): `Core/GameEngine/Source/Common/ReplaySimulation.cpp`

### Player client

- [Game client](https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameClient/ClientInstance.cpp): `Core/GameEngine/Source/GameClient/ClientInstance.cpp`
- [Input handling](https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameClient/Input/Keyboard.cpp): `Core/GameEngine/Source/GameClient/Input/Keyboard.cpp`
- [Game UI](https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp): `Core/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp`
- [Display](https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameClient/Display.cpp): `Core/GameEngine/Source/GameClient/Display.cpp`
- [Visual effects](https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameClient/System/ParticleSys.cpp): `Core/GameEngine/Source/GameClient/System/ParticleSys.cpp`

### Multiplayer

- [Network transport](https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameNetwork/ConnectionManager.cpp): `Core/GameEngine/Source/GameNetwork/ConnectionManager.cpp`
- [LAN multiplayer](https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameNetwork/LANAPI.cpp): `Core/GameEngine/Source/GameNetwork/LANAPI.cpp`
- [GameSpy lobby](https://github.com/thesuperhackers/generalsgamecode/blob/main/Core/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp): `Core/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp`
- [Player persistence](https://github.com/thesuperhackers/generalsgamecode/blob/main/Generals/Code/GameEngine/Source/GameNetwork/GameSpyPersistentStorage.cpp): `Generals/Code/GameEngine/Source/GameNetwork/GameSpyPersistentStorage.cpp`

### Other components

- **Player**
- **GameSpy services**

## Connections

- Player → Win32 engine: drives
- Win32 engine → Game engine: delegates updates
- Game engine → Game logic: initializes
- Game engine → Game client: initializes
- Game engine → File systems: initializes
- Game engine → INI data: loads settings
- Game engine → Audio: initializes
- Game logic → Mission scripts: runs scripts
- Game logic → AI pathfinding: uses
- Game logic → Terrain logic: uses
- Game logic → Damage system: uses
- Player → Input handling: provides input
- Game client → Input handling: processes
- Game client → Game UI: updates interface
- Game client → Display: presents game
- Game client → Visual effects: updates effects
- Game logic → Replay simulation: records playback
- Game logic → Network transport: exchanges game data
- Network transport → LAN multiplayer: supports LAN play
- GameSpy lobby → GameSpy services: uses
- Player persistence → GameSpy services: reads and writes stats
