Piercing weapon skill training wonkiness

I have this veteran survivor with melee, cutting and bashing around 10, but 0 piercing (almost a game year of whacking stuff with a nodachi). I gave him a rapier, but despite killing hordes of zombies, his piercing skill would stay at 0. He also wouldn’t block, despite rapier having WBLOCK_2, nor would get his weapon stuck even once.

So I tried a pointy stick, because spears have better training ratios (always train piercing first). Piercing stayed at 0, despite every hit being described as “You pierce x”. Unlike when using the rapier, he wouldn’t use any techniques when using the spear (with the rapier literally every hit was rapid or precise).

I checked the savefile - piercing was listed as never trained (lasttrained: 4800, like barter and swimming).

I tried replicating it in debug mode both with similarly inflated skills and 0 in all - neither rapier nor pointy stick did anything to piercing skill. Only steel spear worked. I thought it might be focus, but the effect was the same with focus around 20 and 90. I got my debug survivor high on meth and then made him break a pointy stick over a zombie hulk - melee skill went from 1 to 2, bashing from 1 to 2, piercing stayed at 6% from 0 to 1.

It was all in build 900f26d, version 0.A-2119.

I also found an unrelated minor issue: when using “set all skills” debug command, practice doesn’t get rescaled properly and can go from like 10 (30%) to 0 (200%).

tl;dr Rapier and pointy stick don’t train piercing.

Pointy stick has a specific flag set instead of one-value array, maybe that’s the reason.

As for rapier, does “STAB” flag even make them train piercing?

Yes, “STAB” should split practice about evenly between cutting and piercing. At least that’s how it looks in melee.cpp and how comment clarifies it.

I see why pointy stick doesn’t train piercing despite being a spear - weapons that deal less than 10 points of damage of a certain type don’t count as that type for the purposes of training (unless you miss). I still see no explanation for rapiers, though.

I could have sworn I fixed the 10 point thing, maybe it got lost somewhere. Anyway, will fix that soon if it’s still there, it’s dumb.

Also, I believe [“STAB”] should actually train zero cutting.

Perhaps one of the flags of “stab” and “spear” can be made so that it trains no cutting at all? Or is that already the case?

So one flag could be used for knives, that are used for stabbing as well as cutting, and one for spears, which have no cutting edge.

Currently spears don’t train cutting at all, because they explicitly can’t count as cutting weapons.

Missed hits don’t check for actual damage that would be dealt, only damage types.
is_cutting() returns (cut/stab damage >= 8 && !spear), which makes any sharp dagger also train cutting on a miss.
Similarly, any weapon with bashing >= 8 trains bashing, though it would probably also do so on a hit.

Actual hits can train 2 damage types: always should train the one that deals the most damage, but the secondary only if the hit dealt at least 10 points of damage of this type.
I haven’t read all the sources, but from what I can tell, stabbing weapons don’t ever cut and cutting weapons don’t ever stab, resistance to cut counts against both stabbing and cutting (stabbing bypasses 20% of cutting armor).

In newest experimental binary, rapiers STILL don’t train piercing (on a fresh debug char) - they train cutting and some bashing. Pointy sticks now work, though.

That’s because the game has two types of damage: bashing and cutting. The cutting gets flag-modified into stab or pierce depending on weapon.

This should no longer the case, You practice the skill for a damage type if you dealt 10+ damage of that type OR if it’s the highest damage type. Pointy stick should be dealing 8 stabbing, and practicing that skill most of the time. a quick test verified this is happening at least at low levels.