Description

Build with and for GMS 1.4. Grid path is based on a breadth first search algorithm.

scr_find_grid_path(id, target_x, target_y, diag, cell_size)

It finds the shortest way from id.x, id.y to target.x, target.y. All coordinates of the path is kept on a ds_list. Perfect for turn by turn grid based game. As always, it's well commented. Mouse click movements. YYC tested.

End User Licence Agreement (EULA).

Changes in 1.4.0

Cleaner code and added parentheses to statements and semicolon to all lines.

Version 1.4.0. Published July 9, 2016

Created with GameMaker: Studio v1.4.1757

Age Rating: 4+

Average Rating

Your review

You can only review assets you've bought.


Gravatar

Anton G 21 April 2018

This algorithm is broken.

Algorithm give non-determined result if you try to get path to some constatn point more than one time. Priority is not given to the shortest paths.

Logo

Jonathan Moreau (Publisher) 27 April 2018

Not on my side. Send me a mail, we'll fix your issue: jonathan.naztail@gmail.com -edit 1- Still waiting for a mail to help you fix your issue. -edit 2- Still no mail from you. -edit 3: Well, I never had a request for help from you... ... I will wait longer.


Gravatar

David C 27 October 2015

Needs a lot more commenting

Works great and is intelligently thought out code, but the actual grid finding portions of the script need a lot more commenting on how the functions are working and the concepts behind them.

Also, uses object collision. To use tile collision, replace the with(obj_wall) section with this (Probably not the most efficient and sorry it removed my indents):

Update:
(Received some much cleaner code!)

var array = tile_get_ids_at_depth(10);
for(var i=0; i

This review was left for a previous version of this asset.


Gravatar

Aleksandr S 20 July 2015

simple to integrate, and does what it says

I'd recommend this plugin for games requiring simple, straight forward, grid based path finding. It doesn't necessarily get you from point A to point B in the most optimal way (if diagonals are enabled, it really doesn't seem to like calculating straight lines), but it will get you from point A to point B nevertheless, and for cases where that's your main concern, this is perfect. I'm more artist than programmer, and coding such a thing from scratch would have been a bit too much for me. As such, I was glad to find this script/example to fill the gap. Fairly easy to integrate, also (though it helps to have some GML knowledge),

This review was left for a previous version of this asset.


Gravatar

Garrett S 29 October 2014

Very useful for grid based games

The script is awesome and the developer is the best :D

This review was left for a previous version of this asset.

Package contents

Loading, please wait

What is the issue?

Back to Top