From f0bb97b0d21eeed38df98e1a80e9365e8cf64524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Zieli=C5=84ski?= Date: Fri, 9 Sep 2022 20:59:44 +0200 Subject: [PATCH] AI will actually attack all heroes when possible - and win the game eventually :) --- AI/Nullkiller/Engine/PriorityEvaluator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AI/Nullkiller/Engine/PriorityEvaluator.cpp b/AI/Nullkiller/Engine/PriorityEvaluator.cpp index 0bbee0b15..0cf787a35 100644 --- a/AI/Nullkiller/Engine/PriorityEvaluator.cpp +++ b/AI/Nullkiller/Engine/PriorityEvaluator.cpp @@ -297,7 +297,8 @@ float RewardEvaluator::getEnemyHeroStrategicalValue(const CGHeroInstance * enemy vstd::amax(objectValue, getStrategicalValue(obj)); } - return objectValue / 2.0f + enemy->level / 15.0f; + //AI should absolutely prioritize killing enemy heroes, even scouts + return std::min(1.0f, objectValue * 0.9f + (1.0f - (1.0f / (1 + enemy->level)))); } float RewardEvaluator::getResourceRequirementStrength(int resType) const