-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AI fixes related to strafing and expensive land units #4110
Conversation
@@ -930,7 +930,7 @@ private void determineUnitsToAttackWith(final List<ProTerritory> prioritizedTerr | |||
tuvSwing *= 0.5; | |||
} | |||
final double attackValue = | |||
tuvSwing + territoryValue * result.getWinPercentage() / 100 - enemyCounterTuvSwing * 2 / 3; | |||
1 + tuvSwing + territoryValue * result.getWinPercentage() / 100 - enemyCounterTuvSwing * 2 / 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AI was generally undervaluing low production territories.
final boolean isExpensiveLandUnit = Matches.unitIsLand().test(unit) | ||
&& ProData.unitValueMap.getInt(unit.getType()) > 2 * ProData.minCostPerHitPoint; | ||
if (isAirUnit || isExpensiveLandUnit || addedUnits.contains(unit)) { | ||
continue; // skip air and expensive units |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Want to use cheap land units to populate attacks in territories first as fodder. Most maps this doesn't matter since all land units are fairly cheap but some of the advanced maps have expensive land units.
} | ||
// Check if I can win without amphib units | ||
final List<Unit> defenders = | ||
new ArrayList<>(isIgnoringRelationships ? t.getUnits() : patd.getMaxEnemyDefenders(player, data)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So removing all units with AA attacks causes issues for advanced maps that have lots of different types of unit with AA style attacks. So remove this filter as its causing problems.
Codecov Report
@@ Coverage Diff @@
## master #4110 +/- ##
============================================
+ Coverage 22.65% 23.09% +0.44%
- Complexity 6106 6652 +546
============================================
Files 844 845 +1
Lines 70906 76105 +5199
Branches 11379 13410 +2031
============================================
+ Hits 16062 17578 +1516
- Misses 52765 56301 +3536
- Partials 2079 2226 +147
Continue to review full report at Codecov.
|
AI adjustments based on feedback here: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback/127