# phonealmonda/katierustfly architecture

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

- Interactive diagram: https://gitdiagram.com/phonealmonda/katierustfly
- Repository: https://github.com/phonealmonda/katierustfly

## Overview

KatieFlySimRust is a Macroquad space-flight simulator: players choose a game mode and map, fly vehicles through gravity-driven worlds, manage satellite and fuel systems, and view HUD/trajectory information. The runtime is organized around game modes and shared world/simulation services, with save/load and online multiplayer as supporting branches. KatieMapMaker is a separate map-authoring application in the same tree. The excerpts show the main entry and selected systems; menu, save, and several game-mode internals are represented from the file tree, so uncertain call wiring is omitted.

Main entry points: [`KatieFlySimRust/src/main.rs`](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/main.rs) (Mode Router), [`KatieFlySimRust/src/systems/world.rs`](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/systems/world.rs) (World Systems), [`KatieFlySimRust/src/game_modes/single_player.rs`](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/game_modes/single_player.rs) (Single Player), [`KatieFlySimRust/src/game_modes/multiplayer_client.rs`](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/game_modes/multiplayer_client.rs) (Online Client Mode)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game Runtime"]
  node_entry["Mode Router<br/>[main.rs]"]
  node_modes["Game Modes<br/>[mod.rs]"]
  node_single["Single Player<br/>[single_player.rs]"]
  node_split["Split Screen<br/>[split_screen.rs]"]
  node_clientmode["Online Client Mode"]
  node_hostmode["Online Host Mode"]
  node_game_state["Game State<br/>[game_state.rs]"]
end

subgraph group_simulation["World Simulation"]
  node_world["World Systems<br/>[world.rs]"]
  node_vehicles["Vehicle Manager<br/>[vehicle_manager.rs]"]
  node_satellites["Satellite Manager"]
  node_fuel["Fuel Transfers"]
  node_orbit["Orbit Maintenance"]
  node_entities["Space Entities<br/>[mod.rs]"]
  node_gravity["Gravity Simulation"]
  node_trajectory["Trajectory Prediction<br/>[trajectory.rs]"]
end

subgraph group_presentation["Player Interface"]
  node_menus["Menus<br/>[mod.rs]"]
  node_hud["HUD Manager<br/>[ui_manager.rs]"]
end

subgraph group_persistence["Maps And Saves"]
  node_maps["Map Configuration<br/>[mod.rs]"]
  node_saves["Save System<br/>[mod.rs]"]
  node_mapmaker["Map Maker<br/>[main.rs]"]
  node_mapdata["Map Data<br/>[map_data.rs]"]
end

subgraph group_multiplayer["Multiplayer"]
  node_network["Network Manager<br/>[network_manager.rs]"]
  node_netclient["Network Client"]
  node_nethost["Network Host"]
end

node_player(("Player"))

node_player -->|"selects mode"| node_entry
node_entry -->|"routes menu state"| node_menus
node_entry -->|"starts game"| node_single
node_entry -->|"starts game"| node_split
node_entry -->|"starts client"| node_clientmode
node_entry -->|"starts host"| node_hostmode
node_entry -->|"updates state"| node_game_state
node_single -->|"updates world"| node_world
node_split -->|"updates world"| node_world
node_clientmode -->|"updates world"| node_world
node_hostmode -->|"updates world"| node_world
node_world -->|"manages entities"| node_entities
node_world -->|"simulates gravity"| node_gravity
node_world -->|"manages vehicles"| node_vehicles
node_world -->|"manages satellites"| node_satellites
node_satellites -->|"coordinates transfers"| node_fuel
node_satellites -->|"maintains orbits"| node_orbit
node_vehicles -->|"requests predictions"| node_trajectory
node_trajectory -->|"calculates forces"| node_gravity
node_single -->|"loads map"| node_maps
node_entry -->|"loads or saves"| node_saves
node_menus -->|"selects saves"| node_saves
node_menus -->|"selects map"| node_maps
node_mapmaker -->|"edits map data"| node_mapdata
node_single -->|"renders interface"| node_hud
node_split -->|"renders interface"| node_hud
node_clientmode -.->|"exchanges messages"| node_network
node_hostmode -.->|"exchanges messages"| node_network
node_clientmode -->|"uses client protocol"| node_netclient
node_hostmode -->|"uses host protocol"| node_nethost
node_netclient -->|"sends and receives"| node_network
node_nethost -->|"sends and receives"| node_network

click node_entry "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/main.rs"
click node_modes "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/game_modes/mod.rs"
click node_single "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/game_modes/single_player.rs"
click node_split "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/game_modes/split_screen.rs"
click node_clientmode "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/game_modes/multiplayer_client.rs"
click node_hostmode "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/game_modes/multiplayer_host.rs"
click node_menus "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/menus/mod.rs"
click node_hud "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/ui/ui_manager.rs"
click node_world "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/systems/world.rs"
click node_vehicles "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/systems/vehicle_manager.rs"
click node_satellites "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/systems/satellite_manager.rs"
click node_fuel "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/systems/fuel_transfer_network.rs"
click node_orbit "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/systems/orbit_maintenance.rs"
click node_entities "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/entities/mod.rs"
click node_gravity "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/physics/gravity_simulator.rs"
click node_trajectory "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/physics/trajectory.rs"
click node_maps "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/map_config/mod.rs"
click node_saves "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/save_system/mod.rs"
click node_mapmaker "https://github.com/phonealmonda/katierustfly/blob/main/KatieMapMaker/src/main.rs"
click node_mapdata "https://github.com/phonealmonda/katierustfly/blob/main/KatieMapMaker/src/map_data.rs"
click node_network "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/networking/network_manager.rs"
click node_netclient "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/networking/multiplayer_client.rs"
click node_nethost "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/networking/multiplayer_host.rs"
click node_game_state "https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/game_state.rs"

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_entry,node_modes,node_single,node_split,node_clientmode,node_hostmode,node_game_state toneBlue
class node_world,node_vehicles,node_satellites,node_fuel,node_orbit,node_entities,node_gravity,node_trajectory toneAmber
class node_menus,node_hud toneMint
class node_maps,node_saves,node_mapmaker,node_mapdata toneRose
class node_network,node_netclient,node_nethost,node_player toneIndigo
```

## Components

### Game Runtime

- [Mode Router](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/main.rs): `KatieFlySimRust/src/main.rs`
- [Game Modes](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/game_modes/mod.rs): `KatieFlySimRust/src/game_modes/mod.rs`
- [Single Player](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/game_modes/single_player.rs): `KatieFlySimRust/src/game_modes/single_player.rs`
- [Split Screen](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/game_modes/split_screen.rs): `KatieFlySimRust/src/game_modes/split_screen.rs`
- [Online Client Mode](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/game_modes/multiplayer_client.rs): `KatieFlySimRust/src/game_modes/multiplayer_client.rs`
- [Online Host Mode](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/game_modes/multiplayer_host.rs): `KatieFlySimRust/src/game_modes/multiplayer_host.rs`
- [Game State](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/game_state.rs): `KatieFlySimRust/src/game_state.rs`

### World Simulation

- [World Systems](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/systems/world.rs): `KatieFlySimRust/src/systems/world.rs`
- [Vehicle Manager](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/systems/vehicle_manager.rs): `KatieFlySimRust/src/systems/vehicle_manager.rs`
- [Satellite Manager](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/systems/satellite_manager.rs): `KatieFlySimRust/src/systems/satellite_manager.rs`
- [Fuel Transfers](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/systems/fuel_transfer_network.rs): `KatieFlySimRust/src/systems/fuel_transfer_network.rs`
- [Orbit Maintenance](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/systems/orbit_maintenance.rs): `KatieFlySimRust/src/systems/orbit_maintenance.rs`
- [Space Entities](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/entities/mod.rs): `KatieFlySimRust/src/entities/mod.rs`
- [Gravity Simulation](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/physics/gravity_simulator.rs): `KatieFlySimRust/src/physics/gravity_simulator.rs`
- [Trajectory Prediction](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/physics/trajectory.rs): `KatieFlySimRust/src/physics/trajectory.rs`

### Player Interface

- [Menus](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/menus/mod.rs): `KatieFlySimRust/src/menus/mod.rs`
- [HUD Manager](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/ui/ui_manager.rs): `KatieFlySimRust/src/ui/ui_manager.rs`

### Maps And Saves

- [Map Configuration](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/map_config/mod.rs): `KatieFlySimRust/src/map_config/mod.rs`
- [Save System](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/save_system/mod.rs): `KatieFlySimRust/src/save_system/mod.rs`
- [Map Maker](https://github.com/phonealmonda/katierustfly/blob/main/KatieMapMaker/src/main.rs): `KatieMapMaker/src/main.rs`
- [Map Data](https://github.com/phonealmonda/katierustfly/blob/main/KatieMapMaker/src/map_data.rs): `KatieMapMaker/src/map_data.rs`

### Multiplayer

- [Network Manager](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/networking/network_manager.rs): `KatieFlySimRust/src/networking/network_manager.rs`
- [Network Client](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/networking/multiplayer_client.rs): `KatieFlySimRust/src/networking/multiplayer_client.rs`
- [Network Host](https://github.com/phonealmonda/katierustfly/blob/main/KatieFlySimRust/src/networking/multiplayer_host.rs): `KatieFlySimRust/src/networking/multiplayer_host.rs`

### Other components

- **Player**

## Connections

- Player → Mode Router: selects mode
- Mode Router → Menus: routes menu state
- Mode Router → Single Player: starts game
- Mode Router → Split Screen: starts game
- Mode Router → Online Client Mode: starts client
- Mode Router → Online Host Mode: starts host
- Mode Router → Game State: updates state
- Single Player → World Systems: updates world
- Split Screen → World Systems: updates world
- Online Client Mode → World Systems: updates world
- Online Host Mode → World Systems: updates world
- World Systems → Space Entities: manages entities
- World Systems → Gravity Simulation: simulates gravity
- World Systems → Vehicle Manager: manages vehicles
- World Systems → Satellite Manager: manages satellites
- Satellite Manager → Fuel Transfers: coordinates transfers
- Satellite Manager → Orbit Maintenance: maintains orbits
- Vehicle Manager → Trajectory Prediction: requests predictions
- Trajectory Prediction → Gravity Simulation: calculates forces
- Single Player → Map Configuration: loads map
- Mode Router → Save System: loads or saves
- Menus → Save System: selects saves
- Menus → Map Configuration: selects map
- Map Maker → Map Data: edits map data
- Single Player → HUD Manager: renders interface
- Split Screen → HUD Manager: renders interface
- Online Client Mode → Network Manager: exchanges messages
- Online Host Mode → Network Manager: exchanges messages
- Online Client Mode → Network Client: uses client protocol
- Online Host Mode → Network Host: uses host protocol
- Network Client → Network Manager: sends and receives
- Network Host → Network Manager: sends and receives
