-
Notifications
You must be signed in to change notification settings - Fork 0
Lifecycle Wait Chain
Claude deep-dive page (source-cited). This is the canonical page for precise boot ordering, the machine-role truth table, JIP waits and the global-flag dependency graph that enforces init order. Use Mission entrypoints and lifecycle for the include graph, role dispatch and per-role init responsibility map.
All paths below are relative to the source mission root Missions/[55-2hc]warfarev2_073v48co.chernarus/.
WFBE does not use the BIS Functions CfgFunctions auto-init system. There is no engine-managed preInit/postInit ordering. Instead, boot order is enforced entirely by hand-rolled waitUntil {<flag>} barriers on global variables. A script execVM'd before the flag it waits on is set will simply spin forever, silently hanging that machine's boot. Before reordering any init call, check this page.
Role is computed in initJIPCompatible.sqf:52-56. isHeadLessClient comes from Headless/Functions/HC_IsHeadlessClient.sqf (!(hasInterface || isDedicated)).
| Machine | isServer |
isDedicated |
hasInterface |
isHostedServer |
isHeadLessClient |
Init branches run |
|---|---|---|---|---|---|---|
| Dedicated server | true | true | false | false | false | Server |
| Hosted (listen) server | true | false | true | true | false | Server + Client |
| Pure client | false | false | true | false | false | Client |
| Headless client (HC) | false | false | false | false | true | HC |
| Singleplayer | true | false | true | true | false | Server + Client |
isHostedServer = !isMultiplayer || (isServer && !isDedicated) (initJIPCompatible.sqf:52).
- Engine parses
description.ext→#include "version.sqf"(preprocessor#defines) + allRsc/*.hpp,Sounds/,Music/includes. - Engine runs
init.sqf(server-only: spawnstest/wasp_selftest.sqf). - Engine runs
initJIPCompatible.sqf— the master bootstrap, including on JIP clients.
Mission object init fields are also part of startup. In the Chernarus source mission, town logic objects call Common\Init\Init_Town.sqf from mission.sqm, while the WF_Logic object at mission.sqm:3265 seeds town-mode lists and starts Common\Init\Init_TownMode.sqf. Treat mission.sqm as an init source when auditing town lifecycle, not just as map placement data.
Gotcha —
version.sqfis generated and git-ignored. It is#included bydescription.extandinitJIPCompatible.sqfbut is produced per-terrain by LoadoutManager (see Tools and build workflow) and listed in.gitignore. A fresh checkout will not compile until LoadoutManager has been run or aversion.sqfis dropped in.
| Branch | Guard | Line |
|---|---|---|
| Server |
isHostedServer || isDedicated → ExecVM "Server/Init/Init_Server.sqf"
|
initJIPCompatible.sqf:218-220 |
| Client |
isHostedServer || (!isHeadLessClient && !isDedicated) → execVM "Client/Init/Init_Client.sqf"
|
initJIPCompatible.sqf:224-233 |
| Headless |
isHeadLessClient → execVM "Headless/Init/Init_HC.sqf"
|
initJIPCompatible.sqf:237-238 |
The old WASP client-init block is commented out at initJIPCompatible.sqf:241-245 (see WASP overlay).
Each row: a flag, where it is set, and the waitUntil barriers it unblocks. Editing any producer line without its consumers (or vice-versa) risks a boot hang.
| Flag | Set at | Unblocks (consumer waitUntil) |
|---|---|---|
VERSION_SET |
Common/Init/Init_Version.sqf |
initJIPCompatible.sqf:49 |
WFBE_Parameters_Ready |
initJIPCompatible.sqf:212 |
Common/Init/Init_TownMode.sqf:3, Init_Town.sqf:18
|
townModeSet |
Common/Init/Init_TownMode.sqf:21, started by mission.sqm:3265
|
Init_Towns.sqf:3, Init_Town.sqf:18
|
BIS_fnc_init (engine) |
engine | Common/Init/Init_Common.sqf:205-206 |
WFBE_PRESENTSIDES |
Common/Init/Init_Common.sqf:282 |
client branch initJIPCompatible.sqf:235; test/wasp_selftest.sqf
|
commonInitComplete |
Common/Init/Init_Common.sqf:371 |
Init_Server.sqf:127, Init_Client.sqf:165, Init_Town.sqf:42, Init_Unit.sqf:18
|
townInit |
Common/Init/Init_Towns.sqf:13 |
Init_Server.sqf:127, client FSM launches, Init_Client.sqf:596
|
serverInitComplete |
Init_Server.sqf:117 |
town model creation in Init_Town.sqf:92
|
serverInitFull |
Init_Server.sqf:507 |
signals all per-side setup done (HC sleep 20 is a crude proxy) |
clientInitComplete |
Init_Client.sqf:957 |
Init_Unit.sqf:33; then CLIENT_INIT_READY is publicVariableServer'd (Init_Client.sqf:961-963) |
Init_Version → WFBE_Parameters_Ready → Init_Common (sets WFBE_PRESENTSIDES, then commonInitComplete) → Init_Towns (townInit) → Init_Server (serverInitComplete early, serverInitFull after per-side loop) → launch server_town.sqf, server_town_ai.sqf, cleaners/restorers, updateresources.sqf, victory loop.
Block on WFBE_PRESENTSIDES + wfbe_teams → Init_Client compiles functions → block on commonInitComplete → set up HUD/modules/JIP handshake → block on townInit → launch map/marker/action FSMs → remove blackout (Init_Client.sqf:775) → clientInitComplete → broadcast CLIENT_INIT_READY.
Init_HC.sqf compiles the three delegation handlers (Client_DelegateTownAI, Client_DelegateAI, Client_DelegateAIStaticDefence) plus Client_HandlePVF, then sleep 20 (a hard wait used in place of a waitUntil {serverInitFull} barrier) and notifies the server via ["RequestSpecial", ["connected-hc", player]]. See AI, headless and performance for the runtime source router and Headless delegation and failover for DR-21/DR-42 patch policy.
Source-check note: Init_HC.sqf:12 is the fixed sleep and :15 sends the HC registration request. serverInitFull is not set until Server/Init/Init_Server.sqf:507, after serverInitComplete at :117 and the commonInitComplete && townInit wait at :127.
Page ownership note: this lifecycle page owns HC boot timing and wait-chain risk only. HC work tracking, update-back choices, disconnect policy and failover design intentionally live in Headless delegation and failover.
There is no didJIP variable; JIP is handled implicitly because initJIPCompatible.sqf runs identically on joining clients, hitting the same barriers.
-
Time catch-up:
initJIPCompatible.sqf:212—if (local player) then {skipTime (time/3600)}; initial date applied fromWFBE_DAYNIGHT_DATEif present (:203). -
Spawn position:
Init_Client.sqf:462—if (time < 30)use start position, else (JIP) spawn at newest factory building. -
Markers:
Init_Client.sqf:732-736— deferred re-init of town/camp markers from already-synced object variables after a short sleep. -
State sync: town
sideID/supplyValue, side-logic commander/HQ/upgrades/teams, and teamwfbe_fundsare all written withsetVariable [..., true]so the engine replicates them to JIP clients automatically (see the JIP section of Networking and public variables).
Claude DR-37 reviewed the boot/JIP path as broadly correct: the RequestJoin handshake has a 30-second retry, time/date/team/client state is replicated through broadcast variables, and the apparent while {true} joins at Init_Client.sqf:419 and :444 are bounded handshake polls. The remaining robustness gap is the post-join serial wait chain in Init_Client.sqf:367-502: waits for wfbe_structures, side supply, wfbe_commander, radio HQ state, start position, HQ, deployment state and vote time have no timeout or log fallback. A single missed synced variable can leave a JIP client black-screened or stuck forever. Treat defensive timeouts here as a robustness improvement, not evidence that the normal JIP path is broken.
Gap closure note (2026-06-03): this table is the source-backed wait-chain audit promised by the old gap-wait-chain-timeouts machine record. It is intentionally scoped to boot/JIP gates rather than ordinary gameplay loops. Rows distinguish retrying handshakes from timeout-less replicated-variable waits and cite both the consumer gate and the producer where practical.
Bernoulli's 2026-06-02 wait-chain audit split the client join gates into two classes: retrying handshake gates and replicated-variable waits with no terminal timeout.
| Gate | Producer | Consumer / source anchors | Timeout / retry state | Failure mode | Fix direction |
|---|---|---|---|---|---|
RequestJoin -> WFBE_P_CANJOIN
|
RequestJoin.sqf sends HandleSpecial ["join-answer", ...]; client HandleSpecial.sqf writes WFBE_P_CANJOIN. |
Init_Client.sqf:416-431, RequestJoin.sqf:75-79, HandleSpecial.sqf:24-28. |
Polls and resends every 30 seconds; no hard terminal timeout. | Black screen / join pending forever if no answer; explicit lobby return if denied. | Keep retry but add hard timeout, log and fail-soft fallback. |
Launch ACK -> WFBE_P_HAS_CONNECTED_AT_LAUNCH_ACK
|
Server PVEH records launch side and replies to the player owner; client PVEH stores the ACK variable. |
Init_Client.sqf:441-456, clientHasConnectedAtLaunch.sqf:1-15, hasConnectedAtLaunchACK.sqf:1-6. |
Polls and resends every 30 seconds; no hard terminal timeout. | Join remains pending if ACK is lost. | Add bounded retry budget and diagnostic log. |
wfbe_structures / optional side supply |
Server seeds wfbe_structures and initial side supply; side-supply PVEH later updates wfbe_supply_<side>. |
Init_Client.sqf:367-371, Init_Server.sqf:363,386, Server_ChangeSideSupply.sqf:19-21,43-45. |
No timeout, no retry. | Client never reaches action/resources init. | Add timeout/log fallback around structure and supply sync. |
wfbe_commander |
Server init seeds side commander state; vote/reassignment/disconnect handlers later mutate it. |
Init_Client.sqf:384, Init_Server.sqf:356, RequestNewCommander.sqf:12-14, Server_OnPlayerDisconnected.sqf:136-146. |
No timeout, no retry. | Commander FSM/UI state never starts correctly. | Guard with timeout and missing-broadcast diagnostic. |
wfbe_radio_hq / wfbe_radio_hq_id
|
Server init creates side radio HQ objects and topic IDs. |
Init_Client.sqf:394-405, Init_Server.sqf:401-413. |
No timeout, no retry. | HQ announcer identity/radio wiring stalls. | Add sync check and log. |
Spawn location: wfbe_startpos, else wfbe_hq + wfbe_structures
|
Server init seeds start position, HQ and structures; later construction/kill/repair paths mutate HQ state. |
Init_Client.sqf:461-486, Init_Server.sqf:357,361,363. |
No timeout, no retry. | Spawn position never resolves or resolves poorly. | Fail soft if HQ/structures are absent. |
wfbe_hq_deployed and nested wfbe_hq
|
Server init seeds deployment/HQ; HQ construction, death and repair paths later update them. |
Init_Client.sqf:490-506, Init_Server.sqf:357-358, Construction_HQSite.sqf:79-91, Server_MHQRepair.sqf:41-43. |
No timeout, no retry. | CoIn/HQ event-handler setup can block; JIP client may miss HQ killed handler. | Timeout and skip/retry only the dependent setup instead of stalling all client boot. |
townInit |
Common/Init/Init_Towns.sqf sets townInit = true; client waits before JIP town/FSM setup. |
Init_Client.sqf:595, Init_Towns.sqf:13. |
No timeout, no retry. | Town, marker and action FSMs never launch. | Log a town-init stall before launching client FSM bundle. |
wfbe_votetime |
Server init seeds vote time from mission constants; vote code later updates countdown state. |
Init_Client.sqf:787-789, Init_Server.sqf:370. |
No timeout, no retry. | Vote menu does not open when vote state should exist. | Treat as optional/lazy-polled with timeout and log. |
-
Debug-only economy override:
initJIPCompatible.sqf:151-162raises starting funds/supply and other test parameters only insideif (WF_Debug). ConfirmWF_Debugstate before comparing economy behavior against mission parameters. -
Server-only code inside Common:
Init_Common.sqf:303-308runs anif (isServer)town-group load from the common path. Functionally correct but architecturally surprising. -
Mission object init can look invisible in SQF-only scans: town setup begins from
mission.sqmobjectinitfields. Auditmission.sqmtogether withInit_Town*.sqfbefore changing town startup, town-mode filters, town count assumptions or generated mission propagation. -
Duplicate compiles in
Init_Server: several functions are compiled twice (e.g.WFBE_SE_FNC_PlayerObjectsList,WFBE_CO_FNC_LogGameEnd); harmless (second overwrites first) but wasteful. -
gameOvervsWFBE_GameOvervsWFBE_gameover: SQF identifiers are case-insensitive, soWFBE_gameover == WFBE_GameOver; the lowercase-gameOveris a separate variable also set at boot. No bug, but easy to misread.
Previous: Mission lifecycle | Next: Source inventory
Main map: Home | Fast path: Quickstart | Agent file: agent-context.json
Home | Agent Guide | Current live state | Release 1.2.2 (B91) | Quickstart | Progress | Lifecycle wait-chain | Join/disconnect | Parameters/build | Assets/config | SQF atlas | PV index | Modules | Support/specials | Commander/HQ | Commander vote/reassign | Construction/CoIn | Construction cleanup | WDDM compositions | Factory/purchase | Upgrades/research | Towns/camps/capture | Victory/endgame | Markers/cleanup | Server runtime | AI runtime/HC | AI commander audit | HC delegation | Town AI safety | Commander reassignment | Resistance supply | Player UI workflow | UI atlas | Respawn/death | Gear template filter | Vehicle cargo loop | Service guards | UI IDD repair | UI design inspiration | WASP overlay | Feature status | Source propagation | release readiness | Tooling readiness | Integration trust | AntiStack DB | Owner decisions | Shelved registry | Abandoned feature revival | Hardening roadmap | PVF dispatch | Server authority | ICBM authority | Attack-wave authority | Telemetry families | AICOM V2 cutover | Consumer port map | Testing workflow | Server ops | Web tools | Ecosystem repos | Arma 2 OA refs | A2 traps | OA compatibility audit | Coverage ledger | Navigation inventory | Pruning ledger | Knowledge roadmap | Agent context | Collab protocol | Worklog | Audit archive 2026-07 | Briefing reference | Utes invasion concept
- Shelved AICOM concepts - revivable someday ideas (owner-shelved 2026-07-03)
Docs rule: source-backed claims only; Arma 2 OA scripting docs only; gameplay edits start in Missions/[55-2hc]warfarev2_073v48co.chernarus.
- Getting started
- Status and coordination
- Agent context
- Agent collaboration protocol
- Agent worklog
- Agent worklog archive
- Progress dashboard
- PR cleanup and integration lab
- Shelved PR #169: gear price double-count
- Shelved PR #194: Chernarus no-trees
- Coordination board
- Codebase coverage ledger
- Bottleneck removal queue
- Current source status
- Wiki mirror reconciliation
- Navigation inventory
- Registers
- Agent orchestration
- Architecture
- Architecture overview
- Mission entrypoints and lifecycle
- Lifecycle wait chain
- Player join/disconnect and AntiStack lifecycle
- Mission parameters/localization/build inputs
- Stringtable localization key-family catalog
- Source inventory
- Content structure and maps
- Assets/config/localization/parameters
- Mission start parameters index
- Code and networking
- Gameplay systems
- Core systems index
- Gameplay systems atlas
- Commander/HQ lifecycle atlas
- Economy, towns and supply
- Economy system reference
- Balance asymmetries
- Anti-stack skill-balance mechanic
- Empty-side supply income stagnation
- Towns, camps and capture atlas
- Victory and endgame atlas
- Victory conditions reference
- Territorial victory reference
- Marker cleanup and restoration
- Marker loop engine and registries
- Map marker families content catalog
- Marker subsystem function reference
- Client marker FSM updater map
- Support specials and tactical modules
- SCUD TEL tactical munitions
- Naval HVT objectives (carriers/SCUD)
- SCUD saturation strike mechanic
- Takistan airfield FPV drone design
- Construction and CoIn systems
- Structure damage reduction & friendly-fire
- Construction logic list cleanup
- Flak tower & WDDM anchor compositions
- Resistance supply scaffold
- GUER Insurgents faction overview
- GUER Insurgents branch audit
- GUER insurgent player economy
- GUER Commissar Panel
- GUER air-defense loop (Ka-137/Mi-24)
- Upgrades and research atlas
- Supply mission architecture
- Supply mission authority cleanup
- Current supply helicopters PR1
- Respawn and death-loop lifecycle
- Vehicle theft economy pitch
- GUER tunnel network pitch
- Content, reference and catalogs
- Faction unit/vehicle roster catalog
- Auxiliary/SF/civilian unit catalog
- Gear store loadout route catalog
- Upgrade research (cross-faction)
- Gear store price and upgrade catalog
- Gear store catalog (complete, per faction)
- Defense structures catalog
- Artillery reference per faction
- AI squad team templates catalog
- Town AI lifecycle reference
- Town AI group composition catalog
- Class-skill system reference
- Player skill abilities reference
- Default gear template content catalog
- Chernarus map content reference
- Takistan map content reference
- Takistan features
- Takistan parity reference
- Takistan oilfields objective reference
- IRS IR-smoke countermeasure
- Arty module special munitions
- Zeta cargo sling-load reference
- Spawn primitive function reference
- Kill and score pipeline
- Waypoint helper function reference
- Position and proximity function reference
- Side/team state function reference
- Player AI watchdog and recovery
- AICOM stuck-recovery v2
- LoadoutManager data-model contributor guide
- Discord status bot setup and reference
- GLOBALGAMESTATS extension reference
- New player quickstart (player guide)
- Optional client mods (player guide)
- Earning funds and score (player guide)
- Vehicle service and logistics (player guide)
- Commander's handbook (player guide)
- Tactical support menu
- Paradrop player experience
- Supply missions (player guide)
- In-game briefing & Diary field manual
- Playable maps catalog
- Faction root variables reference
- Faction base structures catalog
- Counter-battery radar system
- Bank, Reserve and Artillery Radar structures
- Map ruleset model and object config
- Countermeasures module reference
- Vehicle countermeasure (flares/spoofing)
- UAV terminal and spotter system
- Artillery firing function reference
- Service Point pricing model
- Medic redeployment truck (forward spawn)
- Side-patrol runtime and convoy mechanics
- Day/night cycle and weather system
- Config lookup helper reference
- CIPHER sort utilities reference
- Modded maps status and content
- BattlEye filter setup and OA taxonomy
- Player squad/group join protocol
- AutoFlip vehicle recovery
- Engine stealth fuel toggle
- Valhalla vehicle climbing-assist
- Missile and ordnance Fired-EH reference
- Vehicle equip and rearm reference
- Array and collection utilities
- Server composition spawner reference
- Upgrade queue server loop
- Map boundaries and off-map enforcement
- Namespace/profile/diagnostic utilities
- Group bool getVariable A2-OA trap
- Vehicle weapon balance init
- View distance auto-throttle
- Camp & respawn-camp getters
- Performance audit writer
- Site clearance (bulldozer)
- Factory queue cancel & refund
- AI commander tunable constants
- Experimental feature-flag constants
- Flag system quick reference
- Mission tunable constants catalog
- Gear parsing & cargo capacity
- Structure dressing function
- Paradrop delivery functions
- ICBM nuke client VFX & radiation
- Server HandleSpecial router
- LocalizeMessage chat router
- Gear buy-menu render & price functions
- Server broadcast & telemetry loops
- Per-unit client init pipeline
- Vehicle marking & texture pipeline
- Defense category & budget
- Legacy AI order primitives
- Commander-team driver
- AICOM command verbs
- AICOM behavior fix taxonomy
- AI commander wildcard deck reference
- AICOM aircraft and airfield system
- Static-defense manning
- End-of-game stats screen
- AI commander execution loop
- Deployable bipod / weapon resting
- Town-economy getters
- Server-init deadspawn & airfield probe
- GUER VBIED detonate action
- Resource income-tick engine
- AI commander treasury accessors
- PVF send-helper contracts
- AICOM logging & AICOMSTAT telemetry
- AICOMSTAT v2 event census
- WASPSCALE v2 telemetry
- WASPSCALE v2-ext coverage audit
- Telemetry families reference
- Group lifecycle & entity reaping
- Batch AI spawner orchestrator
- Client funds/income HUD readout
- Server group GC & cap warning
- Town runtime tuning constants
- Client input/hotkey handler
- WASP base-repair system
- WASP DropRPG launcher/ordnance
- CoIn construction-interface client engine
- Town-capture garrison & airfield rebuild
- Map-control & minimap templates
- Client FPS & state telemetry
- Client service-proximity getters
- Airfield-exclusive roster & unit hints
- Unit-camera spectator system
- Town-garrison patrol/defense worker
- RequestTeamUpdate squad-discipline
- Arma2Warfare GPT assistant
- LoadoutManager build configs & defines
- GLOBALGAMESTATS extension logging
- Discord bot instrumented logging
- Eden/Everon & Taviana map content
- Cruise missile strike asset
- AI / HC
- AI headless and performance
- AI mods and pathfinding reference
- Headless client scaling and topology
- AI runtime/HC loop map
- Headless client init and stat loop
- HC delegation target selection
- Player AI caps and role balance
- Old WarfareBE FPS comparison
- AI commander autonomy audit
- Upstream BE 2073 AICOM delta
- Parent 2.073 divergence audit
- AI commander capture & fun plan
- AI commander B69 improvement roadmap
- AI commander B69 implementation sketches
- AICOM V2 cutover status
- Headless delegation and failover
- Commander reassignment call shape
- GUER Director living-resistance pitch
- Quality and operations
- Foundation perf findings & Tier-3 dead-ends
- Dead/stale code register
- Commander vote/reassignment
- Attack-wave authority
- Server runtime and operations
- Server ops runbook
- JIP enrollment & client data delivery (b74.2 lessons)
- Server gameplay runtime atlas
- PerformanceAuditAnalyzer
- Performance opportunity sweep
- Documentation plan
- Knowledge platform roadmap
- Wiki quality audit
- Wiki pruning and relevance ledger
- Audit findings queue (2026-06-03)
- Deep review findings
- Client UI / server-loop perf findings
- Performance gain simulation
- Self-host testing field notes
- Cleanup and work lanes
- Hardening and authority
- UI / player workflows
- Client UI, HUD and menus
- UI HUD and dialogs
- Player UI workflow map
- Client UI systems atlas
- UI IDD collision repair
- UI control class library reference
- UI theme palette and style macros
- UI design inspiration 2026-07
- Available-actions client gate FSM
- Gear/loadout/EASA atlas
- Gear template profile filter
- Vehicle cargo equip loop bounds
- Factory and purchase systems atlas
- Service menu affordability guards
- WASP overlay
- Class-skill system reference
- Skin selector and class swap
- Earplugs audio toggle
- Mission audio catalog
- HQ radio knowledge-base catalog
- QoL trio player hints
- Player vehicle/travel actions
- Tooling / release / integrations
- Tools and build workflow
- Warfare web tools
- Ecosystem & companion repos
- Zargabad tooling parity
- July 2026 release readiness
- Operator monitor and CPU affinity tools
- Tooling release readiness audit
- Source fix propagation queue
- Agent release readiness ledger
- Release source intake map
- Testing/debugging/release workflow
- Current RPT release gate
- RPT telemetry consumer port map
- External integrations
- Integration trust boundary audit
- AntiStack database extension audit
- Community & Dev
- Community & Dev
- Miksuu upstream wiki import / archive index
- Upstream changelog feature leads
- Developer history and upstream lessons
- Upstream Miksuu commit intel
- Upstream mining ledger
- Archive script mining v2
- Upstream BE 2073 AICOM delta
- Parent 2.073 divergence audit
- PR8 and Drone upstream lesson match
- Development lessons learned
- External research reports
- Audit archive 2026-07
- Briefing reference
- Utes invasion concept
- Miksuu archive: Home
- Miksuu archive: Welcome
- Miksuu archive: Big announcements
- Miksuu archive: Changelog
- Miksuu archive: Development process
- Miksuu archive: Discord bot
- Miksuu archive: Gameplay videos
- Miksuu archive: LoadoutManager
- Miksuu archive: Chernarus script architecture
- Base-game visual catalogs
- Compatibility and references
- HC upstream history and lessons
- Player stats branch audit
- BuyMenu EASA QoL branch audit
- Perf quick wins branch audit
- Commander positions branch audit
- Zargabad branch audit
- Quad AI Commander concept
- Arma 2 OA external reference guide
- Base-game config & image reference
- Arma 2 OA compatibility audit
- Arma 2 OA agent traps reference
- Arma 2 OA command versions
- Wiki source consistency
- External Arma 2 OA reference index