The Mysterious Lever: Weapon Damage Mathing

Friday, August 25, 2017

Weapon Damage Mathing

Big dreams of grandiose games are all well and good, but when it comes down to the pen on the paper, sometimes getting the exact details right is the hardest part. I've been struggling with a seemingly easy problem: balancing weapon damage.

The problem I have can be boiled down to normal vs heavy weapons (or one-handed vs two-handed), and how to make each of them a viable, fun, and unique option. Let's assuming the following:

  • Damage Dealt = (Weapon Damage + Character Stat - Enemy Armor) * Time
  • Time = 2 for normal, 1 for heavy (basically, normal attacks attack twice as much as heavy attacks)

Our unknown X variable then is Weapon Damage for each normal and heavy case. Condensed, this looks like:

Normal Damage = (Xn + St - Ar) * 2
Heavy Damage = (Xh + St - Ar) * 1

Let's balance that:

Xh + St - Ar = (Xn + St - Ar) * 2
Xh + St - Ar = 2*Xn + 2*St - 2*AR
Xh = 2*Xn + St - Ar

With just my gut balancing these numbers, I came up with Xn as 3 and Xh as 6, because in theory the stats and armor should cancel each other out (you apply stats twice with normal, but also armor twice, to heavy weapon's once and once). Therefor, weapon damage Xh should simply be twice as much as Xn because it takes twice as much time.

The few tricks here are that a 2 handed weapon dealing +3 damage means that with that extra time it will be bypassing some of the enemy armor more often than not, where two "normal" attacks will deal more damage to lightly armored opponents. This is shown by our equation that includes variables for St and Ar.

Let's plug some numbers in, and assume:
  • Character Stat = A number between 2 and 6
  • Enemy Armor = A number between 3 and 7
If we plug in the averages for those ranges, we get:

Xh = 2*Xn + 3 - 4
Xh = 2*Xn - 1

This is good, given our numbers that Ar will be on average slightly higher than St. If they would be the same, then the math would be a simple "heavy damage should be twice as much as normal" just as my gut told me. However, because we expect armor to be slightly more, we can now have numbers such as Xn = 3, and Xh = 5.

It all depends on St and Ar values. This is fun to me because that means characters that have low St will want to use heavier weapons. Those with high St lean towards lighter weapons. Then, against enemies with low armor, lighter weapons are more useful. But go against a tank that's armored head to toe, and you'll be missing your heavy weapon.

Interestingly, if armor is high enough, we could have ended up with an equation like Xh = 2*Xn -3. But, this means that given Xn = 3, Xh would also be 3! And if it was even larger, would heavy weapons have to be weaker?! On one hand this makes sense: attacking twice means you are encountering twice the armor. Here we've found our tipping point. When armor is so large that no attack would actually deal "positive" damage, we no longer have an interesting equation.

9 comments:

  1. I don't understand what you're asking at the end there. It looks like you're varying Xh versus Xn again, but you already fixed Xh = 2Xn earlier?

    Assumptions:
    * you want the two "damage dealt" quantities to usually be equal
    * a typical value for (St - Ar) is zero

    In that case you should fix Xh = 2Xn.
    Now you can start exploring the way the two "damage dealt" quantities (*not* Xn/Xh) vary when (St - Ar) is nontypical.

    * When (St > Ar), the "normal" damage deals an extra (St - Ar) damage over what heavy does
    * When (Ar > St), "heavy" damage deals an extra (Ar - St) damage over what normal does

    Does that help?

    ReplyDelete
    Replies
    1. I was indeed still a little confused myself, and over the course of today have been working at it. I've fixed the last paragraph with my findings.

      Basically, I was confused that at some point, the equation points to single and double attacks needing to be exactly the same amount of damage. That's crazy, right? Well it is! That's the point where damage output = armor, so nothing actually happens. If you keep going, all of a sudden your total damage will be "negative", which is nonsense.

      On the flip side, it is interesting to note that if armor values were on average less, we would need to increase Xh past 2Xn, so something like Xn=3 and Xh=7, in order to make heavy attacks (costing twice the time) to be worthwhile.

      Bottom line though is you nailed it: we've successfully found numbers where normal attacks are better against lightly armored opponents, and heavy attacks are better against heavily armored ones, which was more or less the original goal in the first place. Thank you for your thoughts!

      Delete
  2. What you have worked out does seem interesting. Two handed attacks need a benefit as they don't allow the use of a shield or a second one handed weapon. It does seem like taking more time and lacking those options imparts several disincentives to using two handed weapons? I would need to see this in play if taking more time to resolve an attack would be satisfying. I found in my previous iteration that players get less interested in taking attacks that take more time and actions.

    ReplyDelete
    Replies
    1. And there's the whole other part of the equation :D

      For Hostargo, for now, I'm actually going to try ignoring one vs two handed weapons. The theme of the game (Weird Tech Western) suggests that players will never really have "shields" or other off-hands. "Dual weilding" will be counted just as having two, single-handed weapons that both take a single tick to use (in other words no extra benefit at this point in time).

      That's a little lame probably long term, but I want to see how this works first.

      Delete
  3. It's a hard balance to navigate. Especially for dual weilding. It is something that players expect to work like D&D. In my experience a lot of players who really want this are trying to see how to game the system.

    ReplyDelete
    Replies
    1. I don't know about gaming the system as much as looking for a sense of realism. Bigger things do more damage, but are harder to use. Alternately, the balance could be timing, range, or ability. If there isn't a balance of pros and cons, in-game, every character and NPC would know what's best and always use that.

      Delete
    2. That's the trick: is coming up with SIMPLE yet significant differences between all of these things. I was going to start with the light/heavy difference and expand from there.

      In my recent playtest, it turned out that needing to spend two ticks on a heavy weapon was simply not fun, especially if that attack missed. It has a lot to do with you have less actions than everyone else - something I am against for this exact reason. Despite my vigilance on the topic, this mechanic had slipped through haha.

      Delete
  4. This is an interesting balancing equation, where I think you have to take melee vs range into account. In a "western" style game, you are more likely to have ranged weapons
    like pistols and shotguns, which means how far and accurate you can shoot is more important (as it determines how many turns you get before full engagement). One interesting thing I liked about DOOM (yeah, I know, dating myself) was the scaling shotgun damage based on range (due to spread). I also think your equations need one more tweak - 2H melee weapons should have an increased strength bonus - you are using both hands after all. I can certainly split a piece of wood more than twice as easily with a two-handed axe than with a hatchet.

    ReplyDelete
    Replies
    1. Agreed on all accounts. One difference between using a light and heavy weapon is using your Agility stat vs Strength stat respectively.

      My solution for balancing ranged weapons is that you first need to spend a tick to "aim" at a target, with difficulty based on distance, things in the way (allies, boxes, etc), and visibility conditions. Then you fire using dexterity based on the defense of the target. This is roughly the same as melee, who has to spend a tick to move into melee range, plus rolls for avoid obstacles or whatnot in the way.

      Once I have single-bullet style mechanics, I can then add "modifiers" like spread to increase/decrease damage based on range. Likewise, certain rifles/scopes will have positive or negative modifiers to aiming based on range.

      Delete