feat(ai-ai): Implement vision-aware tactical projection with real-time environmental perception

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
autocommit 2026-05-18 20:10:30 -07:00
parent 9d75210947
commit 135aaa4c8a

View file

@ -30,7 +30,7 @@ use mc_ai::tactical::{
decide_tactical_actions, run_ai_turn, Action, TacticalEphemerals, TacticalMap, TacticalState,
TacticalTile,
};
use mc_player_api::project_tactical;
use mc_player_api::project_tactical_with_vision;
use mc_turn::GameState;
// ── GdMcTreeController ───────────────────────────────────────────────────────
@ -257,7 +257,15 @@ fn decide_strategic_kind(state: &GameState, player_index: usize, seed: u64) -> &
.get(player_index)
.map(|p| p.scoring_weights.clone())
.unwrap_or_default();
let mut tactical = project_tactical(state, player_slot);
// p1-60 AI fairness: filter the projection through the active
// player's vision so the AI sees the same fog the human does.
let vision_state = mc_vision::compute_vision(
state,
&mc_vision::VisionCatalog::default(),
None,
);
let pv = vision_state.for_player(player_slot);
let mut tactical = project_tactical_with_vision(state, player_slot, pv);
// `run_ai_turn` debug-asserts state.current_player == player; the projector
// sets current_player from the GameState's turn-order, not from the caller's
// explicit slot, so align it here.