# alexbatalov/fallout2-ce architecture

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

- Interactive diagram: https://gitdiagram.com/alexbatalov/fallout2-ce
- Repository: https://github.com/alexbatalov/fallout2-ce

## Overview

Fallout 2 Community Edition is a cross-platform reimplementation of Fallout 2, preserving its gameplay with engine fixes and quality-of-life changes. The player supplies original game assets, launches the game, and plays through exploration, dialogue, inventory, combat, and world-map travel; saves and mod/script support are additional capabilities. Android adds an asset-import flow before launch. The graph includes major gameplay domains from the source tree, but most native implementation files were not excerpted, so their internal call relationships are intentionally omitted. Android and UI/rendering links use the available source references and excerpts.

Main entry points: [`src/map.cc`](https://github.com/alexbatalov/fallout2-ce/blob/main/src/map.cc) (Map exploration), [`src/main.cc`](https://github.com/alexbatalov/fallout2-ce/blob/main/src/main.cc) (Game startup), [`os/android/app/src/main/java/org/libsdl/app/SDLActivity.java`](https://github.com/alexbatalov/fallout2-ce/blob/main/os/android/app/src/main/java/org/libsdl/app/SDLActivity.java) (SDL activity), [`os/android/app/src/main/java/com/alexbatalov/fallout2ce/ImportActivity.java`](https://github.com/alexbatalov/fallout2-ce/blob/main/os/android/app/src/main/java/com/alexbatalov/fallout2ce/ImportActivity.java) (Asset import)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile platform"]
  node_android_import["Asset import"]
  node_android_app["Android launcher<br/>[MainActivity.java]"]
  node_sdl_activity["SDL activity<br/>[SDLActivity.java]"]
  node_hid_manager["HID devices"]
  node_audio_platform["SDL audio"]
end

subgraph group_runtime["Game runtime"]
  node_game_entry["Game startup<br/>[main.cc]"]
  node_configuration["Game configuration<br/>[config.cc]"]
  node_save_load["Save and load<br/>[loadsave.cc]"]
end

subgraph group_gameplay["Gameplay systems"]
  node_map_exploration["Map exploration<br/>[map.cc]"]
  node_world_travel["World travel<br/>[worldmap.cc]"]
  node_combat["Combat<br/>[combat.cc]"]
  node_inventory["Inventory<br/>[inventory.cc]"]
  node_dialogue["Dialogue<br/>[game_dialog.cc]"]
  node_character_editor["Character editor"]
end

subgraph group_content["Content and scripting"]
  node_prototypes["Game prototypes<br/>[proto.h]"]
  node_scripts["Game scripts<br/>[scripts.cc]"]
  node_sfall["Sfall compatibility<br/>[sfall_opcodes.cc]"]
  node_art_assets["Art resources<br/>[art.h]"]
end

subgraph group_presentation["Input and presentation"]
  node_input["Input handling<br/>[input.h]"]
  node_window_manager["Window manager<br/>[window_manager.cc]"]
  node_rendering["Display rendering<br/>[svga.h]"]
  node_audio_engine["Audio engine<br/>[audio_engine.cc]"]
end

node_player(("Player"))
node_game_assets["Game assets"]

node_player -->|"selects assets"| node_android_import
node_game_assets -->|"provides files"| node_android_import
node_android_import -->|"returns to"| node_android_app
node_android_app -->|"launches"| node_sdl_activity
node_sdl_activity -->|"manages devices"| node_hid_manager
node_player -->|"starts game"| node_game_entry
node_game_entry -.->|"loads settings"| node_configuration
node_game_entry -.->|"runs gameplay"| node_map_exploration
node_map_exploration -.->|"supports travel"| node_world_travel
node_map_exploration -.->|"supports combat"| node_combat
node_map_exploration -.->|"supports encounters"| node_dialogue
node_map_exploration -.->|"uses inventory"| node_inventory
node_player -.->|"creates character"| node_character_editor
node_game_entry -.->|"offers saves"| node_save_load
node_combat -.->|"runs scripts"| node_scripts
node_scripts -.->|"extends scripting"| node_sfall
node_map_exploration -.->|"uses prototypes"| node_prototypes
node_map_exploration -.->|"uses art"| node_art_assets
node_sdl_activity -.->|"provides audio"| node_audio_platform
node_input -->|"feeds events"| node_window_manager
node_window_manager -.->|"presents windows"| node_rendering
node_game_entry -.->|"starts audio"| node_audio_engine
node_game_entry -.->|"initializes input"| node_input

click node_android_import "https://github.com/alexbatalov/fallout2-ce/blob/main/os/android/app/src/main/java/com/alexbatalov/fallout2ce/ImportActivity.java"
click node_android_app "https://github.com/alexbatalov/fallout2-ce/blob/main/os/android/app/src/main/java/com/alexbatalov/fallout2ce/MainActivity.java"
click node_sdl_activity "https://github.com/alexbatalov/fallout2-ce/blob/main/os/android/app/src/main/java/org/libsdl/app/SDLActivity.java"
click node_hid_manager "https://github.com/alexbatalov/fallout2-ce/blob/main/os/android/app/src/main/java/org/libsdl/app/HIDDeviceManager.java"
click node_audio_platform "https://github.com/alexbatalov/fallout2-ce/blob/main/os/android/app/src/main/java/org/libsdl/app/SDLAudioManager.java"
click node_game_entry "https://github.com/alexbatalov/fallout2-ce/blob/main/src/main.cc"
click node_configuration "https://github.com/alexbatalov/fallout2-ce/blob/main/src/config.cc"
click node_save_load "https://github.com/alexbatalov/fallout2-ce/blob/main/src/loadsave.cc"
click node_map_exploration "https://github.com/alexbatalov/fallout2-ce/blob/main/src/map.cc"
click node_world_travel "https://github.com/alexbatalov/fallout2-ce/blob/main/src/worldmap.cc"
click node_combat "https://github.com/alexbatalov/fallout2-ce/blob/main/src/combat.cc"
click node_inventory "https://github.com/alexbatalov/fallout2-ce/blob/main/src/inventory.cc"
click node_dialogue "https://github.com/alexbatalov/fallout2-ce/blob/main/src/game_dialog.cc"
click node_character_editor "https://github.com/alexbatalov/fallout2-ce/blob/main/src/character_editor.cc"
click node_prototypes "https://github.com/alexbatalov/fallout2-ce/blob/main/src/proto.h"
click node_scripts "https://github.com/alexbatalov/fallout2-ce/blob/main/src/scripts.cc"
click node_sfall "https://github.com/alexbatalov/fallout2-ce/blob/main/src/sfall_opcodes.cc"
click node_input "https://github.com/alexbatalov/fallout2-ce/blob/main/src/input.h"
click node_window_manager "https://github.com/alexbatalov/fallout2-ce/blob/main/src/window_manager.cc"
click node_rendering "https://github.com/alexbatalov/fallout2-ce/blob/main/src/svga.h"
click node_art_assets "https://github.com/alexbatalov/fallout2-ce/blob/main/src/art.h"
click node_audio_engine "https://github.com/alexbatalov/fallout2-ce/blob/main/src/audio_engine.cc"

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_import,node_android_app,node_sdl_activity,node_hid_manager,node_audio_platform toneBlue
class node_game_entry,node_configuration,node_save_load toneAmber
class node_map_exploration,node_world_travel,node_combat,node_inventory,node_dialogue,node_character_editor toneMint
class node_prototypes,node_scripts,node_sfall,node_art_assets toneRose
class node_input,node_window_manager,node_rendering,node_audio_engine,node_player,node_game_assets toneIndigo
```

## Components

### Mobile platform

- [Asset import](https://github.com/alexbatalov/fallout2-ce/blob/main/os/android/app/src/main/java/com/alexbatalov/fallout2ce/ImportActivity.java): `os/android/app/src/main/java/com/alexbatalov/fallout2ce/ImportActivity.java`
- [Android launcher](https://github.com/alexbatalov/fallout2-ce/blob/main/os/android/app/src/main/java/com/alexbatalov/fallout2ce/MainActivity.java): `os/android/app/src/main/java/com/alexbatalov/fallout2ce/MainActivity.java`
- [SDL activity](https://github.com/alexbatalov/fallout2-ce/blob/main/os/android/app/src/main/java/org/libsdl/app/SDLActivity.java): `os/android/app/src/main/java/org/libsdl/app/SDLActivity.java`
- [HID devices](https://github.com/alexbatalov/fallout2-ce/blob/main/os/android/app/src/main/java/org/libsdl/app/HIDDeviceManager.java): `os/android/app/src/main/java/org/libsdl/app/HIDDeviceManager.java`
- [SDL audio](https://github.com/alexbatalov/fallout2-ce/blob/main/os/android/app/src/main/java/org/libsdl/app/SDLAudioManager.java): `os/android/app/src/main/java/org/libsdl/app/SDLAudioManager.java`

### Game runtime

- [Game startup](https://github.com/alexbatalov/fallout2-ce/blob/main/src/main.cc): `src/main.cc`
- [Game configuration](https://github.com/alexbatalov/fallout2-ce/blob/main/src/config.cc): `src/config.cc`
- [Save and load](https://github.com/alexbatalov/fallout2-ce/blob/main/src/loadsave.cc): `src/loadsave.cc`

### Gameplay systems

- [Map exploration](https://github.com/alexbatalov/fallout2-ce/blob/main/src/map.cc): `src/map.cc`
- [World travel](https://github.com/alexbatalov/fallout2-ce/blob/main/src/worldmap.cc): `src/worldmap.cc`
- [Combat](https://github.com/alexbatalov/fallout2-ce/blob/main/src/combat.cc): `src/combat.cc`
- [Inventory](https://github.com/alexbatalov/fallout2-ce/blob/main/src/inventory.cc): `src/inventory.cc`
- [Dialogue](https://github.com/alexbatalov/fallout2-ce/blob/main/src/game_dialog.cc): `src/game_dialog.cc`
- [Character editor](https://github.com/alexbatalov/fallout2-ce/blob/main/src/character_editor.cc): `src/character_editor.cc`

### Content and scripting

- [Game prototypes](https://github.com/alexbatalov/fallout2-ce/blob/main/src/proto.h): `src/proto.h`
- [Game scripts](https://github.com/alexbatalov/fallout2-ce/blob/main/src/scripts.cc): `src/scripts.cc`
- [Sfall compatibility](https://github.com/alexbatalov/fallout2-ce/blob/main/src/sfall_opcodes.cc): `src/sfall_opcodes.cc`
- [Art resources](https://github.com/alexbatalov/fallout2-ce/blob/main/src/art.h): `src/art.h`

### Input and presentation

- [Input handling](https://github.com/alexbatalov/fallout2-ce/blob/main/src/input.h): `src/input.h`
- [Window manager](https://github.com/alexbatalov/fallout2-ce/blob/main/src/window_manager.cc): `src/window_manager.cc`
- [Display rendering](https://github.com/alexbatalov/fallout2-ce/blob/main/src/svga.h): `src/svga.h`
- [Audio engine](https://github.com/alexbatalov/fallout2-ce/blob/main/src/audio_engine.cc): `src/audio_engine.cc`

### Other components

- **Player**
- **Game assets**

## Connections

- Player → Asset import: selects assets
- Game assets → Asset import: provides files
- Asset import → Android launcher: returns to (evidence: `os/android/app/src/main/java/com/alexbatalov/fallout2ce/ImportActivity.java`)
- Android launcher → SDL activity: launches (evidence: `os/android/app/src/main/java/com/alexbatalov/fallout2ce/MainActivity.java`)
- SDL activity → HID devices: manages devices (evidence: `os/android/app/src/main/java/org/libsdl/app/SDLActivity.java`)
- Player → Game startup: starts game
- Game startup → Game configuration: loads settings
- Game startup → Map exploration: runs gameplay
- Map exploration → World travel: supports travel
- Map exploration → Combat: supports combat
- Map exploration → Dialogue: supports encounters
- Map exploration → Inventory: uses inventory
- Player → Character editor: creates character
- Game startup → Save and load: offers saves
- Combat → Game scripts: runs scripts
- Game scripts → Sfall compatibility: extends scripting
- Map exploration → Game prototypes: uses prototypes
- Map exploration → Art resources: uses art
- SDL activity → SDL audio: provides audio
- Input handling → Window manager: feeds events (evidence: `src/window_manager.cc`)
- Window manager → Display rendering: presents windows (evidence: `src/window_manager.cc`)
- Game startup → Audio engine: starts audio
- Game startup → Input handling: initializes input
