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
+11 -7
View File
@@ -6,22 +6,22 @@ Implemented 2026-09-23 in the combined Core addon. These are server-owned missio
Only a fresh BODY report delivered to HQ identifies a body for aggression. The identity is the immutable formation SourceId plus original roster slot. A status-known death can subsequently be identified once; multiple observers, repeat deliveries and status reports cannot inflate this counter. Missing or silent units do not count.
`ERR_HQWatchRules.Aggression(bodies)` is `clamp(floor(bodies / 3), 0, 30)`. `Hunters(level)` is `ceil(level / 2)`, capped at 15:
`ERR_HQWatchRules.Aggression(bodies)` is `clamp(floor(bodies / 3), 0, 30)`. `Hunters(level)` is `3 + ceil(clamp(level, 0, 30) × 12 / 30)`, capped at 15:
| Identified bodies | Aggression | Cumulative UAZ allowance |
|---:|---:|---:|
| 0–2 | 0 | 0 |
| 3–8 | 1–2 | 1 |
| 9–14 | 3–4 | 2 |
| 45 | 15 | 8 |
| 0–2 | 0 | 3 |
| 3–8 | 1–2 | 4 |
| 9–14 | 3–4 | 5 |
| 45 | 15 | 9 |
| 87–89 | 29 | 15 |
| 90+ | 30 | 15 |
The existing confirmed-loss infantry response budget remains independent. The new allowance creates **additional hunter UAZ-PKM vehicles**, separate from supply convoys, each with the selected primary enemy faction's driver and gunner. There are at most 15 deployments per round, not an endless replacement pool. Destroyed, captured or failed vehicles consume their deployment; surviving entities and loot remain physical. Surviving AI crew retain their HQ registration and skill profile when a driving task ends; capture releases the mission binding. The status string distinguishes active vehicles from the cumulative allowance.
Deployment waits until the prison is unlocked and checks friendly-site road access, terrain, collision, the force-ledger cap and a 400 m player exclusion radius. A blocked candidate is retried after 30 seconds; native crew readiness has a 30-second deadline. Vehicles are registered only with their actual original native agents and seat occupants. Faction selection, inventory, radio fitting and body/intel ownership use existing mission services.
Deployment waits until the prison is unlocked. Three initial UAZs are planned around the opening player centroid (prison position if no player exists), on actual roads at least 90 degrees apart and at least 600 m from that center. The bounded survey tries up to 64 candidates in four rings (800–2150 m), eight queries per HQ second, and retains three clear positions before spawning at most one vehicle per second. Every spawn rechecks terrain/collision, the force ledger and a 400 m exclusion around every player. Unsafe placement is withheld and logged. Additional aggression deployments use friendly-site roads and 30-second spacing. Native crew readiness has a 30-second deadline. Vehicles are registered only with their actual original native agents and seat occupants. Faction selection, inventory, radio fitting and body/intel ownership use existing mission services.
Without delivered sightings, hunters patrol roads between friendly objectives. With fresh actionable HQ memory, they intercept a road near the last reported/predicted position. Destination selection does not query live player positions. Orders must traverse the existing physical radio network. Loss of communications prevents new orders; it does not magically reveal a player or cancel the last received order.
Each hunter crew requests one physical manpack through the existing finite radio-fitting service; destroyed or looted radios are not replenished. Without delivered sightings, hunters patrol roads between friendly objectives. With fresh actionable HQ memory, they intercept a road near the last reported/predicted position. A fresh delivered contact bypasses the 30-second patrol cooldown and cancels a pending patrol downlink. An interception already in radio transit is allowed to complete; updates are limited to one attempt per five seconds. The destination is a road within 250 m of the delivered belief. Destination selection does not query live player positions. Orders must traverse the existing physical radio network. Loss of communications prevents new orders; it does not magically reveal a player or cancel the last received order.
## Objective crews
@@ -57,3 +57,7 @@ The complete HQ journal is `$logs:rereintroduced-hq.log` (existing filename reta
Production-method policy tests cover body/status deduplication, three-body thresholds, 30/15 caps, reset, authority/capture boundaries, maximum skill binding/restoration, regular aim-error selection and native perception fallback. The native `aggression` fixture exercises actual body intake, a physical UAZ with seated crew, radio delivery and movement, objective reservations, medical-stash reinforcement admission and teardown. This is local native Workbench validation, not a dedicated-server multiplayer or full 15-UAZ performance benchmark.
Final local run: `/tmp/erri-aggression-native7/logs/logs_2026-09-23_15-01-06`. All 14 native assertions and the completion marker passed: full medical defence at terrain height, seated driver/gunner, real radio delivery, driving over 30 m, bounded deployment and surviving-crew profile after release. Source stayed unchanged during the run. The runner reported a transient empty-argv Wine `enfMain` during cleanup; a subsequent explicit private-prefix idle check passed. Existing external localization/resource messages remain in the native log; this is not a clean-log claim. `python tools/check.py` passed, and the final hunter lifecycle and affected skill/body/registration policy tests passed separately.
Opening-patrol regressions: `test_hunter_opening.py` executes the actual geometry and order-selection methods, covering angular separation, insufficient candidates, first-contact preemption, in-flight order preservation, lost radio and retry throttling. `test_hq_watch.py` checks the three-to-fifteen allowance across all aggression levels.
2026-09-23 opening-patrol validation: `/tmp/erri-opening-hunters-native2/logs/logs_2026-09-23_17-32-18` completed all 16 native assertions. Three physical UAZs with seated two-man crews and manpacks were confirmed at mutually separated road starts before any fixture body reports. Three distinct delivered body reports then raised allowance to four. The test observed real HQ radio orders and over 30 m of native driving, preserved objective security, and verified survivor handling. Source/addon fingerprints remained unchanged and cleanup was confirmed. Existing external resource errors remain; multiplayer and an actual patrol sighting through the complete uplink were not tested. First-contact preemption is covered by the production-method regression with radio adapters.