From 5cc5602b3fa42e5864d205a1c42c895504038b10 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 25 Nov 2026 20:14:25 +0400 Subject: fix(ai): start player and clan cycles on the first update Fresh AI contexts enter their first cycle immediately, including the player context with an empty Problems0. Share their logical clock with Mission timeouts and registration notifications. The stock original confirms the first Mission callback sees zero before the first AI cycle. Run the player Problems0 path and support TAKE_ALL_BATTLE_UNITS: preserve reserved and same-kind assignments, take warbots from other combat tasks. Native ai.dll calls verify recruitment and the initial shared RNG draws. Validation: workspace fmt/check/tests, release build, licensed stock-clock test, all 29 stock missions at --sim-report 900 without script stops, and stock mission windows 28 and 20. Full AI chronology, native occupancy and remaining RNG consumers are still approximate. --- crates/fparkan-runtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/fparkan-runtime/src/lib.rs') diff --git a/crates/fparkan-runtime/src/lib.rs b/crates/fparkan-runtime/src/lib.rs index c2c25634..111633a9 100644 --- a/crates/fparkan-runtime/src/lib.rs +++ b/crates/fparkan-runtime/src/lib.rs @@ -2917,7 +2917,7 @@ pub struct SimulationReport { pub mission_event_stops: Vec, /// Uncovered clan AI instructions and the number of invocations they stopped. pub clan_ai_event_stops: Vec<(MissionEventStop, u64)>, - /// Clan index, executed AI cycles and new registrations; initial phase and RNG order remain approximate. + /// Clan index, executed AI cycles and new registrations; full RNG ordering remains approximate. pub clan_ai_clock_ticks: Vec<(usize, u64, u64)>, /// Calls to stubbed research policy or status, grouped by clan and handler. pub clan_research_status_stubs: Vec<(usize, u8, u64)>, -- cgit v1.2.3