Shield point formula

Playing an Oni conjurer, trained enough shield to finally wear my kite shield without too much spell success chance but I seem to get a lot less shield stat from it then I would expect from the formulas on the wiki.

Top of the dump:

 Dungeon Crawl Stone Soup version 0.34.1 (tiles) character file.

Game seed: 2427067576691629886

Gatox the Fighter (Oni Conjurer)                   Turns: 23881, Time: 02:54:49

Health: 154/154    AC:  7    Str: 16    XL:     14   Next: 34%
Magic:  38/38      EV:  8    Int: 23    God:    Vehumet [*****.]
Gold:   1416       SH: 10    Dex:  7    Spells: 11/35 levels left

rFire   . . .  (100%)   x - +4 flail {elec, rElec rN+ Str+2}
rCold   + . .  (50%)    q - +2 kite shield
rNeg    + . .  (50%)    w - +1 robe of the Isitwalangcengce {Will+}
rPois   .      (100%)   g - +0 hat
rElec   +      (33%)    a - +2 cloak {Air}
rCorr   .      (100%)   h - amulet of regeneration
SInv    .               o - ring of magical power
Will    ++...           t - ring of protection from cold
Stlth   ++        
HPRegen 1.25/turn
MPRegen 0.26/turn

%: no passive effects
@: studying Maces & Flails
A: large, unfitting armour, horns 1, tough skin 1, double potion healing,
drunken brawling
a: Renounce Religion (0%)


You are on level 3 of the Lair of Beasts.
You worship Vehumet.
Vehumet is extremely pleased with you.
You have visited 4 branches of the dungeon, and seen 19 of its levels.

You have collected 2120 gold pieces.
You have spent 704 gold pieces at shops.

Inventory:

Hand Weapons
 m - a +1 whip of flaming
 n - a +0 trident of protection
 p - a +2 war axe of freezing
 s - a +5 mace of protection
 v - a +4 mace of freezing
 x - the +4 flail "Seelatew" (weapon) {elec, rElec rN+ Str+2}
   (You bought it in a shop on level 1 of the Orcish Mines)   
   
   rElec:     It insulates you from electricity.
   rN+:       It protects you from negative energy.
   Str+2:     It affects your strength (+2).
   
   It cannot be enchanted further.
 y - the +1 spear "Xunwag" {heavy, rF- Dex+4}
   (You bought it in a shop on level 2 of the Orcish Mines)   
   
   rF-:       It makes you vulnerable to fire.
   Dex+4:     It affects your dexterity (+4).
   
   It cannot be enchanted further.
Missiles
 d - 3 darts of disjunction
 e - 25 poisoned darts (quivered)
 k - 10 curare-tipped darts
Armour
 a - a +2 cloak of air (worn)
 g - a +0 hat (worn)
 q - a +2 kite shield (worn)
 u - a +1 robe of cold resistance
 w - the +1 robe of the Isitwalangcengce (worn) {Will+}
   (You found it on level 13 of the Dungeon)   
   
   Will+:     It increases your willpower.
   
   It cannot be enchanted further.
Magical Staves
 l - a staff of cold
Jewellery
 h - an amulet of regeneration (worn)
 o - a ring of magical power (worn)
 r - the amulet "Josia" {Chemistry Bane rPois rC+ SInv}
   (You took it off Cassandra on level 10 of the Dungeon)   
   
   [amulet of chemistry]
   
   Chemistry: It restores some MP whenever you drink a potion and also enhances
              your alchemy spells.
   Bane:      It inflicts you with a random bane when you equip it.
   rPois:     It protects you from poison.
   rC+:       It protects you from cold.
   SInv:      It lets you see invisible.
 t - a ring of protection from cold (worn)
Talismans
 j - an inkwell talisman
Wands
 c - a wand of roots (11)
 b - a wand of quicksilver (20)
 a - a wand of flame (30)
 e - a wand of charming (8)
Scrolls
 t - 8 scrolls of teleportation
 V - 2 scrolls of vulnerability
 b - 3 scrolls of blinking
 r - 2 scrolls of revelation
 a - 3 scrolls of enchant armour
 w - 4 scrolls of enchant weapon
 g - a scroll of fog
 e - 2 scrolls labelled WUIT WOTTAESONOTZ
 p - a scroll of poison
 m - a scroll labelled YSINELATARCH
 h - a scroll labelled GEFACI MI FINIL
 x - 3 scrolls of amnesia
Potions
 g - 3 potions of magic
 i - 3 potions of invisibility
 c - a potion of curing
 w - 4 potions of heal wounds
 r - a potion of resistance
 B - 6 potions of berserk rage
 e - a potion of enlightenment
 n - a black potion
 M - 3 potions of mutation
 o - a fuming ruby potion
 m - a potion of might
 p - a golden potion
 d - a murky clear potion


   Skills:
 * Level 13,8 Fighting
 + Level 2,1 Maces & Flails
 - Level 0,3 Throwing
 + Level 7,0 Dodging
 - Level 2,0 Stealth
 * Level 7,5 Shields
 - Level 11,0 Spellcasting
 + Level 10,4 Conjurations
 - Level 8,0 Translocations
 + Level 3,2 Fire Magic
 + Level 5,8 Ice Magic
 + Level 3,2 Air Magic
 + Level 3,7 Alchemy
 + Level 1,2 Evocations

Shield is a kite shield +2, shield skill is 7.5, dex is 7 so by the formula in the wiki:
8 base
+(8/40 +0.19)7 = 2.73 skill bonus
+7
38*(8+13)/5200 = 1.07 dex bonus
+2 enchantment

comes to 13.8 shield. But I only get 10.9 from looking at the shield. So what am I missing, why is my Oni getting a lot less shield?

You shouldn’t trust the wiki for anything. The code for shields:

static int _sh_from_shield(const item_def &item)
{
    const int base_shield = property(item, PARM_AC) * 2;

    // bonus applied only to base, see above for effect:
    int shield = base_shield * 50;
    shield += base_shield * you.skill(SK_SHIELDS, 5) / 2;

    shield += item.plus * 200;

    shield += you.skill(SK_SHIELDS, 38);

    shield += 3 * 38;

    shield += you.dex() * 38 * (base_shield + 13) / 26;
    return shield;
}

And then, because of some weirdness, the value displayed is half that IWRC.

Thanks, I assume this is copied directly from code but I’m still confused.

First, the shield value from a kite shield property(item, PARM_AC)=8? Which is multiplied first by 2 and then by 50, so by 100. But then the item.plus (=enchantment?) is multiplied by 200. Meaning the difference between a kite shield +0 and a kite shield +2 is not 8 versus 10 or 25% better but rather 800 versus 1200 or 50% better? That doesn’t seem to match what I observe in game?

The rest almost matches the formula in the wiki if you know that the final numbers are divided by 200.

Played around with a tower and kite shield some more. I think the you.dex() function is not directly your dex but rather your dex score minus 10, so sort of your dex relative to a 10 base value. And if you are an oni with crappy dex like my current char, this line of the formula will actually give you a negative contribution.

1 Thank