L2JMobius

Strange behaviour of mobs

tabo8226 · 4 · 663

Offline tabo8226

  • Vassal
  • *
    • Posts: 2
Hi folks, I have strange behavior of mobs (https://youtu.be/7MyQRj5vj3s), they are not going straight towards me, but they are running back and forth for some reason.
I think it might be because of geodata but maybe you might have better clue?

I have latest commit of High Five and this is my settings for geodata currently and tried several different Geodatas
# =================================================================
#                             Geodata
# =================================================================

# Pathfinding options:
# 0 = Disabled
# 1 = Enabled using path node files.
# 2 = Enabled using geodata cells at runtime (recommended).
# Default: 2
PathFinding = 2

# Geodata file directory.
GeoDataPath = ./data/geodata/

# Pathnode file directory.
# Default: pathnode
PathnodePath = ./data/pathnode/

# Geodata editor save directory.
# Can set to ./data/geodata/ to replace existing files on save.
GeoEditPath = ./saves/

# Pathfinding array buffers configuration.
PathFindBuffers = 100x6;128x6;192x6;256x4;320x4;384x4;500x2

# Weight for nodes without obstacles far from walls.
LowWeight = 0.5

# Weight for nodes near walls.
MediumWeight = 2

# Weight for nodes with obstacles.
HighWeight = 3

# Angle paths will be more "smart", but in cost of higher CPU utilization.
AdvancedDiagonalStrategy = True

# Avoid pathing to nodes that are obstructed at any direction.
AvoidObstructedPathNodes = True

# Weight for diagonal movement. Used only with AdvancedDiagonalStrategy = True
# Default: LowWeight * sqrt(2)
DiagonalWeight = 0.707

# Maximum number of LOS postfilter passes, 0 will disable postfilter.
# Default: 3
MaxPostfilterPasses = 3

Any help is greatly appreciated :handshake:


Online Naker

  • Count
  • *****
    • Posts: 450
  • Coding Dreams
Hi folks, I have strange behavior of mobs (https://youtu.be/7MyQRj5vj3s), they are not going straight towards me, but they are running back and forth for some reason.
I think it might be because of geodata but maybe you might have better clue?

I have latest commit of High Five and this is my settings for geodata currently and tried several different Geodatas
# =================================================================
#                             Geodata
# =================================================================

# Pathfinding options:
# 0 = Disabled
# 1 = Enabled using path node files.
# 2 = Enabled using geodata cells at runtime (recommended).
# Default: 2
PathFinding = 2

# Geodata file directory.
GeoDataPath = ./data/geodata/

# Pathnode file directory.
# Default: pathnode
PathnodePath = ./data/pathnode/

# Geodata editor save directory.
# Can set to ./data/geodata/ to replace existing files on save.
GeoEditPath = ./saves/

# Pathfinding array buffers configuration.
PathFindBuffers = 100x6;128x6;192x6;256x4;320x4;384x4;500x2

# Weight for nodes without obstacles far from walls.
LowWeight = 0.5

# Weight for nodes near walls.
MediumWeight = 2

# Weight for nodes with obstacles.
HighWeight = 3

# Angle paths will be more "smart", but in cost of higher CPU utilization.
AdvancedDiagonalStrategy = True

# Avoid pathing to nodes that are obstructed at any direction.
AvoidObstructedPathNodes = True

# Weight for diagonal movement. Used only with AdvancedDiagonalStrategy = True
# Default: LowWeight * sqrt(2)
DiagonalWeight = 0.707

# Maximum number of LOS postfilter passes, 0 will disable postfilter.
# Default: 3
MaxPostfilterPasses = 3

Any help is greatly appreciated :handshake:
Code: [Select]
### Eclipse Workspace Patch 1.0
#P L2J_Mobius_CT_0_Interlude
Index: java/org/l2jmobius/gameserver/model/actor/Creature.java
===================================================================
--- java/org/l2jmobius/gameserver/model/actor/Creature.java (revision 19589)
+++ java/org/l2jmobius/gameserver/model/actor/Creature.java (working copy)
@@ -4637,8 +4637,11 @@
  distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
  }
 
+ final int pathfindingThreshold = isPlayer() ? 30 : 15;
+ final boolean dangerousFall = isMonster() && (Math.abs(dz) > 100) && (distance < 500);
+
  // Pathfinding checks.
- if (!directMove && (!isPlayer() || ((originalDistance - distance) > 30)) && !isAfraid() && !isInVehicle)
+ if (!directMove && (((originalDistance - distance) > pathfindingThreshold) || dangerousFall) && !isAfraid() && !isInVehicle)
  {
  // Path calculation -- overrides previous movement check
  move.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId(), isPlayer());



Online Mobius

  • Distinguished King
  • *****
    • Posts: 19654
Code: [Select]
### Eclipse Workspace Patch 1.0
#P L2J_Mobius_CT_0_Interlude
Index: java/org/l2jmobius/gameserver/model/actor/Creature.java
===================================================================
--- java/org/l2jmobius/gameserver/model/actor/Creature.java (revision 19589)
+++ java/org/l2jmobius/gameserver/model/actor/Creature.java (working copy)
@@ -4637,8 +4637,11 @@
  distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy);
  }
 
+ final int pathfindingThreshold = isPlayer() ? 30 : 15;
+ final boolean dangerousFall = isMonster() && (Math.abs(dz) > 100) && (distance < 500);
+
  // Pathfinding checks.
- if (!directMove && (!isPlayer() || ((originalDistance - distance) > 30)) && !isAfraid() && !isInVehicle)
+ if (!directMove && (((originalDistance - distance) > pathfindingThreshold) || dangerousFall) && !isAfraid() && !isInVehicle)
  {
  // Path calculation -- overrides previous movement check
  move.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId(), isPlayer());

Committed with https://gitlab.com/MobiusDevelopment/L2J_Mobius/-/commit/0e99665176afcd92483aca8aa7be5a912fac6adc