Skip to content

Core: Refactor PathFind#10334

Open
zach2good wants to merge 1 commit into
basefrom
zach2good/pathing_improvements
Open

Core: Refactor PathFind#10334
zach2good wants to merge 1 commit into
basefrom
zach2good/pathing_improvements

Conversation

@zach2good

@zach2good zach2good commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
  • I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have tested my code and the things my code has changed since the last commit in the PR and will test after any later commits.

What does this pull request do?

Replaces: #6117

From commit:

This commit does many things.

  • Remove "Wallhack" was a PathFind flag. Replace it with some stall-checking and teleport logic, and some force-despawn logic to curtail abusers. This will be sufficient for now until we really lock down exactly how retail handles this.
  • Retool PathFind to actually use the points given to it by NavMesh. It was using a "good enough" approach when travelling between points, which would lead to the entity dropping down holes, etc.
  • Add chunked pathing as an implementation detail of PathFind, allowing cheap and reliable long-distance pathing while only specifying two points.
  • Add LOS caching in MobController, so we're not constantly hammering ximesh with requests if nothing has changed.
  • Some other caching bits and bobs.
  • General refactoring and cleanup of PathFind, NavMesh, XiMesh.
  • Removing stray ligatures.
  • Add NO_STUCK_TELEPORT mobmod, to control the "I think I'm stuck, I'm just going to teleport straight to you now so you can't cheese" logic
  • Removed calls and bindings for "setCarefulPathing". We'll still use it for drawIn since that's based on rough math. We'll eventually (maybe) replace this sort of thing with navmesh::moveAlongSurface()
  • This will probably all work fine with the current navmeshes, but everything would be improved if you updated your navmeshes using the rebuild commands I added recently (Will soon update submodule)

Notes:

Adversarial chunking test case:

image

Garliage pathing before:

NOTE: We're getting close to all the pathing points, but we never actually hit them, leading to us (visually) dropping down holes, etc.
image

Garliage after:

NOTE: We actually hit the points we're given from the navmesh, and pathing LOOKS good, and is correct:
image

More Old:

image

More New:

NOTE: It's intended that we stop a little before our goal: model/combat radii, etc.
image

Degenerate cases/cheaters/cheesers:

In the interest of keeping mobs on-mesh at all times (because the mesh is correct!), we have some try-again and backoff logic. If these steps fail, the mob is going to teleport into melee range of you and try to beat your ass. In this case, I ran !up 20, waited a moment, then the pot came to get me. If you die/disappear etc. the mob will go back to roam, see it's off-mesh, and despawn.
image

Difficult pathing video:

2026-06-10.21-38-51.mp4

@LandSandBoat LandSandBoat deleted a comment from github-actions Bot Jun 16, 2026
@zach2good zach2good force-pushed the zach2good/pathing_improvements branch from 1d67af7 to 1641654 Compare June 16, 2026 11:29
@zach2good

zach2good commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Test Corpus:

  • Chunking: Long path across Bhaflau Thickets
    -- Info: Bhaflau Thickets
    -- Ruins (North of the map): 70.5, -32.2, 643.5
    -- Entrance to Al Zhabi: 383.7, -10.1, 10.0
    -- !pos 383.7 -10.1 10.0
    -- mob:pathTo(383.7, -10.1, 10.0)

    -- Wajaom Woodlands - Mamool Ja Beseiged advancing path
    -- !gotoid 16986363 (Mamook Entrance)
    -- !rebuildnavmesh
    -- !fafnir
    -- /follow
    -- (128 buffer) 1x degenerate case where they run down a tunnel and then back out, otherwise paths well
    -- (512 buffer) No degenerate cases
    -- mob:pathTo(610.29, -23.7, 356.1)

Interestingly: the degenerate cases only appear if you long-path the wrong way (south-north instead of north-south, etc.). If you do the retail-accurate direction there are no issues.

  • Pathing around high walkways in Sky (corners)
  • Pathing around high walkways in Sky (not skipping and running across ground/gap)
  • Pathing around holes in Garlaige Citadel (adherence to navmesh/path)
  • Find common locations where people cheese mobs (high value/difficult NMs)
  • Ensure draw-in still works and doesn't lead the mob to be in strange states (Minotaur)
  • Check-in on mobs that teleport
  • Check-in on worms, make sure they're OK
  • Check-in on summons, BST pets, BST jugs, dragoon wyverns
  • Check-in AGGRESSIVELY on Trusts, make sure they're OK, even though their pathing is simple
  • Check case in Obliette around "that little bridge" which has LOS blocking and thin walls
  • Halvung: Can cast Dia across the chasm, and have a troll path all the way around the bridges to come get you
  • Dragging mobs around the stairs and walkways in Dyna Jeuno
  • TODO: Lots and lots of testing

Trying to cheese:
!up 100 after engaging AV:
image

They're gonna teleport and come get you. This is an over-the-top test of what happens if you manage to find a place off-mesh where you think the mob will get stuck and you'll be allowed to wail on them. Nope. They're gonna find you.

@zach2good zach2good added the hold On hold, pending further action/info label Jun 16, 2026
@zach2good

Copy link
Copy Markdown
Contributor Author

Added hold tag until test corpus is completed

@zach2good zach2good force-pushed the zach2good/pathing_improvements branch from 1641654 to 1af1511 Compare June 16, 2026 12:50
This commit does _many_ things.

- Remove "Wallhack" was a PathFind flag. Replace it with some stall-checking and teleport logic, and some force-despawn logic to curtail abusers. This will be sufficient for now until we really lock down exactly how retail handles this.
- Retool PathFind to actually use the points given to it by NavMesh. It was using a "good enough" approach when travelling between points, which would lead to the entity dropping down holes, etc.
- Add chunked pathing as an implementation detail of PathFind, allowing cheap and reliable long-distance pathing while only specifying two points.
- Add LOS caching in MobController, so we're not constantly hammering ximesh with requests if nothing has changed.
- Some other caching bits and bobs.
- General refactoring and cleanup of PathFind, NavMesh, XiMesh.
- Removing stray ligatures.
- Add NO_STUCK_TELEPORT mobmod, to control the "I think I'm stuck, I'm just going to teleport straight to you now so you can't cheese" logic
- Removed calls and bindings for "setCarefulPathing". We'll still use it for drawIn since that's based on rough math. We'll eventually (maybe) replace this sort of thing with navmesh::moveAlongSurface()
- This will probably all work fine with the current navmeshes, but everything would be improved if you updated your navmeshes using the rebuild commands I added recently (Will soon update submodule)
@zach2good zach2good force-pushed the zach2good/pathing_improvements branch from 1af1511 to 9328947 Compare June 16, 2026 14:51
@Skold177

Copy link
Copy Markdown
Contributor

Faust around the teleporter might be a good check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold On hold, pending further action/info

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants