shape
This commit is contained in:
@@ -15,6 +15,7 @@ import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.PowersManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mobileAI.MobAI;
|
||||
import engine.mobileAI.utilities.PathingUtilities;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.Mob;
|
||||
import engine.objects.PlayerCharacter;
|
||||
@@ -153,11 +154,12 @@ public class aiInfoCmd extends AbstractDevCmd {
|
||||
}
|
||||
output += "Walking: " + ((Mob) target).isMoving() + newline;
|
||||
output += "Destination: " + ((Mob) target).destination + newline;
|
||||
output += "is Pathing: " + mob.isPathing + newline;
|
||||
output += "NavPath: " + newline;
|
||||
for(Vector3fImmutable point : ((Mob) target).navPath){
|
||||
output += "(" + ((Mob) target).navPath.indexOf(point) + ")(" +((Mob) target).loc.distanceSquared2D(point) + ") "+ point + newline;
|
||||
for(PathingUtilities.Node point : ((Mob) target).navPath){
|
||||
output += point.location + newline;
|
||||
}
|
||||
|
||||
((Mob) target).isPathing = false;
|
||||
throwbackInfo(playerCharacter, output);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ public class NavigationManager {
|
||||
MobAI.directMove((Mob)character,character.combatTarget != null);
|
||||
return; //no points to walk to
|
||||
}
|
||||
character.navPath = path;
|
||||
//character.navPath = path;
|
||||
|
||||
} catch (Exception e) {
|
||||
//something failed
|
||||
|
||||
@@ -30,6 +30,12 @@ public class PathingUtilities {
|
||||
this.parentBuilding = parent;
|
||||
this.neighbors = new ArrayList<>();
|
||||
}
|
||||
public Node(Node clone){
|
||||
this.location = clone.location;
|
||||
this.region = clone.region;
|
||||
this.parentBuilding = clone.parentBuilding;
|
||||
this.neighbors = (ArrayList<Node>) clone.neighbors.clone();
|
||||
}
|
||||
public ArrayList<Node> getNeighbors(){
|
||||
if(neighbors.size() == 0){
|
||||
Zone zone = ZoneManager.findSmallestZone(new Vector3fImmutable(this.location.x,0,this.location.y));
|
||||
@@ -69,7 +75,7 @@ public class PathingUtilities {
|
||||
ArrayList<Node> path = new ArrayList<>();
|
||||
Node startNode = getClosestNode(start);
|
||||
Node goalNode = getClosestNode(goal);
|
||||
Node currentNode = startNode;
|
||||
Node currentNode = new Node(startNode);
|
||||
path.add(startNode);
|
||||
int attempts = 0;
|
||||
while(!currentNode.equals(goalNode) && attempts < 250){
|
||||
@@ -112,6 +118,7 @@ public class PathingUtilities {
|
||||
move(character,new Vector3fImmutable(path.get(0).location.x,0,path.get(0).location.y));
|
||||
path.remove(0);
|
||||
}
|
||||
character.isPathing = false;
|
||||
}
|
||||
public static void move(AbstractCharacter mob, Vector3fImmutable goal) {
|
||||
mob.destination = goal;
|
||||
|
||||
@@ -25,6 +25,7 @@ import engine.jobs.TrackJob;
|
||||
import engine.math.AtomicFloat;
|
||||
import engine.math.Bounds;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mobileAI.utilities.PathingUtilities;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.ErrorPopupMsg;
|
||||
@@ -127,7 +128,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
||||
|
||||
public ArrayList<CharacterRune> runes;
|
||||
|
||||
public ArrayList<Vector3fImmutable> navPath = new ArrayList<>();
|
||||
public ArrayList<PathingUtilities.Node> navPath = new ArrayList<>();
|
||||
public boolean isPathing = false;
|
||||
|
||||
public AbstractCharacter() {
|
||||
|
||||
Reference in New Issue
Block a user