From bbd6088b7fb1162a976bcfa1ca6720c2c91e8a72 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sun, 15 Nov 2026 00:04:40 +0400 Subject: feat(ai): find and reserve sites for scripted construction Handler 18 scans base rings, checks terrain and clearance, and writes the site back to the script. The stock Two Fortresses window found a tower site and reached the builder order. The native DLL returned the expected site with and without a reservation, and zero for missing areas. The builder task remains explicit in coverage. --- 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 9dba33cb..0261b1b0 100644 --- a/crates/fparkan-runtime/src/lib.rs +++ b/crates/fparkan-runtime/src/lib.rs @@ -51,6 +51,7 @@ mod clan_problem_conditions; mod clan_script_init; mod clan_targeting; mod clan_transport_schemes; +mod construction_site; mod mesh_collision; mod mining; mod mission_events; @@ -2953,6 +2954,7 @@ pub struct SimulationReport { pub script_problem_waits: Vec<(usize, u32, u64)>, pub script_factory_patrol_continues: Vec<(usize, u32, u64)>, pub script_ore_transport_orders: Vec<(usize, u32, u64)>, + pub script_building_site_queries: Vec<(usize, u32, u64)>, pub script_capturer_queries: Vec<(usize, u64)>, pub script_capture_approaches: Vec<(u32, u32, u64)>, /// First factory completion by clan, in milliseconds. @@ -3005,6 +3007,7 @@ pub fn simulate_mission_report( script_problem_waits: Vec::new(), script_factory_patrol_continues: Vec::new(), script_ore_transport_orders: Vec::new(), + script_building_site_queries: Vec::new(), script_capturer_queries: Vec::new(), script_capture_approaches: Vec::new(), first_factory_completion_ms: Default::default(), @@ -3110,6 +3113,9 @@ pub fn simulate_mission_report( report .script_ore_transport_orders .extend(loaded.clan_ai_events.transport_orders()); + report + .script_building_site_queries + .extend(loaded.clan_ai_events.building_site_queries()); report .script_capturer_queries .extend(loaded.clan_ai_events.capturer_queries()); -- cgit v1.2.3