Page 1 of 1

Castle doors and path fiding.

Posted: Mon Aug 07, 2017 9:19 pm
by DjSt3rios
Hello all, I am having a strange "problem" with path finding.
While inside a castle, if I try to attack one of the doors, the path finding seems to be quite weird.
Here's a picture below to help you understand:

Image

This is quite essential because I am modding a server to be a faction server, Good vs Evil with capturing towns and castles. The problem is, I need to be really close to the door in order to attack, and I need to have a "weird line of sight", as you can see in the picture. I guess the problem is with path finding, and I can't seem to be able to find a decent solution. So far I tried increasing the offset of the search, tried to get the door location and add/subtract 20 to it's X/Y, no results either. Is there a workaround?

EDIT: Forgot to mention, I am using these settings:

Code: Select all

# ---------------------------------------------------------------------------
# Geodata
# ---------------------------------------------------------------------------

# GeoData options:
# 0 = GeoData and PathFinding OFF (default)
# 1 = GeoData is used to check Line Of Sight (LOS) targeting and 
#     L2Playable movement. You need to download files for data/geodata folder.
#     Monsters can pass walls but not aggro (no line of sight) through them.
# 2 = Full GeoData enabled. Includes PathFinding (requires also /data/pathnode 
#     files if CellPathFinding not enabled) and all character moves go through 
#     geodata checks (if a mob passes a wall, pathfinding didn't find a route 
#     but we allow attack and returning home).
#     Recommended server memory minimum 2 GB, rather 3 GB.
# Default: 0
GeoData = 2

# GeoData driver to use
# Default: com.l2jserver.gameserver.geoengine.NullDriver
#GeoDataDriver=com.l2jserver.gameserver.geoengine.NullDriver
#GeoDataDriver=com.l2j.geodriver.GeoDriver
GeoDataDriver=com.l2j.geodriver.GeoDriver

# Pathnode directory
# Default: data/pathnode
PathnodeDirectory = data/pathnode

# Cell-level pathfinding, produces more accurate routes but is (maybe 10x) heavier to calculate. Recommended for small servers at least.
# If False, pathnode files are used. Uses a max number of nodes in calculation which can be adjusted in the algorithm if it needs to be faster.
# Default: False
CellPathFinding = true

# 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

# 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

# Path debug function.
# Nodes known to pathfinder will be displayed as adena, constructed path as antidots.
# Number of the items show node cost * 10
# Potions display path after first stage filter
# Red potions - actual waypoints. Green potions - nodes removed by LOS postfilter
# This function FOR DEBUG PURPOSES ONLY, never use it on the live server !
DebugPath = False

# True = Loads GeoData buffer's content into physical memory.
# False = Does not necessarily imply that the GeoData buffer's content is not resident in physical memory.
# Default: True
ForceGeodata = True

# This setting controls Client <--> Server Player coordinates synchronization:
# -1 - Will synchronize only Z from Client --> Server. Default when no geodata.
# 1 - Synchronization Client --> Server only. Using this option (without geodata) makes it more difficult for players to bypass obstacles.
# 2 - Intended for geodata (at least with cell-level pathfinding, otherwise can you try -1).
# Server sends validation packet if client goes too far from server calculated coordinates.
# Default: -1
CoordSynchronize = 2
and I tried 2 different geodata packs.

Re: Castle doors and path fiding.

Posted: Tue Aug 08, 2017 9:39 pm
by HorridoJoho
Try this patch:
https://bitbucket.org/snippets/HorridoJoho/88Lq4

The usual door coordinates are the doors hinge coordinates, because that is currently the interaction point for attacking which is near a wall, this could cause problems. This patch moves the interaction point for doors into it's middle point, which possibly solves unreachable interaction points.

Re: Castle doors and path fiding.

Posted: Wed Aug 09, 2017 1:17 pm
by DjSt3rios
Thanks a lot, this indeed solved the problem! :clap: Now there's only a small issue, when walking near the door, the player stops and does not attack, but I think this won't be a hard fix, I will give it a go myself. Thanks again :)

Re: Castle doors and path fiding.

Posted: Thu Aug 10, 2017 5:15 pm
by HorridoJoho
Check this stuff again to see if this helps for door related movement and seeing problems. I updated it to possibly solve the movement problems as well.
https://bitbucket.org/snippets/HorridoJoho/88Lq4

Re: Castle doors and path fiding.

Posted: Fri Aug 11, 2017 3:37 pm
by u3games
HorridoJoho wrote: Thu Aug 10, 2017 5:15 pm Check this stuff again to see if this helps for door related movement and seeing problems. I updated it to possibly solve the movement problems as well.
https://bitbucket.org/snippets/HorridoJoho/88Lq4
Nice!

Re: Castle doors and path fiding.

Posted: Fri Aug 11, 2017 6:27 pm
by DjSt3rios
HorridoJoho wrote: Thu Aug 10, 2017 5:15 pm Check this stuff again to see if this helps for door related movement and seeing problems. I updated it to possibly solve the movement problems as well.
https://bitbucket.org/snippets/HorridoJoho/88Lq4
Thank you, I will give it a go. However my source seems to be quite outdated, I think I will download the latest version and reinstall the faction mod, so it might take a while. I will let you know though :)

Re: Castle doors and path fiding.

Posted: Tue Aug 22, 2017 10:40 pm
by DjSt3rios
HorridoJoho wrote: Thu Aug 10, 2017 5:15 pm Check this stuff again to see if this helps for door related movement and seeing problems. I updated it to possibly solve the movement problems as well.
https://bitbucket.org/snippets/HorridoJoho/88Lq4
Sorry for the late reply, had some personal problems. The attack issue is now gone, however there is still a small issue. If there is a straight path to the door, the character attacks from far away(more than it should), however, if the character needs walk over 2 or more locations, the range is correct. I don't want to trouble you more with this though, but if you do have some ideas on top of your head it would be nice. Thank you for all your help!

Re: Castle doors and path fiding.

Posted: Sat Jun 02, 2018 5:30 pm
by u3games
Notices? no add to repository?