Improve AI garrisons, player recovery and mission administration

This commit is contained in:
2026-09-24 22:12:45 +02:00
parent 1b1a8b5173
commit 2551d171b3
115 changed files with 3622 additions and 547 deletions
+24
View File
@@ -1,9 +1,31 @@
# Player lifecycle and pending admission
Admitted prisoners now survive lethal damage as treatable unconscious casualties.
If everyone is unconscious and neither treatment nor recovery progresses for 30
seconds, the round ends in defeat. See [recovery rules](recovery.md) for medical
behavior and reconnect reservations. The death/spectator paths below remain as
fallbacks for deleted bodies and administrative/native lifecycle events.
## Unconscious teammate camera
An admitted player who becomes unconscious now gets a local third-person spectator camera without losing possession of the injured body. Teammates can continue treatment, including the existing epinephrine recovery path. Native healing restores the player's own camera automatically; the round's all-unconscious failure timer is unchanged.
The server selects conscious, friendly players whose controlled bodies belong to the current round. It excludes the unconscious observer's own body, unfinished admissions and stale/replaced bodies. If the target becomes unavailable, it selects another valid teammate. With no conscious teammate, the camera remains near the casualty's own body. Press **Left/Right arrow** to cycle teammates without administrator rights; holding an arrow does not repeatedly switch targets, and open menus suppress cycling. `/esc spectate next` and `/esc spectate previous` remain available as chat alternatives. Native manual-camera look and zoom controls orbit the target at a bounded distance; there is no free-flight or target possession. The follow view also handles teammates in vehicles and traces camera clearance against terrain and objects. Default screen effects hide while a manual camera is active and return with the normal player camera.
Existing dead/late-join spectator reasons retain their prior eligibility and wording. The new unconscious reason explains treatment and recovery rather than telling a living player to wait for the next round. Closing the round clears the selected target and the existing forced target/vehicle streaming leases.
The owner's original `ESCT_SpectatorComponent`, `ESCT_OrbitPlayerManualCameraComponent`, and `ESCT_OrbitDistanceManualCameraComponent` were inspected read-only. The successor extends its existing observer instead of importing the original editor mode, fade dependencies or epinephrine-based camera exclusion. Their SHA-256 values are respectively `543891977028488a149498ab777477b4cc415e35d54d63d239a9358ae08393be`, `f11166bc01dc63b5503f74f40d7901f683c004b2f92b913fbdf8104d923e8c9b`, and `6245587ac6fad9819bd3098d14cb2f000539557cb4f0781f25611ad10be26354`.
The successor keeps one round-owned life record per authenticated account. A connection number is only the current binding to that record. A new life can enter during prison, radio search or radio defence; extraction and terminal phases refuse new admission. Successful initial assignment spends the life. Cancelling an unassigned preload never restores or spends a life.
Native reconnect reservation and handoff remain separate from new-character admission. A returning account may reclaim its surviving reserved actor through Reforger's reconnect system. A dead actor remains a spent life; unconsciousness is not death. Reserved living actors remain participants while their connections are absent. These policies are implemented, but real remote reconnect and reservation-expiry acceptance remains unfinished.
## Weapon retention on unconsciousness
**Esc → Co10 Escape Reintroduced → Mission → Keep weapon when unconscious** offers Enabled/Disabled buttons. Enabled is the default, including for older settings files. Administrators can also use `/esc mission keepweapon set 1` or `0`. The preference persists in the server profile and is captured at each knockout; changing it does not alter a casualty already being treated.
Enabled retains the actual held firearm, including its magazine and attachments, and selects it again after revival. It never creates a replacement or takes a gun acquired by another inventory. Disabled allows the normal ground drop. Grenades, gadgets and mounted weapons are excluded. The native test verifies inventory retention and the same rifle in hand after waking; it does not qualify the unconscious ragdoll's hand pose. Revival inside a vehicle leaves the gun in inventory rather than forcing an equip animation.
## Placement
Prison placement searches a 4×4 lattice with axis coordinates -4.5, -1.5, 1.5 and 4.5m relative to the authored center. The four inner positions are checked first, then eight edge positions, then four corners. Neighboring centers are 3m apart and remain 1.5m inside walls positioned at ±6m. The inner and edge positions are within 5m of the prison center. Terrain height and slope, physical scene/character occupancy, and pending reservations can reject a slot. Connection IDs 1 and 13 receive no special or shared position. Disconnected physical bodies still obstruct the native query.
@@ -31,3 +53,5 @@ The native lifecycle fixture in [050403](evidence/native-2026-09-19-050403/repor
`tests/test_participant_selection.py` executes the actual `CurrentActor`, `SpawnPosition` and server observer-selection methods with engine enumeration, geometry and streaming represented by adapters. It covers unregistered and pending actors, missing identity, disconnect, mismatched connection/body, recycled IDs, dead/foreign bodies, accepted canonical targets, cycling, loss of a previously selected target, unconscious following and unchanged prison/geometry fallback. This closes a source-proven membership omission; it does not establish native possession or multiplayer streaming behavior for the revision.
`tests/test_spawn_retry_budget.py` executes the actual `DoSpawn_S` method with native controller, respawn, geometry and scheduler adapters. It covers persistent blocked positions, missing prerequisites, thirty-attempt exhaustion, temporary recovery, request rejection, preparation waiting, spent/late life refusal and unchanged pending requests. The counter change has source-local regression evidence only until the next native integration run; this does not qualify slow remote clients or real multiplayer admission.
The combined unconscious-camera/weapon revision passed eighteen native Workbench assertions on 24 September 2026: real player incapacitation, current manual camera activation, unchanged possession/living body, no-target fallback, physical-target tracking and movement, native FullHeal recovery, restoration of the player camera, repeated knockout, default-enabled retention of the exact rifle, the same rifle equipped after revival, and normal ground drop with retention disabled. There were no script/runtime failures, and runner cleanup and unchanged-source verification succeeded. Existing RHS/WCS and vanilla resource errors remain in the log, so this is not an error-free engine log. A WORKBENCH-only target stand-in exercises camera tracking because this runner has one real player; it does not establish remote multiplayer streaming. The actual server selection/client policy regressions cover self-exclusion, conscious teammates, canonical identity, target loss, recovery, inactive rounds and delayed unconscious metadata. Arrow input edge/hold/menu behavior and firearm categories have source-policy tests; the new menu controls have structural and command-route checks. The complete repository checks passed. Evidence is in `.local/analysis/unconscious-weapon-2026-09-24`.