I am making a Diablo-like game and I want to randomly generate the stats of the loot that gets dropped. I'll use "damage per second" as an example. I've filled a spreadsheet with two columns of numbers. The first column is the level
, the second column is the average damage per second
. So when you look at a row of the spreadsheet it'll say something like, "at level 50, the average damage per second should be 100". From here there are many branches I could take:
- Decide that the range values are not weighted. In which case, all you have to do is find a range below and above the average and randomly generate numbers in that range. For example, I'll arbitrarily decide that 20% is a good number and then the random range goes from 80 to 120. AFAIK, as long as that same % is added and subtracted to the number, then it should average out to 100.
- Decide that the range values are weighted. In this case, I want the higher stats to be more rare than the lower stats. So if the range were between 10 to 20, it would be more common to get a 10 than a 20. But, I think that there are other unknowns I have to solve first. Like, I probably need to figure out how I want the numbers weighted. I know how to set up weighted random values. But I don't know how to guarantee the average of the values is the number I want. How would I figure that out?
1) Seems way easier to code and balance. But I'm wondering if it's a poor choice for a loot system. If all the popular games out there use this, that's good enough for me and I'd consider that an answer.
On the other hand, if they use something like 2), I'd like to figure out how I can use the average as input to get the weighted range as output.
And if there's a 3) I haven't thought of that most games use, I'd like to hear about that.