# momusdigital/f3_decomp architecture

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

- Interactive diagram: https://gitdiagram.com/momusdigital/f3_decomp
- Repository: https://github.com/momusdigital/f3_decomp

## Overview

This repository is a function-by-function C++ decompilation of Fallout 3 for research, modding, and preservation—not a playable game or replacement executable. The principal workflow is for a modder or researcher to consult the source to understand game behavior. Its major domains include gameplay, interface/audio, rendering, animation, physics, and shared engine services. The README documents the repository’s purpose; sampled source confirms selected internal behavior, but most game subsystems are not runtime-connected here because their source was not sampled.

Main entry points: [`src/bsshader/imagespacemanager.cpp`](https://github.com/momusdigital/f3_decomp/blob/main/src/bsshader/imagespacemanager.cpp) (Image-space effects), [`src/bscore/memorymanager.cpp`](https://github.com/momusdigital/f3_decomp/blob/main/src/bscore/memorymanager.cpp) (Memory manager), [`src/havok/physics/collide/shape/compound/collection/storageextendedmesh/hkpstorageextendedmeshshape.cpp`](https://github.com/momusdigital/f3_decomp/blob/main/src/havok/physics/collide/shape/compound/collection/storageextendedmesh/hkpstorageextendedmeshshape.cpp) (Stored mesh shapes), [`src/fallout/misc/main.cpp`](https://github.com/momusdigital/f3_decomp/blob/main/src/fallout/misc/main.cpp) (Game startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Gameplay systems"]
  node_startup["Game startup<br/>[main.cpp]"]
  node_combat["Combat AI"]
  node_script_runtime["Script runtime"]
end

subgraph group_presentation["Presentation systems"]
  node_interface["Interface manager"]
  node_audio["Audio manager<br/>[bsaudiomanager.cpp]"]
  node_shader["Shader manager"]
  node_imagespace["Image-space effects"]
  node_decals["Decal manager"]
  node_facegen["Face generation"]
  node_speedtree["SpeedTree manager"]
end

subgraph group_engine["Engine services"]
  node_animation["Controller sequences"]
  node_time["Time controller"]
  node_memory["Memory manager<br/>[memorymanager.cpp]"]
  node_memory_pools["Memory pools<br/>[MemoryPool.h]"]
  node_archive["Archive handling<br/>[archive.cpp]"]
  node_layout["Engine type layouts<br/>[layout_support.h]"]
end

subgraph group_physics["Havok physics"]
  node_havok_shapes["Stored mesh shapes"]
  node_havok_world["World broad phase"]
  node_havok_character["Character state machine"]
  node_havok_base["Havok base types<br/>[hkBase.h]"]
end

node_researcher(("Modder / researcher"))
node_decomp["Fallout 3 source reference"]

node_researcher -->|"consults"| node_decomp
node_decomp -->|"documents behavior"| node_startup
node_decomp -->|"documents behavior"| node_combat
node_decomp -->|"documents behavior"| node_interface
node_decomp -->|"documents behavior"| node_audio
node_decomp -->|"documents behavior"| node_shader
node_decomp -->|"documents behavior"| node_imagespace
node_decomp -->|"documents behavior"| node_decals
node_decomp -->|"documents behavior"| node_animation
node_decomp -->|"documents behavior"| node_time
node_decomp -->|"documents behavior"| node_memory
node_decomp -->|"documents behavior"| node_archive
node_decomp -->|"documents behavior"| node_script_runtime
node_decomp -->|"documents behavior"| node_facegen
node_decomp -->|"documents behavior"| node_speedtree
node_decomp -->|"documents behavior"| node_havok_shapes
node_decomp -->|"documents behavior"| node_havok_world
node_decomp -->|"documents behavior"| node_havok_character
node_imagespace -->|"sets up effects"| node_imagespace
node_memory -->|"creates pools"| node_memory_pools
node_havok_shapes -->|"uses base types"| node_havok_base

click node_startup "https://github.com/momusdigital/f3_decomp/blob/main/src/fallout/misc/main.cpp"
click node_combat "https://github.com/momusdigital/f3_decomp/blob/main/src/fallout/ai/combatcontroller.cpp"
click node_interface "https://github.com/momusdigital/f3_decomp/blob/main/src/fallout/interface/interfacemanager.cpp"
click node_audio "https://github.com/momusdigital/f3_decomp/blob/main/src/bsaudio/bsaudiomanager.cpp"
click node_shader "https://github.com/momusdigital/f3_decomp/blob/main/src/bsshader/bsshadermanager.cpp"
click node_imagespace "https://github.com/momusdigital/f3_decomp/blob/main/src/bsshader/imagespacemanager.cpp"
click node_decals "https://github.com/momusdigital/f3_decomp/blob/main/src/fallout_shared/bgsdecalmanager.cpp"
click node_animation "https://github.com/momusdigital/f3_decomp/blob/main/src/gamebryo2.2/corelibs/nianimation/nicontrollersequence.cpp"
click node_time "https://github.com/momusdigital/f3_decomp/blob/main/src/gamebryo2.2/corelibs/nimain/nitimecontroller.cpp"
click node_memory "https://github.com/momusdigital/f3_decomp/blob/main/src/bscore/memorymanager.cpp"
click node_memory_pools "https://github.com/momusdigital/f3_decomp/blob/main/include/MemoryPool.h"
click node_archive "https://github.com/momusdigital/f3_decomp/blob/main/src/bssystem/archive.cpp"
click node_script_runtime "https://github.com/momusdigital/f3_decomp/blob/main/src/fallout_shared/tesscriptrunmanager.cpp"
click node_facegen "https://github.com/momusdigital/f3_decomp/blob/main/src/fallout_shared/facegen/bsfacegenmanager_o2_variant.cpp"
click node_speedtree "https://github.com/momusdigital/f3_decomp/blob/main/src/fallout_shared/speedtree/bstreemanager_o2_variant.cpp"
click node_havok_shapes "https://github.com/momusdigital/f3_decomp/blob/main/src/havok/physics/collide/shape/compound/collection/storageextendedmesh/hkpstorageextendedmeshshape.cpp"
click node_havok_world "https://github.com/momusdigital/f3_decomp/blob/main/src/havok/physics/dynamics/world/util/aabbtree/hkpaabbtreeworldmanager.cpp"
click node_havok_character "https://github.com/momusdigital/f3_decomp/blob/main/src/havok/physics/utilities/charactercontrol/statemachine/hkpcharacterstatemanager.cpp"
click node_layout "https://github.com/momusdigital/f3_decomp/blob/main/include/layout_support.h"
click node_havok_base "https://github.com/momusdigital/f3_decomp/blob/main/include/havok/hkBase.h"

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_startup,node_combat,node_script_runtime toneBlue
class node_interface,node_audio,node_shader,node_imagespace,node_decals,node_facegen,node_speedtree toneAmber
class node_animation,node_time,node_memory,node_memory_pools,node_archive,node_layout toneMint
class node_havok_shapes,node_havok_world,node_havok_character,node_havok_base toneRose
class node_researcher,node_decomp toneIndigo
```

## Components

### Gameplay systems

- [Game startup](https://github.com/momusdigital/f3_decomp/blob/main/src/fallout/misc/main.cpp): `src/fallout/misc/main.cpp`
- [Combat AI](https://github.com/momusdigital/f3_decomp/blob/main/src/fallout/ai/combatcontroller.cpp): `src/fallout/ai/combatcontroller.cpp`
- [Script runtime](https://github.com/momusdigital/f3_decomp/blob/main/src/fallout_shared/tesscriptrunmanager.cpp): `src/fallout_shared/tesscriptrunmanager.cpp`

### Presentation systems

- [Interface manager](https://github.com/momusdigital/f3_decomp/blob/main/src/fallout/interface/interfacemanager.cpp): `src/fallout/interface/interfacemanager.cpp`
- [Audio manager](https://github.com/momusdigital/f3_decomp/blob/main/src/bsaudio/bsaudiomanager.cpp): `src/bsaudio/bsaudiomanager.cpp`
- [Shader manager](https://github.com/momusdigital/f3_decomp/blob/main/src/bsshader/bsshadermanager.cpp): `src/bsshader/bsshadermanager.cpp`
- [Image-space effects](https://github.com/momusdigital/f3_decomp/blob/main/src/bsshader/imagespacemanager.cpp): `src/bsshader/imagespacemanager.cpp`
- [Decal manager](https://github.com/momusdigital/f3_decomp/blob/main/src/fallout_shared/bgsdecalmanager.cpp): `src/fallout_shared/bgsdecalmanager.cpp`
- [Face generation](https://github.com/momusdigital/f3_decomp/blob/main/src/fallout_shared/facegen/bsfacegenmanager_o2_variant.cpp): `src/fallout_shared/facegen/bsfacegenmanager_o2_variant.cpp`
- [SpeedTree manager](https://github.com/momusdigital/f3_decomp/blob/main/src/fallout_shared/speedtree/bstreemanager_o2_variant.cpp): `src/fallout_shared/speedtree/bstreemanager_o2_variant.cpp`

### Engine services

- [Controller sequences](https://github.com/momusdigital/f3_decomp/blob/main/src/gamebryo2.2/corelibs/nianimation/nicontrollersequence.cpp): `src/gamebryo2.2/corelibs/nianimation/nicontrollersequence.cpp`
- [Time controller](https://github.com/momusdigital/f3_decomp/blob/main/src/gamebryo2.2/corelibs/nimain/nitimecontroller.cpp): `src/gamebryo2.2/corelibs/nimain/nitimecontroller.cpp`
- [Memory manager](https://github.com/momusdigital/f3_decomp/blob/main/src/bscore/memorymanager.cpp): `src/bscore/memorymanager.cpp`
- [Memory pools](https://github.com/momusdigital/f3_decomp/blob/main/include/MemoryPool.h): `include/MemoryPool.h`
- [Archive handling](https://github.com/momusdigital/f3_decomp/blob/main/src/bssystem/archive.cpp): `src/bssystem/archive.cpp`
- [Engine type layouts](https://github.com/momusdigital/f3_decomp/blob/main/include/layout_support.h): `include/layout_support.h`

### Havok physics

- [Stored mesh shapes](https://github.com/momusdigital/f3_decomp/blob/main/src/havok/physics/collide/shape/compound/collection/storageextendedmesh/hkpstorageextendedmeshshape.cpp): `src/havok/physics/collide/shape/compound/collection/storageextendedmesh/hkpstorageextendedmeshshape.cpp`
- [World broad phase](https://github.com/momusdigital/f3_decomp/blob/main/src/havok/physics/dynamics/world/util/aabbtree/hkpaabbtreeworldmanager.cpp): `src/havok/physics/dynamics/world/util/aabbtree/hkpaabbtreeworldmanager.cpp`
- [Character state machine](https://github.com/momusdigital/f3_decomp/blob/main/src/havok/physics/utilities/charactercontrol/statemachine/hkpcharacterstatemanager.cpp): `src/havok/physics/utilities/charactercontrol/statemachine/hkpcharacterstatemanager.cpp`
- [Havok base types](https://github.com/momusdigital/f3_decomp/blob/main/include/havok/hkBase.h): `include/havok/hkBase.h`

### Other components

- **Modder / researcher**
- **Fallout 3 source reference**

## Connections

- Modder / researcher → Fallout 3 source reference: consults (evidence: `README.md`)
- Fallout 3 source reference → Game startup: documents behavior (evidence: `README.md`)
- Fallout 3 source reference → Combat AI: documents behavior (evidence: `README.md`)
- Fallout 3 source reference → Interface manager: documents behavior (evidence: `README.md`)
- Fallout 3 source reference → Audio manager: documents behavior (evidence: `README.md`)
- Fallout 3 source reference → Shader manager: documents behavior (evidence: `README.md`)
- Fallout 3 source reference → Image-space effects: documents behavior (evidence: `README.md`)
- Fallout 3 source reference → Decal manager: documents behavior (evidence: `README.md`)
- Fallout 3 source reference → Controller sequences: documents behavior (evidence: `README.md`)
- Fallout 3 source reference → Time controller: documents behavior (evidence: `README.md`)
- Fallout 3 source reference → Memory manager: documents behavior (evidence: `README.md`)
- Fallout 3 source reference → Archive handling: documents behavior (evidence: `README.md`)
- Fallout 3 source reference → Script runtime: documents behavior (evidence: `README.md`)
- Fallout 3 source reference → Face generation: documents behavior (evidence: `README.md`)
- Fallout 3 source reference → SpeedTree manager: documents behavior (evidence: `README.md`)
- Fallout 3 source reference → Stored mesh shapes: documents behavior (evidence: `README.md`)
- Fallout 3 source reference → World broad phase: documents behavior (evidence: `README.md`)
- Fallout 3 source reference → Character state machine: documents behavior (evidence: `README.md`)
- Image-space effects → Image-space effects: sets up effects (evidence: `src/bsshader/imagespacemanager.cpp`)
- Memory manager → Memory pools: creates pools (evidence: `src/bscore/memorymanager.cpp`)
- Stored mesh shapes → Havok base types: uses base types
