Browse Source

patrol delay fine tuning

master
FatBoy-DOTC 1 year ago
parent
commit
eb9a1143e4
  1. 12
      src/engine/ai/MobileFSM.java
  2. 2
      src/engine/server/MBServerStatics.java

12
src/engine/ai/MobileFSM.java

@ -168,18 +168,16 @@ public class MobileFSM { @@ -168,18 +168,16 @@ public class MobileFSM {
}
private static void Patrol(Mob mob) {
//make sure mob is out of combat stance
if(mob.stopPatrolTime == 0) {
mob.stopPatrolTime = System.currentTimeMillis();
return;
}
if (mob.isCombat() && mob.getCombatTarget() == null) {
mob.setCombat(false);
UpdateStateMsg rwss = new UpdateStateMsg();
rwss.setPlayer(mob);
DispatchMessage.sendToAllInRange(mob, rwss);
}
if (mob.isMoving() == true) {
//early exit for a mob who is already moving to a patrol point
//while mob moving, update lastPatrolTime so that when they stop moving the 10 second timer can begin
mob.stopPatrolTime = System.currentTimeMillis();
return;
}
if (mob.stopPatrolTime + (MBServerStatics.AI_PATROL_DIVISOR * 1000) > System.currentTimeMillis())
//early exit while waiting to patrol again
return;
@ -190,6 +188,7 @@ public class MobileFSM { @@ -190,6 +188,7 @@ public class MobileFSM {
mob.patrolPoints = barracks.patrolPoints;
} else{
randomGuardPatrolPoint(mob);
mob.stopPatrolTime = System.currentTimeMillis() + (MBServerStatics.AI_PATROL_DIVISOR * 1000);
return;
}
}
@ -199,6 +198,7 @@ public class MobileFSM { @@ -199,6 +198,7 @@ public class MobileFSM {
mob.destination = mob.patrolPoints.get(mob.lastPatrolPointIndex);
mob.lastPatrolPointIndex += 1;
MovementUtilities.aiMove(mob, mob.destination, true);
mob.stopPatrolTime = System.currentTimeMillis() + (MBServerStatics.AI_PATROL_DIVISOR * 1000);
if(mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardCaptain.ordinal()){
for (Entry<Mob, Integer> minion : mob.siegeMinionMap.entrySet()) {
//make sure mob is out of combat stance

2
src/engine/server/MBServerStatics.java

@ -651,7 +651,7 @@ public class MBServerStatics { @@ -651,7 +651,7 @@ public class MBServerStatics {
public static int AI_RECALL_RANGE = 400;
public static int AI_PULSE_MOB_THRESHOLD = 200;
public static int AI_THREAD_SLEEP = 1000;
public static int AI_PATROL_DIVISOR = 10;
public static int AI_PATROL_DIVISOR = 15;
public static int AI_POWER_DIVISOR = 20;
public static int AI_PET_HEEL_DISTANCE = 10;
public static int AI_PATROL_RADIUS = 60;

Loading…
Cancel
Save