Reverted back to l2j geoengine.

This commit is contained in:
MobiusDevelopment
2021-02-20 07:48:16 +00:00
parent 4c92ceeabc
commit dd0d74a8e6
794 changed files with 45461 additions and 70442 deletions

View File

@@ -1,6 +0,0 @@
@echo off
title L2D geodata converter
java -Xmx512m -cp ./../libs/* org.l2jmobius.tools.geodataconverter.GeoDataConverter
pause

View File

@@ -1,4 +0,0 @@
#! /bin/sh
java -Xmx512m -cp ../libs/*: org.l2jmobius.tools.geodataconverter.GeoDataConverter > log/stdout.log 2>&1

View File

@@ -1,10 +1,6 @@
# =================================================================
# Geodata
# =================================================================
# Because of real-time performance we are using geodata files only in
# diagonal L2D format now (using filename e.g. 22_16.l2d).
# L2D geodata can be obtained by conversion of existing L2J or L2OFF geodata.
# Launch "GeoDataConverter.bat/sh" and follow instructions to start the conversion.
# Specifies the path to geodata files. For example, when using geodata files located
# at different folder/harddrive ("C:/Program Files/Lineage II/system/geodata/"), default: ./data/geodata/
@@ -16,16 +12,6 @@ GeoDataPath = ./data/geodata/
# -1 - Old system: will synchronize Z only
CoordSynchronize = 2
# =================================================================
# Path checking
# =================================================================
# Line of sight start at X percent of the character height, default: 75
PartOfCharacterHeight = 75
# Maximum height of an obstacle, which can exceed the line of sight, default: 32
MaxObstacleHeight = 32
# =================================================================
# Path finding
# =================================================================
@@ -37,22 +23,18 @@ PathFinding = true
# Pathfinding array buffers configuration, default: 100x6;128x6;192x6;256x4;320x4;384x4;500x2
PathFindBuffers = 100x6;128x6;192x6;256x4;320x4;384x4;500x2
# Base path weight, when moving from one node to another on axis direction, default: 10
BaseWeight = 10
# Weight for nodes without obstacles far from walls
LowWeight = 0.5
# Path weight, when moving from one node to another on diagonal direction, default: BaseWeight * sqrt(2) = 14
DiagonalWeight = 14
# Weight for nodes near walls
MediumWeight = 2
# When movement flags of target node is blocked to any direction, multiply movement weight by this multiplier.
# This causes pathfinding algorithm to avoid path construction exactly near an obstacle, default: 10
ObstacleMultiplier = 10
# Weight for nodes with obstacles
HighWeight = 3
# Weight of the heuristic algorithm, which is giving estimated cost from node to target, default: 20
# For proper function must be higher than BaseWeight and/or DiagonalWeight.
HeuristicWeight = 20
# Maximum number of generated nodes per one path-finding process, default 3500
MaxIterations = 3500
# Weight for diagonal movement.
# Default: LowWeight * sqrt(2)
DiagonalWeight = 0.707
# =================================================================
# Other

View File

@@ -55,11 +55,12 @@ public class AdminGeodata implements IAdminCommandHandler
final int worldX = activeChar.getX();
final int worldY = activeChar.getY();
final int worldZ = activeChar.getZ();
final int geoX = GeoEngine.getGeoX(worldX);
final int geoY = GeoEngine.getGeoY(worldY);
final int geoX = GeoEngine.getInstance().getGeoX(worldX);
final int geoY = GeoEngine.getInstance().getGeoY(worldY);
if (GeoEngine.getInstance().hasGeoPos(geoX, geoY))
{
BuilderUtil.sendSysMessage(activeChar, "WorldX: " + worldX + ", WorldY: " + worldY + ", WorldZ: " + worldZ + ", GeoX: " + geoX + ", GeoY: " + geoY + ", GeoZ: " + GeoEngine.getInstance().getHeight(geoX, geoY, worldZ));
BuilderUtil.sendSysMessage(activeChar, "WorldX: " + worldX + ", WorldY: " + worldY + ", WorldZ: " + worldZ + ", GeoX: " + geoX + ", GeoY: " + geoY + ", GeoZ: " + GeoEngine.getInstance().getHeight(worldX, worldY, worldZ));
}
else
{
@@ -72,8 +73,9 @@ public class AdminGeodata implements IAdminCommandHandler
final int worldX = activeChar.getX();
final int worldY = activeChar.getY();
final int worldZ = activeChar.getZ();
final int geoX = GeoEngine.getGeoX(worldX);
final int geoY = GeoEngine.getGeoY(worldY);
final int geoX = GeoEngine.getInstance().getGeoX(worldX);
final int geoY = GeoEngine.getInstance().getGeoY(worldY);
if (GeoEngine.getInstance().hasGeoPos(geoX, geoY))
{
BuilderUtil.sendSysMessage(activeChar, "WorldX: " + worldX + ", WorldY: " + worldY + ", WorldZ: " + worldZ + ", GeoX: " + geoX + ", GeoY: " + geoY + ", GeoZ: " + GeoEngine.getInstance().getHeight(worldX, worldY, worldZ));
@@ -133,7 +135,7 @@ public class AdminGeodata implements IAdminCommandHandler
{
final int x = ((activeChar.getX() - World.MAP_MIN_X) >> 15) + World.TILE_X_MIN;
final int y = ((activeChar.getY() - World.MAP_MIN_Y) >> 15) + World.TILE_Y_MIN;
BuilderUtil.sendSysMessage(activeChar, "GeoMap: " + x + "_" + y);
BuilderUtil.sendSysMessage(activeChar, "GeoMap: " + x + "_" + y + " (" + ((x - World.TILE_ZERO_COORD_X) * World.TILE_SIZE) + "," + ((y - World.TILE_ZERO_COORD_Y) * World.TILE_SIZE) + " to " + ((((x - World.TILE_ZERO_COORD_X) * World.TILE_SIZE) + World.TILE_SIZE) - 1) + "," + ((((y - World.TILE_ZERO_COORD_Y) * World.TILE_SIZE) + World.TILE_SIZE) - 1) + ")");
break;
}
}

View File

@@ -18,18 +18,18 @@ package handlers.admincommandhandlers;
import java.util.List;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.geoengine.GeoEnginePathfinding;
import org.l2jmobius.gameserver.geoengine.pathfinding.AbstractNodeLoc;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.util.BuilderUtil;
public class AdminPathNode implements IAdminCommandHandler
{
private static final String[] ADMIN_COMMANDS =
{
"admin_path_find",
"admin_path_find"
};
@Override
@@ -37,30 +37,29 @@ public class AdminPathNode implements IAdminCommandHandler
{
if (command.equals("admin_path_find"))
{
if (!Config.PATHFINDING)
{
BuilderUtil.sendSysMessage(activeChar, "PathFinding is disabled.");
return true;
}
if (activeChar.getTarget() != null)
{
final List<Location> path = GeoEngine.getInstance().findPath(activeChar.getX(), activeChar.getY(), (short) activeChar.getZ(), activeChar.getTarget().getX(), activeChar.getTarget().getY(), (short) activeChar.getTarget().getZ(), activeChar.getInstanceId());
final List<AbstractNodeLoc> path = GeoEnginePathfinding.getInstance().findPath(activeChar.getX(), activeChar.getY(), (short) activeChar.getZ(), activeChar.getTarget().getX(), activeChar.getTarget().getY(), (short) activeChar.getTarget().getZ(), activeChar.getInstanceId());
if (path == null)
{
BuilderUtil.sendSysMessage(activeChar, "No route found or pathfinding disabled.");
BuilderUtil.sendSysMessage(activeChar, "No Route!");
return true;
}
else
for (AbstractNodeLoc a : path)
{
for (Location point : path)
{
BuilderUtil.sendSysMessage(activeChar, "x:" + point.getX() + " y:" + point.getY() + " z:" + point.getZ());
}
BuilderUtil.sendSysMessage(activeChar, "x:" + a.getX() + " y:" + a.getY() + " z:" + a.getZ());
}
}
else
{
activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
BuilderUtil.sendSysMessage(activeChar, "No Target!");
}
}
else
{
return false;
}
return true;
}