While the array lookup method of assigning stats is a decent method of managing stats, to me it has two drawbacks… 1) It’s rather tedious to have to do each of these entries for every character, and 2) Generally speaking, your progression is going to follow some sort of predictable pattern anyways.
My take was a little different. I still wanted something easily customized by a later designer (likely to be me) but I didn’t want to spend a lot of time calculating all those levels… so I created another class…
[System.Serializable]
class ProgressionStatFormula
{
[Range(1,1000)]
[SerializeField] float startingValue=100;
[Range(0,1)]
[SerializeField] float percentageAdded = 0.0f;
[Range(0,1000)]
[SerializeField] float absoluteAdded = 10;
public float Calculate(int level)
{
if (level <= 1) return startingValue;
float c = Calculate(level - 1);
return c + (c * percentageAdded) + absoluteAdded;
}
}
The idea here is that you’ll start with the level one value. Then you calculate a new value for each level you wish to access. There are two modification paths which can be used separately or together (I considered making one modifier with a toggle for formula). At level 1, the formula will aways return the starting value. At subsequent levels, it will perform a recursive calculation to arrive at the new value by getting the value of the previous level, adding that value to itself times the multipler and adding the absolute addition. This leaves you tweaking only a very few parameters to get a virtually unlimited progression of stat values. If you want things to ramp up exponentially by level, you can use the multiplier (You’d be surprised how quickly a character can go from 100 to 1,000,000 using a percentageAdded value of 1!), if you want a slow consistent progression use the absolute added.
It wouldn’t be that hard to modify this into a hybrid system where you could type in an array of values but let the system fall back to the formula if the array is incomplete or missing.