Asset - Scripts Fast Optimized GM Pathfinding *FREE* By James222

James222

Member
Hi everyone!

So for the past few months I have been having a little competition with my friend to write a fast simple pathfinder that can work with multiple units while always returning the optimal path.
after a lot of trial and error I have finally simplified my work down to this tiny asset for the GM community :), The asset uses my custom path finding engine which uses a pre unrolled Dijkstra based flood fill.
it is optimized with early exits and is really easy to use. 100% pure GML :)

the grid object simply takes one script in its create event
scr_OPF_INIT_Grid();

with usage being as simple as
scr_OPF_GenerateSpider_EarlyExit(mouse_x,mouse_y,global.PathfindingGrid,obj_block,5,obj_Unit);

and then to make a unit move to the goal
scr_OPF_GetPath_Helper();

simple :)
very easy to modify also and mostly commented code :)

feel free to check out this thread where I have been posting results and comparisons

YYG Marketplace link pending (asset submitted)
DOWNLOAD GMZ - GMS 1.4.999

capable of 100x100 test map with all its obstacles, here are the results!
Grid gen: 0.89 milliseconds, Path: 0.33 milliseconds for a total of 1.22 milliseconds :)



and the same with 1002 units.
4.37 milliseconds for the grid and 147.97 for the pathing total: 152.34 milliseconds


The speed of it crushes Game makers inbuilt pathfinding speed and to the best of my knowledge beating all other GM pathfinding DLL's in raw speed,
getting comparable results to a direct C++ Flood fill implementation... in pure GML :).

DOWNLOAD GMZ - GMS 1.4.999


Enjoy guys and any questions feel free to ask :)
James
 
Last edited by a moderator:
Top