diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-25 17:06:07 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-25 17:06:07 +0300 |
| commit | bef4fbab7701a51945ed93357babe12b416bb9a8 (patch) | |
| tree | 3990f0e2898b369c53f42b514c185ceeb7372132 /crates/fparkan-runtime/src/lib.rs | |
| parent | 593e38ba45fc7d28e28bdcc0fa8020a6c62deac0 (diff) | |
| download | fparkan-bef4fbab7701a51945ed93357babe12b416bb9a8.tar.xz fparkan-bef4fbab7701a51945ed93357babe12b416bb9a8.zip | |
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.
Diffstat (limited to 'crates/fparkan-runtime/src/lib.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/lib.rs | 9 |
1 files changed, 8 insertions, 1 deletions
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<MissionBehaviorControlGroupingState>, research_trf_tables: Vec<MissionResearchTrfTable>, free_research: research::FreeResearch, + laboratories: laboratory::Laboratories, ai_startup_states: Vec<MissionAiStartupState>, script_bundles: Vec<MissionScriptBundle>, script_varset: Option<MissionScriptVarSet>, @@ -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 |
