A Project for Chronicle 4 based on L2JServer.


    Geodata question

    Share
    avatar
    Karakan

    Posts : 471
    Join date : 2013-10-04

    Geodata question

    Post  Karakan on 16th October 2017, 14:08


    Is there any possibility to implement L2DC's or even L2JServer's geo engine to our project ?

    NPCs can't aggro through walls which is nice but they still can run/cast through them.

    This is a big problem especially on Sieges.


    I know you don't have much time to code stuff lately DnR.
    But please consider this option as it will greatly improve the projects quality even more.


    Thanks and regards. Cool
    avatar
    DnR
    Admin
    Admin

    Posts : 1053
    Join date : 2012-12-03

    Re: Geodata question

    Post  DnR on 16th October 2017, 20:47

    It's true I don't have much time to do such a massive rework.
    However, if monsters are the only problem so far, we can inject some code checks similar to L2j.
    It's mostly an AI problem that monsters attack through walls, so some good checks might solve the issue.

    Thanks for the precious feedback. I'll try to minimize the problem as much as possible.

    Regards
    DnR
    avatar
    Karakan

    Posts : 471
    Join date : 2013-10-04

    Re: Geodata question

    Post  Karakan on 18th October 2017, 18:23

    It would be great if it could effect Npc's too. (siege guards especially)

    Thanks for considering it.
    Can't go wrong with it i bet. Cool

    Flopix

    Posts : 18
    Join date : 2014-02-28

    Re: Geodata question

    Post  Flopix on 2nd December 2017, 16:21

    99% problems in method L2Character.moveToLocation

    some fixs

    fix 1
    Code:

    ...
          if ((Config.GEODATA > 0) && !isFlying() // currently flying characters not checked
          && !(this instanceof L2NpcWalkerInstance) && !(this instanceof L2BoatInstance) && (!isInsideZone(ZONE_WATER) || isInsideZone(ZONE_SIEGE)))
             // swimming also not checked - but distance is limited
          {
             final boolean isInBoat = (this instanceof L2PcInstance) && ((L2PcInstance) this).isInBoat();
             if (isInBoat)
             {
                m.disregardingGeodata = true;
             }
             
             double originalDistance = distance;
             int originalX = x;
             int originalY = y;
             int originalZ = z;
             int gtx = (originalX - L2World.MAP_MIN_X) >> 4;
             int gty = (originalY - L2World.MAP_MIN_Y) >> 4;
             
             // ------------- start fix -------------
             if ((this instanceof L2Attackable) && ((L2Attackable) this).isReturningToSpawnPoint() && (originalDistance > 2000))
             {
                // если моб в режиме возвращения на точку спауна и расстояние больше 2000 то делаем телепорт
                // if the mob is in the mode of returning to the spawn point and the distance is more than 2000 then we make a teleport
                if (this instanceof L2GrandBossInstance)
                   _log.info(this.toString() + " return to spawn");
                broadcastPacket(new MagicSkillUser(this, this, 2036, 1, 500, 0));
                teleToLocation(targetX, targetY, targetZ);
                return;
             }
             // ------------- end fix -------------
    ...

    fix 2
    Code:

    ...
                   m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, this instanceof L2PlayableInstance);
                   if ((m.geoPath == null) || (m.geoPath.size() < 1)) // No path found < 2
                   {
                      if (this.isGM())
                      {
                         this.sendMessage("moveToLocation: error build path");
                      }
                      
                      // Even though there's no path found (remember geonodes aren't perfect),
                      // the mob is attacking and right now we set it so that the mob will go
                      // after target anyway, if dz is small enough. Summons will follow their masters no matter what.
                      if ((this instanceof L2PcInstance) || (!(this instanceof L2PlayableInstance) && !(this instanceof L2MinionInstance) && (Math.abs(z - curZ) > 140)) || ((this instanceof L2Summon)
                         && !((L2Summon) this).getFollowStatus()))
                      {
                         getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
                         // ------------- start fix -------------
                         if ((this instanceof L2Attackable) && ((L2Attackable) this).isReturningToSpawnPoint())
                         {
                            // если моб в режиме возвращения на точку спауна и путь не найден то делаем телепорт
                            // if the mob is in the mode of returning to the spawn point and the path is not found, then make a teleport
                            teleToLocation(targetX, targetY, targetZ);
                         }
                         // ------------- end fix -------------
                         return;
                      }
                      
                      // ------------- start fix -------------
                      if ((this instanceof L2Summon) || (this instanceof L2PetInstance))
                      {
                         //чтобы суммон не проходил сквозь стены во время атаки
                         // so that the summon does not pass through the walls during the attack
                         if (this.getAI().getIntention() != CtrlIntention.AI_INTENTION_FOLLOW)
                         {
                            ((L2Summon)this).setFollowStatus(true);
                            return;
                         }
                      }
                      
                      if ((this instanceof L2Attackable) && this.getAI().getIntention() == CtrlIntention.AI_INTENTION_ACTIVE)
                      {
                         // если моб ничем не занят но пытается пройти сквозь стену не даем этого ему сделать
                         // if the mob is not busy at all but tries to go through the wall do not let it do it
                         getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
                         return;// test
                      }
                      // ------------- end fix -------------

                      m.disregardingGeodata = true;
                      x = originalX;
                      y = originalY;
                      z = originalZ;
                      distance = originalDistance;
    ...

    Flopix

    Posts : 18
    Join date : 2014-02-28

    Re: Geodata question

    Post  Flopix on 2nd December 2017, 16:47

    fix3
    Code:

    // Pathfinding checks. Only when geodata setting is 2, the LoS check gives shorter result
             // than the original movement was and the LoS gives a shorter distance than 2000
             // This way of detecting need for pathfinding could be changed.
             if ((Config.GEODATA == 2) && ((originalDistance - distance) > 30) && (distance < 2000) && !isAfraid())
             {
                // Path calculation
                // Overrides previous movement check

                // ------- fix_start -------            
                // test find path for mobs not only isInCombat
                if (((this instanceof L2PlayableInstance) && !isInBoat) || isInCombat() || (this instanceof L2MinionInstance) || (this instanceof L2Attackable))
                {
                   // проверяем чтобы конечная точка имела корректную высоту
                   // check that the endpoint has the correct height
                   Integer checkZ = GeoData.getInstance().getNextLowerZByCoordEx(originalX, originalY, originalZ + 50);
                   if ((checkZ == null) || (checkZ < (targetZ - 150)))
                   {
                      if (this.isGM())
                      {
                         this.sendMessage("moveToLocation: calc end point incorrect");
                      }
                      originalX = targetX;
                      originalY = targetY;
                      originalZ = targetZ;
                      checkZ = GeoData.getInstance().getNextLowerZByCoordEx(originalX, originalY, originalZ + 50);
                      if (checkZ == null)
                      {
                         if (this.isGM())
                         {
                            this.sendMessage("moveToLocation: end point incorrect");
                         }
                         originalX = x;
                         originalY = y;
                         originalZ = z;
                         checkZ = GeoData.getInstance().getNextLowerZByCoordEx(originalX, originalY, originalZ + 50);
                         if (checkZ == null)
                         {
                            if (this.isGM())
                            {
                               this.sendMessage("moveToLocation: to first wall end point incorrect, move abort");
                            }
                            return;
                         }
                      }
                   }
                   // ------- fix_end -------

    Flopix

    Posts : 18
    Join date : 2014-02-28

    Re: Geodata question

    Post  Flopix on 2nd December 2017, 16:49

    GeoData.java

    Code:

       public Integer getNextLowerZByCoordEx(int x, int y, int z)
       {
          return getNextLowerZEx(getGeoX(x), getGeoY(y), z);
       }

       public Integer getNextLowerZEx(int geoX, int geoY, int z)
       {
          //идиотский велосипед из за того что геодвижек при отсутствии нижнего слоя возвращает переданное z
          // an idiotic bike because of the fact that in the absence of the bottom layer of the geodetics returns the transmitted z
          int z1 = _driver.getNextLowerZ(geoX, geoY, z - 1);
          int z2 = _driver.getNextLowerZ(geoX, geoY, z - 2);
          //если оба результата равны  значит ниже слой точно есть
          if (z1 == z2)
          {
             return z1;
          }

          return null;
       }
    avatar
    Karakan

    Posts : 471
    Join date : 2013-10-04

    Re: Geodata question

    Post  Karakan on 3rd December 2017, 17:57

    First of all thanks for your contribution.
    Please post everything in diff format so people can add and test it easier.

    Regards Cool
    avatar
    improvise

    Posts : 10
    Join date : 2017-07-21

    Re: Geodata question

    Post  improvise on 7th December 2017, 18:56

    The NPC's ability to pass and shoot through walls actually makes any server launch to a wider audience not possible. This is a very big problem and I really hope its at least a partial solution. Even if it is some radical method. I tried to put different Geodata but the result is always the same. Also known problem is that the monsters spawns under the textures and sometimes it seems that they are just in a small amount, but in fact they are underground


    Last edited by improvise on 9th October 2018, 12:13; edited 1 time in total
    avatar
    Karakan

    Posts : 471
    Join date : 2013-10-04

    Re: Geodata question

    Post  Karakan on 7th December 2017, 21:34

    Jeah bugged geodata is what kills most servers.
    Thats still why L2Off files are still better then L2Java.


    My main problem is the things posted above (mobs shooting/running through walls)
    Also a major part of sieges are broken cause of that.

    Example : Npc Archer Siege Guards^^

    Well we can't do much other then wait for a reply from DnR.
    But....I haven't heard from him for a while now. silent

    Flopix

    Posts : 18
    Join date : 2014-02-28

    Re: Geodata question

    Post  Flopix on 9th December 2017, 23:13

    Mobs don't shoot through walls.
    Mobs move to wall and shoot from there Smile
    L2 Client can not display the mobs in the wall, it displays them nearby, but it's not.
    avatar
    Karakan

    Posts : 471
    Join date : 2013-10-04

    Re: Geodata question

    Post  Karakan on 10th December 2017, 15:04

    Mobs don't shoot through walls.

    Of course they can.

    Mobs move to wall and shoot from there.

    That depends on cast range. Rolling Eyes

    confejulian

    Posts : 56
    Join date : 2016-08-27

    Re: Geodata question

    Post  confejulian on 17th December 2017, 23:02

    Karakan wrote:
    Mobs don't shoot through walls.

    Of course they can.

    Mobs move to wall and shoot from there.

    That depends on cast range. Rolling Eyes

    Karake, did u had tested this fixs?
    avatar
    Karakan

    Posts : 471
    Join date : 2013-10-04

    Re: Geodata question

    Post  Karakan on 18th December 2017, 02:57

    I won't add that "mess" without a proper diff. patch Smile

    confejulian

    Posts : 56
    Join date : 2016-08-27

    Re: Geodata question

    Post  confejulian on 19th December 2017, 01:40

    Karakan wrote:I won't add that "mess" without a proper diff. patch Smile

    Yes, that's why I was asking, in case you had it ordered. Thank You.

    SunRise

    Posts : 12
    Join date : 2018-01-10

    Re: Geodata question

    Post  SunRise on 10th January 2018, 22:53

    Hello, dear friends!

    Are there any suggestions about mobs hiding in walls and spawning in ground?
    Also got problems with mobs walking in walls while I try to farm them with polearm.

    Red message in system chat means that target is unseen.

    PS: I'm using geodata from this forum.




    Thank you very much for this project!
    avatar
    Karakan

    Posts : 471
    Join date : 2013-10-04

    Re: Geodata question

    Post  Karakan on 10th January 2018, 23:37

    Mobs walking inside walls are because they are trying to circle around the player.
    And because there is no "canMoveToLocation" check.

    Either decrease the rate they do (circle)....or completly remove it from core.

    Regards

    SunRise

    Posts : 12
    Join date : 2018-01-10

    Re: Geodata question

    Post  SunRise on 11th January 2018, 09:58

    Dear Karakan!
    Thanks for reply.

    I'm not strong in java, but I have good skills in developing.
    So can I have your skype or other messenger in order to ask some questions (about java compilation and IDE). Or can I find this information in forum?
    avatar
    Karakan

    Posts : 471
    Join date : 2013-10-04

    Re: Geodata question

    Post  Karakan on 11th January 2018, 17:17

    Thats offtopic but...


    http://acis.i-live.eu/index.php?topic=78.0

    Check the first post there.


    Or just google.
    There are tons of forums how to checkout l2jserver and compile it using eclipse.

    confejulian

    Posts : 56
    Join date : 2016-08-27

    Re: Geodata question

    Post  confejulian on 11th January 2018, 19:30

    Karakan wrote:Mobs walking inside walls are because they are trying to circle around the player.
    And because there is no "canMoveToLocation" check.

    Either decrease the rate they do (circle)....or completly remove it from core.

    Regards

    do u tell me if i change the attack range to 0 i can solve this problem?
    avatar
    Maneco2

    Posts : 72
    Join date : 2015-01-11
    Age : 27
    Location : United States

    Geodata question

    Post  Maneco2 on 12th January 2018, 19:38

    @SunRise C4 Branch geofiles no have any issue/report at this time.
    And about core engine geodata, better for now is acis engine, but acis use only L2D geofiles, better improved patch and made always L2J files. But too have one converter, acis have one converter L2J geofiles to L2D geofiles.
    avatar
    Karakan

    Posts : 471
    Join date : 2013-10-04

    Re: Geodata question

    Post  Karakan on 12th January 2018, 20:20

    confejulian wrote:
    Karakan wrote:Mobs walking inside walls are because they are trying to circle around the player.
    And because there is no "canMoveToLocation" check.

    Either decrease the rate they do (circle)....or completly remove it from core.

    Regards

    do u tell me if i change the attack range to 0 i can solve this problem?


    You can disable it by


    1. Openening "\java\net\sf\l2j\gameserver\ai\L2AttackableAI.java"

    2. and deleting this part...



    Code:

          // **************************************************
          // Else, if this is close enough for physical attacks
          // In case many mobs are trying to hit from same place, move a bit,
          // circling around the target
          if (Rnd.nextInt(100) <= 33) // check it once per 3 seconds
          {
             for (L2Object nearby : _actor.getKnownList().getKnownCharactersInRadius(20))
             {
                if ((nearby instanceof L2Attackable) && (nearby != _mostHatedAnalysis.character))
                {
                   int diffx = Rnd.get(combinedCollision, combinedCollision + 40);
                   if (Rnd.get(10) < 5)
                   {
                      diffx = -diffx;
                   }
                   
                   int diffy = Rnd.get(combinedCollision, combinedCollision + 40);
                   if (Rnd.get(10) < 5)
                   {
                      diffy = -diffy;
                   }
                   
                   moveTo(_mostHatedAnalysis.character.getX() + diffx, _mostHatedAnalysis.character.getY() + diffy, _mostHatedAnalysis.character.getZ());
                   return;
                }
             }
          }


    SunRise

    Posts : 12
    Join date : 2018-01-10

    Re: Geodata question

    Post  SunRise on 13th January 2018, 12:42

    Flopix wrote:GeoData.java

    Code:

     public Integer getNextLowerZByCoordEx(int x, int y, int z)
     {
     return getNextLowerZEx(getGeoX(x), getGeoY(y), z);
     }

     public Integer getNextLowerZEx(int geoX, int geoY, int z)
     {
     //идиотский велосипед из за того что геодвижек при отсутствии нижнего слоя возвращает переданное z
     // an idiotic bike because of the fact that in the absence of the bottom layer of the geodetics returns the transmitted z
     int z1 = _driver.getNextLowerZ(geoX, geoY, z - 1);
     int z2 = _driver.getNextLowerZ(geoX, geoY, z - 2);
     //если оба результата равны  значит ниже слой точно есть
     if (z1 == z2)
     {
     return z1;
     }

     return null;
     }

    Tried this "fix", so practically all mobs got underground.

    confejulian

    Posts : 56
    Join date : 2016-08-27

    Re: Geodata question

    Post  confejulian on 22nd January 2018, 20:00

    Thank you a lot Karaken. You are really cool.
    avatar
    Karakan

    Posts : 471
    Join date : 2013-10-04

    Re: Geodata question

    Post  Karakan on 22nd January 2018, 23:31

    @confejulian

    You're welcome. Cool
    avatar
    Karakan

    Posts : 471
    Join date : 2013-10-04

    Re: Geodata question

    Post  Karakan on 12th February 2018, 14:34

    @SunRise C4 Branch geofiles no have any issue/report at this time.
    And about core engine geodata, better for now is acis engine, but acis use only L2D geofiles, better improved patch and made always L2J files. But too have one converter, acis have one converter L2J geofiles to L2D geofiles.

    Few reports...

    Did some tests on acis r360 yesterday.

    Same stuff happens there too...
    Even if their pathnode engine works a bit better, mobs still can run through walls.


    What I like is that they added a function that forces monsters walking back to
    spawn location ,when they reach a wall.
    This prevents them from getting stuck most times.


    Overall it would be a slightly improvement if we implement the acis geo engine.


    Sponsored content

    Re: Geodata question

    Post  Sponsored content


      Current date/time is 23rd October 2018, 16:36