# tbra/stackfall architecture

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

- Interactive diagram: https://gitdiagram.com/tbra/stackfall
- Repository: https://github.com/tbra/stackfall

## Overview

Stackfall is a real-time competitive block-stacking territory game, with online ENet multiplayer and a retained hot-seat mode. The documented player flow is host or join, configure and ready in a lobby, start a match, place blocks through host validation, then compete for territory and goals. The supplied tree contains only tools, not the Godot runtime source, so game subsystem paths and internal call relationships cannot be verified; those nodes use null paths and documented relationships cite the README. Analysis and asset-generation tools are omitted as non-runtime tooling.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_session["Session and Lobby"]
  node_menu["Main Menu"]
  node_lobby["Lobby Settings"]
  node_ready["Ready Roster"]
  node_match_start["Match Start"]
end

subgraph group_match["Match Play"]
  node_placement["Block Placement"]
  node_territory["Territory Control"]
  node_specials["Special Blocks"]
  node_goals["Goals and Victory"]
  node_hotseat["Hot-seat Mode"]
end

subgraph group_network["Networking"]
  node_host["Host Authority"]
  node_lan["LAN Discovery"]
  node_direct_ip["Direct IP Join"]
  node_peer_sync["Peer Synchronization"]
  node_disconnect["Disconnect Handling"]
end

subgraph group_presentation["Player Feedback"]
  node_hud["Player HUD"]
  node_debug["Network Debug Overlay"]
end

node_player(("Player"))

node_player -->|"opens"| node_menu
node_menu -->|"hosts or joins"| node_lobby
node_lobby -->|"configures roster"| node_ready
node_ready -->|"starts match"| node_match_start
node_match_start -->|"begins play"| node_placement
node_placement -->|"submits intent"| node_host
node_host -->|"validates and relays"| node_peer_sync
node_peer_sync -->|"spawns placement"| node_placement
node_placement -->|"changes territory"| node_territory
node_territory -->|"determines victory"| node_goals
node_placement -->|"throws specials"| node_specials
node_player -->|"starts legacy mode"| node_hotseat
node_lobby -->|"discovers hosts"| node_lan
node_player -->|"joins by address"| node_direct_ip
node_direct_ip -->|"connects peer"| node_peer_sync
node_lan -->|"connects peer"| node_peer_sync
node_peer_sync -->|"detects departure"| node_disconnect
node_match_start -->|"shows player status"| node_hud
node_peer_sync -->|"reports connection metrics"| node_debug

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_menu,node_lobby,node_ready,node_match_start toneBlue
class node_placement,node_territory,node_specials,node_goals,node_hotseat toneAmber
class node_host,node_lan,node_direct_ip,node_peer_sync,node_disconnect toneMint
class node_hud,node_debug toneRose
class node_player toneIndigo
```

## Components

### Session and Lobby

- **Main Menu**
- **Lobby Settings**
- **Ready Roster**
- **Match Start**

### Match Play

- **Block Placement**
- **Territory Control**
- **Special Blocks**
- **Goals and Victory**
- **Hot-seat Mode**

### Networking

- **Host Authority**
- **LAN Discovery**
- **Direct IP Join**
- **Peer Synchronization**
- **Disconnect Handling**

### Player Feedback

- **Player HUD**
- **Network Debug Overlay**

### Other components

- **Player**

## Connections

- Player → Main Menu: opens
- Main Menu → Lobby Settings: hosts or joins
- Lobby Settings → Ready Roster: configures roster
- Ready Roster → Match Start: starts match
- Match Start → Block Placement: begins play
- Block Placement → Host Authority: submits intent
- Host Authority → Peer Synchronization: validates and relays
- Peer Synchronization → Block Placement: spawns placement
- Block Placement → Territory Control: changes territory
- Territory Control → Goals and Victory: determines victory
- Block Placement → Special Blocks: throws specials
- Player → Hot-seat Mode: starts legacy mode
- Lobby Settings → LAN Discovery: discovers hosts
- Player → Direct IP Join: joins by address
- Direct IP Join → Peer Synchronization: connects peer
- LAN Discovery → Peer Synchronization: connects peer
- Peer Synchronization → Disconnect Handling: detects departure
- Match Start → Player HUD: shows player status
- Peer Synchronization → Network Debug Overlay: reports connection metrics
