Skip to content

Architecture Overview

rayswaynl edited this page Jun 14, 2026 · 16 revisions

Architecture Overview

For upstream development patterns and negative knowledge from Miksuu PRs, reverts and branch history, start with Developer history and upstream lessons. It helps distinguish current architecture from old experiments and abandoned merge attempts.

The repository is an Arma 2 OA Warfare/CTI mission derived from Benny's Warfare and actively modernized for the Miksuu/WASP server. The core runtime is SQF in a mission folder, surrounded by C# helper tools, a Discord status bot, and a Windows extension bridge.

Unless a row names another ref, source anchors below are valid for docs checkout docs/developer-wiki-index 4277a2ad. Rechecked 2026-06-14: the overview's cited runtime and tooling paths are unchanged from the earlier 1bef8801 / 1aa178f8 source-anchor snapshots, so the docs-checkout line refs remain valid. Treat stable origin/master cf2a6d6a, release a96fdda2, Miksuu b8389e74 and origin/perf/quick-wins 0076040f as branch-scope refs; follow the owner pages before citing line refs from those branches.

How To Use This Page

Use this page to choose the right owner document. Keep detailed branch matrices, patch shapes and smoke checklists in the narrower pages.

Need Open this
Boot order, role detection and JIP waits Mission entrypoints and lifecycle, Lifecycle wait-chain, SQF code atlas
Function compile ownership and runtime wiring SQF code atlas, Function and module index, Variable and naming conventions
Server loops, operations and integrations Server runtime and operations, Server gameplay runtime atlas, External integrations
Networking, PV/PVF and authority hardening Networking and public variables, Public variable channel index, Server authority migration map, PVF dispatch implementation
Client UI, menus, HUD and markers Client UI systems atlas, Player UI workflow map
Economy, construction, upgrades, AI, supports and artillery Economy, towns and supply, Construction and CoIn systems atlas, Upgrades and research, AI/headless/performance, Support specials and tactical modules atlas
Generated targets, release propagation and branch status Tools and build workflow, Agent release readiness ledger, Current source status snapshot, Feature status register

Current Branch Scope

Use this table before turning an architecture overview anchor into a branch claim.

Ref Architecture source scope Practical route
Docs checkout 4277a2ad Runtime/tooling anchors listed here are unchanged from the earlier 1bef8801 / 1aa178f8 overview passes for description.ext, initJIPCompatible.sqf, Init_Common.sqf, Init_Server.sqf, Init_Client.sqf, Init_HC.sqf, FileManager.cs, SqfFileGenerator.cs and ZipManager.cs. Use this page for orientation, then open the linked owner page for system behavior, branch matrices and smoke gates.
Stable origin/master cf2a6d6a and release a96fdda2 Same high-level source/generated-target architecture, but branch behavior and line refs differ for propagated fixes, server FPS shape, supply scan shape, commander ARTY and some UI/runtime surfaces. LoadoutManager root discovery accepts a repo-shaped root through mission path + Tools/LoadoutManager + AGENTS.md. Start from Current source status snapshot, Source fix propagation queue and the subsystem owner page before citing stable/release line refs.
Miksuu b8389e74 and origin/perf/quick-wins 0076040f Source shape is close enough for architecture orientation, but branch drift remains important. Their LoadoutManager root discovery still requires an ancestor folder named a2waspwarfare. Recheck exact source paths before making upstream/perf claims; use Developer history and upstream lessons for historical context.

Runtime Owner Map

Partition Primary responsibility Source anchors Deeper owner
Common Shared constants, config imports, utility functions, public-variable registration, faction/core data, artillery and shared modules. Common/Init/Init_Common.sqf:6-85, :94-160, :289-323, :369-371 SQF code atlas, Assets/config/localization atlas
Server Authoritative side logic, economy state, towns, AI spawning, victory checks, PVF request handling, cleanup, extension hooks, AntiStack and server metrics. Server/Init/Init_Server.sqf:10-95, :355-386, :507-538, :577-620 Server gameplay runtime atlas, Server runtime and operations
Client UI, menus, player actions, local HUD/marker loops, skill modules, supply mission start flow, map interactions and client PVF handlers. Client/Init/Init_Client.sqf:49-140, :324-339, :360-388, :490-509, :547-595, :773-789 Client UI systems atlas, Player UI workflow map
Headless Headless-client function subset and registration into server delegation. initJIPCompatible.sqf:164-170, :236-238; Headless/Init/Init_HC.sqf:4-15 AI/headless/performance, Headless delegation and failover
WASP Custom gameplay overlay such as RPG drop, base repair, marker monitor and start-vehicle additions. initJIPCompatible.sqf:241-245 keeps the old WASP bootstrap commented; live client wiring starts from Client/Init/Init_Client.sqf:15, :573-574, and WASP start vehicles are server-created in Server/Init/Init_Server.sqf:425-463. WASP overlay, WASP marker wait cleanup

Partition caveat: Common/Init/Init_Common.sqf is not purely client-safe shared code. It imports public variables at :294-295, but also has server-only group config under if (isServer) at :302-308. Confirm the owner before moving compile or config registration.

Source And Generated Targets

Missions/[55-2hc]warfarev2_073v48co.chernarus is the source mission for gameplay edits. Maintained Vanilla/Takistan is generated or copied from that source family; modded folders are not a safe propagation target unless a tooling owner explicitly claims them.

Target / tool Current source-backed rule
Source mission Edit Chernarus first for gameplay/source changes. description.ext:39-58 includes generated version.sqf, sounds/music and the resource/dialog/title/parameter headers.
LoadoutManager root Root discovery is branch-sensitive; keep the branch matrix in Tools and build workflow. Docs checkout 4277a2ad keeps the 1bef8801 FileManager shape: it accepts an ancestor named a2waspwarfare at FileManager.cs:153-155 / :166-168 or a repo-like root with Missions, Missions_Vanilla and Tools/LoadoutManager/LoadoutManager.csproj at :176-188. Stable/release use a different repo-shape check at :165,170-176; Miksuu/perf still require the ancestor-name shape at :145,150-152.
Maintained generated targets SqfFileGenerator.cs:128-129 writes Chernarus and Takistan terrain outputs; :131-132 keeps modded terrain writing commented.
Packaging ZipManager.cs:16 packages Missions and Missions_Vanilla; Modded_Missions is commented out. ZipManager.cs:96 supports A2WASP_SKIP_ZIP for propagation-only runs.

Bootstrap Shape

initJIPCompatible.sqf is the front-door role router. It imports MP parameters and constants at :121-123, applies Air Event/debug overrides at :125-162, gates headless support at :164-170, starts Common/Towns at :214-215, starts Server at :217-220, waits for side team state before Client at :223-233, and starts Headless at :236-238.

The exact wait graph belongs in Lifecycle wait-chain. The exact compile registry belongs in SQF code atlas. The high-risk architecture fact is the separation of ownership: server creates replicated side/team/HQ state (Init_Server.sqf:355-386, :465-502), clients wait for that state and wire local UI/action/runtime surfaces (Init_Client.sqf:360-388, :459-509, :787-789), and headless clients still register after a fixed sleep rather than an explicit serverInitFull barrier (Headless/Init/Init_HC.sqf:11-15 versus Init_Server.sqf:507).

Representative Source Anchors

Claim Source anchors
Mission front door and include graph description.ext:39-58 includes version.sqf, sound/music headers and the Rsc header/style/parameter/resource/dialog/title files.
Runtime role dispatch initJIPCompatible.sqf:214-238 starts Common, Towns, Server, Client and Headless branches after parameter setup.
Common side-presence/defender setup Common/Init/Init_Common.sqf:273-287 detects which side logics exist and fills WFBE_PRESENTSIDES, then still fixes WFBE_DEFENDER = resistance; keep dynamic-defender work routed through the lifecycle/feature owner pages.
Server replicated state and loops Server/Init/Init_Server.sqf:355-386 seeds side logic state; :507-538 starts town/victory/resource/collector loops; :577-620 starts server FPS, PerformanceAudit, AntiStack and player-list follow-up work.
Client waits and local runtime surfaces Client/Init/Init_Client.sqf:360-388 waits for town/structure/commander state before client FSMs; :459-509 handles spawn/HQ/CoIn setup; :773-789 finishes load-in and vote-menu state.
Headless timing edge Headless/Init/Init_HC.sqf:11-15 uses sleep 20 before connected-hc; it is not an explicit wait on serverInitFull from Server/Init/Init_Server.sqf:507.

Development Philosophy

This mission values runtime performance and live-server stability. Many systems have explicit audit logging, cached UI writes, deferred loops, and optional switches. Documentation and feature work should preserve those patterns instead of reintroducing large per-frame scans or unconditional global broadcasts.

Continue Reading

Previous: Quickstart | Next: Mission entrypoints and lifecycle

Main map: Home | Source map: Source inventory | Runtime: Lifecycle wait-chain

Sidebar

Clone this wiki locally