diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-25 22:42:11 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-25 22:42:11 +0300 |
| commit | 6f746b8e31de323a55e2a47d8117faca2aa93a50 (patch) | |
| tree | 6ede0f9b453fd7b6a08c012abf07fdb9017cb067 /crates/fparkan-runtime/src/lib.rs | |
| parent | 9e5a8867d1a12a66772e6e97c3a0213f9636d56c (diff) | |
| download | fparkan-6f746b8e31de323a55e2a47d8117faca2aa93a50.tar.xz fparkan-6f746b8e31de323a55e2a47d8117faca2aa93a50.zip | |
fix(combat): launch AI projectiles from mounted weapon CPTs
Resolve weapon node poses and EXTO socket chains on the CPU, replace each
mounted component root with its socket, and transform the selected CPT into
the world. Test terrain sight lines from each barrel rather than the hull.
Share initial Control pose sampling with the window renderer. Count missing
mounts and animation fallbacks by original object ID without losing history
when an object dies.
Checked Control.dll RVA 0x1b4f0 by native invocation, including nonuniform
scale and a rotated world matrix. cargo fmt/check/test workspace pass, as do
licensed stock AutoDemo and scripted patrol/factory regressions. All 29
stock missions reach --sim-report 900 with no script interruption or weapon
pose fallback. Both games were observed in stock AutoDemo windows.
AI turret aim, recoil and first-shot chronology remain approximate; this
change does not establish full G7 or G8 gameplay parity.
Diffstat (limited to 'crates/fparkan-runtime/src/lib.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/lib.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/fparkan-runtime/src/lib.rs b/crates/fparkan-runtime/src/lib.rs index bb5d496f..917adc2b 100644 --- a/crates/fparkan-runtime/src/lib.rs +++ b/crates/fparkan-runtime/src/lib.rs @@ -84,6 +84,8 @@ mod unit_combat; mod unit_patrol; mod unit_size_class; mod unit_spawn; +mod weapon_pose; +pub use weapon_pose::{initial_component_node_times, WeaponPoseReport}; pub use autodemo::{autodemo_camera, AutoDemoCamera, AutoDemoReinforcement, AutoDemoView}; pub use boarding::{ @@ -2949,6 +2951,7 @@ pub struct SimulationReport { pub factory_clock_ticks: Vec<(u16, u32, u64)>, pub control_resource_ticks: Vec<(u32, u64)>, pub control_resource_stops: Vec<(u32, u64, String)>, + pub weapon_poses: WeaponPoseReport, /// Approximate clan strength queries, grouped by caller and target clan. pub script_strength_queries: Vec<(usize, u16, u64)>, pub script_capture_queries: Vec<(usize, u64)>, @@ -3025,6 +3028,7 @@ pub fn simulate_mission_report( factory_clock_ticks: Vec::new(), control_resource_ticks: Vec::new(), control_resource_stops: Vec::new(), + weapon_poses: WeaponPoseReport::default(), script_strength_queries: Vec::new(), script_capture_queries: Vec::new(), script_attack_queries: Vec::new(), @@ -3144,6 +3148,9 @@ pub fn simulate_mission_report( if let Some(production) = &engine.production { report.factory_clock_ticks.extend(production.clock_ticks()); } + if let Some(combat) = &engine.autodemo_combat { + report.weapon_poses = combat.pose_report().clone(); + } for problem in loaded.clan_ai_events.pending_problems() { *report .clan_problem_dispatch_stubs |
