In the game I am working on, users can play as different characters, each with their own statistics (health, movement speed, and so on). On top of that users can level-up those characters, where each level improves a certain statistic.
Currently we use two ModuleScripts for this. One ModuleScript contains all default values for all characters. The other ModuleScript contains for each character, for each level what should be upgraded, and by how much. Here is rough example of what these modules look like:
----------------------------------------------------
-- ModuleScript with statistics
local CharacterStatistics = {
["Character1"] = {
["Health"] = 100;
["WalkSpeed"] = 16;
-- more values
};
-- more keys for other characters
}
----------------------------------------------------
-- ModuleScript with upgrade information
local Upgrades = {
["Character1"] = {
["1"] = { -- at which level the upgrade applies
["Upgrade"] = "Health"; -- thing to upgrade
["Value"] = 10; -- amount to increase it by
};
-- more levels
};
-- more characters
}
----------------------------------------------------
As you can imagine, this ModuleScript grows real big, real fast. On top of that, the vertical nature of code makes it difficult to compare the statistics of two characters next to each other.
For balancing purposes, I would like to figure out a better approach to storing and / or visualizing character statistics, with a focus on two factors:
- Making it easy to add and change values if it turns out that some character is very strong / weak.
- Having a clean way of comparing the statistics of two different characters, to see how they differ numerically, including their upgrades at different levels.
I am considering using a spreadsheet software which will allow me to better compare individual character statistics, however that would require me to change values both within the ModuleScripts and the spreadsheet software. I could also perhaps develop a plugin that can better visualize the contents of the ModuleScripts and allow me to make changes as well, but that would require a ton of development time for a single use-case.
I am wondering if other people have any valuable insights. Are there any approaches I am missing? Would love to hear your thoughts!