From bef4fbab7701a51945ed93357babe12b416bb9a8 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 25 Nov 2026 18:06:07 +0400 Subject: feat(ai): execute laboratory research from clan scripts Clan laboratories accept the selected DAT project, request power and ore, accumulate native research progress, and publish learned technologies to construction and production. Research requests wait for the live laboratory; newly built objects are no longer mistaken for destroyed targets. Behavior.dll task 0x2f730 was called with paid and free work under x87 0x007f. The stock Single.02 regression checks both completed technologies and keeps the request pending while the laboratory is busy. Workspace fmt/check/tests, the 29-mission 900-second corpus, and the Vulkan window check pass. Dependent availability and free child propagation remain explicit script_research_unlock_stub counters; candidate properties 65 and policy 69 remain open. This does not close G7 or establish live AI chronology parity. --- crates/fparkan-runtime/src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 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 1b80a8ac..9eb5f23d 100644 --- a/crates/fparkan-runtime/src/lib.rs +++ b/crates/fparkan-runtime/src/lib.rs @@ -59,8 +59,10 @@ mod clan_targeting; mod clan_transport_schemes; mod construction; mod construction_site; +mod laboratory; mod mesh_collision; mod mining; +pub use laboratory::LaboratoryReport; mod mission_events; mod ore_transport; mod player_motion; @@ -1370,6 +1372,7 @@ struct LoadedMissionState { behavior_control_groupings: Vec, research_trf_tables: Vec, free_research: research::FreeResearch, + laboratories: laboratory::Laboratories, ai_startup_states: Vec, script_bundles: Vec, script_varset: Option, @@ -2698,6 +2701,7 @@ fn load_mission_with_options( behavior_control_groupings, research_trf_tables, free_research, + laboratories: Default::default(), ai_startup_states: loaded_scripts.ai_startup_states, script_bundles: loaded_scripts.bundles, script_varset: loaded_scripts.varset, @@ -2921,7 +2925,8 @@ pub struct SimulationReport { pub clan_ai_event_stops: Vec<(MissionEventStop, u64)>, /// Calls to stubbed research policy or status, grouped by clan and handler. pub clan_research_status_stubs: Vec<(usize, u8, u64)>, - pub clan_research_catalogs: Vec<(usize, usize, u32)>, + pub clan_research_catalogs: Vec<(usize, usize, u32, u64)>, + pub laboratory: LaboratoryReport, /// Counts of pending script problems by clan and problem kind. pub clan_problem_dispatch_stubs: std::collections::BTreeMap<(usize, u32), u64>, /// Starts under the approximate scheduler, grouped by clan and problem kind. @@ -2994,6 +2999,7 @@ pub fn simulate_mission_report( clan_ai_event_stops: Vec::new(), clan_research_status_stubs: Vec::new(), clan_research_catalogs: Vec::new(), + laboratory: Default::default(), clan_problem_dispatch_stubs: Default::default(), clan_problem_starts: Vec::new(), script_factory_rejections: Vec::new(), @@ -3097,6 +3103,7 @@ pub fn simulate_mission_report( report .clan_research_catalogs .extend(loaded.clan_ai_events.research_catalogs()); + report.laboratory = loaded.laboratories.report(); for problem in loaded.clan_ai_events.pending_problems() { *report .clan_problem_dispatch_stubs -- cgit v1.2.3