I was hoping someone could help me understand the dynamic array and maybe correct my understanding of the various other array type objects. I am just deciding which is best to use for given purposes.
Purpose 1 - I want to have static data loaded at the start of the application to be referenced later:
- objects (say, enemies, or items), an associated text description, various stat values and maybe some other info, mixed strings and values, to be called up as needed based on name. I was considering MagicDeque for this but I wonder if it gets really big what the speed implications would be.
- events (like cards), each having a text description, a reference to which image to use on the in game object, and some other data. Also considering magicdeque here, with 1 "array" for each "event" and data for each held in a corresponding element.
Purpose 2 - savegame purpose
I will create a frame (not included in the application) just for me to load data into arrays from a CSV or INI, then save the array file to be loaded at runtime (so I can update the arrays myself as I add content, but the actual application will just load the premade array files). So my understanding of each object is as follows:
The standard array I understand perfectly, xyz is easy to reference BUT it can't load data from common file types, so that's a big limitation as I would prefer to edit data in something like Excel and then import it.
I'm leaning towards MagicDeque, because it can load from common file types and is easy to conceptualize (array = x, element pos. = y). However, not being able reference by key is a small inconvenience (would have to keep track of which # corresponds to which value. For instance array1 = monster 1 etc.
Associative array seems good but is limiting in that it is essentially only a 1d array with a string and value for each element. I think it is incredibly useful for other purposes but probably not the ones I listed above.
Now the one that is bending my mind: the dynamic array.
+ seems to be the most flexible, combining desirable features from all the other array type objects (associative keys, can have multiple dimensions, mixed string/value elements, load from common file types).
+ 3d array is technical easy to visualize however:
- hurts my brain when I get into the event editor
I am having trouble grasping the concept of the index position. For instance "insert value at" just wants a single index value. How do I know where (xyz? key?) Or what key? There appears to be some conversions for XYZ however it seems incredibly complicated to even perform a simple operation as "get string at". I feel like I am majorly lacking understanding of how this array (or maybe all arrays!) work here.
Does anyone have a good example of how to use a dynamic array? Or can provide me a sort "explanation for idiots" . Is it more like a deck of cards, each containing a# of values/strings (one for each dimension?) I can't seem to wrap my mind around how to work with it. The documentation doesn't really help me out and I've read it thoroughly.
Thanks in advance!