浏览代码

Update PriorityEvaluator.cpp

Scores for all sorts of visitable and pickable objects are now unified in order to prevent AI from ignoring nearby valuables.
Xilmi 1 年之前
父节点
当前提交
0143a52755
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      AI/Nullkiller/Engine/PriorityEvaluator.cpp

+ 4 - 3
AI/Nullkiller/Engine/PriorityEvaluator.cpp

@@ -1431,7 +1431,9 @@ float PriorityEvaluator::evaluate(Goals::TSubgoal task, int priorityTier)
 					return 0;
 				if (evaluationContext.isArmyUpgrade)
 					return 0;
-				if (evaluationContext.enemyHeroDangerRatio > 0 && arriveNextWeek)
+				if ((evaluationContext.enemyHeroDangerRatio > 0 && arriveNextWeek) || evaluationContext.enemyHeroDangerRatio > 1)
+					return 0;
+				if (maxWillingToLose - evaluationContext.armyLossPersentage < 0)
 					return 0;
 				score += evaluationContext.strategicalValue * 1000;
 				score += evaluationContext.goldReward;
@@ -1442,11 +1444,10 @@ float PriorityEvaluator::evaluate(Goals::TSubgoal task, int priorityTier)
 				score -= evaluationContext.armyInvolvement * evaluationContext.armyLossPersentage;
 				if (score > 0)
 				{
+					score = 1000;
 					score *= evaluationContext.closestWayRatio;
-					score /= (1 + evaluationContext.enemyHeroDangerRatio);
 					if (evaluationContext.movementCost > 0)
 						score /= evaluationContext.movementCost;
-					score *= (maxWillingToLose - evaluationContext.armyLossPersentage);
 				}
 				break;
 			}