fix: AI units now engage nearby enemies instead of ignoring them in FFA#1412
Merged
braedonsaunders merged 1 commit intomainfrom Feb 10, 2026
Merged
fix: AI units now engage nearby enemies instead of ignoring them in FFA#1412braedonsaunders merged 1 commit intomainfrom
braedonsaunders merged 1 commit intomainfrom
Conversation
Previously, AI armies attacking a base would ignore other players' armies standing right next to them because units with active building targets never re-evaluated for higher-priority threats. Four fixes working together for SC2-style combat behavior: 1. CombatSystem threat retarget: Units attacking buildings periodically check for enemy combat units within attack range and switch targets (every 15 ticks) 2. findThreatRetarget: New method searches attack range for units only (not buildings), using existing TargetAcquisition with includeBuildingsInSearch=false 3. AITacticsManager near-army threat detection: During attack operations, idle units are redirected toward nearby enemy combat units (2+ within 25 units) instead of being re-commanded to the committed enemy's buildings 4. Engagement buffer widened from attackRange+3 to attackRange+5 for more responsive target acquisition during attack-move marches https://claude.ai/code/session_01DmLGJRBv2EMiF95WJXKABz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, AI armies attacking a base would ignore other players' armies standing right next to them because units with active building targets never re-evaluated for higher-priority threats.
Four fixes working together for SC2-style combat behavior:
https://claude.ai/code/session_01DmLGJRBv2EMiF95WJXKABz