In my current project, I've run into two very similar scenarios both involving large amounts data, and I'm wondering which is the most efficient way of handling them.
The first question is in the leveling system. I'm trying to make my game as close to the source game as possible, and instead of having several EXP equations that determine how much EXP is required to reach the next level, there is a single stat (from 1-32) that corresponds to a list containing a different EXP level for every level (1-99). Thus, this leads to 32 different lists, times 99 values in each list... it's alot of data. (Plus, a similar system is used for another stat system of the game)
I've already gotten all the information, but right now I have the 32 lists stored as global variables. Is this bad? Would it be more efficient to create the correct list every time someone levels up, or is it more efficient to simply create them once and then access them when needed? Or does it even make a difference.
I have another similar issue. This time, I'm using datums to store combinations. (There is one datum per result, not one datum per combination) Since I need to initialize each datum to get the information inside of them, would it be more efficient to initialize them all once, and save them in a list (or several), or would it be more efficient to simply loop through typesof() and initialize them one at a time? (Each one only stores three variables, two of which may or may not be lists)
If it's relevant, this will be used much less than something like leveling.
Apr 11 2009, 11:38 am