# Min-Maxing Melee Damage

I took a look at Melee.cpp but I couldn’t make heads of tails of how bashing damage is capped by strength + skill, or how to math my around cutting weapons getting stuck.

Could I get an explanation how the variables bash_cap and roll_stuck_penalty work?

The end result should be a character capable of wielding a sledgehammer and/or a katana to full potential.

roll_stuck_penalty, this is the number of turns you lose if the weapon gets stuck.
For a katana you get 180 + 5enemy bash armor + 4enemy cut armor - d10*CutSkill. This value cannot exceed 450 for a katana.
If you have 5 cutting skill attacking an enemy with 2 of both armor types, you will lose between 148-193 moves.
180+10+8-(Some number between 5 and 50, because there are 5 10-sided dice being rolled).
Edit: I’m not sure whether you always get your weapon stuck, or what controls the probability.

[code]
ret = weapon.damage_cut() * 4 + basharm * 5 + cutarm * 4 -
dice(skillLevel(“cutting”), 10);

if (ret >= weapon.damage_cut() * 10)
return weapon.damage_cut() * 10;[/code]
bash_cap = 5 + Strength + Bashing.
This ignores the weapon you are using.
A sledgehammer does 40 bash, so if you have 0 skill and 8 strength you will deal 13 damage maximum normally, 26 on a critical (Criticals double bash_cap).

[quote=“Weyrling, post:2, topic:1161”]bash_cap = 5 + Strength + Bashing.
This ignores the weapon you are using.
A sledgehammer does 40 bash, so if you have 0 skill and 8 strength you will deal 13 damage maximum normally, 26 on a critical (Criticals double bash_cap).[/quote]

Please expand on this a little. Are you saying that the bash value of the weapon doesn’t matter? Or is it about the chance of having the weapon stuck only? (i’m totally inept at reading code, so use words )

The bash cap is a limit on how much damage you can do with a bashing weapon, meaning that a weakling deals significantly less than 40 damage with a sledgehammer, despite its massive potential.
If you have 4 Str 0 Bashing skill, you could deal a max of (5+4+0=)9 damage with a sledgehammer. However if you had 24 Str (Hydraulic muscles) and 0 skill, you could deal (5+24+0=)29 damage with the sledgehammer.
With 28 Str and 7 bash skill, you’d have a bash_cap of (5+28+7=)40, giving you full potential wielding the sledgehammer.
Note that all above values are only maximum damage, you might deal significantly less than this in practice.
AFAIK bashing weapons don’t ever get stuck, thats for stabbing/cutting weapons only.

Thank you very much. I understand how bashing works now.

As for cutting, with such a wide range in armor types, it seems to me the most effective way to get more damage from cutting would be to decrease the probability of getting stuck in the first place. You’d need to use a steak knife (2 bash, 10 cut) against an unarmored opponent to get stuck times to a reasonable level, but the second you try stabbing a zombie soldier (8 bash armor, 16 cut armor) you’re stuck all over again.

40 + 0 + 0 - 5 through 50 = Okay to get stuck

40 + 40 + 64 - 5 through 50 = Lose a turn when you get stuck.

And that’s a steak knife.

[quote=“krAbhandz, post:5, topic:1161”]Thank you very much. I understand how bashing works now.

As for cutting, with such a wide range in armor types, it seems to me the most effective way to get more damage from cutting would be to decrease the probability of getting stuck in the first place. You’d need to use a steak knife (2 bash, 10 cut) against an unarmored opponent to get stuck times to a reasonable level, but the second you try stabbing a zombie soldier (8 bash armor, 16 cut armor) you’re stuck all over again.

40 + 0 + 0 - 5 through 50 = Okay to get stuck

40 + 40 + 64 - 5 through 50 = Lose a turn when you get stuck.

And that’s a steak knife.[/quote]
The good thing about using a low moves/attack and low cut damage weapon is that the maximum time stuck is 10*CuttingDamage. It allows you to both hit+run most common zombies, as well as have an easy recovery if the weapon misses or gets stuck. In comparison, the katana is best if you immediately kill everything you swing at in a single blow.

I seem to remember (from somewhere) that there’s a lower chance of getting a cutting weapon stuck with higher strength, so obviously the best way to use a katana is to first get Hydraulic Muscles, but I rarely if ever find both of them in the same game.

I kinda get it (at least i think so). So a weapon’s damage is not the damage inflicted, but the maximum damage a weapon can inflict, depending on the formula used for the specific type of damage, right?
If so, the only way to do extra damage is to have a critical roll ? and increasing skill helps only to a certain limit, depending on the weapon’s max damage, but it helps also critting more often then not?
Also, is it a fixed amount of damage, or does it have a variable ?

[quote=“Ferodaktyl, post:7, topic:1161”]I kinda get it (at least i think so). So a weapon’s damage is not the damage inflicted, but the maximum damage a weapon can inflict, depending on the formula used for the specific type of damage, right?
If so, the only way to do extra damage is to have a critical roll ? and increasing skill helps only to a certain limit, depending on the weapon’s max damage, but it helps also critting more often then not?
Also, is it a fixed amount of damage, or does it have a variable ?[/quote]
Bash damage is half your strength + weapon bashing damage. The Maximum it can be is 5+Str+Skill.
A critical increases damage by 50% flat, then adds skill, half of strength, and halves the effective enemy bash armor. It also doubles bash_cap.
Minimum bashing damage is (weapon bashing+half strength) divided by 4. Another minimum is that your bash_dam can’t be less than your skill+half strength.
So at 8 Strength 0 Skill, wielding a sledgehammer, your minimum damage is 11, max damage is 13. Crit and you do between 20-26 damage.

For Cutting damage, base is weapon cut damage minus enemy cut armor, then modified by skill:

```// 80%, 88%, 96%, 104%, 112%, 116%, 120%, 124%, 128%, 132% if (skillLevel("cutting") <= 5) ret *= double( 0.8 + 0.08 * skillLevel("cutting") ); else ret *= double( 0.92 + 0.04 * skillLevel("cutting") );```
Cutting criticals are apparently uncapped, but it takes 12 skill levels to reach 200% damage.

``` if (crit) ret *= double( 1.0 + double(skillLevel("cutting") / 12) );```

For Stabbing damage enemy armor is first reduced by 3*Stabbing Skill. Then it gets a bonus against fast monsters, which is capped at potentially double damage. Stabbing criticals are maxed at 250% damage at skill level 8.

I am wielding a steel chain at the moment, just for fun.
It has the “+Grab” perk and sometiems the battlog says:
“You wrap your steel chain around the zombie, inflicting X damage!”
"You whack the zombie for X damage!"
It’s like a double attack, I guess. But I wonder how the damage is calculated for those special attacks.

[quote=“Rookie, post:9, topic:1161”]I am wielding a steel chain at the moment, just for fun.
It has the “+Grab” perk and sometiems the battlog says:
“You wrap your steel chain around the zombie, inflicting X damage!”
"You whack the zombie for X damage!"
It’s like a double attack, I guess. But I wonder how the damage is calculated for those special attacks.[/quote]
AFAIK the second attack is an unarmed one. I’ve been noticing my unarmed skill rising when using a chain too, so I guess it’s true and for my piddly 8 STR guy I suppose it’s not the best weapon. Then again, the +Grab is +God tier. Maybe I should just make a martial artist, find a chain and some hydraulic muscles. Could be pretty freaking OP.

GET OVER HERE…

From my experience a sledge hammer is useless against multiple enemies.

[quote=“Dalgul, post:11, topic:1161”]From my experience a sledge hammer is useless against multiple enemies.[/quote] well yeah. Shame you can’t dual-wield combat knives for extra slicy goodness. I’ve never used a sledge purely because my chars don’t have the strength and generally the moves per attack is so damn high.

I’ve really been trying hard to make a character that could use a sledge. 20 strength illiterate savants are not easy to play. Even with 20 strength, I’d still need 15 bash to make the sledge fully effective.