Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
44 lines
7.2 KiB
Markdown
44 lines
7.2 KiB
Markdown
# Finite site patrols
|
||
|
||
## Current verification — 3 October 2026
|
||
|
||
The [corrected isolated fixture](evidence/native-2026-10-03-hq-search-patrol/report.json) completes 172 assertions with one round, zero script/runtime failures and thirteen retained engine errors. Its historical catalog receives two finite mobile outpost responders before ordinary site preparation; the six permanent guards and their route are preserved. This arrangement applies only to the Workbench `patrol-hq` selector. The fixture uses canonical prisoner admission to leave the prison phase, allowing the intended enemy-AI hold to release.
|
||
|
||
The mobile responder group receives an actual native Search waypoint with queued/native radius both 45 m. The actual delivery method, injected combat pause, quiet-period resume, release and restoration of its existing Defend waypoint are checked first. The separate permanent guard group then moves at least 8 m and completes five ordered native Move events across a cycle boundary within the unchanged 180-second bound. This is not physical resumption of the same group after HQ retasking. The older generic completion-log label must be interpreted using these distinct targets. Radio transit, actual search coverage, the 110 m bound, remote clients and FPS remain unverified.
|
||
|
||
Two earlier failures are retained: the fixture waited for movement during the intended prison freeze, then the historical catalog lacked the required mobile team. Production policy was not weakened to make them pass. [Implementation, full regressions and scope](evidence/hq-native-checkpoint-2026-10-03/README.md). The historical authoring and September evidence below remain bound to their own versions.
|
||
|
||
Two existing six-member site squads receive native repeating ground routes: the western supply cache and eastern outpost. Four other guarded sites retain their initial Defend orders, including the prison gate guards. No group, member, ammunition or route replacement occurs on an alert, casualty or later tick.
|
||
|
||
`ERR_SiteDefinition.Patrol` is optional. A route requires an existing guarded depot/outpost, 2–6 non-null points, ground offsets within 60 metres of its guard anchor, and at least 12 metres between every pair of points. The Move prefab's native completion radius is 5 metres. Ground height is sampled at each point. These authoring bounds do not prove navmesh connectivity or obstacle clearance.
|
||
|
||
The authored loops are offsets `(18,0,0), (18,0,24), (-6,0,24), (-6,0,0)` from their guard anchors. Western anchor: X5976/Z7220; eastern anchor: X6756/Z7300. They avoid the authored western crate/parked UAZ and eastern cover footprint on paper. Native traversal and visual/manual route suitability remain pending; terrain coordinates alone are insufficient evidence.
|
||
|
||
SiteService creates and owns four Move waypoints and one Cycle per route during its one permitted preparation. The native cycle inserts its own children and itself; only the Cycle is initially enqueued. Partial resource failure rolls back the site population and all route entities. Stop clears the cycle's children, removes only owned patrol waypoints from the group queue, and deletes those entities. Stop is idempotent. A foreign Search waypoint is preserved by route cleanup; mission shutdown separately stops HQ and the groups.
|
||
|
||
Existing HQ behavior remains authoritative. Its delivered order inserts Search at queue index zero. Its release removes only that Search, so the pre-existing native cycle can resume. No production HQ code changes are needed.
|
||
|
||
## Resource provenance
|
||
|
||
The identities were read from the installed vanilla `addons/data/resourceDatabase.rdb`:
|
||
|
||
- `{750A8D1695BD6998}Prefabs/AI/Waypoints/AIWaypoint_Move.et`
|
||
- `{35BD6541CBB8AC08}Prefabs/AI/Waypoints/AIWaypoint_Cycle.et`
|
||
|
||
Installed vanilla `scripts/Game/Commanding/Commands/SCR_PatrolGroupCommand.c`, `scripts/Game/Components/Locations/SCR_AmbientPatrolSpawnPointComponent.c` and generated `AIWaypointCycle` API establish the SetWaypoints + enqueue-Cycle pattern. Cycle prefab sets RerunCounter -1. This is vanilla resource/API use; no original Escapists implementation was copied.
|
||
|
||
## Native fixture integration and limits
|
||
|
||
Compile Core and AI first. No engine run was performed by this implementation agent.
|
||
|
||
1. Core: construct `new ERR_NativePatrolProbe(mode, "everon-outpost-1")` after site activation, then call `Tick(now)` with real world milliseconds. Return -1 means failure, 0 pending, 1 success. It subscribes to actual completion events, requires five ordered Move completions (crossing a cycle boundary) and >=8m displacement of an existing physical actor, with a 180s deadline. It does not teleport actors, complete waypoints artificially or spawn soldiers. It also validates both authored routes, queue uniqueness, bounded definitions and stationary prison orders. Run the same probe for `"everon-supply-2"` to validate both traversals. Call `Stop()` on abort; destructor also removes its listener.
|
||
2. AI: `new ERR_NativePatrolHQProbe(mode)`, same Tick convention, after an outpost route has been observed. Its WORKBENCH-only HQ adapter invokes the actual DeliverOrder and Release on an eligible, idle, registered outpost unit. It verifies Search becomes current, the baseline queue survives, then a patrol waypoint becomes current again after release. This is an intentionally simulated delivered-order trigger, not proof of radio transit or multiplayer timing. Existing perception/combat or a live HQ assignment causes failure rather than being erased. Call `Stop()` on abort.
|
||
3. After the HQ probe, run the outpost movement probe again to demonstrate physical traversal after release. The queue check alone is not physical-resumption proof.
|
||
4. Last, in a disposable mission, `ERR_NativePatrolProbe.StopChecks(mode)` verifies route cleanup preserves a separately owned Search and repeated Stop remains stopped. This intentionally stops site services; finish/reset the fixture immediately afterwards.
|
||
|
||
The probes are opt-in under WORKBENCH. They do not change normal startup or force responses. Full AI fights, patrol losses, multiple remote players, long-session performance and manual stealth gameplay remain separate acceptance work.
|
||
|
||
Native run `native-2026-09-19-070919` passes 295 combined assertions with zero engine or script errors. Both routes physically move existing guards and complete five native Move events in cyclic order, then retain unique queues and preserve a foreign Search through repeated route cleanup. Initial GetWaypoints snapshots contain repeated Move references; these disappear as native completions occur. The fixture retains bounded queue-growth and completion-order checks, deferring strict uniqueness until the first cycle has advanced. This observed startup behavior does not justify manually deduplicating the native queue. HQ preemption/resumption, manual route suitability and multiplayer remain separate.
|
||
|
||
HQ integration now passes in [072838](evidence/native-2026-09-19-072838/report.json), 272 assertions and zero errors with all companions loaded. Actual delivered-order assignment preempts the existing outpost patrol; actual release preserves the route, and five subsequent ordered native completions and physical displacement demonstrate resumed movement. Radio delivery and remote clients remain separate acceptance gates.
|