From e6b0ced735a71002847f5060339a7c2f37798fbb Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 25 Nov 2026 21:11:28 +0400 Subject: fix(ai): account for occupied clan mind slots Handler(49) read the immutable Init snapshot and always reported all clan minds as free. Project occupied slots from live mobile units (including the hero) and valid factory reservations, including orders queued in the current script pass. Unit loss, capture and factory ownership loss release capacity. Expose per-clan query counts and current capacity/free/reserved values through script_free_minds_approx; retain explicit native-ID and admission boundaries. GOG ai.dll SHA-256 c19cd6cd31cd2896f8c4ba0f0e700dd3408aec8182daaf4863d98a7d233a2abc: native calls to Handler(49), RVA 0xdb2e, confirm that only 0xffffffff is free. In stock Single.01 clan 1 starts with five occupied slots out of nine. Hardware watches in Behavior.dll SHA-256 ddfbdbde07832358fe6e35e01c8dba9b58e7313789498b6049ed51d4ed9baf99 show the factory reserve zero at RVA 0x2a0bb and release it at 0x2a7e5 before birth. Validated fmt, workspace check/tests, release build, ordinary lifecycle tests and an ignored licensed Single.01 test covering startup, order, birth and factory ownership loss. All 29 stock missions finish --sim-report 900 without new script stops. Stock mission 28 also ran in the window: four orders now fill the clan instead of the previous eight over the simulation interval. This does not establish complete mission playthrough or full AI parity. Warbot design ranking still uses the explicit compatible-prebuild fallback; factory logs now include the requested class and selection mode. Native mind IDs, full-capacity order admission and factory timing remain approximate. --- apps/fparkan-game/src/script_coverage.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'apps') diff --git a/apps/fparkan-game/src/script_coverage.rs b/apps/fparkan-game/src/script_coverage.rs index 0415000b..a4537a03 100644 --- a/apps/fparkan-game/src/script_coverage.rs +++ b/apps/fparkan-game/src/script_coverage.rs @@ -92,6 +92,9 @@ pub(super) fn log_clan_ai_stops(report: &SimulationReport) { for &(clan, mode, count) in &report.script_group_recruitments { eprintln!("sim_coverage script_group_recruitment_approx={count} clan={clan} mode={mode}"); } + for &(clan, capacity, free, reserved, count) in &report.script_free_mind_queries { + eprintln!("sim_coverage script_free_minds_approx={count} clan={clan} capacity={capacity} free={free} reserved={reserved}"); + } for &(clan, class, target, count) in &report.script_class_target_queries { eprintln!("sim_coverage script_class_target_approx={count} clan={clan} class={class} target={target}"); } -- cgit v1.2.3