1
\$\begingroup\$

So I've been browsing the list of questions tagged with . 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?

Turn based battle and formula

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".

\$\endgroup\$
  • 3
    \$\begingroup\$ +1 Thank you for looking at these and trying to find a solution. \$\endgroup\$ – MichaelHouse Jun 9 '17 at 19:53
  • \$\begingroup\$ @Byte56 You're welcome. To be honest, this is a pretty long term irritation of mine. You see, I've tried to over the years implement turn based combat like stuff and the best way to efficiently do that is with a linked structure. Game Maker has no built in "cycle" data structure so this naturally led to a lot of bugs and irritations as you can imagine. \$\endgroup\$ – The Great Duck Jun 9 '17 at 21:32
  • \$\begingroup\$ Why did this get downvoted? \$\endgroup\$ – S. Tarık Çetin Jun 20 '17 at 11:36
  • \$\begingroup\$ @S.TarıkÇetin no clue. It had -5 or -6 at one point. \$\endgroup\$ – The Great Duck Jun 20 '17 at 12:54
7
\$\begingroup\$

We do not close questions as duplicates because the answers or potential answers are the same. We close them as duplicates because the questions are the same. Looking at this list you have provided, I see absolutely no evidence that these are all duplicates at all, so that is a non-starter.

It looks to me like you have a reverse XY problem of sorts here: you have identified that all of these questions may require the use of a persistent data structure that can survive saving and loading, and you thus want to write about how to do that as part of (or the entire) answer. While that is your prerogative, I don't think it will produce answers that are widely considered to be good answers to the actual questions asked by the users who are trying to find solutions to specific high-level problems.

If you think the concern about writing a C-style allocator to back the data structures is so fundamental to every single answer you'd want to write to those questions, the proper thing to do is ask that question ("How can I build a data structure that will persist across saves/loads in GameMaker?") and self-answer it.

Then, for each of the questions you have listed, write a better answer than the ones that are there, making sure to specifically address the unique high level problem in each question while referring to your canonical question on writing data structures in case the reader feels the need to step down to that particular level of abstraction.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .