Addition of diagonal GeoEngine.

This commit is contained in:
MobiusDev
2018-09-24 02:31:21 +00:00
parent 0f36a0da37
commit 19e467cfbf
62 changed files with 3447 additions and 4122 deletions

View File

@@ -1,3 +1,41 @@
################################################
# L2j Geodata #
################################################
##############################################
GEODATA COMPENDIUM
##############################################
Comprehensive guide for geodata, by Tryskell and Hasha.
I - How to configure it
a - Prerequisites
b - Make it work
c - L2D format
II - Addendum
##############################################
I - How to configure it
##############################################
----------------------------------------------
a - Prerequisites
----------------------------------------------
* A 64bits Windows/Java JDK is a must-have to run server with geodata. Linux servers don't have the issue.
* The server can start (hardly) with -Xmx3000m. -Xmx4g is recommended.
----------------------------------------------
b - Make it work
----------------------------------------------
To make geodata working:
* unpack your geodata files into "/data/geodata" folder
* open "/config/GeoEngine.ini" with your favorite text editor and then edit following config:
- CoordSynchronize = 2
* If you do not use any geodata files, the server will automatically change this setting to -1.
----------------------------------------------
c - L2D format
----------------------------------------------
* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags.
* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times).
* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver.
* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones.

View File

@@ -1,3 +0,0 @@
################################################
# L2j pathnode #
################################################

View File

@@ -31,7 +31,7 @@ import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SkillTable;
import com.l2jmobius.gameserver.datatables.sql.NpcTable;
import com.l2jmobius.gameserver.datatables.sql.SpawnTable;
import com.l2jmobius.gameserver.geodata.GeoData;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.instancemanager.GrandBossManager;
import com.l2jmobius.gameserver.model.L2Skill;
import com.l2jmobius.gameserver.model.L2World;
@@ -621,7 +621,8 @@ public class Antharas extends Quest
final int rx = Rnd.get(175000, 179900);
final int ry = Rnd.get(112400, 116000);
final int rdt = ((_antharas.getX() - rx) * (_antharas.getX() - rx)) + ((_antharas.getY() - ry) * (_antharas.getY() - ry));
if (GeoData.getInstance().canSeeTarget(_antharas.getX(), _antharas.getY(), -7704, rx, ry, -7704))
final Location randomLocation = new Location(rx, ry, -7704);
if (GeoEngine.getInstance().canSeeTarget(_antharas, randomLocation))
{
if (rdt < dt)
{

View File

@@ -29,7 +29,7 @@ import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.datatables.SkillTable;
import com.l2jmobius.gameserver.geodata.GeoData;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.instancemanager.GrandBossManager;
import com.l2jmobius.gameserver.model.L2Effect;
import com.l2jmobius.gameserver.model.L2Object;
@@ -487,7 +487,7 @@ public class Baium extends Quest
{
if (obj instanceof L2Character)
{
if (((((L2Character) obj).getZ() < (npc.getZ() - 100)) && (((L2Character) obj).getZ() > (npc.getZ() + 100))) || !GeoData.getInstance().canSeeTarget(obj, npc))
if (((((L2Character) obj).getZ() < (npc.getZ() - 100)) && (((L2Character) obj).getZ() > (npc.getZ() + 100))) || !GeoEngine.getInstance().canSeeTarget(obj, npc))
{
continue;
}