# gusmarcum/fallout2-coop architecture

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

- Interactive diagram: https://gitdiagram.com/gusmarcum/fallout2-coop
- Repository: https://github.com/gusmarcum/fallout2-coop

## Overview

Fallout 2 Co-op is a multiplayer game: each player runs a client, while a dedicated server owns and persists the shared world. The main workflow is players joining, sending actions, and receiving updates from that authoritative world. The README documents major gameplay additions, including trading, revival, party-wide XP, quicksave/load, and companion orders. Paths are based on the supplied tree; where source was not sampled, documented features are represented without speculative internal call links.

Main entry points: [`src/server_loop.cc`](https://github.com/gusmarcum/fallout2-coop/blob/main/src/server_loop.cc) (Server loop), [`src/server_net.cc`](https://github.com/gusmarcum/fallout2-coop/blob/main/src/server_net.cc) (Server networking), [`src/client_net.cc`](https://github.com/gusmarcum/fallout2-coop/blob/main/src/client_net.cc) (Client networking), [`src/server_admin.cc`](https://github.com/gusmarcum/fallout2-coop/blob/main/src/server_admin.cc) (Admin controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game runtime"]
  node_server["Dedicated server<br/>[server_main.cc]"]
  node_server_loop["Server loop<br/>[server_loop.cc]"]
  node_main["Client entry point<br/>[main.cc]"]
end

subgraph group_world["World simulation"]
  node_world_state["World and maps<br/>[map.cc]"]
  node_scripts["Game scripts<br/>[scripts.cc]"]
  node_interpreter["Script interpreter<br/>[interpreter.cc]"]
  node_combat["Combat and AI<br/>[combat.cc]"]
  node_dialog["Dialogue<br/>[dialog.cc]"]
  node_worldmap["Worldmap<br/>[worldmap.cc]"]
end

subgraph group_multiplayer["Multiplayer services"]
  node_server_net["Server networking<br/>[server_net.cc]"]
  node_client_net["Client networking<br/>[client_net.cc]"]
  node_accounts["Accounts and seats<br/>[server_accounts.cc]"]
  node_players_state["Connected players<br/>[server_players.cc]"]
  node_trade["Player trading<br/>[server_trade.cc]"]
  node_admin["Admin controls<br/>[server_admin.cc]"]
end

subgraph group_client["Client experience"]
  node_client_present["World presentation<br/>[client_present.cc]"]
  node_game_ui["Game interface<br/>[game_ui.cc]"]
  node_input["Player input<br/>[input.cc]"]
  node_android_import["Game data import"]
end

subgraph group_persistence["Persistence"]
  node_savegame["Save and load<br/>[savegame.cc]"]
  node_loadsave["Savegame coordination<br/>[loadsave.cc]"]
end

node_players(("Players"))
node_operator(("Server operator"))

node_players -->|"send actions"| node_client_net
node_client_net -->|"transmit actions"| node_server_net
node_server_net -->|"dispatch messages"| node_server_loop
node_server_loop -->|"run world"| node_server
node_server -->|"send updates"| node_server_net
node_server_net -->|"deliver updates"| node_client_net
node_server_net -->|"manage sessions"| node_accounts
node_server_net -->|"track connections"| node_players_state
node_server_loop -->|"advance world"| node_world_state
node_server_loop -->|"run scripts"| node_scripts
node_scripts -->|"execute commands"| node_interpreter
node_server_loop -->|"resolve combat"| node_combat
node_server_loop -->|"process dialogue"| node_dialog
node_server_loop -->|"process travel"| node_worldmap
node_server_net -->|"dispatch trade"| node_trade
node_server_net -->|"dispatch commands"| node_admin
node_operator -->|"issue commands"| node_admin
node_admin -->|"request load"| node_loadsave
node_server_loop -->|"save or restore"| node_loadsave
node_loadsave -->|"read or write"| node_savegame
node_client_net -->|"update display"| node_client_present
node_main -->|"start interface"| node_game_ui
node_game_ui -->|"collect actions"| node_input
node_players -.->|"select game data"| node_android_import

click node_server "https://github.com/gusmarcum/fallout2-coop/blob/main/src/server_main.cc"
click node_server_loop "https://github.com/gusmarcum/fallout2-coop/blob/main/src/server_loop.cc"
click node_server_net "https://github.com/gusmarcum/fallout2-coop/blob/main/src/server_net.cc"
click node_client_net "https://github.com/gusmarcum/fallout2-coop/blob/main/src/client_net.cc"
click node_accounts "https://github.com/gusmarcum/fallout2-coop/blob/main/src/server_accounts.cc"
click node_players_state "https://github.com/gusmarcum/fallout2-coop/blob/main/src/server_players.cc"
click node_world_state "https://github.com/gusmarcum/fallout2-coop/blob/main/src/map.cc"
click node_scripts "https://github.com/gusmarcum/fallout2-coop/blob/main/src/scripts.cc"
click node_interpreter "https://github.com/gusmarcum/fallout2-coop/blob/main/src/interpreter.cc"
click node_combat "https://github.com/gusmarcum/fallout2-coop/blob/main/src/combat.cc"
click node_dialog "https://github.com/gusmarcum/fallout2-coop/blob/main/src/dialog.cc"
click node_worldmap "https://github.com/gusmarcum/fallout2-coop/blob/main/src/worldmap.cc"
click node_trade "https://github.com/gusmarcum/fallout2-coop/blob/main/src/server_trade.cc"
click node_admin "https://github.com/gusmarcum/fallout2-coop/blob/main/src/server_admin.cc"
click node_savegame "https://github.com/gusmarcum/fallout2-coop/blob/main/src/savegame.cc"
click node_loadsave "https://github.com/gusmarcum/fallout2-coop/blob/main/src/loadsave.cc"
click node_client_present "https://github.com/gusmarcum/fallout2-coop/blob/main/src/client_present.cc"
click node_game_ui "https://github.com/gusmarcum/fallout2-coop/blob/main/src/game_ui.cc"
click node_input "https://github.com/gusmarcum/fallout2-coop/blob/main/src/input.cc"
click node_main "https://github.com/gusmarcum/fallout2-coop/blob/main/src/main.cc"
click node_android_import "https://github.com/gusmarcum/fallout2-coop/blob/main/os/android/app/src/main/java/com/alexbatalov/fallout2ce/ImportActivity.java"

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,node_server_loop,node_main toneBlue
class node_world_state,node_scripts,node_interpreter,node_combat,node_dialog,node_worldmap toneAmber
class node_server_net,node_client_net,node_accounts,node_players_state,node_trade,node_admin,node_operator toneMint
class node_client_present,node_game_ui,node_input,node_android_import toneRose
class node_savegame,node_loadsave,node_players toneIndigo
```

## Components

### Game runtime

- [Dedicated server](https://github.com/gusmarcum/fallout2-coop/blob/main/src/server_main.cc): `src/server_main.cc`
- [Server loop](https://github.com/gusmarcum/fallout2-coop/blob/main/src/server_loop.cc): `src/server_loop.cc`
- [Client entry point](https://github.com/gusmarcum/fallout2-coop/blob/main/src/main.cc): `src/main.cc`

### World simulation

- [World and maps](https://github.com/gusmarcum/fallout2-coop/blob/main/src/map.cc): `src/map.cc`
- [Game scripts](https://github.com/gusmarcum/fallout2-coop/blob/main/src/scripts.cc): `src/scripts.cc`
- [Script interpreter](https://github.com/gusmarcum/fallout2-coop/blob/main/src/interpreter.cc): `src/interpreter.cc`
- [Combat and AI](https://github.com/gusmarcum/fallout2-coop/blob/main/src/combat.cc): `src/combat.cc`
- [Dialogue](https://github.com/gusmarcum/fallout2-coop/blob/main/src/dialog.cc): `src/dialog.cc`
- [Worldmap](https://github.com/gusmarcum/fallout2-coop/blob/main/src/worldmap.cc): `src/worldmap.cc`

### Multiplayer services

- [Server networking](https://github.com/gusmarcum/fallout2-coop/blob/main/src/server_net.cc): `src/server_net.cc`
- [Client networking](https://github.com/gusmarcum/fallout2-coop/blob/main/src/client_net.cc): `src/client_net.cc`
- [Accounts and seats](https://github.com/gusmarcum/fallout2-coop/blob/main/src/server_accounts.cc): `src/server_accounts.cc`
- [Connected players](https://github.com/gusmarcum/fallout2-coop/blob/main/src/server_players.cc): `src/server_players.cc`
- [Player trading](https://github.com/gusmarcum/fallout2-coop/blob/main/src/server_trade.cc): `src/server_trade.cc`
- [Admin controls](https://github.com/gusmarcum/fallout2-coop/blob/main/src/server_admin.cc): `src/server_admin.cc`

### Client experience

- [World presentation](https://github.com/gusmarcum/fallout2-coop/blob/main/src/client_present.cc): `src/client_present.cc`
- [Game interface](https://github.com/gusmarcum/fallout2-coop/blob/main/src/game_ui.cc): `src/game_ui.cc`
- [Player input](https://github.com/gusmarcum/fallout2-coop/blob/main/src/input.cc): `src/input.cc`
- [Game data import](https://github.com/gusmarcum/fallout2-coop/blob/main/os/android/app/src/main/java/com/alexbatalov/fallout2ce/ImportActivity.java): `os/android/app/src/main/java/com/alexbatalov/fallout2ce/ImportActivity.java`

### Persistence

- [Save and load](https://github.com/gusmarcum/fallout2-coop/blob/main/src/savegame.cc): `src/savegame.cc`
- [Savegame coordination](https://github.com/gusmarcum/fallout2-coop/blob/main/src/loadsave.cc): `src/loadsave.cc`

### Other components

- **Players**
- **Server operator**

## Connections

- Players → Client networking: send actions
- Client networking → Server networking: transmit actions
- Server networking → Server loop: dispatch messages
- Server loop → Dedicated server: run world
- Dedicated server → Server networking: send updates
- Server networking → Client networking: deliver updates
- Server networking → Accounts and seats: manage sessions
- Server networking → Connected players: track connections
- Server loop → World and maps: advance world
- Server loop → Game scripts: run scripts
- Game scripts → Script interpreter: execute commands
- Server loop → Combat and AI: resolve combat
- Server loop → Dialogue: process dialogue
- Server loop → Worldmap: process travel
- Server networking → Player trading: dispatch trade
- Server networking → Admin controls: dispatch commands
- Server operator → Admin controls: issue commands
- Admin controls → Savegame coordination: request load
- Server loop → Savegame coordination: save or restore
- Savegame coordination → Save and load: read or write
- Client networking → World presentation: update display
- Client entry point → Game interface: start interface
- Game interface → Player input: collect actions
- Players → Game data import: select game data
