From 0c29341f5b46588443bc6e3f7cd60347666677bd Mon Sep 17 00:00:00 2001 From: EmperorPinguin <99119424+EmperorPinguin@users.noreply.github.com> Date: Wed, 20 Aug 2025 12:09:57 +0200 Subject: [PATCH] AI: declare less war against humans on higher difficulties (#13830) * Update MotivationToAttackAutomation.kt * Update MotivationToAttackAutomation.kt * Update MotivationToAttackAutomation.kt --- .../civilization/MotivationToAttackAutomation.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/src/com/unciv/logic/automation/civilization/MotivationToAttackAutomation.kt b/core/src/com/unciv/logic/automation/civilization/MotivationToAttackAutomation.kt index 4f5acd948e..522b805636 100644 --- a/core/src/com/unciv/logic/automation/civilization/MotivationToAttackAutomation.kt +++ b/core/src/com/unciv/logic/automation/civilization/MotivationToAttackAutomation.kt @@ -17,6 +17,7 @@ import com.unciv.models.ruleset.unique.UniqueType import com.unciv.models.ruleset.unit.BaseUnit import com.unciv.ui.screens.victoryscreen.RankingType import yairm210.purity.annotations.Readonly +import kotlin.math.pow object MotivationToAttackAutomation { @@ -276,10 +277,8 @@ object MotivationToAttackAutomation { // At higher difficulty levels the AI gets a unit production boost. // In that case while we may have more units than them, we don't nessesarily want to be more aggressive. // This is to reduce the amount that the AI targets players at these higher levels somewhat. - if (civInfo.isAI() && targetCiv.isHuman() && combatStrengthRatio > 1) { - val ourCombatModifiers = civInfo.gameInfo.getDifficulty().aiUnitCostModifier - val theirCombatModifiers = civInfo.gameInfo.getDifficulty().unitCostModifier - combatStrengthRatio *= ourCombatModifiers / theirCombatModifiers + if (civInfo.isAI() && targetCiv.isHuman()) { + combatStrengthRatio *= civInfo.gameInfo.getDifficulty().aiUnitCostModifier.pow(1.5f) } val combatStrengthModifier = when { combatStrengthRatio > 5f -> 20f