ScratchData LogoScratchData
Back to iaobardar's profile

Faster Pathfinding - JPS (an A* variant)

IAiaobardar•Created February 16, 2023
Faster Pathfinding - JPS (an A* variant)
89
76
620 views
View on Scratch

Instructions

Press V to show and hide the variables. Some need the project to be rerun. JPS is a variant of A* that is a ton faster, with the caveat that it only works on uniform cost grids. (not that it matters, since that's what I already was doing.) It significantly reduces the number of nodes in the open set by efficiently expanding nodes instead of just throwing all their immediate neighbors on the queue. It took me a while to iron out all the wrinkles, but I think this is pretty much exactly what the paper specifies. The next thing I might try is implementing a Factorio style HPA*, which in essence just creates a simplified copy of the map and searches on it to get a better heuristic for the regular / full A* (or maybe JPS). (see: Factorio Friday Facts #317 - New pathfinding algorithm)

Description

https://web.archive.org/web/20140310022652/https://zerowidth.com/2013/05/05/jump-point-search-explained.html The A* heuristic function: https://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html The JPS papers: https://web.archive.org/web/20180929173738/http://users.cecs.anu.edu.au/~dharabor/data/papers/harabor-grastien-aaai11.pdf https://web.archive.org/web/20150314212624/http://users.cecs.anu.edu.au/~dharabor/data/papers/harabor-grastien-socs12.pdf

Project Details

Project ID805263660
CreatedFebruary 16, 2023
Last ModifiedFebruary 18, 2023
SharedFebruary 18, 2023
Visibilityvisible
CommentsAllowed