# thomasdgn/alterdune architecture

> Architecture diagram of the GitHub repository thomasdgn/alterdune, 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/thomasdgn/alterdune
- Repository: https://github.com/thomasdgn/alterdune

## Overview

ALTERDUNE is a C++ mini-RPG with a playable console version and an optional SFML frontend sharing the same game engine. The player starts a run, advances through region-gated encounters, resolves fights through combat or mercy choices, and earns progression and one of three endings. The README also describes inventory, bestiary, appearance selection, and frontend views. Core implementation and frontend wiring are supported by the sampled files; several documented subsystems are represented at their existing enclosing paths because their source was not sampled.

Main entry points: [`src/Game.cpp`](https://github.com/thomasdgn/alterdune/blob/main/src/Game.cpp) (Game engine), [`src/FrontendApp.cpp`](https://github.com/thomasdgn/alterdune/blob/main/src/FrontendApp.cpp) (SFML frontend), [`src/Player.cpp`](https://github.com/thomasdgn/alterdune/blob/main/src/Player.cpp) (Player model), [`src/main.cpp`](https://github.com/thomasdgn/alterdune/blob/main/src/main.cpp) (Console entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Player Interfaces"]
  node_console["Console entry<br/>[main.cpp]"]
  node_frontend["SFML frontend<br/>[FrontendApp.cpp]"]
end

subgraph group_engine["Game Engine"]
  node_game["Game engine<br/>[Game.cpp]"]
  node_campaign["Campaign progression<br/>[Game.cpp]"]
  node_battle["Battle resolution<br/>[Game.cpp]"]
  node_outcomes["Rewards and endings<br/>[Game.cpp]"]
  node_views["Frontend view data"]
end

subgraph group_domain["Game Domain"]
  node_player_model["Player model<br/>[Player.cpp]"]
  node_monster["Monster model<br/>[Monster.cpp]"]
  node_entity["Entity stats<br/>[Entity.cpp]"]
  node_items["Items and inventory<br/>[Item.cpp]"]
  node_act["ACT actions<br/>[ActAction.cpp]"]
  node_bestiary["Bestiary entries<br/>[BestiaryEntry.cpp]"]
end

subgraph group_content["Game Content"]
  node_item_data["Item definitions<br/>[items.csv]"]
  node_monster_data["Monster definitions<br/>[monsters.csv]"]
  node_assets["Visual and audio assets"]
end

node_player(("Player"))

node_player -->|"starts run"| node_console
node_player -.->|"uses interface"| node_frontend
node_console -->|"runs"| node_game
node_frontend -->|"invokes shared logic"| node_game
node_frontend -->|"renders view data"| node_views
node_game -->|"builds"| node_views
node_game -->|"manages progression"| node_campaign
node_game -->|"resolves turns"| node_battle
node_game -->|"records results"| node_outcomes
node_game -->|"updates player"| node_player_model
node_game -->|"loads and battles"| node_monster
node_game -->|"loads and grants"| node_items
node_game -->|"uses ACT catalog"| node_act
node_game -->|"updates entries"| node_bestiary
node_player_model -->|"inherits stats"| node_entity
node_monster -->|"inherits stats"| node_entity
node_player_model -->|"owns inventory"| node_items
node_game -->|"loads CSV"| node_item_data
node_game -->|"loads CSV"| node_monster_data
node_frontend -.->|"loads optionally"| node_assets

click node_console "https://github.com/thomasdgn/alterdune/blob/main/src/main.cpp"
click node_frontend "https://github.com/thomasdgn/alterdune/blob/main/src/FrontendApp.cpp"
click node_game "https://github.com/thomasdgn/alterdune/blob/main/src/Game.cpp"
click node_campaign "https://github.com/thomasdgn/alterdune/blob/main/src/Game.cpp"
click node_battle "https://github.com/thomasdgn/alterdune/blob/main/src/Game.cpp"
click node_outcomes "https://github.com/thomasdgn/alterdune/blob/main/src/Game.cpp"
click node_views "https://github.com/thomasdgn/alterdune/blob/main/include/FrontendViewModels.h"
click node_player_model "https://github.com/thomasdgn/alterdune/blob/main/src/Player.cpp"
click node_monster "https://github.com/thomasdgn/alterdune/blob/main/src/Monster.cpp"
click node_entity "https://github.com/thomasdgn/alterdune/blob/main/src/Entity.cpp"
click node_items "https://github.com/thomasdgn/alterdune/blob/main/src/Item.cpp"
click node_act "https://github.com/thomasdgn/alterdune/blob/main/src/ActAction.cpp"
click node_bestiary "https://github.com/thomasdgn/alterdune/blob/main/src/BestiaryEntry.cpp"
click node_item_data "https://github.com/thomasdgn/alterdune/blob/main/data/items.csv"
click node_monster_data "https://github.com/thomasdgn/alterdune/blob/main/data/monsters.csv"
click node_assets "https://github.com/thomasdgn/alterdune/tree/main/assets"

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_console,node_frontend toneBlue
class node_game,node_campaign,node_battle,node_outcomes,node_views toneAmber
class node_player_model,node_monster,node_entity,node_items,node_act,node_bestiary toneMint
class node_item_data,node_monster_data,node_assets toneRose
class node_player toneIndigo
```

## Components

### Player Interfaces

- [Console entry](https://github.com/thomasdgn/alterdune/blob/main/src/main.cpp): `src/main.cpp`
- [SFML frontend](https://github.com/thomasdgn/alterdune/blob/main/src/FrontendApp.cpp): `src/FrontendApp.cpp`

### Game Engine

- [Game engine](https://github.com/thomasdgn/alterdune/blob/main/src/Game.cpp): `src/Game.cpp`
- [Campaign progression](https://github.com/thomasdgn/alterdune/blob/main/src/Game.cpp): `src/Game.cpp`
- [Battle resolution](https://github.com/thomasdgn/alterdune/blob/main/src/Game.cpp): `src/Game.cpp`
- [Rewards and endings](https://github.com/thomasdgn/alterdune/blob/main/src/Game.cpp): `src/Game.cpp`
- [Frontend view data](https://github.com/thomasdgn/alterdune/blob/main/include/FrontendViewModels.h): `include/FrontendViewModels.h`

### Game Domain

- [Player model](https://github.com/thomasdgn/alterdune/blob/main/src/Player.cpp): `src/Player.cpp`
- [Monster model](https://github.com/thomasdgn/alterdune/blob/main/src/Monster.cpp): `src/Monster.cpp`
- [Entity stats](https://github.com/thomasdgn/alterdune/blob/main/src/Entity.cpp): `src/Entity.cpp`
- [Items and inventory](https://github.com/thomasdgn/alterdune/blob/main/src/Item.cpp): `src/Item.cpp`
- [ACT actions](https://github.com/thomasdgn/alterdune/blob/main/src/ActAction.cpp): `src/ActAction.cpp`
- [Bestiary entries](https://github.com/thomasdgn/alterdune/blob/main/src/BestiaryEntry.cpp): `src/BestiaryEntry.cpp`

### Game Content

- [Item definitions](https://github.com/thomasdgn/alterdune/blob/main/data/items.csv): `data/items.csv`
- [Monster definitions](https://github.com/thomasdgn/alterdune/blob/main/data/monsters.csv): `data/monsters.csv`
- [Visual and audio assets](https://github.com/thomasdgn/alterdune/tree/main/assets): `assets`

### Other components

- **Player**

## Connections

- Player → Console entry: starts run
- Player → SFML frontend: uses interface
- Console entry → Game engine: runs
- SFML frontend → Game engine: invokes shared logic
- SFML frontend → Frontend view data: renders view data
- Game engine → Frontend view data: builds
- Game engine → Campaign progression: manages progression
- Game engine → Battle resolution: resolves turns
- Game engine → Rewards and endings: records results
- Game engine → Player model: updates player
- Game engine → Monster model: loads and battles
- Game engine → Items and inventory: loads and grants
- Game engine → ACT actions: uses ACT catalog
- Game engine → Bestiary entries: updates entries
- Player model → Entity stats: inherits stats
- Monster model → Entity stats: inherits stats
- Player model → Items and inventory: owns inventory
- Game engine → Item definitions: loads CSV
- Game engine → Monster definitions: loads CSV
- SFML frontend → Visual and audio assets: loads optionally
