So I've been browsing the list of questions tagged with game-maker. There's a decent number of them all asking about various data structures or something pretty similar to the concept. A number of these are listed below.
How should I structure my turn based engine to allow flexibility for players/AI and observation?
Events and objects being skipped in GameMaker
GameMaker : how can i get the instance ID of multiple instance in a radius?
How should I make realistic electricity?
How to Check and Destroy "linked" gems quickly efficiently
How would I go about making an unstable tower of objects, that must be balanced by the player?
Drawing a possible movement area in a tiled map
Saving an array in GameMaker with DS Maps
How to make compound data in Game Maker?
A way to create a variable that includes a modifier that should be checked every step [Gamemaker]
How can I spawn only two objects, instead of spawning an infinite number of them?
The core issues lie in how game maker handles objects and data structures.
To those unfamiliar with game maker, there are two likely avenues for making data structures. The first is to use object instances as nodes for trees, graphs, and other linked structures. This won't work though as game maker's idea of pointer doesn't work. The things they point two randomly shuffle. The documentation describes it here:
Note that the assignment of the instances to the instance id's changes every step so you cannot use values from previous steps.
Similarly the built in data structures will be deleted from memory when one uses the default mechanism for saving and loading (there is no alternative short of writing your own save mechanism).
My only known workaround that isn't buggy is to write a C-style allocator from scratch and work from the bottom up. This prescribes the same answer for several different questions such as this one in particular.
This begs the question:
Should we close all of them as duplicates and refer to one question? ..or should we compile the allocator code somewhere? ...or should we give the other options as horrible answers?
I've been using game maker for quite a while and I can see that people have the same problem just with different structures. I'd hate to force people to be put as duplicates but I fear most of the code to write will just be "another set of allocation functions copied from somewhere else".