# frontlineops/flops_flo architecture

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

- Interactive diagram: https://gitdiagram.com/frontlineops/flops_flo
- Repository: https://github.com/frontlineops/flops_flo

## Overview

1. **Project shape**
   FLO is an Arma 3 mission framework, not a conventional app. The runtime is split between server-owned mission logic and client-side UI/actions, with persistence across sessions through save/load. The core gameplay loop is a dynamic frontline campaign rather than a fixed scenario.

2. **Startup and authority boundary**
   The authoritative boot path is the server-side phase manager in `Functions/Init`. It runs a staged initialization pipeline: save detection, mission config restore/setup, faction loading, objective indexing, virtualization seeding, then mission systems startup. Clients do not drive campaign state directly; they wait for mission-ready and then finalize local UI and interaction layers.

3. **Persistent campaign state**
   Saved state spans mission config, objective ownership, virtual groups, logistics state, and commander/runtime data. That persistence boundary is important for the diagram: the server restores a campaign world, rather than recreating one each launch. Fresh-start lobby parameters alter whether the mission resumes or rebuilds from scratch.

4. **Faction and composition layer**
   Mission setup feeds a runtime faction catalog built from custom faction scripts and optionally auto-generated compatible Arma config data. The faction layer supplies unit/vehicle pools, composition defaults, and objective template values used downstream by commanders, virtualization, logistics, and civilian spawning. Root files like `CUSTOM_PLAYER_FACTION.sqf` and the `Scripts/factions` presets are the main authoring boundary.

5. **Objective graph and frontline model**
   `Functions/Objective` builds and maintains the world’s territorial structure: objective indexing, graph links, clustering, ownership flips, and respawn markers. This subsystem is the spatial backbone for the campaign; it informs frontline pressure, rear areas, capture growth, and where forces are seeded or reinforced.

6. **GTN command-and-control layer**
   `Functions/AI/GTN` is the strategic brain. It includes side commanders, world-state maintenance, planners, executors, monitors, intel aggregation, combat resolution, alerts, and player support integration. The command loop consumes objective state and logistics availability, then produces attack/defend/garrison orders, support requests, and tasking for each military side.

7. **Strategic decision flow**
   The commander does not directly “spawn enemies”; it evaluates world state, classifies combat zones, computes pressure and reserve needs, and allocates limited strategic orders over time. That makes the main data flow: objectives and combat events feed commander world-state models, which then drive virtual group orders and logistics demand.

8. **Virtualized battlefield subsystem**
   `Functions/Virtualization` is the large-scale simulation boundary. Groups exist in a persistent registry and spatial index, move between virtual and real states based on player proximity and mission needs, and preserve orders, transport links, mission locks, and runtime state across activation cycles. This subsystem covers spawning, deactivation, route updates, patrol logic, and transport carrier behavior.

9. **Logistics and resource economy**
   `Functions/Logistics` implements side resources and supply chains. The network chooses HQ/rear objectives, builds delivery and replacement paths, records dispatches, and refreshes supply chains. Side resources gate replacements and growth, so the campaign’s force regeneration is economically constrained rather than free-respawn based.

10. **Civilian simulation and missions**
   `Functions/Civilian` models a separate population system with behavior, routines, missions, intel gossip, protests, and detainment reactions. Civilians ingest nearby combat events and local control signals, then adapt behavior and produce mission/intel opportunities. This is a distinct AI subsystem from the military commanders, but it shares the same world and objective context.

11. **Player-facing support, intel, and arsenal**
   Player interaction is mediated through support-request flows, intel pickups, commander-side markers, and a restricted arsenal/economy layer. Support requests go through the commander systems, not directly to effects; intel pickups reveal temporary side-only information; the arsenal uses funds, purchases, and crate finalization. These are the main client-to-server interaction boundaries.

12. **Embedded UI, tooling, and reusable modules**
   The repo also contains mission UIs and embedded support modules: `UI`, `IDS_Logistics`, `IDS_Notifications`, and `LARs/spawnComp`. These provide dialogs, notification presentation, build/placement workflows, and composition spawning. Static assets in `Compositions`, `Screens`, and `Sounds` feed mission content and presentation, while `include/` and `CfgFunctions.hpp`-style files wire Arma’s config-driven function registration.

Main entry points: [`Functions/fn_MissionStartup.sqf`](https://github.com/frontlineops/flops_flo/blob/Release/Functions/fn_MissionStartup.sqf) (Mission startup), [`Functions/AI/GTN/Core/fn_gtnCommander.sqf`](https://github.com/frontlineops/flops_flo/blob/Release/Functions/AI/GTN/Core/fn_gtnCommander.sqf) (GTN commander), [`Functions/Factions/fn_factionBuildAutoMilitaryCatalog.sqf`](https://github.com/frontlineops/flops_flo/blob/Release/Functions/Factions/fn_factionBuildAutoMilitaryCatalog.sqf) (Faction catalog), [`Functions/Virtualization/System/fn_initVirtualization.sqf`](https://github.com/frontlineops/flops_flo/blob/Release/Functions/Virtualization/System/fn_initVirtualization.sqf) (Virtualization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["Server runtime"]
  node_phase_manager["Phase manager<br/>server init"]
  node_mission_startup["Mission startup<br/>save/bootstrap"]
  node_mission_save[("Save state<br/>persistence<br/>[fn_MissionSave.sqf]")]
  node_mission_load[("Load state<br/>persistence<br/>[fn_MissionLoad.sqf]")]
  node_faction_catalog["Faction catalog<br/>faction runtime"]
  node_objective_graph{{"Objective graph<br/>territory model"}}
  node_gtn_commander["GTN commander<br/>strategic AI"]
  node_gtn_worldstate["World state<br/>campaign model"]
  node_gtn_planner["Planner<br/>order planning<br/>[fn_gtnPlanner.sqf]"]
  node_gtn_monitor["Monitor<br/>[fn_gtnMonitor.sqf]"]
  node_virtualization{{"Virtualization<br/>battlefield sim"}}
  node_transport["Transport"]
  node_logistics_network["Supply network<br/>logistics economy"]
  node_side_resources[("Side resources<br/>resource economy")]
  node_civilians["Civilians<br/>civilian AI"]
end

subgraph group_client["Client runtime"]
  node_player_support["Player support<br/>player bridge"]
  node_intel["Intel layer<br/>intel bridge"]
  node_arsenal["Arsenal<br/>player economy"]
  node_faction_ui["Faction UI<br/>client UI"]
end

subgraph group_content["Mission content"]
  node_logistics_ui["Build tools<br/>client module"]
  node_spawn_comp["Spawn comp<br/>composition module<br/>[fn_spawnComp.sqf]"]
  node_compositions["Compositions<br/>mission content<br/>[compositions.hpp]"]
end

node_phase_manager -->|"drives"| node_mission_startup
node_mission_startup -->|"restores"| node_mission_load
node_mission_startup -->|"persists"| node_mission_save
node_mission_startup -->|"initializes"| node_faction_catalog
node_mission_startup -->|"indexes"| node_objective_graph
node_mission_startup -->|"seeds"| node_virtualization
node_mission_startup -->|"starts"| node_gtn_commander
node_mission_startup -->|"starts"| node_logistics_network
node_mission_startup -->|"starts"| node_civilians
node_objective_graph -->|"feeds"| node_gtn_worldstate
node_faction_catalog -->|"supplies"| node_gtn_commander
node_faction_catalog -->|"supplies"| node_virtualization
node_gtn_commander -->|"delegates"| node_gtn_planner
node_gtn_monitor -->|"updates"| node_gtn_worldstate
node_gtn_worldstate -->|"demands"| node_logistics_network
node_logistics_network -->|"gated by"| node_side_resources
node_gtn_planner -->|"orders"| node_virtualization
node_virtualization -->|"coordinates"| node_transport
node_player_support -->|"routes to"| node_gtn_commander
node_intel -->|"publishes"| node_gtn_commander
node_arsenal -->|"spends"| node_side_resources
node_faction_ui -->|"configures"| node_faction_catalog
node_logistics_ui -->|"uses"| node_spawn_comp
node_spawn_comp -->|"instantiates"| node_compositions

click node_phase_manager "https://github.com/frontlineops/flops_flo/blob/Release/Functions/Init/fn_initPhaseManager.sqf"
click node_mission_startup "https://github.com/frontlineops/flops_flo/blob/Release/Functions/fn_MissionStartup.sqf"
click node_mission_save "https://github.com/frontlineops/flops_flo/blob/Release/Functions/fn_MissionSave.sqf"
click node_mission_load "https://github.com/frontlineops/flops_flo/blob/Release/Functions/fn_MissionLoad.sqf"
click node_faction_catalog "https://github.com/frontlineops/flops_flo/blob/Release/Functions/Factions/fn_factionBuildAutoMilitaryCatalog.sqf"
click node_objective_graph "https://github.com/frontlineops/flops_flo/blob/Release/Functions/Objective/fn_buildObjectiveGraph.sqf"
click node_gtn_commander "https://github.com/frontlineops/flops_flo/blob/Release/Functions/AI/GTN/Core/fn_gtnCommander.sqf"
click node_gtn_worldstate "https://github.com/frontlineops/flops_flo/blob/Release/Functions/AI/GTN/Core/fn_gtnWorldState.sqf"
click node_gtn_planner "https://github.com/frontlineops/flops_flo/blob/Release/Functions/AI/GTN/Core/fn_gtnPlanner.sqf"
click node_gtn_monitor "https://github.com/frontlineops/flops_flo/blob/Release/Functions/AI/GTN/Core/fn_gtnMonitor.sqf"
click node_virtualization "https://github.com/frontlineops/flops_flo/blob/Release/Functions/Virtualization/System/fn_initVirtualization.sqf"
click node_transport "https://github.com/frontlineops/flops_flo/blob/Release/Functions/Virtualization/Transport/fn_transportRequest.sqf"
click node_logistics_network "https://github.com/frontlineops/flops_flo/blob/Release/Functions/Logistics/fn_logisticsNetwork.sqf"
click node_side_resources "https://github.com/frontlineops/flops_flo/blob/Release/Functions/Logistics/fn_sideResources.sqf"
click node_civilians "https://github.com/frontlineops/flops_flo/blob/Release/Functions/Civilian/Core/fn_civilianManager.sqf"
click node_player_support "https://github.com/frontlineops/flops_flo/blob/Release/Functions/AI/GTN/PlayerSupport/fn_gtnSubmitPlayerSupportRequest.sqf"
click node_intel "https://github.com/frontlineops/flops_flo/blob/Release/Functions/AI/GTN/Intel/fn_gtnPublishCommanderIntel.sqf"
click node_arsenal "https://github.com/frontlineops/flops_flo/blob/Release/Functions/Arsenal/fn_restrictedArsenal.sqf"
click node_faction_ui "https://github.com/frontlineops/flops_flo/blob/Release/Functions/UI/fn_factionDialogStart.sqf"
click node_logistics_ui "https://github.com/frontlineops/flops_flo/blob/Release/IDS_Logistics/functions/ui/fn_openBuildMenu.sqf"
click node_spawn_comp "https://github.com/frontlineops/flops_flo/blob/Release/LARs/spawnComp/functions/fn_spawnComp.sqf"
click node_compositions "https://github.com/frontlineops/flops_flo/blob/Release/Compositions/compositions.hpp"

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_phase_manager,node_mission_startup,node_mission_save,node_mission_load,node_faction_catalog,node_objective_graph,node_gtn_commander,node_gtn_worldstate,node_gtn_planner,node_gtn_monitor,node_virtualization,node_transport,node_logistics_network,node_side_resources,node_civilians toneBlue
class node_player_support,node_intel,node_arsenal,node_faction_ui toneAmber
class node_logistics_ui,node_spawn_comp,node_compositions toneMint
```

## Components

### Server runtime

Authoritative mission startup, campaign state, command, logistics, virtualization, and persistence.

- [Phase manager](https://github.com/frontlineops/flops_flo/blob/Release/Functions/Init/fn_initPhaseManager.sqf): server init · Server-owned staged bootstrap and authority boundary for the mission. · `Functions/Init/fn_initPhaseManager.sqf`
- [Mission startup](https://github.com/frontlineops/flops_flo/blob/Release/Functions/fn_MissionStartup.sqf): save/bootstrap · Coordinates save detection, mission config restore, and system startup. · `Functions/fn_MissionStartup.sqf`
- [Save state](https://github.com/frontlineops/flops_flo/blob/Release/Functions/fn_MissionSave.sqf): persistence · Serializes and restores campaign state across sessions. · `Functions/fn_MissionSave.sqf`
- [Load state](https://github.com/frontlineops/flops_flo/blob/Release/Functions/fn_MissionLoad.sqf): persistence · Reconstructs the campaign world from saved mission data. · `Functions/fn_MissionLoad.sqf`
- [Faction catalog](https://github.com/frontlineops/flops_flo/blob/Release/Functions/Factions/fn_factionBuildAutoMilitaryCatalog.sqf): faction runtime · Builds authoritative faction pools, tuning, and composition defaults. · `Functions/Factions/fn_factionBuildAutoMilitaryCatalog.sqf`
- [Objective graph](https://github.com/frontlineops/flops_flo/blob/Release/Functions/Objective/fn_buildObjectiveGraph.sqf): territory model · Indexes objectives, builds links, clusters territory, and tracks ownership. · `Functions/Objective/fn_buildObjectiveGraph.sqf`
- [GTN commander](https://github.com/frontlineops/flops_flo/blob/Release/Functions/AI/GTN/Core/fn_gtnCommander.sqf): strategic AI · Strategic side AI that evaluates world state and issues campaign orders. · `Functions/AI/GTN/Core/fn_gtnCommander.sqf`
- [World state](https://github.com/frontlineops/flops_flo/blob/Release/Functions/AI/GTN/Core/fn_gtnWorldState.sqf): campaign model · Maintains side context, engagement picture, reserve needs, and order inputs. · `Functions/AI/GTN/Core/fn_gtnWorldState.sqf`
- [Planner](https://github.com/frontlineops/flops_flo/blob/Release/Functions/AI/GTN/Core/fn_gtnPlanner.sqf): order planning · Allocates attacks, defenses, garrisons, and support requests over time. · `Functions/AI/GTN/Core/fn_gtnPlanner.sqf`
- [Monitor](https://github.com/frontlineops/flops_flo/blob/Release/Functions/AI/GTN/Core/fn_gtnMonitor.sqf): campaign monitor · Observes combat and commander state, then feeds updates back into the loop. · `Functions/AI/GTN/Core/fn_gtnMonitor.sqf`
- [Virtualization](https://github.com/frontlineops/flops_flo/blob/Release/Functions/Virtualization/System/fn_initVirtualization.sqf): battlefield sim · Persistent group registry, activation cycle, routing, and on-demand spawning. · `Functions/Virtualization/System/fn_initVirtualization.sqf`
- [Transport](https://github.com/frontlineops/flops_flo/blob/Release/Functions/Virtualization/Transport/fn_transportRequest.sqf): logistics transport · Carrier, pickup, dismount, reserve, and passenger-state management. · `Functions/Virtualization/Transport/fn_transportRequest.sqf`
- [Supply network](https://github.com/frontlineops/flops_flo/blob/Release/Functions/Logistics/fn_logisticsNetwork.sqf): logistics economy · Side supply chains, dispatch planning, replacements, and objective flow. · `Functions/Logistics/fn_logisticsNetwork.sqf`
- [Side resources](https://github.com/frontlineops/flops_flo/blob/Release/Functions/Logistics/fn_sideResources.sqf): resource economy · Tracks side funds, income, and spending constraints for the campaign. · `Functions/Logistics/fn_sideResources.sqf`
- [Civilians](https://github.com/frontlineops/flops_flo/blob/Release/Functions/Civilian/Core/fn_civilianManager.sqf): civilian AI · Civilian routines, gossip, missions, protests, and behavior reactions. · `Functions/Civilian/Core/fn_civilianManager.sqf`

### Client runtime

Local UI, player interaction, and finalization after mission-ready.

- [Player support](https://github.com/frontlineops/flops_flo/blob/Release/Functions/AI/GTN/PlayerSupport/fn_gtnSubmitPlayerSupportRequest.sqf): player bridge · Validates and routes player support requests through commander systems. · `Functions/AI/GTN/PlayerSupport/fn_gtnSubmitPlayerSupportRequest.sqf`
- [Intel layer](https://github.com/frontlineops/flops_flo/blob/Release/Functions/AI/GTN/Intel/fn_gtnPublishCommanderIntel.sqf): intel bridge · Publishes commander intel, markers, and pickup reveals to players. · `Functions/AI/GTN/Intel/fn_gtnPublishCommanderIntel.sqf`
- [Arsenal](https://github.com/frontlineops/flops_flo/blob/Release/Functions/Arsenal/fn_restrictedArsenal.sqf): player economy · Restricted arsenal, crate purchase, and funds-driven gear access. · `Functions/Arsenal/fn_restrictedArsenal.sqf`
- [Faction UI](https://github.com/frontlineops/flops_flo/blob/Release/Functions/UI/fn_factionDialogStart.sqf): client UI · Faction and mission setup dialogs for local configuration. · `Functions/UI/fn_factionDialogStart.sqf`

### Mission content

Authoring surfaces and static assets that feed factions, compositions, and presentation.

- [Build tools](https://github.com/frontlineops/flops_flo/blob/Release/IDS_Logistics/functions/ui/fn_openBuildMenu.sqf): client module · Embedded build/placement UI and reusable logistics interaction layer. · `IDS_Logistics/functions/ui/fn_openBuildMenu.sqf`
- [Spawn comp](https://github.com/frontlineops/flops_flo/blob/Release/LARs/spawnComp/functions/fn_spawnComp.sqf): composition module · Composition spawning and reusable mission object placement utilities. · `LARs/spawnComp/functions/fn_spawnComp.sqf`
- [Compositions](https://github.com/frontlineops/flops_flo/blob/Release/Compositions/compositions.hpp): mission content · Static mission layouts and templates used for objectives and spawns. · `Compositions/compositions.hpp`

## Connections

- Phase manager → Mission startup: drives · Boot pipeline hands off to mission startup.
- Mission startup → Load state: restores · Chooses saved campaign restoration when available.
- Mission startup → Save state: persists · Establishes the save/load boundary for campaign state.
- Mission startup → Faction catalog: initializes · Loads and tunes factions before systems start.
- Mission startup → Objective graph: indexes · Builds territorial backbone and ownership map.
- Mission startup → Virtualization: seeds · Initializes virtual groups and spatial state.
- Mission startup → GTN commander: starts · Brings strategic AI online after world setup.
- Mission startup → Supply network: starts · Initializes supply and replacement systems.
- Mission startup → Civilians: starts · Brings civilian simulation online with world context.
- Objective graph → World state: feeds · Objective ownership and links inform strategic context.
- Faction catalog → GTN commander: supplies · Unit pools and defaults constrain strategic planning.
- Faction catalog → Virtualization: supplies · Spawn pools and composition data seed virtual groups.
- GTN commander → Planner: delegates · Strategic AI produces plans and assignments through planner logic.
- Monitor → World state: updates · Combat and side-state observations refresh the world model.
- World state → Supply network: demands · Reserve and pressure state drive supply routing and replacements.
- Supply network → Side resources: gated by · Supply actions are constrained by side resources.
- Planner → Virtualization: orders · Plans become attack, defend, garrison, or move orders.
- Virtualization → Transport: coordinates · Virtual groups use transport carriers and passenger state.
- Player support → GTN commander: routes to · Player requests are validated then handed to commander systems.
- Intel layer → GTN commander: publishes · Commander markers and intel are exposed to players.
- Arsenal → Side resources: spends · Funds and purchases are tied to the resource economy.
- Faction UI → Faction catalog: configures · Local faction setup feeds runtime catalog generation.
- Build tools → Spawn comp: uses · Placement tools rely on composition spawning helpers.
- Spawn comp → Compositions: instantiates · Spawns mission content from composition templates.
