From f0e3a84cf5c0d7a0edd890c303299306c513ba8b Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 25 Nov 2026 18:57:03 +0400 Subject: fix(research): update laboratories on the native Behavior timer Active laboratory work now uses the owner task timer instead of consuming and clearing its ore buffer on every host frame. The native 1/1 timer waits for a clock strictly beyond its deadline, draws one Behavior RNG value, and reschedules 64..127 ms from the observed clock. Resource distributors reuse the same deadline arithmetic with their existing 3/1 parameters. Behavior.dll 0x4c550 calls verify deadlines, equality, late calls and RNG state. The original laboratory was sampled through 20 bounded debugger hits; its caller uses the owner +0x930 timer initialized at 0x398f. A second native task fixture uses the original ore getter/setter and confirms that the buffer really is cleared, ruling out the host callback interpretation. Workspace fmt/check/tests, the licensed stock research chain, all 29 missions at 900 seconds and a live Vulkan window check pass. The active-only clock still reports script_lab_clock_approx: idle owner phases and full native event/RNG ordering remain open. Factory selection 69 and query 65 still need Control prototype metadata. This does not close G7. --- apps/fparkan-game/src/script_coverage.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'apps') diff --git a/apps/fparkan-game/src/script_coverage.rs b/apps/fparkan-game/src/script_coverage.rs index 53007d54..2a0ee337 100644 --- a/apps/fparkan-game/src/script_coverage.rs +++ b/apps/fparkan-game/src/script_coverage.rs @@ -38,6 +38,9 @@ pub(super) fn log_clan_ai_stops(report: &SimulationReport) { for &(clan, lab, count) in &report.laboratory.stopped { eprintln!("sim_coverage script_lab_research_stopped={count} clan={clan} lab={lab}"); } + for &(clan, lab, count) in &report.laboratory.clock_ticks { + eprintln!("sim_coverage script_lab_clock_approx={count} clan={clan} lab={lab}"); + } for &(clan, target, x, y, count) in &report.script_mine_queries { eprintln!("sim_coverage script_mine_target_approx={count} clan={clan} target={target} x={x} y={y}"); } -- cgit v1.2.3