Page 1 of 1

Ranged Weapon Melee Penalties

PostPosted: Monday, 19th March 2012, 16:25
by XuaXua
Are the penalties for attacking melee while wielding a ranged weapon scaled based on the weapon or take into consideration Unarmed Combat?

I ask because I am currently wielding a cursed sling (D9 and still not one Remove Curse scroll! Didn't realize it was an artifact b/c I'm playing near-trunk and all artefacts are showing up as "@description_needed" or somesuch) and I have 8 Unarmed Combat skill and am having little to no success in melee. I'd assume having a sling clenched in my fist wouldn't interfere THAT MUCH with melee combat. It's not like I'm trying to bean the monster over the head with an empty sling; I'm punching him with that sling in whatever way it's in my hand.

I can understand a crossbow being a bigger burden in the hands to conduct melee (though if used, it'd do more physical damage than, say, a sling), but a sling should be a minor penalty at worst.

Is it trying to use my Slings skill to hit the monster? That's nonsensical if so.

Re: Ranged Weapon Melee Penalties

PostPosted: Monday, 19th March 2012, 16:35
by Yet Another Stupid Noob
"You lash the orc with your sling"
The orc says "not my kink, sorry"

Re: Ranged Weapon Melee Penalties

PostPosted: Monday, 19th March 2012, 17:05
by mageykun
I don't know the exact formulas, but yes, making mele attacks with ranged weapons is not ideal.

This is somewhat of a moot point for ranged weapons users however, as there is no penalty to making a ranged attack at 0 range (So sling away!). Personally, I think it would make more sense if there was some penalty for trying to draw and fire your bow literally in an orc's face as he attacks you. Presumably this is why most ranged monsters switch to a mele weapon when adjacent to you, barring bowmasters, who are obviously just that good. (Not that there is a penalty, the AI just behaves as if trying to get a shot off at point blank range is a bad idea).

Not a moot point for melee users who make the mistake of wielding a cursed launcher, they're stuck with something they may not have the skill or ammo to use appropriately.

Re: Ranged Weapon Melee Penalties

PostPosted: Monday, 19th March 2012, 17:19
by Kate
It does no (base) damage, like hitting things with any other non-weapon. The "clumsily bash" message wasn't being properly displayed though, that's fixed now.

Re: Ranged Weapon Melee Penalties

PostPosted: Monday, 19th March 2012, 21:58
by XuaXua
mageykun wrote:I don't know the exact formulas, but yes, making mele attacks with ranged weapons is not ideal.

This is somewhat of a moot point for ranged weapons users however, as there is no penalty to making a ranged attack at 0 range (So sling away!).


This was a special case where (1) the description was buggy and misleading due to a bug and (2) I got cursed by it because of such (it looked like it read "uncursed" at a glance) and (3) I wasn't carrying any ammo, nor could I find any because I had nemelex-sacrificed all prior ammo for piety.

mageykun wrote:Personally, I think it would make more sense if there was some penalty for trying to draw and fire your bow literally in an orc's face as he attacks you. Presumably this is why most ranged monsters switch to a mele weapon when adjacent to you, barring bowmasters, who are obviously just that good. (Not that there is a penalty, the AI just behaves as if trying to get a shot off at point blank range is a bad idea).

Not a moot point for melee users who make the mistake of wielding a cursed launcher, they're stuck with something they may not have the skill or ammo to use appropriately.


I agree that point-blank missile weapons should be penalized at low skill (penalty eliminated at high skill), but I also think the melee penalty for attacking while wielding a ranged weapon need to be adjusted and compensate for a slightly penalized Unarmed Skill (secondary attacks notwithstanding).

Re: Ranged Weapon Melee Penalties

PostPosted: Tuesday, 20th March 2012, 02:21
by ElectricAlbatross
Re: point-blank shooting: My proposal is that for ranged weapons, the attack delay happens before the shot instead of after, and that any interruption-like event (primarily getting hit or taking damage, but there are probably other kinds) cancels the ranged attack.

So it'd look like this:
  Code:
[you press the button to fire]
You draw your bow, and prepare to fire.
[attack delay]
You shoot a +0 arrow.

or:
  Code:
You draw your bow, and prepare to fire.
The goblin hits you with a dagger. Your shot is interrupted!


Some balancing knobs to tweak:
  • Attack delay decreases with higher ranged skill, so with the proposal implemented exactly as above you would be less likely to be interrupted before you complete your shot.
  • Let the chance of being interrupted by damage decrease with the appropriate ranged skill.
  • Let only a fraction of the attack delay happen before the shot, and the rest after. Bonus points if the pre-delay to post-delay ratio differs by weapon type.

Ideally I'd like to see magic spells under a similar interruptible delay system, but that may be too game-ruining for early magic-using characters, or encourage tedious kiting.

Re: Ranged Weapon Melee Penalties

PostPosted: Tuesday, 20th March 2012, 06:50
by TwilightPhoenix
I'd imagine Crossbows would have a quick pre-shot delay and long post-shot delay. It's just a point and click interface for shooting, but you have to place a new bolt and rewind the crossbow to reload it.

Bows and slings would make sense with a longer pre-shot delay. The bow you need to draw the arrow and aim. Reloading it you just reach back into your quiver for another arrow. The sling you need to spin it for momentum before releasing the rock. Reloading it is just putting one in the sling.

Blowguns, maybe even? Sticking a dart in a blowgun is a quick task, as is aiming and blowing some air.

Throwing weapons... well, I'd say about even too. Tossing something is fast, as is picking up another whatever to toss.

Re: Ranged Weapon Melee Penalties

PostPosted: Tuesday, 20th March 2012, 14:24
by Kate
I'm not sure what the gain is from adding even more complicated delays to ranged weapons, really (whether at point blank or not).

Re: Ranged Weapon Melee Penalties

PostPosted: Tuesday, 20th March 2012, 14:57
by BlackSheep
I think it was an attempt at a subtle nerf of ranged weapons. Intuitively, it seems like a bad idea to fire missiles at point blank range, but there's no mechanical drawback apart from being vulnerable to melee attacks from your opponent.

I don't know what XuaXua was going on about with unarmed combat, though.

Re: Ranged Weapon Melee Penalties

PostPosted: Tuesday, 20th March 2012, 15:59
by Kate
There are probably much better ways to nerf them if they need it than to add a lot of unnecessary complexity.

Re: Ranged Weapon Melee Penalties

PostPosted: Tuesday, 20th March 2012, 18:23
by XuaXua
BlackSheep wrote:I don't know what XuaXua was going on about with unarmed combat, though.


I'm referring to using Unarmed Combat in melee as a default (penalized) when wielding a missle weapon for the purposes of melee (read: hand to hand combat).

Use a unarmed combat skill with a to-hit penalty and a damage penalty when attacking MELEE while wielding a missile weapon in a hand, whether intentional or not (cursed). Curve the penalty based on the weapon held (100% penalty when wielding a crossbow, 50% when wielding a longbow, 10% penalty when wielding a sling, 0% when wielding a rock).

Potentially have separate penalties for to-hit and damage.

Re: Ranged Weapon Melee Penalties

PostPosted: Tuesday, 20th March 2012, 18:54
by BlackSheep
Why limit that to just missile weapons?

Re: Ranged Weapon Melee Penalties

PostPosted: Tuesday, 20th March 2012, 19:01
by XuaXua
BlackSheep wrote:Why limit that to just missile weapons?


I wasn't going to be so bold.

Re: Ranged Weapon Melee Penalties

PostPosted: Tuesday, 20th March 2012, 19:12
by Kate
Attacking with a non-weapon means you get zero base damage. Much clearer and simpler than using some completely unrelated skill but with obscure, variable penalties.

Re: Ranged Weapon Melee Penalties

PostPosted: Tuesday, 20th March 2012, 20:07
by XuaXua
MarvinPA wrote:Attacking with a non-weapon means you get zero base damage.


That's great. What's the to-hit?

Re: Ranged Weapon Melee Penalties

PostPosted: Tuesday, 20th March 2012, 20:38
by Kate
Whatever your regular to-hit with no weapon bonuses is.

Re: Ranged Weapon Melee Penalties

PostPosted: Tuesday, 20th March 2012, 21:18
by XuaXua
MarvinPA wrote:Whatever your regular to-hit with no weapon bonuses is.


And is that based on a skill?

Re: Ranged Weapon Melee Penalties

PostPosted: Tuesday, 20th March 2012, 21:49
by Kate
Fighting skill contributes to it, yes. melee_attack.cc can probably answer questions, also.

Re: Ranged Weapon Melee Penalties

PostPosted: Tuesday, 20th March 2012, 23:14
by XuaXua
So... someone with Unarmed 27 puts a grape or choko in his hand and attempts to attack melee and uses SK_Unarmed_Combat.
That's fine.

Someone with Unarmed 27 and no ammo puts a sling in his hand and attempts to attack melee and uses SK_Slings for striking. Totally makes sense.

Granted I just checked several files for the source to weapon_skill to see what it returns and can't locate it. Only damage in that source file you reference refers to ranged weapons.

Re: Ranged Weapon Melee Penalties

PostPosted: Tuesday, 20th March 2012, 23:48
by galehar
nonsense.
When using anything else than a proper weapon (launcher, food, scroll,...) the only skill that factors in is fighting. UC and launcher skills have no effect when meleeing with a non-weapon.

Re: Ranged Weapon Melee Penalties

PostPosted: Wednesday, 21st March 2012, 01:35
by XuaXua
galehar wrote:nonsense.
When using anything else than a proper weapon (launcher, food, scroll,...) the only skill that factors in is fighting. UC and launcher skills have no effect when meleeing with a non-weapon.


So...

  Code:
wpn_skill       = weapon ? weapon_skill(*weapon) : SK_UNARMED_COMBAT;


doesn't mean "if this is a weapon, give me the weapon skill associated with this weapon, otherwise give me the unarmed combat skill and assign this as the weapon skill" ?

To me, that reads as "if I have a sword or crossbow, give me the sword or crossbow skill, otherwise if I have a choco, deck of cards or nothing in my hands, give me unarmed combat", which is great except that crossbow skill shouldn't dictate how well I fight in melee with a crossbow; it should default to unarmed like the choco and deck do."

Re: Ranged Weapon Melee Penalties

PostPosted: Wednesday, 21st March 2012, 01:55
by BlackSheep
No, it means if you have something in your weapon slot, find the relevant weapon skill. If you have nothing equipped, use UC.

EDIT: Found the weapon_skill function in itemprop.cc: it only returns a weapon skill if an item is a weapon and is not a ranged weapon (or is a rod/stave). Otherwise, it just returns Fighting, like galehar said.

Re: Ranged Weapon Melee Penalties

PostPosted: Wednesday, 21st March 2012, 07:11
by galehar
XuaXua wrote:
galehar wrote:nonsense.
When using anything else than a proper weapon (launcher, food, scroll,...) the only skill that factors in is fighting. UC and launcher skills have no effect when meleeing with a non-weapon.


So...

  Code:
wpn_skill       = weapon ? weapon_skill(*weapon) : SK_UNARMED_COMBAT;


doesn't mean "if this is a weapon, give me the weapon skill associated with this weapon, otherwise give me the unarmed combat skill and assign this as the weapon skill" ?

It does, but then you have to look at how this variable is used.

  Code:
int melee_attack::player_apply_weapon_skill(int damage)
{
    if (weapon && (weapon->base_type == OBJ_WEAPONS
                   && !is_range_weapon(*weapon)
                   || weapon->base_type == OBJ_STAVES))
    {
        damage *= 2500 + (random2(you.skill(wpn_skill, 100) + 1));
        damage /= 2500;
    }

    return (damage);
}

Re: Ranged Weapon Melee Penalties

PostPosted: Wednesday, 21st March 2012, 13:08
by XuaXua
galehar wrote:
XuaXua wrote:So...

  Code:
wpn_skill       = weapon ? weapon_skill(*weapon) : SK_UNARMED_COMBAT;


doesn't mean "if this is a weapon, give me the weapon skill associated with this weapon, otherwise give me the unarmed combat skill and assign this as the weapon skill" ?

It does, but then you have to look at how this variable is used.

... snip damage calculation code...



That damage calculation code really take into account some manner of the size of the non-weapon object used; brass knuckles anyone?

Back on topic, every post I've made (except this one) has always been referring to how a weapon skill affects the "to-hit" chance, especially since I started this thread not even realizing weapon skill factors into damage.

Re: Ranged Weapon Melee Penalties

PostPosted: Wednesday, 21st March 2012, 15:40
by BlackSheep
If you're using a non-melee weapon in melee, what you're wielding doesn't factor into the to-hit calculation. It uses dex modified by strength as a base, then factors in:
Fighting skill
slaying bonuses
amulet of inaccuracy
invisible target
starving status
armour penalty
eyeball mutation

Re: Ranged Weapon Melee Penalties

PostPosted: Wednesday, 21st March 2012, 16:30
by BlackSheep
Yeah, not unless you're getting in a stab, berserking or under the effect of a might potion.

Re: Ranged Weapon Melee Penalties

PostPosted: Wednesday, 21st March 2012, 16:57
by Kate
As has been explained multiple times already: weapon and unarmed combat skills have no effect at all on anything at all when using a non-weapon (this includes launchers) in melee. All non-weapons (this includes launchers) do zero damage in melee.

I see no reason to change any of that.

Re: Ranged Weapon Melee Penalties

PostPosted: Thursday, 22nd March 2012, 14:15
by njvack
MarvinPA wrote:As has been explained multiple times already: weapon and unarmed combat skills have no effect at all on anything at all when using a non-weapon (this includes launchers) in melee. All non-weapons (this includes launchers) do zero damage in melee.

I see no reason to change any of that.


Is the "wield nonweapon before Mara clones you" thing a real trick, or is that apocryphal? The description of my clone doesn't, IIRC, include a wielded weapon at all...

Re: Ranged Weapon Melee Penalties

PostPosted: Thursday, 22nd March 2012, 15:53
by BlackSheep
It works. Wielding a bread ration causes the clone to do next to no damage. (I say next to no because when I took off all armor, it was able to plink me for like 1 HP per turn.)