Search Unity

Formula for balancing weapon dps

Discussion in 'Scripting' started by johot, Sep 2, 2014.

  1. johot

    johot

    Joined:
    Apr 11, 2011
    Posts:
    201
    I'm not sure that this is the proper part of the forum to post about this but I didn't really find a good spot.

    I was thinking about balancing weapons in a shooting game using math. Say I have a weapon, a spell etc and want to balance it's dps, mana cost (in the case of a spell) and so on, what would be a good way to assist in finding the best values, in order to keep weapons balanced, other than pure game testing?

    Have anyone found any articles etc with theories on building mathematical models in order to simplify and assist in this process? For example you could perhaps calculate the dps, the damage per mana and so on. But then comes the question, how do you factor in something such as a weapon firing a bullet faster than another but doing less damage, or a weapon being able to hold twice the amounts of bullets? Could we for example develop a formula for giving a weapon a score such as:

    score = dps * cost * utility and so on?

    One would then ideally try to make sure all weapons have a similair score.

    Anyone got any good suggestions or have read any articles related to this subject?
     
  2. cranky

    cranky

    Joined:
    Jun 11, 2014
    Posts:
    180
    Using mathematics for game balance is not the greatest idea. Balancing is generally done through intuition and trial and error. There may be a little math involved in getting the general idea, but using it as the primary tool is balancing is flawed.

    For example, let's say players have 100 HP. Gun A does 100 damage per shot, fires 1 shot per second, and has a 4 round capacity. Gun B does 10 damager per shot, fires 10 shots per second, and has a 40 round capacity. Perfectly balanced mathematically. But Gun B is several times easier to use because it leaves more room for user error (if you miss with Gun A, you must wait an entire second to fire again, while Gun B can simply be sprayed as missed shots are insignificant).

    Also, balance achieved by making everything equal isn't as fun. If all weapons do the same DPS and that's their only difference, where's the fun and the flavor?

    Just some food for thought ;).
     
  3. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    If you're talking about "level 1" weapons having certain ranges of values versus "level 20" or something, it seems that you could handle that with various sets of hand tweaked min/max values for the individual attributes. Since the attributes are what contribute to DPS or whatever, that sort of works itself out. And instead of distributing the values linearly, you could have some sort of curves per level, like bell curves and that sort of thing so that say, a weapon with a crazy fast fire rate only comes along rarely. It'd be a fun item the player might want to hang on to a little longer than normal.

    Also, certain attributes and XP curves, etc you might be able to handle with some exponential curves of various "curviness". This guy can come in handy for those:
    http://docs.unity3d.com/ScriptReference/Mathf.Pow.html

    I don't really know what I'm talking about. I'm dealing with some of the same things in my game and don't have it worked out yet either.
     
  4. johot

    johot

    Joined:
    Apr 11, 2011
    Posts:
    201
    Thanks for your replies guys.

    @cranky
    You are absolutely right in that you can't really create a formula for balancing, and it also comes down to making things feel differently and so on. However creating tools that can assist us in this process would be highly valuable instead of only "shooting from the hip" when it comes to the rough numbers.

    When we balanced our game Castle Raid 2 we created an assisting tool that showed all the different units dps, damage per unit cost, health per cost and so on, and it was a great great tool for assisting us in balancing the different units. The reason I am still asking is that I wanted to hear if anyone had come up with an ever better way or had other input in creating tools for helping out in the process of balancing a game.

    After googling some I found a lot of Star Craft 2 theorycrafting threads where they do these kinds of calculations for determining strategies, finding strong unit combos and so on.

    I still think dps, damage per cost and utility are good values to look at when balancing and would love to find a good way of comparing these values to each other in more ways than just looking at them, even though I realize that will be the most important factor along with actually playing your game. Also "utility" is a very hard thing to measure ;)
     
  5. johot

    johot

    Joined:
    Apr 11, 2011
    Posts:
    201
  6. cranky

    cranky

    Joined:
    Jun 11, 2014
    Posts:
    180
    Don't get me wrong, I totally agree. Ways to break balance down into mathematics are great tools to use in supplement of intuition/trial and error. Possibly even required to catch balance issues!

    I just didn't want anyone to come off thinking there's a magic formula you can press to balance your game perfectly ;).

    Anyways, I don't use anything advanced mathematically when I balance my games. I prefer to balance by strengths and weaknesses to keep things interesting. But a generic sort of thing like I did above with Gun A and B can be employed to get things generally within balance.

    Another important thing: feedback. Invite friends over to your house, have them LAN. Maybe don't even ask for balance suggestions until AFTER they played an hour or two to see if they notice any blatant balance issues. Watch them play sometimes too, don't participate in all the games. Players may find things you never even expected possible (different rotations, weapon/unit combos, strategies, etc).

    Sorry this got a little off-topic!