diff --git a/src/simulator/crates/mc-player-api/tests/common/mod.rs b/src/simulator/crates/mc-player-api/tests/common/mod.rs index 2fde6e6a..d267fde1 100644 --- a/src/simulator/crates/mc-player-api/tests/common/mod.rs +++ b/src/simulator/crates/mc-player-api/tests/common/mod.rs @@ -83,6 +83,14 @@ pub fn add_player_militarist_inline( state.players.push(PlayerState { player_index: pi, + // Game 1 is all-dwarf. The real engine sets this from presentation + // metadata (api-gdext set_player_presentation -> p.race_id); the + // tactical production picker filters race-gated units (dwarf_warrior + // has race_required="dwarf") by it, so an empty race_id makes + // pick_best_unit_for_clan reject every unit and fall back to the + // phantom "warrior" id — which the queue classifier then treats as a + // building, so the AI never spawns a unit. Mirror the engine here. + race_id: "dwarf".into(), gold: 60, cities: vec![mc_city::CityState::starter()], unit_upkeep: Vec::new(), @@ -133,7 +141,12 @@ pub fn build_unit_catalog() -> Vec { id: "dwarf_warrior".into(), tier: 1, tech_required: None, - unit_type: "military".into(), + // Combat archetype, NOT the "military" ai_tag. The tactical picker + // (pick_best_unit_of_type) filters on unit_type ∈ {melee,ranged,siege}; + // the real units JSON uses "melee" for dwarf_warrior. A bogus + // "military" here matches no preferred type, so the picker falls back + // to the phantom "warrior" id and the AI never spawns a unit. + unit_type: "melee".into(), requires_resource: None, race_required: Some("dwarf".into()), clan_affinity: Vec::new(), @@ -155,7 +168,7 @@ pub fn build_unit_catalog() -> Vec { id: "pikeman".into(), tier: 2, tech_required: Some("iron_working".into()), - unit_type: "military".into(), + unit_type: "melee".into(), requires_resource: None, race_required: None, clan_affinity: Vec::new(),