diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-25 18:41:17 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-25 18:41:17 +0300 |
| commit | 85474bcd60f66b610985c90a697351837208528b (patch) | |
| tree | 34f18cd85dac1f85efbeaba15926ba9fb2ec3bb5 /crates/fparkan-runtime/src/lib.rs | |
| parent | d4e008fe33337494c0a28d9e35da9986a7dd42c7 (diff) | |
| download | fparkan-85474bcd60f66b610985c90a697351837208528b.tar.xz fparkan-85474bcd60f66b610985c90a697351837208528b.zip | |
fix(ai): advance clan cycles when units register
Advance the signed AI deadline by 1400 ms when an active clan receives a
new unit. Connect production, construction, mines, reinforcements and
ownership transfers through the shared spawn path. Preserve negative
deadlines and count registration notifications per clan. Move the common
spawn code and result type out of AutoDemo without changing its public API.
Native ai.dll calls cover duplicate and missing IDs, the disabled guard,
both registration kinds, negative deadlines and unchanged RNG. A live
original warbot registration confirms the same advance. Workspace checks,
the licensed stock factory timing test and all 29 900-second reports pass;
a stock mission-28 window runs through successive factory outputs.
Initial clock phase, complete RNG ordering and full G7 chronology remain open.
Diffstat (limited to 'crates/fparkan-runtime/src/lib.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/lib.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/fparkan-runtime/src/lib.rs b/crates/fparkan-runtime/src/lib.rs index b810eda8..c2c25634 100644 --- a/crates/fparkan-runtime/src/lib.rs +++ b/crates/fparkan-runtime/src/lib.rs @@ -80,10 +80,9 @@ mod script_time; mod unit_combat; mod unit_patrol; mod unit_size_class; +mod unit_spawn; -pub use autodemo::{ - autodemo_camera, AutoDemoCamera, AutoDemoReinforcement, AutoDemoView, SpawnedUnit, -}; +pub use autodemo::{autodemo_camera, AutoDemoCamera, AutoDemoReinforcement, AutoDemoView}; pub use boarding::{ board_friendly_warbot, disembark_warbot, player_vehicle, select_boarding_target, }; @@ -111,6 +110,7 @@ pub use projectile::{ }; pub use research::order_lab_research; pub use unit_combat::{AutoDemoCombatEvent, AutoDemoProjectileType}; +pub use unit_spawn::SpawnedUnit; const MISSION_DECODED_PAYLOAD_CACHE_ENTRIES: usize = 256; const MAX_MISSION_AI_RECORD_SLOTS: usize = 1_000_000; @@ -2917,8 +2917,8 @@ pub struct SimulationReport { pub mission_event_stops: Vec<MissionEventStop>, /// Uncovered clan AI instructions and the number of invocations they stopped. pub clan_ai_event_stops: Vec<(MissionEventStop, u64)>, - /// Executed AI clock cycles by clan; initial phase and full RNG ordering remain approximate. - pub clan_ai_clock_ticks: Vec<(usize, u64)>, + /// Clan index, executed AI cycles and new registrations; initial phase and RNG order remain approximate. + pub clan_ai_clock_ticks: Vec<(usize, u64, 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, u64)>, |
