Skip to content

Foundation Perf Findings And Tier3 Dead Ends

rayswaynl edited this page Jul 2, 2026 · 1 revision

Foundation Perf Findings And Tier-3 Dead-Ends

Provenance: 2026-07-02 five-pillar Fable foundations assessment (server loops, network/PV/JIP, AI/group budget, client frame cost, engine/config) plus the Tier-3 perf PR (#229, opened then canceled by owner as marginal). Every item below was adversarially verified — the "verified-safe" set survived a refutation pass; the "dead ends" were killed by it. Arma 2 OA 1.64. Source cites relative to Missions/[55-2hc]warfarev2_073v48co.chernarus/.

Headline verdict

The SQF foundations are mature. The big structural levers are already pulled: per-unit marker VMs consolidated into Common_MarkerLoop, RHUD fully cached, multi-layer group GC + pop-tier load scaling, PVF allowlist security with the call compile RCE patched, AICOM intent vars change-gated, JIP multi-layer heal. A dedicated Tier-3 pass found the remaining safe perf wins are marginal (spike-smoothing, not steady FPS), and the two largest raw-throughput wins were unsafe (see dead ends). The real remaining gains live in config and AI effectiveness, not micro-optimization.

Verified-safe perf/hygiene (proven gameplay-neutral)

These were built + adversarially reviewed clean in #229 (canceled). Available to re-ship if wanted; the corpse-drain design carries forward into the group-budget work.

Change File(s) Nature Gameplay delta
Delete dead scalar broadcasts WFBE_AICOM_TEAMS_<n>, WFBE_AICOM_FUNDS_<n>, TEAM_WEST/EAST_TICKS_NO_PLAYERS Server/AI/Commander/AI_Commander.sqf, Server/Functions/Server_OnPlayerConnected.sqf, Common/Functions/Common_StagnateSupplyIncomeNoPlayers.sqf Zero consumers (exhaustive scan + refuter confirmed); pure network hygiene None
Cache allUnits once per tick Server/Server_GuerAirDef.sqf Removes ~19 redundant full-collection reads / 120s cycle None (all mutated units are GUER; reads filter WEST/EAST)
Hoist PickLeastLoadedHC out of per-group loop Server/Functions/Server_DelegateAIStaticDefenceHeadless.sqf O(groups×allUnits) → one scan + round-robin, mirroring the town-AI path None (HC routing is player-invisible)
HC static-defence corpse-drain leak fix Client/Functions/Client_DelegateAIStaticDefence.sqf Flag WFBE_C_StaticDefCorpseDrain (default 0). At 1: waitUntil no-alive → deleteVehicle dead non-player bodies → deleteGroup. Guarded by !isPlayer + !alive + local + no-player-within-WFBE_C_UNITS_BODIES_PROX None at default; pays off over hours when enabled (prevents HC group-leak toward the 144/side cap)

⛔ Dead ends — DO NOT re-propose (adversarially proven unsafe)

Idea Why it is unsafe Evidence
Skip nearEntities detection on idle towns (to halve the steady-state server spatial-query floor) That scan is the sole town-activation trigger. server_town_ai.sqf chains _detected_currentEnemies_enemies → the activation branch. Skip it and an idle town never wakes: a player walks into an enemy-owned town and its garrison never spawns — it is taken without resistance. A total break of town activation, not a marginal edge. server_town_ai.sqf detection line → activation branch
Reap the ~26 empty editor-slot groups (to reclaim ~9%/side of the 144 group budget) Reproduces the B746 DEADSPAWN that cmdcon30 was reverted to fix: a JIP player selecting a reaped slot lands in a deleted group → no wfbe_side → enrollment exhausted → dead spawn. The overflow slots (deleteVehicle this init, synchronizations[]={}, no wfbe_persistent) are the exact ones that broke it. Init_Server.sqf editor-slot sweep + the cmdcon30 revert comment

The empty-slot investigation surfaced a possible latent version of the same bug (the overflow slots may already be reapable by the emergency GC in Common_CreateGroup.sqf at ≥140 groups and the 60s server_groupsGC.sqf sweep, both guarding only on wfbe_persistent) — the safe response is to protect those slots (mark wfbe_persistent), not to reap them. That protects budget-neutrally.

Where the real remaining gains are (not micro-opt)

Lever Kind Status
HC ASR AI + allocator — is @adwasp on the headless-client -mod line, and are HCs on -malloc=mimalloc? Config (box) Unverified. If the HC lacks @adwasp, 100% of combat AI (HC-local) runs vanilla skill/danger.fsm despite the server having ASR AI. Potentially the single biggest AI-cost lever; free.
~20,826 "Message not sent - error 0 ID=ffffffff" per round to the HCs Server bug Untouched — ~half of log output is a per-tick send to a stale HC handle.
AICOM effectiveness F1–F7 (AICOM-UNIT-BEHAVIOR-FABLE.md §4) AI behavior Zombie teams, orbiting/wedging, 0/212 capture activations = full sim cost for units that don't advance the game. The biggest unit-efficiency win.

Continue Reading

Sidebar

Clone this wiki locally