diff --git a/AI/Nullkiller/Behaviors/CaptureObjectsBehavior.cpp b/AI/Nullkiller/Behaviors/CaptureObjectsBehavior.cpp index ce7ffa6e5..609511d86 100644 --- a/AI/Nullkiller/Behaviors/CaptureObjectsBehavior.cpp +++ b/AI/Nullkiller/Behaviors/CaptureObjectsBehavior.cpp @@ -62,6 +62,8 @@ Goals::TGoalVec CaptureObjectsBehavior::getTasks() { way->evaluationContext.closestWayRatio = way->evaluationContext.movementCost / closestWay->evaluationContext.movementCost; + logAi->trace("Behavior %s found %s(%s), danger %d", toString(), way->name(), way->tile.toString(), way->evaluationContext.danger); + tasks.push_back(way); } } diff --git a/AI/Nullkiller/Engine/Nullkiller.cpp b/AI/Nullkiller/Engine/Nullkiller.cpp index ab9606deb..9d72bf5b0 100644 --- a/AI/Nullkiller/Engine/Nullkiller.cpp +++ b/AI/Nullkiller/Engine/Nullkiller.cpp @@ -1,6 +1,7 @@ #include "StdInc.h" #include "Nullkiller.h" #include "../VCAI.h" +#include "../AIHelper.h" #include "../Behaviors/CaptureObjectsBehavior.h" #include "../Behaviors/RecruitHeroBehavior.h" #include "../Goals/Invalid.h" @@ -41,7 +42,7 @@ Goals::TSubgoal Nullkiller::choseBestTask(Behavior & behavior) auto task = choseBestTask(tasks); - logAi->trace("Behavior %s found %s, priority %f", behavior.toString(), task->name(), task->priority); + logAi->debug("Behavior %s returns %s(%s), priority %f", behavior.toString(), task->name(), task->tile.toString(), task->priority); return task; } @@ -50,6 +51,8 @@ void Nullkiller::makeTurn() { while(true) { + ai->ah->updatePaths(ai->getMyHeroes()); + Goals::TGoalVec bestTasks = { choseBestTask(CaptureObjectsBehavior()), choseBestTask(RecruitHeroBehavior()) diff --git a/AI/Nullkiller/Pathfinding/AINodeStorage.h b/AI/Nullkiller/Pathfinding/AINodeStorage.h index ae86f6c2e..6111758ac 100644 --- a/AI/Nullkiller/Pathfinding/AINodeStorage.h +++ b/AI/Nullkiller/Pathfinding/AINodeStorage.h @@ -18,6 +18,8 @@ #include "Actions/ISpecialAction.h" #include "Actors.h" +#define VCMI_TRACE_PATHFINDER + struct AIPathNode : public CGPathNode { uint64_t danger;