Skip to content

add avoidObstacles system#4190

Merged
alisonrag merged 38 commits intomasterfrom
reworkPathAvoid
Mar 28, 2026
Merged

add avoidObstacles system#4190
alisonrag merged 38 commits intomasterfrom
reworkPathAvoid

Conversation

@Henrybk
Copy link
Copy Markdown
Contributor

@Henrybk Henrybk commented Mar 20, 2026

Ready for testing / review

Reworked my old plugin to use config.txt key, dynamic route_step for obstacle avoidance, rich configuration.

Still needs more work

V1: https://youtu.be/82owECOWyXA

V2: https://youtu.be/3H4T1wneXaE

V3: https://www.youtube.com/watch?v=TeB6qx2pg5c

V4: https://www.youtube.com/watch?v=cMHPemgh4iw

V5: https://www.youtube.com/watch?v=QROjEMqUw1k&t=12s

V6: https://www.youtube.com/watch?v=ik8CJaTEbtQ

This is actually making me rework a bit of the pathfinding algorithmn, the route logic and the position calculation logic.

Implemented a new function to calculate the character position, this are the test results:

This first test is the comparison between the prediction of old and new methods at the movement a movement packet arrives, so it is basically a check to see if we are calculating right.
The old function had a 75.53% correctness rate over 2624 moves, with an average error of 0.245 cells
The new one has a 99.77% correctness rate with an average of 0.002 cells of error

Character Moves
---------------
Events processed              2624
Avg walk speed               0.150

Exact Match Summary
-------------------
Old exact                      1982 (75.53%)
New exact                      2618 (99.77%)
Both exact                     1978 (75.38%)
Both wrong                     2 (0.08%)
Old exact only                 4 (0.15%)
New exact only                 640 (24.39%)

Block Distance Summary
----------------------
Old closer                     4 (0.15%)
New closer                     640 (24.39%)
Equal distance                 1980 (75.46%)
Avg old block distance         0.245
Avg new block distance         0.002

Adjusted Block Distance Summary
-------------------------------
Old closer                     4 (0.15%)
New closer                     640 (24.39%)
Equal distance                 1980 (75.46%)
Avg old adjusted distance      0.300
Avg new adjusted distance      0.002

And this is the same comparison, but made at the movement a movement packet is sent, instead of when it arrives, so we are kinda predicting the future here, so it won't be exact.
Old one had a 15.23% match rate with avg error of 0.860 cells
New one has a 57.31% match rate of avg error of 0.427 cells

Route SetMove
-------------
Events processed              2600
Avg walk speed               0.150

Exact Match Summary
-------------------
Old exact                      396 (15.23%)
New exact                      1490 (57.31%)
Both exact                     396 (15.23%)
Both wrong                     1110 (42.69%)
Old exact only                 0 (0.00%)
New exact only                 1094 (42.08%)

Block Distance Summary
----------------------
Old closer                     0 (0.00%)
New closer                     1127 (43.35%)
Equal distance                 1473 (56.65%)
Avg old block distance         0.860
Avg new block distance         0.427

Adjusted Block Distance Summary
-------------------------------
Old closer                     0 (0.00%)
New closer                     1127 (43.35%)
Equal distance                 1473 (56.65%)
Avg old adjusted distance      1.057
Avg new adjusted distance      0.514

@Henrybk Henrybk marked this pull request as draft March 20, 2026 01:01
@Henrybk Henrybk changed the title Rework NewAStarAvoid Rework NewAStarAvoid to avoidObstacles Mar 20, 2026
@Henrybk Henrybk changed the title Rework NewAStarAvoid to avoidObstacles add avoidObstacles system Mar 23, 2026
@Henrybk Henrybk marked this pull request as ready for review March 23, 2026 12:24
Henrybk added 12 commits March 25, 2026 22:27
- Consolidate position calculation utilities and introduce a configurable prediction delay via `ai_route_position_prediction_delay`.
- Implement a wait mechanism in the attack loop for targets predicted to enter range or line-of-sight shortly.
- Refine meeting position calculations with improved reachability lookups and support for `route_avoidWalls`.
- Fix boundary conditions in `get_lockMap_cell` to prevent selecting cells on the map edge.
- Clean up redundant path initialization when loading maps or using skills.
- Add specific avoidance configuration for monster 1368 and update portal penalty settings.
- Reduce AI route adjustment timeouts for more frequent path updates.
- Fine-tune position prediction, target wait delays, and meeting position reachability lookups.
@alisonrag alisonrag merged commit cc7576b into master Mar 28, 2026
9 checks passed
@alisonrag alisonrag deleted the reworkPathAvoid branch March 28, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants