1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-01 23:12:49 +02:00

BattleAI: divide only positive part of score onto turns count

This commit is contained in:
Andrii Danylchenko
2023-10-03 08:16:12 +03:00
parent 3880ea58b9
commit 9eb9404f28
4 changed files with 187 additions and 55 deletions

View File

@@ -274,6 +274,7 @@ void Nullkiller::makeTurn()
bestTask = choseBestTask(bestTasks);
std::string taskDescription = bestTask->toString();
HeroPtr hero = bestTask->getHero();
HeroRole heroRole = HeroRole::MAIN;
@@ -292,7 +293,7 @@ void Nullkiller::makeTurn()
logAi->trace(
"Goal %s has low priority %f so decreasing scan depth to gain performance.",
bestTask->toString(),
taskDescription,
bestTask->priority);
}
@@ -308,7 +309,7 @@ void Nullkiller::makeTurn()
{
logAi->trace(
"Goal %s has too low priority %f so increasing scan depth to full.",
bestTask->toString(),
taskDescription,
bestTask->priority);
scanDepth = ScanDepth::ALL_FULL;
@@ -316,7 +317,7 @@ void Nullkiller::makeTurn()
continue;
}
logAi->trace("Goal %s has too low priority. It is not worth doing it. Ending turn.", bestTask->toString());
logAi->trace("Goal %s has too low priority. It is not worth doing it. Ending turn.", taskDescription);
return;
}
@@ -325,7 +326,7 @@ void Nullkiller::makeTurn()
if(i == MAXPASS)
{
logAi->error("Goal %s exceeded maxpass. Terminating AI turn.", bestTask->toString());
logAi->error("Goal %s exceeded maxpass. Terminating AI turn.", taskDescription);
}
}
}