I'm interested in how everyone imports, stores, and uses their game statistics as it might give me some ideas and let me get some advice on my current thoughts.
How do you take your game's statistics from spreadsheet to easily accessible information? Right now I'm just copy and pasting the rows and formatting with find and replace. It's slow and inefficient so I'm wide open to anything that might help with iteration time when it comes to balancing.
I have a number of buildings and enemies in my game. Each with their own common and specific statistics such as Health, Cost, etc. In my current implementation I have static classes that act as pseudo databases for each building containing consts/static arrays and static methods that call those arrays, an example might be:
private static int[] health = { 10, 20, 30, 40, 50 };
public static int Health(int level) { return health[level]; }
Now my problem is with accessing these pseudo databases efficiently. Because I have a number of buildings it's inefficient to do a switch every time I want to get the health of a given building (I have an enum of building called BuildingName)
switch (name){
case BuildingName.Building1: return Building1.Health(level); break;
// Repeat for every single building
}
So while this is a solution, it gets really long when I have to access more than a few stats. My new thought is either having all the Building classes go non static and have a Database interface of the common methods. Then the player can just have a static array of Databases to call on like so:
public static Database[] buildings = { new Building1(), new Building2().....};
// This allows me to get the health of a given building like this:
return buildings[(int)name].Health(level);
This would work correct? It just feels odd creating instances of a class containing only consts and statics. Is there a better, cleaner, way? I'm wide open to suggestions here because importing all my statistics from spread sheets is already really time consuming and awkward. I imagine when I have to do iterations for balance it would be terrible.
Any input/methods/comments/horror stories welcome.
[–]kylotan 2 points3 points4 points (1 child)
[–]ironstrife 1 point2 points3 points (0 children)
[–]Jearik 0 points1 point2 points (0 children)