From 68b1043749b58e39d671e3937eef73430cbc0ab8 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 25 Nov 2026 16:14:57 +0400 Subject: feat(ai): execute scripted mine construction Mission 29 stopped before choosing a deposit. Implement Handler(40)'s vacant deposit and weakest enemy mine policy, preserve its partial output writes and reserve the chosen site. Follow the script's tail transfer into BUILD_MINE with the original problem context and cells. Move event execution out of the large script module and report stops at the actual destination event. Use the existing prepared deposit slot for the builder's mine order. Completion registers its controls, ore buffer and logical ID with the regular resource loop. Track mine queries by clan, target and coordinates in --sim-report. Validation: fmt, workspace check/tests; licensed stock-start tests construct a working mine, collect ore and subsequently construct a working factory. Calls to GOG ai.dll confirm mine choices/output writes and VM event transfer behavior. The 900-second stock mission now stops only at the research transition 8. Window validation reaches mine creation from the stock start; construction animation was outside the player's view and has not been accepted visually. Native ArealMap deposit binding, builder resupply and live BAS cuts remain open. --- crates/fparkan-runtime/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) (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 0d43384f..d297029a 100644 --- a/crates/fparkan-runtime/src/lib.rs +++ b/crates/fparkan-runtime/src/lib.rs @@ -50,6 +50,7 @@ mod clan_build_limits; mod clan_building_queries; mod clan_combat_groups; mod clan_combat_strength; +mod clan_mining; mod clan_problem_conditions; mod clan_script_init; mod clan_targeting; @@ -2937,6 +2938,7 @@ pub struct SimulationReport { pub script_ore_transport_orders: Vec<(usize, u32, u64)>, pub script_building_site_queries: Vec<(usize, u32, u64)>, pub script_class_limit_queries: Vec<(usize, u32, bool, u64)>, + pub script_mine_queries: Vec<(usize, u32, u32, u32, u64)>, pub script_construction_orders: Vec<(usize, u32, u32, u64, u64)>, pub script_capturer_queries: Vec<(usize, u64)>, pub script_capture_approaches: Vec<(u32, u32, u64)>, @@ -3001,6 +3003,7 @@ pub fn simulate_mission_report( script_ore_transport_orders: Vec::new(), script_building_site_queries: Vec::new(), script_class_limit_queries: Vec::new(), + script_mine_queries: Vec::new(), script_construction_orders: Vec::new(), script_capturer_queries: Vec::new(), script_capture_approaches: Vec::new(), @@ -3147,6 +3150,9 @@ pub fn simulate_mission_report( report .script_class_limit_queries .extend(loaded.clan_ai_events.class_limit_queries()); + report + .script_mine_queries + .extend(loaded.clan_ai_events.mine_queries()); report .script_construction_orders .extend(loaded.clan_ai_events.construction_orders()); -- cgit v1.2.3