[Update] NPC Navigation System is Nearly Complete (Full NavMesh Integration & Stop-Fix Implemented) #9545
eyes-and-brain
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
|
Integrating a navigation system using the LandSandBoat server-side NavMesh. Please note that this is a work-in-progress, as the character still frequently gets stuck on obstacles. Key Changes:
Current Issues:
navto.lua autonav.lua: |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
🚀 Overview
I am using a custom navigation system composed of two integrated parts:
Server-side script (navto.lua): Handles target searching (!navto npc/mob) via database query and broadcasts coordinates to the client.
Client-side Addon (autonav.lua): Intercepts the NAVTO_COORDS string and moves the character using setkey (W, A, D) inputs to simulate manual keyboard movement.
💡 The Core Intent: "High-Momentum" Movement
Unlike standard navigation scripts that stop to rotate, this version prioritizes forward velocity. The design goal is to keep the 'W' key pressed as long as possible.
Key Parameters in autonav.lua:
max_turn_threshold = 1.2 (68°): Keeps 'W' down even if significantly off-course.
turn_threshold = 0.5 (28°): Starts 'A' or 'D' steering while moving.
arrival_distance = 4.0: Large tolerance to prevent circling around the target.
I have identified three specific bottlenecks where I need expert advice:
Delayed Stuck Detection: stuck_check_interval is currently 8.0s. This causes the character to run against walls for too long. Reducing this value often triggers "false positives" during normal turns.
Inefficient Obstacle Marking: When stuck, it marks the grid ahead as blocked. However, since the grid_size is large (8.0), it often blocks out valid paths nearby.
W/A/D Oscillation: When turning, the character sometimes vibrates (oscillates) between 'A' and 'D' keys rapidly, which kills the forward momentum.
🛠️ Request for Assistance
Could you suggest improvements for the update_nav function? Specifically:
How to implement a "Back-up and retry" routine when a collision is detected?
Ways to improve the A pathfinding precision* without hitting the 300-iteration limit or causing lag.
Strategies to maintain the "Aggressive W-key" philosophy in narrow corridors.
I've attached/pasted the full source of both scripts for reference. Thank you for your support!
navto.lua:
autonav.lua:
Beta Was this translation helpful? Give feedback.
All reactions