# kiquxd/forest-frontier architecture

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

- Interactive diagram: https://gitdiagram.com/kiquxd/forest-frontier
- Repository: https://github.com/kiquxd/forest-frontier

## Overview

Forest Frontier is a local, single-player exploration and settlement game. Players control individual residents to explore and gather, then develop towns through knowledge, production, trade, diplomacy, and construction; later they sail and dive for resources. The graph separates the interactive entry point, simulation and world state, settlement/economy systems, and presentation/persistence. README-described capabilities whose implementation was not sampled remain represented, but their internal call paths are not inferred.

Main entry points: [`src/main.cpp`](https://github.com/kiquxd/forest-frontier/blob/main/src/main.cpp) (Game loop), [`src/gameplay.cpp`](https://github.com/kiquxd/forest-frontier/blob/main/src/gameplay.cpp) (Exploration and combat), [`src/render.cpp`](https://github.com/kiquxd/forest-frontier/blob/main/src/render.cpp) (World and game UI), [`src/nation.cpp`](https://github.com/kiquxd/forest-frontier/blob/main/src/nation.cpp) (State and economy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Game application"]
  node_main["Game loop<br/>[main.cpp]"]
end

subgraph group_sim["World and adventure"]
  node_world["World simulation<br/>[world.cpp]"]
  node_gameplay["Exploration and combat<br/>[gameplay.cpp]"]
  node_adventure["Residents and progression<br/>[adventure.cpp]"]
  node_vessels["Vessel definitions<br/>[vessels.cpp]"]
end

subgraph group_settlement["Town systems"]
  node_nation["State and economy<br/>[nation.cpp]"]
  node_settlements["Town infrastructure"]
end

subgraph group_interface["Interface and persistence"]
  node_nation_ui["Town management UI<br/>[nation_ui.cpp]"]
  node_summary["Progress summaries<br/>[summary.cpp]"]
  node_summary_render["Summary display<br/>[summary_render.cpp]"]
  node_render["World and game UI<br/>[render.cpp]"]
  node_cartography["Map layers<br/>[cartography.cpp]"]
  node_journal["Map journal<br/>[map_journal.cpp]"]
  node_notes["Saved map notes<br/>[atlas_notes.cpp]"]
  node_save["Save slots<br/>[save_slots.cpp]"]
  node_menu["Start menu<br/>[menu.cpp]"]
  node_settings["Settings UI<br/>[settings_ui.cpp]"]
  node_dialogue["NPC dialogue<br/>[dialogue.cpp]"]
  node_audio["Audio<br/>[audio.cpp]"]
end

node_player(("Player"))

node_player -->|"plays"| node_main
node_main -->|"advances"| node_gameplay
node_main -->|"requests paths"| node_world
node_main -->|"selects resident"| node_nation
node_main -.->|"presents game"| node_render
node_gameplay -->|"moves through"| node_world
node_gameplay -->|"uses vessel data"| node_vessels
node_gameplay -->|"updates residents"| node_adventure
node_nation -->|"uses infrastructure"| node_settlements
node_nation_ui -->|"manages towns"| node_nation
node_summary_render -->|"renders summaries"| node_summary
node_render -->|"draws map layers"| node_cartography
node_journal -->|"edits notes"| node_notes
node_menu -->|"uses save slots"| node_save
node_menu -->|"opens settings"| node_settings
node_player -.->|"talks to NPCs"| node_dialogue
node_render -.->|"uses audio"| node_audio

click node_main "https://github.com/kiquxd/forest-frontier/blob/main/src/main.cpp"
click node_world "https://github.com/kiquxd/forest-frontier/blob/main/src/world.cpp"
click node_gameplay "https://github.com/kiquxd/forest-frontier/blob/main/src/gameplay.cpp"
click node_adventure "https://github.com/kiquxd/forest-frontier/blob/main/src/adventure.cpp"
click node_vessels "https://github.com/kiquxd/forest-frontier/blob/main/src/vessels.cpp"
click node_nation "https://github.com/kiquxd/forest-frontier/blob/main/src/nation.cpp"
click node_settlements "https://github.com/kiquxd/forest-frontier/blob/main/src/settlement_system.cpp"
click node_nation_ui "https://github.com/kiquxd/forest-frontier/blob/main/src/nation_ui.cpp"
click node_summary "https://github.com/kiquxd/forest-frontier/blob/main/src/summary.cpp"
click node_summary_render "https://github.com/kiquxd/forest-frontier/blob/main/src/summary_render.cpp"
click node_render "https://github.com/kiquxd/forest-frontier/blob/main/src/render.cpp"
click node_cartography "https://github.com/kiquxd/forest-frontier/blob/main/src/cartography.cpp"
click node_journal "https://github.com/kiquxd/forest-frontier/blob/main/src/map_journal.cpp"
click node_notes "https://github.com/kiquxd/forest-frontier/blob/main/src/atlas_notes.cpp"
click node_save "https://github.com/kiquxd/forest-frontier/blob/main/src/save_slots.cpp"
click node_menu "https://github.com/kiquxd/forest-frontier/blob/main/src/menu.cpp"
click node_settings "https://github.com/kiquxd/forest-frontier/blob/main/src/settings_ui.cpp"
click node_dialogue "https://github.com/kiquxd/forest-frontier/blob/main/src/dialogue.cpp"
click node_audio "https://github.com/kiquxd/forest-frontier/blob/main/src/audio.cpp"

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_main toneBlue
class node_world,node_gameplay,node_adventure,node_vessels toneAmber
class node_nation,node_settlements toneMint
class node_nation_ui,node_summary,node_summary_render,node_render,node_cartography,node_journal,node_notes,node_save,node_menu,node_settings,node_dialogue,node_audio toneRose
class node_player toneIndigo
```

## Components

### Game application

- [Game loop](https://github.com/kiquxd/forest-frontier/blob/main/src/main.cpp): `src/main.cpp`

### World and adventure

- [World simulation](https://github.com/kiquxd/forest-frontier/blob/main/src/world.cpp): `src/world.cpp`
- [Exploration and combat](https://github.com/kiquxd/forest-frontier/blob/main/src/gameplay.cpp): `src/gameplay.cpp`
- [Residents and progression](https://github.com/kiquxd/forest-frontier/blob/main/src/adventure.cpp): `src/adventure.cpp`
- [Vessel definitions](https://github.com/kiquxd/forest-frontier/blob/main/src/vessels.cpp): `src/vessels.cpp`

### Town systems

- [State and economy](https://github.com/kiquxd/forest-frontier/blob/main/src/nation.cpp): `src/nation.cpp`
- [Town infrastructure](https://github.com/kiquxd/forest-frontier/blob/main/src/settlement_system.cpp): `src/settlement_system.cpp`

### Interface and persistence

- [Town management UI](https://github.com/kiquxd/forest-frontier/blob/main/src/nation_ui.cpp): `src/nation_ui.cpp`
- [Progress summaries](https://github.com/kiquxd/forest-frontier/blob/main/src/summary.cpp): `src/summary.cpp`
- [Summary display](https://github.com/kiquxd/forest-frontier/blob/main/src/summary_render.cpp): `src/summary_render.cpp`
- [World and game UI](https://github.com/kiquxd/forest-frontier/blob/main/src/render.cpp): `src/render.cpp`
- [Map layers](https://github.com/kiquxd/forest-frontier/blob/main/src/cartography.cpp): `src/cartography.cpp`
- [Map journal](https://github.com/kiquxd/forest-frontier/blob/main/src/map_journal.cpp): `src/map_journal.cpp`
- [Saved map notes](https://github.com/kiquxd/forest-frontier/blob/main/src/atlas_notes.cpp): `src/atlas_notes.cpp`
- [Save slots](https://github.com/kiquxd/forest-frontier/blob/main/src/save_slots.cpp): `src/save_slots.cpp`
- [Start menu](https://github.com/kiquxd/forest-frontier/blob/main/src/menu.cpp): `src/menu.cpp`
- [Settings UI](https://github.com/kiquxd/forest-frontier/blob/main/src/settings_ui.cpp): `src/settings_ui.cpp`
- [NPC dialogue](https://github.com/kiquxd/forest-frontier/blob/main/src/dialogue.cpp): `src/dialogue.cpp`
- [Audio](https://github.com/kiquxd/forest-frontier/blob/main/src/audio.cpp): `src/audio.cpp`

### Other components

- **Player**

## Connections

- Player → Game loop: plays
- Game loop → Exploration and combat: advances (evidence: `src/main.cpp`)
- Game loop → World simulation: requests paths (evidence: `src/main.cpp`)
- Game loop → State and economy: selects resident (evidence: `src/main.cpp`)
- Game loop → World and game UI: presents game
- Exploration and combat → World simulation: moves through (evidence: `src/gameplay.cpp`)
- Exploration and combat → Vessel definitions: uses vessel data (evidence: `src/gameplay.cpp`)
- Exploration and combat → Residents and progression: updates residents (evidence: `src/gameplay.cpp`)
- State and economy → Town infrastructure: uses infrastructure (evidence: `src/nation.cpp`)
- Town management UI → State and economy: manages towns (evidence: `src/nation_ui.cpp`)
- Summary display → Progress summaries: renders summaries (evidence: `src/summary_render.cpp`)
- World and game UI → Map layers: draws map layers (evidence: `src/cartography.cpp`)
- Map journal → Saved map notes: edits notes (evidence: `src/map_journal.cpp`)
- Start menu → Save slots: uses save slots (evidence: `src/menu.cpp`)
- Start menu → Settings UI: opens settings (evidence: `src/menu.cpp`)
- Player → NPC dialogue: talks to NPCs
- World and game UI → Audio: uses audio
