aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/lib.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-11-25 23:31:54 +0300
committerValentin Popov <valentin@popov.link>2026-11-25 23:31:54 +0300
commit2d7c17b13b0dc2e4a4712fee25aa8f06161a141b (patch)
treed65452f6a0a1ffcc8ff39429ed92de15be116f87 /crates/fparkan-runtime/src/lib.rs
parent3732b97e0393de323f26f750083f556b16ff6b9d (diff)
downloadfparkan-2d7c17b13b0dc2e4a4712fee25aa8f06161a141b.tar.xz
fparkan-2d7c17b13b0dc2e4a4712fee25aa8f06161a141b.zip
fix(patrol): request place patrol speed from Control limits
Unengaged PatrolPlace movement uses current owner-profile word 7 times 0.8 instead of one fixed speed for every chassis. Preserve a counted fallback for unavailable profiles and report per-object speed samples. The profile is projected at load time; runtime updates, acceleration, turning and speeds of other orders remain approximate. Confirmed the current-profile selector by executing GOG Behavior.dll RVA 0x1bbe0. A live request at RVA 0x2dc67 maps limit 0x416b55d8 and factor 0x3f4ccccd to 0x413c44ad, covered by a Rust regression. Behavior.dll SHA-256: ddfbdbde07832358fe6e35e01c8dba9b58e7313789498b6049ed51d4ed9baf99. Validated fmt, workspace check/tests, release build, licensed stock profile and patrol-list tests, and all 29 stock missions for 900 seconds. Observed stock AutoDemo movement, combat and replenishment in the window; this does not establish full native movement or opening chronology parity.
Diffstat (limited to 'crates/fparkan-runtime/src/lib.rs')
-rw-r--r--crates/fparkan-runtime/src/lib.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/fparkan-runtime/src/lib.rs b/crates/fparkan-runtime/src/lib.rs
index 0d19d898..6b84baab 100644
--- a/crates/fparkan-runtime/src/lib.rs
+++ b/crates/fparkan-runtime/src/lib.rs
@@ -72,8 +72,10 @@ pub use laboratory::LaboratoryReport;
mod mission_events;
mod ore_transport;
mod patrol_points;
+mod patrol_speed;
mod player_motion;
pub use patrol_points::PatrolPointReport;
+pub use patrol_speed::PatrolSpeedReport;
mod player_status;
mod player_weapon;
mod production;
@@ -2781,10 +2783,9 @@ pub fn step_headless(
});
Some(patrol.prepare(
&engine.world,
- &mission.terrain,
+ mission,
queue_time_ms,
&targets,
- &mission.unit_can_fly,
&mut crt,
&mut point_rng,
))
@@ -2980,6 +2981,7 @@ pub struct SimulationReport {
pub control_resource_stops: Vec<(u32, u64, String)>,
pub weapon_poses: WeaponPoseReport,
pub patrol_points: PatrolPointReport,
+ pub patrol_speeds: PatrolSpeedReport,
/// 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)>,
@@ -3058,6 +3060,7 @@ pub fn simulate_mission_report(
control_resource_stops: Vec::new(),
weapon_poses: WeaponPoseReport::default(),
patrol_points: PatrolPointReport::default(),
+ patrol_speeds: PatrolSpeedReport::default(),
script_strength_queries: Vec::new(),
script_capture_queries: Vec::new(),
script_attack_queries: Vec::new(),
@@ -3167,6 +3170,7 @@ pub fn simulate_mission_report(
report.laboratory = loaded.laboratories.report();
if let Some(patrol) = &loaded.unit_patrol {
report.patrol_points = patrol.point_report.clone();
+ report.patrol_speeds = patrol.speed_report.clone();
}
report
.control_resource_ticks