0
\$\begingroup\$

I've been working on a game with a friend for a while now. I'm in charge of plotting most of the stats on the weapons.

Weapons have several attributes:

  • Four damage types: Base, Impact, Punct and Slash
  • Two special damages: Elemental and energy
  • Stats: Speed, durability, crit. chance and crit multiplier

Can anyone think of a way to calculate the price of an item using the weapon stats?

\$\endgroup\$
2
  • \$\begingroup\$ calculatePrice(item) { return 500; } there you go. It's fast to calculate and easy to implement. Not sure which language you're working in but it will be pretty universal, which makes the algorithm very portable. \$\endgroup\$
    – VLAZ
    Sep 15, 2016 at 11:42
  • \$\begingroup\$ I wanted to apologize to you for the behavior of all of these Stackoverflow users. This was an excellent question, and it could have had an answer, if someone would have been willing to describe how other games had achieved their formulas for item prices. Instead, you were subjected to the unfortunate degeneracy that has plagued Stackoverflow since the dawn of its inception. I hope you found an answer, and again, I'm sorry for how all of these people treated you. You didn't deserve it. \$\endgroup\$
    – Krythic
    Dec 13, 2018 at 9:50

2 Answers 2

4
\$\begingroup\$

I'd say this question is really open to opinion, but that would only be the case if we give you an actual formula.

But there are some generic rules and considerations that might lead you to a formula you are satisfied with:

  • Attributes metrics: You should first find a way to generate metrics on your weapon's stats. Not something opinion based, but hard math stuff, combining several stats to generate a single value. For example:

    DPS = attackDamage*attackSpeed
    DamageSpecialization(*) = StandarDeviation(base, impact, punct, slash) 
    DamageAmp = (CriticalChange/100)*CritMultiplier
    
    (*) DamageSpecialization would be 0 if all damage types are the same, and a greater
        number if one of the values deviate a lot from the mean.
    
  • Calculate the weapon rating: Using the values generated in the step before, you should create another formula to generate a rating for your weapong. Just by comparing the rating of two different weapons, you should clearly see how better one is compared to another. Example:

    WeaponRating = DPS*DamageAmp
    
  • Price curve: Now you have a rating for your weapon. But imagine you have a weapon that has double weapon rating compared to another weapon. You could just make it as twice as expensive. That would be a linear growth of the price, but you could apply a geometric growth, or any other formula. You could even calculate the highest possible weapon rating for the very best buyable weapon in the game, and divide every weapon rating by that value, so you have a normalized weapon rating. That way it would be easier to apply a more complicated formula to calculate the price, like price = (1+(rating/maxRating))^10.

Spreasheets are your friends here.

Of course is up to you decide what is more valuable in a weapon and the weight it has to it's rating. Maybe weapons that only deals one kind of damage are most valuable, because they deal better with one kind of enemy (but are trash against others), or maybe an all-around weapon with balanced damage is the best since you don't have to switch weapons.

Important bottom line: The price of the weapon has to fit in the general economy of the game. Even if you specify the price of the weapon, if the player can never buy it because he'll have to grind for years, that's not good. And if he can buy it very early in the game, that will throw the balance of the game off.

\$\endgroup\$
3
  • 2
    \$\begingroup\$ You might want to add that the price of the weapon has to fit in the general economy of the game. Even if you specify the price of the weapon, if the player can never buy it because he'll have to grind for years, that's not good. And if he can buy it very early in the game, that will throw the balance of the game off. \$\endgroup\$
    – Vaillancourt
    Sep 15, 2016 at 9:32
  • \$\begingroup\$ Good point, didnt consider the rest of the economy when calculating the price. I'll update the answer, or you can do it your self if you want the edit points :) \$\endgroup\$
    – Leo
    Sep 15, 2016 at 9:39
  • \$\begingroup\$ I no longer get edit reputation :) I can do it later today, or you can add it if you like, I really don't mind! \$\endgroup\$
    – Vaillancourt
    Sep 15, 2016 at 9:41
1
\$\begingroup\$

I believe the best formula should be : PRICE = BASE * 4 + IMPACT * 6.8 + PUNCT * 0.7 + SLASH * 5

Just kidding, just choose anything, there is no existing formula for that.

\$\endgroup\$
1
  • \$\begingroup\$ It's just that I couldn't think of anything. So I was asking for any ideas. \$\endgroup\$ Sep 15, 2016 at 8:16

Not the answer you're looking for? Browse other questions tagged .