OpenPerpetuum / PerpetuumServer

The Open Perpetuum Project's fork of the Perpetuum Standalone Server
https://openperpetuum.com
Other
44 stars 21 forks source link

NPC ignores some blocking on de-aggro (home state) #364

Open MikeJeffers opened 3 years ago

MikeJeffers commented 3 years ago

Notes from local testing/debug This results from the A* path not solving and falling back to this: https://github.com/OpenPerpetuum/PerpetuumServer/blob/Development/src/Perpetuum/Zones/NpcSystem/Npc.cs#L469 It might be possible it fails for 2 solvable edge cases:

  1. The "Open" PQ list is not properly sized and fills up and prematurely ends the search - this is more probable when the homerange of some NPCs is larger (some bosses, the Invader for which this bug was originally cited) https://github.com/OpenPerpetuum/PerpetuumServer/blob/Development/src/Perpetuum/PathFinders/AStarFinder.cs#L103
  2. The starting point, or ending point is blocked, and the path solver fails because it picked an invalid start or end point. Solve for the nearest walkable first, then run A*

Hope that helps anyone who might pick up this issue.