# bnunu/halo-ce-universal architecture

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

- Interactive diagram: https://gitdiagram.com/bnunu/halo-ce-universal
- Repository: https://github.com/bnunu/halo-ce-universal

## Overview

OpenCE ports Halo: Combat Evolved to Linux, Windows, and Android. The player selects an Xbox disc image; the platform port extracts the maps, then the game loads and runs them. Gameplay spans scenario/map state, units and AI, player control, and game modes; interface and networking provide additional capabilities, including cross-platform system-link play. The graph preserves major README capabilities and uses the supplied source index for selected internal links; unsampled implementation details and platform-specific wiring are not inferred.

Main entry points: [`source/game/game.h`](https://github.com/bnunu/halo-ce-universal/blob/main/source/game/game.h) (Game state), [`port/linux/src/xiso.c`](https://github.com/bnunu/halo-ce-universal/blob/main/port/linux/src/xiso.c) (Disc extraction), [`source/main/main.c`](https://github.com/bnunu/halo-ce-universal/blob/main/source/main/main.c) (Game loop), [`source/game/game_engine.c`](https://github.com/bnunu/halo-ce-universal/blob/main/source/game/game_engine.c) (Game modes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Platform ports"]
  node_linux["Linux port"]
  node_windows["Windows port"]
  node_android["Android app<br/>[HaloActivity.java]"]
  node_xiso["Disc extraction<br/>[xiso.c]"]
end

subgraph group_runtime["Game runtime"]
  node_mainloop["Game loop<br/>[main.c]"]
  node_game["Game state<br/>[game.h]"]
  node_cache["Cache resources<br/>[cache_files.h]"]
end

subgraph group_gameplay["Gameplay systems"]
  node_scenario["Scenario maps<br/>[scenario.h]"]
  node_units["Units and combat<br/>[units.c]"]
  node_ai["AI behavior"]
  node_players["Player control<br/>[players.h]"]
  node_modes["Game modes<br/>[game_engine.c]"]
end

subgraph group_services["Player services"]
  node_interface["Menus and HUD"]
  node_network["Multiplayer networking"]
  node_sound["Sound playback<br/>[sound_manager.c]"]
end

node_player(("Player"))
node_disc["Halo disc image"]
node_maps[("Extracted maps")]

node_player -->|"starts app"| node_android
node_player -->|"selects image"| node_disc
node_disc -->|"extracts maps"| node_xiso
node_xiso -->|"writes"| node_maps
node_player -->|"plays on"| node_linux
node_player -->|"plays on"| node_windows
node_player -->|"plays on"| node_android
node_mainloop -->|"runs game"| node_game
node_mainloop -->|"uses"| node_players
node_mainloop -.->|"uses"| node_interface
node_game -->|"loads maps"| node_scenario
node_game -->|"sets mode"| node_modes
node_modes -->|"uses"| node_players
node_modes -->|"uses"| node_units
node_units -->|"uses"| node_ai
node_mainloop -->|"uses"| node_network
node_network -->|"coordinates"| node_modes
node_game -.->|"loads resources"| node_cache
node_game -.->|"uses"| node_sound
node_linux -.->|"provides extraction"| node_xiso
node_windows -.->|"provides extraction"| node_xiso
node_android -->|"extracts image"| node_xiso

click node_linux "https://github.com/bnunu/halo-ce-universal/tree/main/port/linux"
click node_windows "https://github.com/bnunu/halo-ce-universal/tree/main/port/windows"
click node_android "https://github.com/bnunu/halo-ce-universal/blob/main/port/android/app/src/main/java/com/halo/decomp/HaloActivity.java"
click node_xiso "https://github.com/bnunu/halo-ce-universal/blob/main/port/linux/src/xiso.c"
click node_mainloop "https://github.com/bnunu/halo-ce-universal/blob/main/source/main/main.c"
click node_game "https://github.com/bnunu/halo-ce-universal/blob/main/source/game/game.h"
click node_scenario "https://github.com/bnunu/halo-ce-universal/blob/main/source/scenario/scenario.h"
click node_units "https://github.com/bnunu/halo-ce-universal/blob/main/source/units/units.c"
click node_ai "https://github.com/bnunu/halo-ce-universal/tree/main/source/ai"
click node_players "https://github.com/bnunu/halo-ce-universal/blob/main/source/game/players.h"
click node_modes "https://github.com/bnunu/halo-ce-universal/blob/main/source/game/game_engine.c"
click node_interface "https://github.com/bnunu/halo-ce-universal/tree/main/source/interface"
click node_network "https://github.com/bnunu/halo-ce-universal/tree/main/source/networking"
click node_cache "https://github.com/bnunu/halo-ce-universal/blob/main/source/cache/cache_files.h"
click node_sound "https://github.com/bnunu/halo-ce-universal/blob/main/source/sound/sound_manager.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_linux,node_windows,node_android,node_xiso toneBlue
class node_mainloop,node_game,node_cache,node_maps toneAmber
class node_scenario,node_units,node_ai,node_players,node_modes toneMint
class node_interface,node_network,node_sound toneRose
class node_player,node_disc toneIndigo
```

## Components

### Platform ports

- [Linux port](https://github.com/bnunu/halo-ce-universal/tree/main/port/linux): `port/linux`
- [Windows port](https://github.com/bnunu/halo-ce-universal/tree/main/port/windows): `port/windows`
- [Android app](https://github.com/bnunu/halo-ce-universal/blob/main/port/android/app/src/main/java/com/halo/decomp/HaloActivity.java): `port/android/app/src/main/java/com/halo/decomp/HaloActivity.java`
- [Disc extraction](https://github.com/bnunu/halo-ce-universal/blob/main/port/linux/src/xiso.c): `port/linux/src/xiso.c`

### Game runtime

- [Game loop](https://github.com/bnunu/halo-ce-universal/blob/main/source/main/main.c): `source/main/main.c`
- [Game state](https://github.com/bnunu/halo-ce-universal/blob/main/source/game/game.h): `source/game/game.h`
- [Cache resources](https://github.com/bnunu/halo-ce-universal/blob/main/source/cache/cache_files.h): `source/cache/cache_files.h`

### Gameplay systems

- [Scenario maps](https://github.com/bnunu/halo-ce-universal/blob/main/source/scenario/scenario.h): `source/scenario/scenario.h`
- [Units and combat](https://github.com/bnunu/halo-ce-universal/blob/main/source/units/units.c): `source/units/units.c`
- [AI behavior](https://github.com/bnunu/halo-ce-universal/tree/main/source/ai): `source/ai`
- [Player control](https://github.com/bnunu/halo-ce-universal/blob/main/source/game/players.h): `source/game/players.h`
- [Game modes](https://github.com/bnunu/halo-ce-universal/blob/main/source/game/game_engine.c): `source/game/game_engine.c`

### Player services

- [Menus and HUD](https://github.com/bnunu/halo-ce-universal/tree/main/source/interface): `source/interface`
- [Multiplayer networking](https://github.com/bnunu/halo-ce-universal/tree/main/source/networking): `source/networking`
- [Sound playback](https://github.com/bnunu/halo-ce-universal/blob/main/source/sound/sound_manager.c): `source/sound/sound_manager.c`

### Other components

- **Player**
- **Halo disc image**
- **Extracted maps**

## Connections

- Player → Android app: starts app
- Player → Halo disc image: selects image
- Halo disc image → Disc extraction: extracts maps
- Disc extraction → Extracted maps: writes
- Player → Linux port: plays on
- Player → Windows port: plays on
- Player → Android app: plays on
- Game loop → Game state: runs game (evidence: `source/main/main.c`)
- Game loop → Player control: uses (evidence: `source/main/main.c`)
- Game loop → Menus and HUD: uses (evidence: `source/main/main.c`)
- Game state → Scenario maps: loads maps (evidence: `source/game/game.h`)
- Game state → Game modes: sets mode (evidence: `source/game/game.h`)
- Game modes → Player control: uses (evidence: `source/game/game_engine.c`)
- Game modes → Units and combat: uses
- Units and combat → AI behavior: uses (evidence: `source/units/units.c`)
- Game loop → Multiplayer networking: uses (evidence: `source/main/main.c`)
- Multiplayer networking → Game modes: coordinates (evidence: `source/networking/network_game_manager.c`)
- Game state → Cache resources: loads resources
- Game state → Sound playback: uses (evidence: `source/sound/sound_manager.c`)
- Linux port → Disc extraction: provides extraction
- Windows port → Disc extraction: provides extraction
- Android app → Disc extraction: extracts image
