diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-25 23:12:41 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-25 23:12:41 +0300 |
| commit | 3732b97e0393de323f26f750083f556b16ff6b9d (patch) | |
| tree | 8771eb050a962ad3d3f81faa7527ccbf555af136 /crates/fparkan-runtime/src/player_motion.rs | |
| parent | 6f746b8e31de323a55e2a47d8117faca2aa93a50 (diff) | |
| download | fparkan-3732b97e0393de323f26f750083f556b16ff6b9d.tar.xz fparkan-3732b97e0393de323f26f750083f556b16ff6b9d.zip | |
fix(patrol): use native cyclic PatrolPlace point batches
Generate 15-19 goals with Behavior's two random streams, reject candidates
within 100 units of map edges, and retain the cyclic list until the native
20-second plus 10-second jitter timer expires. Draw coordinate and timer
randomness from the shared Behavior CRT stream rather than a patrol-local
copy. Cache chassis CanFly for autonomous checks and reuse the player parser.
Keep per-object counts of batches, goals, approximate area checks and missing
inputs. The generator's initial seed, owner update order, ground walkability
and physical movement remain explicit approximations.
Verified native Behavior.dll RVA 0x2dd90 by x86 invocation at CW 0x007f,
including edge rejection, and captured a matching batch in live AutoDemo.
Rust golden vectors match all goals, RNG states and deadlines. Workspace
fmt/check/test and licensed patrol, combat and clan-clock regressions pass.
All 29 stock missions reach --sim-report 900 with no script interruptions or
new missing patrol inputs. Observed the change in a stock AutoDemo window.
This does not establish full G7 chronology or G8 movement parity.
Diffstat (limited to 'crates/fparkan-runtime/src/player_motion.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/player_motion.rs | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/crates/fparkan-runtime/src/player_motion.rs b/crates/fparkan-runtime/src/player_motion.rs index d9c48102..881b4b5f 100644 --- a/crates/fparkan-runtime/src/player_motion.rs +++ b/crates/fparkan-runtime/src/player_motion.rs @@ -1,32 +1,12 @@ use super::{transform_state, Engine, EngineError, StartingCockpit, SurfaceQuery, TransformState}; use crate::TerrainWorld; -use fparkan_resource::{resource_name, CachedResourceRepository, ResourceRepository}; +use fparkan_resource::CachedResourceRepository; pub(super) fn warbot_can_fly(engine: &crate::Engine, object_index: usize) -> bool { let profile = || { let draft = engine.loaded.as_ref()?.object_drafts.get(object_index)?; - let chassis = draft.unit_components.first()?; - let archive = crate::bounded_ascii_c_string(&chassis.archive_raw)?; - let registry_path = crate::normalize_engine_path("chassis archive", &archive).ok()?; let resources = CachedResourceRepository::new(engine.services.vfs.as_ref()?.clone()); - let registry = resources.open_archive(®istry_path).ok()?; - let name = crate::bounded_ascii_c_string(&chassis.resource_raw)?; - let entry = resources - .find(registry, &resource_name(name.as_bytes())) - .ok()??; - let references = - fparkan_prototype::decode_registry_entry(resources.read(entry).ok()?.as_slice()) - .ok()?; - // AniMesh supplies the sixth resource pair to CreateBehaviour. - let profile = references.get(5)?; - let archive = crate::bounded_ascii_c_string(&profile.archive_raw)?; - let path = crate::normalize_engine_path("chassis profile archive", &archive).ok()?; - let name = crate::bounded_ascii_c_string(&profile.resource_raw)?; - let archive = resources.open_archive(&path).ok()?; - let entry = resources - .find(archive, &resource_name(name.as_bytes())) - .ok()??; - fparkan_assets::decode_chassis_can_fly(resources.read(entry).ok()?.as_slice()).ok()? + crate::unit_chassis::can_fly(&resources, draft) }; profile().unwrap_or_else(|| { eprintln!("sim_coverage player_chassis_profile_stub=1 object={object_index}"); |
