From a4a9b7a6478c9c1efcf0aef8b37464dc0e5b339e Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 25 Nov 2026 17:04:13 +0400 Subject: feat(ai): resupply scripted builders before construction Use the native Building_Cost threshold to start loading from the nearest owned mine or warehouse. Transfer ore at the stock 100 units/second up to the design price, then resume the reserved building task. Mines bypass loading; direct construction can preserve native negative ore after payment. Execute Behavior.dll's config constructor, start, source selection, loading tick and resource setter in an x86 oracle. Keep exterior docking and custom Behavior configuration explicit approximations, counted per builder/source. The stock Single.02 regression now reaches another completed building after resupply without changing mission objects or resources. Validate fmt/check/ workspace tests, licensed construction and debt regressions, all 29 stock missions for 900 seconds, and mission 29 in a Vulkan-validation window. --- crates/fparkan-runtime/src/lib.rs | 10 ++++++++++ 1 file changed, 10 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 b1e63120..10e8e2a0 100644 --- a/crates/fparkan-runtime/src/lib.rs +++ b/crates/fparkan-runtime/src/lib.rs @@ -43,6 +43,7 @@ use std::sync::Arc; mod autodemo; mod boarding; +mod builder_supply; mod building_door; mod clan_ai_events; mod clan_area_strength; @@ -2939,6 +2940,7 @@ pub struct SimulationReport { 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_builder_supplies: Vec<(u16, u32, u32, u64)>, pub script_capturer_queries: Vec<(usize, u64)>, pub script_capture_approaches: Vec<(u32, u32, u64)>, /// First factory completion by clan, in milliseconds. @@ -3004,6 +3006,7 @@ pub fn simulate_mission_report( script_class_limit_queries: Vec::new(), script_mine_queries: Vec::new(), script_construction_orders: Vec::new(), + script_builder_supplies: Vec::new(), script_capturer_queries: Vec::new(), script_capture_approaches: Vec::new(), first_factory_completion_ms: Default::default(), @@ -3155,6 +3158,13 @@ pub fn simulate_mission_report( report .script_construction_orders .extend(loaded.clan_ai_events.construction_orders()); + report.script_builder_supplies.extend( + loaded + .construction + .supply_orders + .iter() + .map(|(&(clan, builder, source), &count)| (clan, builder, source, count)), + ); report .script_capturer_queries .extend(loaded.clan_ai_events.capturer_queries()); -- cgit v1.2.3