Skip to content

Releases: blurite/pathfinder

Branchless Step Validator

28 Jan 17:11
356c6e9
Compare
Choose a tag to compare

Removes branching in step validator, hopefully significantly reducing CPU cache misses.

fix: check start==end coord before collision for los

29 May 08:16
f81f6b5
Compare
Choose a tag to compare

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

25 Dec 15:51
Compare
Choose a tag to compare
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

18 Oct 02:53
Compare
Choose a tag to compare
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

11 May 21:14
Compare
Choose a tag to compare
2.4.3

fix: findClosestApproachPoint should not return false if the path is …

StepValidator performance

03 Jan 21:17
Compare
Choose a tag to compare

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

03 Jan 14:21
Compare
Choose a tag to compare

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

01 Jan 00:55
Compare
Choose a tag to compare
  • 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)

31 Dec 02:02
Compare
Choose a tag to compare
  • 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

30 Dec 23:28
Compare
Choose a tag to compare
2.2.4

refactor: replace getDirection(x, y) == 0 with notVisited(x, y) as it…