Showing posts with label ds_grid. Show all posts
Showing posts with label ds_grid. Show all posts

Sunday, November 27, 2011

GameMaker - multi-dimensional arrays

As you may know, GameMaker natively supports only 2-dimensional arrays with size up to 32000x32000.
However, in some cases, you may want to use arrays with 3 (or more) dimensions.
Small comparison table with descriptions below:

Stat\Method array:offset array:instance ds_grid's ds_map
Init (fill-up) Slow Slow Fast Slowest
Access (i/o) Fast Fast Average Average
Size limit ~109 cells 32k/dimension Resizable No
Index Integer Integer Integer String
Existance check No No Not needed Yes
Region operations No No Yes Only clearing
References No Partial (layer) Yes Yes