Releases: blurite/pathfinder
Branchless Step Validator
fix: check start==end coord before collision for los
Fixes a priority issue where if a player is standing on a clipping loc, they should still have line of sight to the entity underneath it.
Line of sight/walk now respect BLOCK_PLAYERS flag
fix: line of sight & walk now checks for BLOCK_PLAYERS flag update version to 2.4.5
Zoneflags default set to -1 if zone isn't allocated
2.4.4 fix: flags.get(coord) now defaults to -1 instead of 0 if the zone arr…
fix: findClosestApproachPoint should not return false if the path is empty
2.4.3 fix: findClosestApproachPoint should not return false if the path is …
StepValidator performance
Rework the step validator to function more like the pathfinder itself, this provides about a 2.5x boost in performance over the previous implementation
Add outdoors strategy
feat: add an outdoors strategy
refactor: rename roofbound strategy to indoors
refactor: rename swim strategy to blocked
fix: fix a comment in ZoneFlags indicating it requires 135mb to allocate - this is actually not true, checked with a profiler and it's exactly half that instead.
Update version to 2.4.1
Small fixes, pathfinder renamed
- the default flag for if a zone has no flags is now -1 instead of 0. this prevents the pathfinder from moving through it
- remove PathFinder interface and rename SmartPathFinder to PathFinder
- set default distance value to just 999 to avoid overflow in bitpacking
- set default destination width and height to 1, as 0 is invalid. all elements are at least 1 tile in size
Micro-optimizations (16-21% performance improvement across the board)
- revert latest change of trying to cut down on array resets, as the overhead this causes with its checks outweighs the benefit
- remove dumb pathfinder
- remove extraFlagToCheck argument
- remove defaultFlag argument
- combine validLocalX and validLocalY arrays into one
- remove unnecessary bitwise checks in getZoneIndex
Update version to 2.3.0
Results:
(initial, before any commits from today)
Durations:
Short path: 2.566241001s
Medium path: 744.876900ms
Long path: 296.284801ms
Invalid path: 380.979400ms
Latest
Durations:
Short path: 2.007796300s
Medium path: 590.569600ms
Long path: 248.614ms
Invalid path: 317.780799ms
Gains:
Short: -21.761194711735495%
Medium: -20.715812236894436%
Long: -16.08951955655667%
Invalid: -16.588456226242155%
Note: The test consisted of 100k short paths, 10k medium paths, 1k long and 1k invalid paths. All the paths started from the same coordinate. This was all singlethreaded, and the fifth consecutive results were taken both times.
Turn not-visited checks more efficient
2.2.4 refactor: replace getDirection(x, y) == 0 with notVisited(x, y) as it…