diff --git a/AI/Nullkiller/AIGateway.cpp b/AI/Nullkiller/AIGateway.cpp index c73a12dbe..c803a9259 100644 --- a/AI/Nullkiller/AIGateway.cpp +++ b/AI/Nullkiller/AIGateway.cpp @@ -548,7 +548,7 @@ std::optional AIGateway::makeSurrenderRetreatDecision(const Battle double fightRatio = ourStrength / (double)battleState.getEnemyStrength(); // if we have no towns - things are already bad, so retreat is not an option. - if(cb->getTownsInfo().size() && ourStrength < nullkiller->settings->getRetreatThresholdAbsoolute() && fightRatio < nullkiller->settings->getRetreatThresholdRelative() && battleState.canFlee) + if(cb->getTownsInfo().size() && ourStrength < nullkiller->settings->getRetreatThresholdAbsolute() && fightRatio < nullkiller->settings->getRetreatThresholdRelative() && battleState.canFlee) { return BattleAction::makeRetreat(battleState.ourSide); } diff --git a/AI/Nullkiller/Engine/Settings.cpp b/AI/Nullkiller/Engine/Settings.cpp index c61318bd1..17f38ad64 100644 --- a/AI/Nullkiller/Engine/Settings.cpp +++ b/AI/Nullkiller/Engine/Settings.cpp @@ -30,7 +30,7 @@ namespace NKAI scoutHeroTurnDistanceLimit(5), maxGoldPressure(0.3f), retreatThresholdRelative(0.3), - retreatThresholdAbsoolute(10000), + retreatThresholdAbsolute(10000), safeAttackRatio(1.1), maxpass(10), pathfinderBucketsCount(1), @@ -52,7 +52,7 @@ namespace NKAI pathfinderBucketSize = node["pathfinderBucketSize"].Integer(); maxGoldPressure = node["maxGoldPressure"].Float(); retreatThresholdRelative = node["retreatThresholdRelative"].Float(); - retreatThresholdAbsoolute = node["retreatThresholdAbsoolute"].Float(); + retreatThresholdAbsolute = node["retreatThresholdAbsolute"].Float(); safeAttackRatio = node["safeAttackRatio"].Float(); allowObjectGraph = node["allowObjectGraph"].Bool(); openMap = node["openMap"].Bool(); diff --git a/AI/Nullkiller/Engine/Settings.h b/AI/Nullkiller/Engine/Settings.h index e67b938ad..769c5ae91 100644 --- a/AI/Nullkiller/Engine/Settings.h +++ b/AI/Nullkiller/Engine/Settings.h @@ -29,7 +29,7 @@ namespace NKAI int pathfinderBucketSize; float maxGoldPressure; float retreatThresholdRelative; - float retreatThresholdAbsoolute; + float retreatThresholdAbsolute; float safeAttackRatio; bool allowObjectGraph; bool useTroopsFromGarrisons; @@ -42,7 +42,7 @@ namespace NKAI int getMaxPass() const { return maxpass; } float getMaxGoldPressure() const { return maxGoldPressure; } float getRetreatThresholdRelative() const { return retreatThresholdRelative; } - float getRetreatThresholdAbsoolute() const { return retreatThresholdAbsoolute; } + float getRetreatThresholdAbsolute() const { return retreatThresholdAbsolute; } float getSafeAttackRatio() const { return safeAttackRatio; } int getMaxRoamingHeroes() const { return maxRoamingHeroes; } int getMainHeroTurnDistanceLimit() const { return mainHeroTurnDistanceLimit; } diff --git a/config/ai/nkai/nkai-settings.json b/config/ai/nkai/nkai-settings.json index 62b517abd..7c29e2f27 100644 --- a/config/ai/nkai/nkai-settings.json +++ b/config/ai/nkai/nkai-settings.json @@ -11,7 +11,7 @@ "pathfinderBucketsCount" : 1, // old value: 3, "pathfinderBucketSize" : 32, // old value: 7, "retreatThresholdRelative" : 0.3, - "retreatThresholdAbsoolute" : 10000, + "retreatThresholdAbsolute" : 10000, "safeAttackRatio" : 1.1, "useFuzzy" : false }, @@ -28,7 +28,7 @@ "pathfinderBucketsCount" : 1, // old value: 3, "pathfinderBucketSize" : 32, // old value: 7, "retreatThresholdRelative" : 0.3, - "retreatThresholdAbsoolute" : 10000, + "retreatThresholdAbsolute" : 10000, "safeAttackRatio" : 1.1, "useFuzzy" : false }, @@ -45,7 +45,7 @@ "pathfinderBucketsCount" : 1, // old value: 3, "pathfinderBucketSize" : 32, // old value: 7, "retreatThresholdRelative" : 0.3, - "retreatThresholdAbsoolute" : 10000, + "retreatThresholdAbsolute" : 10000, "safeAttackRatio" : 1.1, "useFuzzy" : false }, @@ -62,7 +62,7 @@ "pathfinderBucketsCount" : 1, // old value: 3, "pathfinderBucketSize" : 32, // old value: 7, "retreatThresholdRelative" : 0.3, - "retreatThresholdAbsoolute" : 10000, + "retreatThresholdAbsolute" : 10000, "safeAttackRatio" : 1.1, "useFuzzy" : false }, @@ -79,7 +79,7 @@ "pathfinderBucketsCount" : 1, // old value: 3, "pathfinderBucketSize" : 32, // old value: 7, "retreatThresholdRelative" : 0.3, - "retreatThresholdAbsoolute" : 10000, + "retreatThresholdAbsolute" : 10000, "safeAttackRatio" : 1.1, "useFuzzy" : false }