stacked enchantments calculated wrong ?

General discussion regarding the OpenMW project.
For technical support, please use the Support subforum.
Post Reply
LoneWolf
Posts: 12
Joined: 26 Sep 2017, 19:13

stacked enchantments calculated wrong ?

Post by LoneWolf » 08 Dec 2017, 13:40

I experimented with a weapon that has a soultrap effect and an offensive spell and noticed something weird in openmw 0.43 .

weapon : steel battle axe , enchant value 5.5

first enchantment : soul trap on touch for 2 seconds, cast on strike, basecost 0.2
enchantment cost = 0.2 * ( (1+1)*2 + 0 )/40 = 0.02
uesp wiki doesn't state how many digits are used on storing enchantment points,
but enchantment values of items are described as integers that should be divided by 10 to get real value.
This also matches the values in Openmw-CS and suggests 1 decimal digit is used.
this soul trap effect would thus count as 0.1 enchantment point .

Points left for second enchantment :
5.5 - 2 * 0.1 = 5.3 points

An enchantment of absorb health on touch for 1 second with magnitude 13 to 13 has this enchantment point value :
8 * ( (13 + 13) *1 + 0 ) / 40 = 5.2 points

Openmw 0.43 only allows me to add a absorb health of magnitude 9 to 9 or 3.6 points .

In the openmw 0.43 change log i found "Fixed enchantment point calculation to match vanilla (#3805)"
Following bug #805 lead me to https://github.com/OpenMW/openmw/blob/m ... anting.cpp

look at the function Enchanting::getEnchantPoints() starting at line 166 .
On line 205 we see :
enchantmentCost += static_cast<int>(cost);

This results in soul trap taking up 1 enchantment point, so there's only 3.5 points left .
(the allowed 3.6 points enchantment could be due to rounding or type conversion errors) .


Notes :

- formulae used for calculating enchantment points are taken from http://en.uesp.net/wiki/Morrowind:Enchant

- While I do think this is a bug, i've never played vanilla morowind and could be misinterpreting enchantment point calculations.
Posting about this seemed best option for now.

- I was unsure whether general > general discussion or technical > development was correct board.
Moderators, please move if you feel this topic is in wrong board.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests