Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Jul 2016
stranger
OP Offline
stranger
Joined: Jul 2016
I'm completely baffled by this. How does it work, and why is it negative (or is that not why a "-" is in front of the value)? I'm changing the values and it seems to give arbitrary results. Unless if I'm mistaken, sometimes when I increase it (change the value towards zero, if it's a negative value like it seems), the damage is increased, and sometimes it's reduced.

And if it isn't a negative value, well, I've often in mods seem that people put values without the "-". I'm utterly confused.

Joined: Jun 2013
old hand
Offline
old hand
Joined: Jun 2013
I've never seen a negative Damage boost increase damage, which item did you see that with? Or was it something of your own creation?


Here is the explanation from one of Larian's Docs:

Quote

DamageBoost

This is a positive or negative number in percentages that adds that amount to the damage after it's been calculated.

E.g. if you fill in -50, it will first calculate the damage using Damage and Damage Range, and then it will cut both numbers in half.
If you fill in 200, it will double both numbers.


Quote

Damage, Damage Range

Usually, the inherited value should be okay. However, for special enemies, it is good to know how weapon damage is calculated.

DA weapon does between x and y damage. How code calculates these numbers is as follows:
base damage x = Damage level mapped, i.e. in Damage, fill in a number between 0 and 10
base damage y = Damage level mapped + Damage Range level mapped, i.e. in Damage Range, fill in a number between 0 and 10

Example:
Damage 2 and Damage Range 6 = weapon does between 2 and 8 damage (level mapped)
Damage 5 and Damage Range 3 = weapon does between 5 and 8 damage (level mapped)
This means that the maximum damage of both weapons is the same, but the second weapon will be more interesting because its minimum damage is higher. I.e. its average damage output will be larger as well.

Joined: Jul 2016
stranger
OP Offline
stranger
Joined: Jul 2016
I see, thank you.

The thing is that, in the files, WPN_Rapier_A seems to represent the "Rapier", Rapier B the "Sharp Rapier", and Rapier C the "Military Rapier", at least according to the MapKeys (if I use those keys for a custom rapier I get the same icon and name). Rapier is the weakest, while Military Rapier is the strongest. But, in the files, Rapier C seems to have the largest negative damage boost, and Rapier A the smallest.

Last edited by Doomjoon; 27/07/16 07:18 PM.
Joined: Jun 2015
F
enthusiast
Offline
enthusiast
F
Joined: Jun 2015
Negative does indeed decrease damage.

But it does not matter that it is negative, only what comes out in the end is important.


They use the increasing negative values to compensate for the function they use for calculating weapon damage having a somewhat exponential effect. (Not good enough in math anymore to be sure about that.)
I have no clue what function they use exactly, but increasing the negative value means that weapon damage does not increase as fast with level as it would without the 'boost'.
Also means that from a certain level on, crafted weapons get better in damage than dropped ones because they always get created with a fixed 'Damage Boost' whereas drops use higher Act Part stats with increased negative 'boosts'.
(In reality, at least crafted 1H axes and swords have higher Damage and Damage Range in the first place, which is why they are so overpowered and become even more so with higher levels.)

I have all possible damage values in a LibreOffice spreadsheet with some functions to fill them in and apply a boost to find out the damage, from Damage 0, Damage Range 10 to Damage 10, Damage Range 10, from level 1 to level 30, but I have no place to upload it and I don't want to register anywhere just to do that ;-)
(I put the values in a sheet so that I could maybe find out some formula, but I failed ;-)

What I know is that the formula posted on the Divinity Wiki (divinity.wikia.com I believe) is wrong because it gets increasingly inaccurate with increasing Damage and Damage range, but it is a good approximation for lower Damage and Damage Range, as the game uses:

Min damage: ((ItemLevel + 1) *2) *(100+Boost DMG)/100 *(Min DMG)
Max damage: ((ItemLevel + 1) *2) *(100+Boost DMG)/100 *(Min DMG + Add DMG)

is the formula they posted and that is a good enough approximation as mentioned above, with
DMG = Damage and Add DMG = Damage Range, ItemLevel = Act Part.
The approximation is good for a Damage 3, Damage Range 2, like a typical 1H sword uses and is still good enough for even 2H axes with 4+3 up to level 20. With higher Damage/Damage Range and above level 20, the values get increasingly inaccurate ... or the game's used floating point math library is so inaccurate, but I doubt that, because with 10/10 on Act Part 30, the difference is some 10% or more as far as I remember, using those values (leaving out any boost, making this multiplier 1)

((30+1)*2*10 == 62 * 10 == 620 and the Max being twice that with a range of 10 --> 1240.
My spreadsheet with values taken from the game's tooltip says 716-1432, so the 'approximation' is no longer good enough for those high values.

The skill system must use the same formula to calculate damage, it only has a different way of calculating Min and Max when some Damage Range is involved.

What values you can use is defined in Stats\Generated\Structure\Modifiers.txt with "DamageBoost" being of type "ConstantInt", which can be looked up in Stats\Generated\Structure\Base\ValueLists.txt.
Now, ConstantInt is not really defined there as a value list, so we must assume, that they mean 'whole number' with it, which can be positive or negative.
... and if that is the case, Larian made tons of mistakes in the Weapons.txt when they used fractional numbers for the boosts, but the engine seems to accept that.

As far as I remember, sharpening a weapon on a whetstone (or a damage boost as a mod on a dropped weapon) does not directly boost current damage with the value specified in the boost but the current and the new boost are first added and then a new damage is calculated, which makes a difference, because, taking as an example a weapon with 1000 base damage and a boost of -30, 1000 * 0.7 = 700. If that were boosted by a 30% boost and that would be applied after this calculation, the damage would be 700 * 1.3 == 910. What is actually calculated though is 1000 * (100 + B1 + B2 )/100 with B1=-30 and B2=30, so the result is 1000 again.

Joined: Jul 2016
stranger
OP Offline
stranger
Joined: Jul 2016
wew

welp, it's pretty much how I imagined it to be, it just seems like there was some bug/abstraction, or maybe I just wasn't paying attention. In any case, thank you.


Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5