debug(Core/Movement): Telemetry whisper showing path tail coords vs bot vs dest

This commit is contained in:
bash 2026-05-31 00:41:20 +02:00
parent ee3f92c04a
commit f4c6177520

View File

@ -1,6 +1,7 @@
#include "NewRpgBaseAction.h" #include "NewRpgBaseAction.h"
#include <limits> #include <limits>
#include <iomanip>
#include <sstream> #include <sstream>
#include "BroadcastHelper.h" #include "BroadcastHelper.h"
@ -131,6 +132,24 @@ bool NewRpgBaseAction::MoveFarTo(WorldPosition dest)
if (path.empty()) if (path.empty())
return false; return false;
// Telemetry: show the path's actual tail coords vs bot + dest so we
// can see whether the resolved path is heading toward the right
// place. dest-distance == 0 means tail IS the dest (good); large
// dest-distance means graph picked a far-off endNode.
if (botAI->HasStrategy("debug move", BOT_STATE_NON_COMBAT))
{
WorldPosition tail = path.getBack();
float const tailToDest = tail.distance(dest);
float const botToTail = bot->GetExactDist(tail.GetPositionX(),
tail.GetPositionY(),
tail.GetPositionZ());
std::ostringstream tlog;
tlog << "[PATH] tail=(" << std::fixed << std::setprecision(1)
<< tail.GetPositionX() << "," << tail.GetPositionY() << "," << tail.GetPositionZ()
<< ") botToTail=" << botToTail << "y tailToDest=" << tailToDest << "y";
botAI->TellMasterNoFacing(tlog);
}
// Walk dispatch. // Walk dispatch.
std::vector<WorldPosition> const& pts = path.getPointPath(); std::vector<WorldPosition> const& pts = path.getPointPath();
Movement::PointsArray points; Movement::PointsArray points;