diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-25 14:41:21 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-25 14:41:21 +0300 |
| commit | 7a7001c96afdbe0e5d574337bec476f230692477 (patch) | |
| tree | 74d887cfb724d06aee67c61dfa5421b9e64c1408 /apps | |
| parent | 27d6ea19b0206b71ef6c309142e0875275882bf0 (diff) | |
| download | fparkan-7a7001c96afdbe0e5d574337bec476f230692477.tar.xz fparkan-7a7001c96afdbe0e5d574337bec476f230692477.zip | |
feat(ai): construct clan factories, storage and laboratories
Allow ORDER_ROBOT_BUILD to use the first BuildDat scheme for factories,
storage and laboratories, with the existing technology and onboard-ore gates.
Register completed factories for production and reset their free-build quota
when a prepared slot is reused. Exclude reserved models from initial BAS cuts
using the mission object count, preserving placed neutral buildings.
Validation: fmt, workspace check and tests; ignored licensed stock-start test
builds a factory in mission 29 and queues a transport there. Original Behavior.dll
price calls confirm 670/770/560 ore for storage/factory/laboratory. Stock simulation
also builds a laboratory; a validation-enabled window reaches the first factory.
The new buildings were outside the player's window view; visual construction
parity is not established. G7 still needs mine query 40, research transition 8,
builder resupply and live BAS updates.
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/fparkan-game/src/main.rs | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/apps/fparkan-game/src/main.rs b/apps/fparkan-game/src/main.rs index 96dfd756..72ee3c74 100644 --- a/apps/fparkan-game/src/main.rs +++ b/apps/fparkan-game/src/main.rs @@ -280,6 +280,7 @@ fn run(args: &[String]) -> Result<String, String> { mission_assets, terrain, roots, + loaded.object_count, camera, args.static_animation_frame, args.static_material_phase, @@ -7632,16 +7633,6 @@ fn mission_basement_footprints( ) -> Result<Vec<MissionBasementFootprint>, String> { let mut footprints = Vec::new(); for (object_index, mission_root) in roots.iter().enumerate() { - // 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 - && matches!( - mission_root.unit_dat_header_flags, - Some(0x8000_0004 | 0x8010_0000 | 0x8020_0000) - ) - { - continue; - } let Some(mode) = mission_root.basement_placement_mode() else { continue; }; @@ -8200,6 +8191,7 @@ fn static_preview_mesh_and_materials( assets: &MissionAssets, terrain: &TerrainWorld, roots: &[MissionObjectDraft], + placed_root_count: usize, legacy_camera: Option<LegacyCameraCapture>, static_animation_frame: Option<u16>, static_material_phase: Option<u16>, @@ -8245,7 +8237,9 @@ fn static_preview_mesh_and_materials( .filter(|face| face.flags.0 & 8 != 0 && face.flags.0 & 0x20000 == 0) .count(); eprintln!("render_coverage terrain_face8_pipeline_unverified={unverified_special_faces} (non-reflective source faces across LODs; native special-pass mapping pending)"); - let footprint_sources = mission_basement_footprints(assets, roots)?; + // shortcut: live construction needs terrain-cell rebuilding before it can cut BAS. + let footprint_sources = + mission_basement_footprints(assets, &roots[..placed_root_count.min(roots.len())])?; let foundation = if footprint_sources.is_empty() { None } else { @@ -14092,6 +14086,7 @@ mod tests { assets, terrain, roots, + loaded.object_count, None, None, None, @@ -15192,6 +15187,7 @@ mod tests { assets, terrain, roots, + loaded.object_count, None, None, None, @@ -15245,6 +15241,7 @@ mod tests { &MissionAssets::default(), &terrain, &[], + 0, None, None, None, |
