1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

NKAI: improve boat handling by object graph, a set of fixes

This commit is contained in:
Andrii Danylchenko
2024-03-28 13:39:15 +02:00
parent adfcb650e2
commit 30d9daf62c
16 changed files with 234 additions and 51 deletions

View File

@@ -329,14 +329,24 @@ void ObjectClusterizer::clusterizeObject(
if(ai->heroManager->getHeroRole(path.targetHero) == HeroRole::SCOUT)
{
if(path.movementCost() > 2.0f)
{
#if NKAI_TRACE_LEVEL >= 2
logAi->trace("Path is too far %f", path.movementCost());
#endif
continue;
}
}
else if(path.movementCost() > 4.0f)
else if(path.movementCost() > 4.0f && obj->ID != Obj::TOWN)
{
auto strategicalValue = valueEvaluator.getStrategicalValue(obj);
if(strategicalValue < 0.5f)
if(strategicalValue < 0.3f)
{
#if NKAI_TRACE_LEVEL >= 2
logAi->trace("Object value is too low %f", strategicalValue);
#endif
continue;
}
}
if(!shouldVisit(ai, path.targetHero, obj))