# A Little Math Help

Staff Emeritus
Hello! I am trying to calculate the value of items in an online game i play. I was wondering what the best way to do this was. I was thinking of take a base item, say a longsword for +10 dmg, and finding the dmg to cost ratio. Then, taking the upgraded items and finding the ratio for each of the different stats compared to the ratio of the base items. Now, is it possible to average these numbers out into one number? Say i get the ratio of an items stats to its cost to be 5.2 to 1, 4.5 to 1, and 7.9 to 1. Is it correct to take an average of 5.2, 4.5, and 7.9 and use that to compare different items?

TylerH
That would work, or you could work out what is more important to you and your style of play, say damage, and give that stat more weight. Say you want a lot of damage, and thought the other stats were a little less important, you could define your value function to be $$value(cost, damage, stat1, stat2) = \frac{1.25damage+stat1+stat2}{cost}$$, or you could go even further to make it a function of cost, stats, and their weights: $$value=\sum{\frac{weight_i stat_i}{cost}}$$. Although it looks prettier to write it like that, if you're going to make a program to calculate it for you, find the sum of all the stats times their weight, then divide.

Last edited:
Staff Emeritus
Well, I don't even know what a Function is, so I think I'll be staying from that one lol. But ill definitively look into what you said. Thanks!

TylerH
A function is just a know-it-all's word for a math expression with variables in it. Like, y = 2x, means y is a function defined in terms of x. Wikipedia can help a lot more than I can. http://en.wikipedia.org/wiki/Function_(mathematics)

The big E looking thing, called sigma, is just an easier way to say "add." Basically, it's shorthand for me saying to sum all the stats multiplied by their respective weights.

Staff Emeritus