Grafana Integration + Unified SQLite Boilerplate + Fixed bot movement performance regression

This commit is contained in:
Ceikry
2023-07-31 14:59:53 +00:00
parent ac0da92a58
commit ee79b0750c
13 changed files with 984 additions and 223 deletions
@@ -192,6 +192,8 @@ public abstract class MovementPulse extends Pulse {
if (!mover.getViewport().getRegion().isActive())
return false;
if (!isRunning()) return true;
if (!validate()) {
stop();
return true;
@@ -295,6 +297,8 @@ public abstract class MovementPulse extends Pulse {
if (destination instanceof Entity || interactLocation == null || (!mover.getWalkingQueue().hasPath() && interactLocation.getDistance(mover.getLocation()) > 0) || (usingTruncatedPath && destination.getLocation().getDistance(mover.getLocation()) < 14)) {
if (!checkAllowMovement())
return;
if (destination instanceof Entity && previousLoc != null && previousLoc.equals(loc) && mover.getWalkingQueue().hasPath())
return;
Path path;
Pair<Boolean, Location> truncation = truncateLoc(mover, loc != null ? loc : destination.getLocation());
@@ -401,7 +405,7 @@ public abstract class MovementPulse extends Pulse {
Vector pathDiff = Vector.betweenLocs (destination.getLocation(), Location.create(p.getX(), p.getY(), plane));
Location predictedCenterPos = (destination.getMathematicalCenter().plus(pathDiff)).toLocation(plane);
Vector toPlayerNormalized = Vector.betweenLocs(predictedCenterPos, mover.getCenterLocation()).normalized();
return predictedCenterPos.transform(toPlayerNormalized.times(destination.size()));
return predictedCenterPos.transform(toPlayerNormalized.times(destination.size() + 1));
}