Grids is a GML script library for Game Maker that allows you to rapidly implement games built on various types of grids.

  • Supports hex grids (pointy and flat), rect grids, and diamond grids
  • Supports grids in different shapes.
  • Supports contents of any data type.
  • Supports fast lookup of points (whether a point is inside a grid or not).
  • Supports access through integer vectors.
  • Vectors support addition, subtraction, scaling, matrix multiplication, and dot product.
  • Supports iterators for grids - easily loop through all the points in a grid.
  • Support easy mapping to screen coordinates (with functions to translate and scale the grid, and align the grid to the edges, corners or center of a rectangle).
  • Support grid colorings.
  • Supports A* path finding.
  • We provide clean code.
  • We provide excellent support.

Examples included:

  • Simple pointy hex grid setup.
  • Simple flat hex setup.
  • Path finding (one with a simple grid, another with two grids for visual display).
  • Lights-Out Game.
  • Lines Game.

More info

End User Licence Agreement (EULA).

Changes in 1.2.3

  • Fixed a bug with rect and diamond coordinate conversions with the generic functions.

Version 1.2.3. Published September 27, 2014

Created with GameMaker: Studio v1.4.1398

Age Rating: 4+

Average Rating

Your review

You can only review assets you've bought.


Jim E 06 March 2018

Great Stuff!

I purchased this a while back during GMS1 days and learned quite a bit looking at the code. A lot of work went into this library, which is evident from the demos it came with. The library is well documented as well and provides several examples. To my knowledge, there is no other asset like this anywhere in the GM world.

Now for my rant... Also, it isn't fair to rate a product against a version it isn't meant to work in (e.g., GMS2). It states clearly on this item that it is meant for GM1.4, not GMS2. Of course, you'll have compatibility issues, but that isn't the developer's fault. If the developer wrote it for GMS2 and you had problems, then that poor feedback is fair game. However, to give a library a bad review for the version it isn't meant to work in isn't right!


Mike H 20 January 2018

Great library but NOT compatible with GM:S 2

I recently bought this, the docs are great, the library itself is great, but it hasn't been updated in 4 years and there are DEFINITELY compatibility issues with Game Maker Studio 2.

Just importing the library warns you about incompatibilities, and if you continue and even try to follow the basic tutorial, your project will compile but fail to run.

I'm having to pick and choose individual scripts I need for my project and manually port them over to GM:S 2 compatible code. I figure that's still probably faster than writing an entire grid library myself (which my game is based on).


Anonymous 01 September 2017


Mikhail K 28 February 2017

Good stuff. But needs improvement.

Everything that Daemon E said. Especially about script tips.

+ It would be nice to make greeds with "connected" sides (Imagine a world map in Civilization). Or at least able to. At the moment there is even no applicable grid shape for this! If A-star would work with these grids it would be perfect!


Relliks M 23 October 2016



Beautiful code, useful function and interface, and examples with detailed document. It is the best Grid extension I've found in GM Marketplace. If anyone wants to create an SLG game, there is no better choice than it at the moment.

And the following is my suggestion:

Now a cell is only two states——accessible or not. Is there possiblilty that every cell have a move-cost but not only "true" or "false"? In some games, it is common that accessible cells cost different move points according to their types.
Also, the astar can get a return from a script to show the move range with given move points. If anyone want to create slg game and found this extension, they will need it as I think.


Pawel T 19 August 2016

Great set, a lot of scripts

For my use it's more than I need for grids, but I will use it for more projects I'm sure. Start is not easy, because here a lot of functions, but after some time you will see power. Good price for value and very good contact with author.


Damon E 25 September 2017

This is vary good library, needs an update

This is very good quality code, especially for the price. I am extremely happy with it.
With that said, there is always room for improvement. I am listing a few things that I think are worthy of an update.

Provide memory cleanup for collections (and use them in your functions to clean up memory).
Any time a collection is create with function like ds_map_create(), there should be a corresponding ds_map_destroy(map).
I would expect to have functions like ds_pointset_destroy(pointset).

There appear to be some memory leaks. One example is gl_grid_connected.
There are a couple of point_sets created that are never destroyed. (ds_pointset_destroy would be great here! :)

Add comments at start of each API function so that code tips work in the editor
Example: ///gl_get_connected_line(grid, point, dir)

Add some documentation related to the connection algorithms. Example shows how to use it, but takes a little digging. It is not clear at first.


Felix B 15 May 2016

Amazing set of scripts, with great documentation!

This is hands down the most impressive collection of scripts i have bought on the marketplace. There is an increadible amount of helper scripts and new data structures for just about everything needed to make a grid based game. The aproach is rather different to anything seen in gamemaker before, but being a fan of object orientated design, this aproach of using object to represent anything from vectors to strategies as some collection or object truely resonates with me.
If i had but one complaint so far, it is that the scripts dont include a parameter signature, making it a little harder to use as i found myself opening every script to take not of their arguments.

Would totally recomend to any more advanced programmer looking for a robust grid framework.


Cristian M 14 March 2016

Five stars support!

By the way, is not recommended for beginners (like me), better start for somewhere else.


Josef S 19 January 2016

Great asset, I love it!

It has a very good documentation, about 10 pages of pdf with code and everything, it gets a bit advanced, but it's easy to understand with the documentation. It has lots of functions, it's really a great lib.
I do recommend to add this to your project first thing and then build your game up from there, as I don't think it would be fun to implement in a finished game.


randy t 16 December 2015


Really easy to dig into. I wish our Gamemaker port was as full featured as the Unity version, specifically I wish this had Rhombille grids. Excellent, nonetheless. Highly recomended!


William G 29 April 2015

Good Product, but no longer supported

Had trouble implementing into my project & after a week- the publisher has not responded to my email. From what I can tell, Gamelogic is still around (Their blog is still active) but "Contact Publisher" is a loss cause.

It does have a wonderful library & a lot of great functions. Nearly everything is documented, though some of it is vague and hard to understand for those without extensive GML experience.


Gamelogic (Publisher) 13 May 2015

Hi William,

I am sorry you had a bad experience. We are definitely still supporting the product. I did a search for your email, and we did send a reply, but your return email address failed. Here is the error report: (I blocked out sensitive information).
This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:
host []
SMTP error from remote mail server after end of data:
554 Message not allowed - [320]
My reply to your query was this:
Are you 100% sure obj_character is in fact an instance (and not an = object)? And if it is 100% an instance, is there not perhaps an object = named with the same name? (In my experience, sometimes GameMaker can get = confused).
If this doesn't resolve your problem, please send me your code so that I have a look.


John H 04 November 2014

Excellent tools with great support

A very extensive library with all the functionality you would hope for when setting up grid based projects. The documentation is excellent at walking you through the steps to get started, and the scripts are noted well.

The support is fantastic. I had an error where I could not properly import it into my project. I was unsure if this was a Game Maker issue or an issue with the tools, but I contacted them just in case. I got a response within 24 hours with an attachment so I could manually import the tools into my project.

Overall I am very pleased with the tools, and the service. I would reccomend this package to anyone who is making grid based games.


Anonymous 20 September 2014

Amazing set of routines

Outstanding library. Requires a little effort to get into it but once you go thru the different functions and routines, you just realize how much this add-on is a must have.

Little suggestion to the authors for a next update: add triple slashes comments (///function(param1, param2, param3 ...) at the beginning of the scripts, it makes auto-completion so much handy while coding..

Beside that, nothing else to add. It's well worth the few bucks spent! Thanks!!

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


Duncan B 27 August 2014

Great library for implementing grids

Well documented, with great examples and easy to understand explanations of how the libraries work.

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


Michael M 27 February 2017

Excellent Library

Excellent library for hex based applications. All scripts are neatly organized and example rooms are provided.

The developer was also very quick to respond to email queries.

Package contents

Total size 1.69 MB 17.3 KB Grids
datafiles Fonts Objects Rooms Scripts
debug_print_coordinates.gml 227 Bytes extra_documentation.gml 1.19 KB get_edge_faces.gml 721 Bytes get_point_axis_color.gml 433 Bytes gl_diamond_distance.gml 417 Bytes gl_diamond_grid2world.gml 366 Bytes gl_diamond_grid_create.gml 1.71 KB gl_diamond_magnitude.gml 391 Bytes gl_diamond_map_create.gml 672 Bytes gl_diamond_shape_create_circle.gml 534 Bytes gl_diamond_shape_create_parallelogram.gml 618 Bytes gl_diamond_shape_create_rectangle.gml 640 Bytes gl_diamond_world2grid.gml 568 Bytes gl_find_node_with_lowest_score_index.gml 509 Bytes gl_flathex_distance.gml 393 Bytes gl_flathex_grid2world.gml 366 Bytes gl_flathex_grid_create.gml 2.09 KB gl_flathex_magnitude.gml 377 Bytes gl_flathex_map_create.gml 714 Bytes gl_flathex_shape_create_fatrectangle.gml 809 Bytes gl_flathex_shape_create_hexagon.gml 894 Bytes gl_flathex_shape_create_parallelogram.gml 821 Bytes gl_flathex_shape_create_thinrectangle.gml 815 Bytes gl_flathex_world2grid.gml 752 Bytes gl_get_biggest_pointset.gml 844 Bytes gl_get_color.gml 1.09 KB gl_get_connected_line.gml 796 Bytes gl_get_connected_lines.gml 813 Bytes gl_grid_astar.gml 4.09 KB gl_grid_clone_structure.gml 875 Bytes gl_grid_connected.gml 1.52 KB gl_grid_connected_set.gml 1.02 KB gl_grid_connection_index.gml 578 Bytes gl_grid_contains.gml 341 Bytes gl_grid_destroy.gml 262 Bytes gl_grid_fill.gml 308 Bytes gl_grid_get.gml 493 Bytes gl_grid_get_iter.gml 610 Bytes gl_grid_get_neighbors.gml 643 Bytes gl_grid_get_points.gml 374 Bytes gl_grid_get_values.gml 439 Bytes gl_grid_neighbors_connected.gml 488 Bytes gl_grid_random_point.gml 333 Bytes gl_grid_set.gml 446 Bytes gl_grid_where_color_equals.gml 1007 Bytes gl_halfplane_clone.gml 266 Bytes gl_halfplane_contains.gml 535 Bytes gl_halfplane_create.gml 695 Bytes gl_halfplane_destroy.gml 154 Bytes gl_init.gml 3.46 KB gl_instance_create.gml 288 Bytes gl_instance_get_position.gml 284 Bytes gl_instance_set_position.gml 345 Bytes gl_iter_create.gml 468 Bytes gl_iter_destroy.gml 159 Bytes gl_iter_hasnext.gml 183 Bytes gl_iter_move.gml 864 Bytes gl_iter_next.gml 262 Bytes gl_list_add_range.gml 351 Bytes gl_list_delete_point.gml 528 Bytes gl_list_exists_point.gml 482 Bytes gl_list_random_item.gml 267 Bytes gl_list_sample_random.gml 650 Bytes gl_map_align_grid_in_rect.gml 2.76 KB gl_map_calc_grid_extent.gml 1.68 KB gl_map_center_grid_in_rect.gml 439 Bytes gl_map_closest.gml 507 Bytes gl_map_destroy.gml 146 Bytes gl_map_distance.gml 578 Bytes gl_map_flip_x.gml 321 Bytes gl_map_flip_y.gml 321 Bytes gl_map_get_cell_dimensions.gml 278 Bytes gl_map_grid2rawworld.gml 553 Bytes gl_map_grid2world.gml 677 Bytes gl_map_magnitude.gml 374 Bytes gl_map_rawdistance.gml 464 Bytes gl_map_scale.gml 509 Bytes gl_map_snap.gml 638 Bytes gl_map_translate.gml 441 Bytes gl_map_world2grid.gml 684 Bytes gl_matrix3_create.gml 337 Bytes gl_matrix3_create_flip_x.gml 217 Bytes gl_matrix3_create_flip_y.gml 221 Bytes gl_matrix3_create_scale.gml 211 Bytes gl_matrix3_create_translation.gml 271 Bytes gl_matrix3_identity.gml 117 Bytes gl_matrix3_inverse.gml 960 Bytes gl_matrix3_mul.gml 906 Bytes gl_mouse_get_position.gml 189 Bytes gl_pointset_add.gml 111 Bytes gl_pointset_addlist.gml 156 Bytes gl_pointset_clear.gml 42 Bytes gl_pointset_create.gml 84 Bytes gl_pointset_delete.gml 74 Bytes gl_pointset_empty.gml 49 Bytes gl_pointset_exists.gml 81 Bytes gl_pointset_findfirst.gml 54 Bytes gl_pointset_tolist.gml 235 Bytes gl_pointyhex_distance.gml 415 Bytes gl_pointyhex_grid2world.gml 366 Bytes gl_pointyhex_grid_create.gml 2.11 KB gl_pointyhex_magnitude.gml 377 Bytes gl_pointyhex_map_create.gml 672 Bytes gl_pointyhex_shape_create_fatrectangle.gml 817 Bytes gl_pointyhex_shape_create_hexagon.gml 901 Bytes gl_pointyhex_shape_create_parallelogram.gml 823 Bytes gl_pointyhex_shape_create_thinrectangle.gml 817 Bytes gl_pointyhex_world2grid.gml 758 Bytes gl_polygon_clone.gml 424 Bytes gl_polygon_contains.gml 828 Bytes gl_polygon_destroy.gml 312 Bytes gl_random_int.gml 311 Bytes gl_reconstruct_path.gml 212 Bytes gl_reconstruct_path_impl.gml 324 Bytes gl_rect_create.gml 586 Bytes gl_rect_destroy.gml 108 Bytes gl_rect_distance.gml 414 Bytes gl_rect_get_dimensions.gml 240 Bytes gl_rect_get_endpoint.gml 312 Bytes gl_rect_get_point.gml 372 Bytes gl_rect_grid2world.gml 366 Bytes gl_rect_grid_create.gml 1.64 KB gl_rect_magnitude.gml 391 Bytes gl_rect_map_create.gml 654 Bytes gl_rect_shape_create_circle.gml 530 Bytes gl_rect_shape_create_parallelogram.gml 817 Bytes gl_rect_shape_create_rectangle.gml 369 Bytes gl_rect_world2grid.gml 544 Bytes gl_room_get_extent.gml 250 Bytes gl_shape_clone.gml 413 Bytes gl_shape_contains.gml 808 Bytes gl_shape_create_polygon.gml 773 Bytes gl_shape_destroy.gml 263 Bytes gl_shape_union.gml 546 Bytes gl_sprite_get_size.gml 336 Bytes gl_svector2str.gml 310 Bytes gl_svector_create.gml 255 Bytes gl_vector2str.gml 256 Bytes gl_vector_add.gml 271 Bytes gl_vector_create.gml 214 Bytes gl_vector_distance.gml 372 Bytes gl_vector_dot.gml 191 Bytes gl_vector_equals.gml 405 Bytes gl_vector_magnitude.gml 247 Bytes gl_vector_mul.gml 317 Bytes gl_vector_negate.gml 339 Bytes gl_vector_perp.gml 283 Bytes gl_vector_sub.gml 310 Bytes gl_vector_transform.gml 455 Bytes lightsout_check_game_end.gml 284 Bytes lightsout_create_grid.gml 692 Bytes lightsout_draw_map.gml 369 Bytes lightsout_init_cell.gml 58 Bytes lightsout_init_pattern.gml 308 Bytes lightsout_on_mouse_click.gml 192 Bytes lightsout_toggle_neighbors.gml 326 Bytes lightsout_update_cell.gml 173 Bytes lines_add_pieces.gml 697 Bytes lines_check_game_end.gml 370 Bytes lines_drop_piece.gml 541 Bytes lines_get_empty_cells.gml 365 Bytes lines_get_new_points.gml 361 Bytes lines_init_grid.gml 1.11 KB lines_pickup_piece.gml 388 Bytes lines_update_current_piece.gml 96 Bytes lines_update_matches.gml 850 Bytes maze_find_shape.gml 706 Bytes maze_get_wall_grid.gml 2.11 KB maze_init_grid.gml 2.25 KB pathfinding_init_cell.gml 78 Bytes pathfinding_init_grid.gml 757 Bytes pathfinding_init_grid2.gml 971 Bytes pathfinding_onleftclick.gml 271 Bytes pathfinding_onleftclick2.gml 405 Bytes pathfinding_onmiddleclick.gml 208 Bytes pathfinding_onmiddleclick2.gml 220 Bytes pathfinding_onrightclick.gml 207 Bytes pathfinding_onrightclick2.gml 219 Bytes pathfinding_update_cell.gml 608 Bytes pathfinding_update_cell2.gml 597 Bytes pathfinding_update_path.gml 826 Bytes pathfinding_update_path2.gml 1.23 KB simpletest_diamond_init_grid.gml 822 Bytes simpletest_flathex_init_grid.gml 859 Bytes simpletest_pointyhex_init_grid.gml 829 Bytes simpletest_rect_init_grid.gml 816 Bytes

What is the issue?

Back to Top