aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-11-14 23:18:34 +0300
committerValentin Popov <valentin@popov.link>2026-11-14 23:18:34 +0300
commit66c02b87b96e63d3cfce29c8ca33a2bb28662ec6 (patch)
treec949f84e12efad4126851bc61eb617ccc87c3948 /apps
parentbbd6088b7fb1162a976bcfa1ca6720c2c91e8a72 (diff)
downloadfparkan-66c02b87b96e63d3cfce29c8ca33a2bb28662ec6.tar.xz
fparkan-66c02b87b96e63d3cfce29c8ca33a2bb28662ec6.zip
feat(ai): execute tower construction orders
Use the first BuildDat scheme for the requested class, check learned components, and route the builder before spending onboard ore. The Behavior.dll oracle rejected the stock scheme and returned 1100 ore after unlocking the components. The stock mission 28 window showed the refusal with its original tech tree. A licensed prepared test exercised construction and ore deduction. Onboard supply remains required pending warehouse refill.
Diffstat (limited to 'apps')
-rw-r--r--apps/fparkan-game/src/main.rs7
-rw-r--r--apps/fparkan-game/src/script_coverage.rs8
2 files changed, 13 insertions, 2 deletions
diff --git a/apps/fparkan-game/src/main.rs b/apps/fparkan-game/src/main.rs
index 68b99426..8949b135 100644
--- a/apps/fparkan-game/src/main.rs
+++ b/apps/fparkan-game/src/main.rs
@@ -7769,10 +7769,13 @@ fn mission_basement_footprints(
) -> Result<Vec<MissionBasementFootprint>, String> {
let mut footprints = Vec::new();
for (object_index, mission_root) in roots.iter().enumerate() {
- // shortcut: deployed mines lack a live BAS cut until terrain can
+ // shortcut: newly built structures lack a live BAS cut until terrain can
// rebuild the affected cells when a building enters the world.
if mission_root.raw_after_resource == u32::MAX
- && mission_root.unit_dat_header_flags == Some(0x8000_0004)
+ && matches!(
+ mission_root.unit_dat_header_flags,
+ Some(0x8000_0004 | 0x8010_0000 | 0x8020_0000)
+ )
{
continue;
}
diff --git a/apps/fparkan-game/src/script_coverage.rs b/apps/fparkan-game/src/script_coverage.rs
index a67ddde3..247d8cff 100644
--- a/apps/fparkan-game/src/script_coverage.rs
+++ b/apps/fparkan-game/src/script_coverage.rs
@@ -50,6 +50,14 @@ pub(super) fn log_clan_ai_stops(report: &SimulationReport) {
"sim_coverage script_building_site_approx={count} clan={clan} class={class:#010x}"
);
}
+ for &(clan, builder, class, accepted, rejected) in &report.script_construction_orders {
+ if accepted != 0 {
+ eprintln!("sim_coverage script_building_order_approx={accepted} clan={clan} builder={builder} class={class:#010x}");
+ }
+ if rejected != 0 {
+ eprintln!("sim_coverage script_building_rejected={rejected} clan={clan} builder={builder} class={class:#010x}");
+ }
+ }
for &(clan, count) in &report.script_capturer_queries {
eprintln!("sim_coverage script_nearest_capturer_approx={count} clan={clan}");
}