Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Jun 2017
W
Wilker Offline OP
journeyman
OP Offline
journeyman
W
Joined: Jun 2017
I found that the old formula to calculate Damage Reduction is: "proportion blocked = armour rating / ((4.5 * (1 + attacker level)) + armour rating)" in the game's wikia. But in the Enhanced Edition the formula was changed, right? So what is the new formula to find Damage Reduction based on Armour Rating and Attacker Level?
(I'm desperate to know)

Joined: Mar 2003
Location: Canada
Support
Offline
Support
Joined: Mar 2003
Location: Canada

The damage reduction is:
sqrt(armor / 10 - attackerLevel + 8)*0.4 - 1.1) clamped between 1% and 95%
The numbers in the formula are single precision floating point values.

Joined: Jun 2017
W
Wilker Offline OP
journeyman
OP Offline
journeyman
W
Joined: Jun 2017
Hallelujah! The Gods have answered my pray! hahaha Thank you very much Raze.
I should have asked for it before... I spent some days searching for it on the internet. And some hours trying to figure it out for my self. I'm glad I gave up, I would never have found it alone.
I found two wikis with the old formula: http://divinityoriginalsin.wiki.fextralife.com/Defenses and
http://divinity.wikia.com/wiki/Defenses_(Divinity:_Original_Sin).
And other wandering souls: https://steamcommunity.com/app/373420/discussions/0/451848855009582900/ and https://steamcommunity.com/app/373420/discussions/0/490124466467920809/ . I would put the formula on the forums, but I don't have a steam account.
Was the formula some sort of secret? Or was it publicated somewhere, with other similar formulas?
After playing other similar RPG's I found this pleasure, of really knowing what's happening behind the numbers. Anyways, it's a wonderful game. Congratulations for all the team.
I have no idea what "single precision floating point value" means. But the formula works!
This is a screenshot of the formula on my calculator, just to clarify it:
[Linked Image]

Joined: May 2010
Location: Oxford
Duchess of Gorgombert
Offline
Duchess of Gorgombert
Joined: May 2010
Location: Oxford
Originally Posted by Wilker
I have no idea what "single precision floating point value" means. But the formula works!

It's the storage type used in programming. In essence it means you get around 6-9 significant figures (in decimal, that is) beyond which there may be small rounding errors, which are probably acceptable within this context.

Typically overly verbose Wikipedia page: everything you never wanted to know! biggrin


J'aime le fromage.
Joined: Jun 2017
W
Wilker Offline OP
journeyman
OP Offline
journeyman
W
Joined: Jun 2017
Ha! Well, at least the essence of it I know now.
But I actually wrote that I have no idea what this "creature" is, after checking the exact same wikipage you mentioned.
I think it will remain forever a mystery... even now that I understand it's essence.
But I agree with you. The fromage is not bad.

Joined: Mar 2003
Location: Canada
Support
Offline
Support
Joined: Mar 2003
Location: Canada

Basically, it means the values are decimal (even though I wrote the 10 and 8 as integers, since the distinction is irrelevant for human calculations), and done with standard precision (the result for the damage is going to be a whole number, so there isn't much point calculating everything to 15 decimal places).

Joined: Jun 2017
W
Wilker Offline OP
journeyman
OP Offline
journeyman
W
Joined: Jun 2017
nhm... So floating point means that 10 and 8 are actually decimals. But it won't make a big difference in my calculations.
And the precision(standard? single?) means that in the end the little decimals will be cut out anyway.

Joined: Mar 2003
Location: Canada
Support
Offline
Support
Joined: Mar 2003
Location: Canada

The precision is just how many decimal places are used in the calculations. It is because the end result will be a whole number that single precision is fine (ie if you wanted to figuring out how many feet of lawn edging to get to go around a tree and it's root system, multiplying the diameter by 3.14 will give you the same result as getting a scientific calculator and using 11 or 12 decimal places, since you'd round up and add a bit, anyway).
If you were doing a series of calculations and the results were not going to be rounded off, then it could be necessary to increase the 'precision' by using more decimal places (or in programming terms, using double precision).

Joined: May 2010
Location: Oxford
Duchess of Gorgombert
Offline
Duchess of Gorgombert
Joined: May 2010
Location: Oxford
I think the point is significant figures, rather than decimal places: so 123,456,789 would be stored as 123,457,000 with six significant figures even without a decimal point coming along to upset everyone.

Of course the vagaries of the various floating point storage systems where assorted other things are crammed into that single-precision 32-bit word length can result in a potentially difficult-to-predict number of significant figures. I've generally shied away from using floating point numbers in programming stuff I do myself, but that's easy for me to say as I mostly do systems stuff rather than complicated and awkward civil engineering projects. Which means I never got to play on something like a Cray*, but on the plus side I never had to use floating point numbers. biggrin

* but I did get to play on weird 36-bit PDP-10s, which I think are just as interesting.

Edit: there's also BCD numbers: "binary coded decimal", where a decimal digit would be stored in a binary 4-digit unit: not very efficient in terms of storage but it did allow for definite and exact representation of decimal values. At the cost of involving COBOL, which is the oldest and worst programming language.

Last edited by vometia; 23/06/17 04:14 PM. Reason: COBOL argh

J'aime le fromage.
Joined: Mar 2003
Location: Canada
Support
Offline
Support
Joined: Mar 2003
Location: Canada

Maybe I over simplified, but when calculating a fraction clamped between 1% and 95%, significant figures and decimal places are pretty much the same thing. Floating point values are basically in scientific or engineering notation, anyway (1.23457x10^8 / 0.123457x10^9).

Fortran is older than COBOL.

Joined: May 2010
Location: Oxford
Duchess of Gorgombert
Offline
Duchess of Gorgombert
Joined: May 2010
Location: Oxford
Originally Posted by Raze
Fortran is older than COBOL.

It is? I've never used either except in passing anyway: Fortran isn't quite as bad as COBOL but that isn't saying much. I was just taught C in college and have used it ever since. How I laughed at the old farts and their primitive ways. And now the kids call me grandma and laugh at me because I won't use their VisualMalarky++ For Things or whatever's the flavour of the month.


J'aime le fromage.
Joined: Jun 2017
W
Wilker Offline OP
journeyman
OP Offline
journeyman
W
Joined: Jun 2017
So... apparently our party got stuck in this SPFP monster... We have a Good Dragon from Canada, an "Irritant" Good Warrior and a mysterious Stranger that gets super excited with formulas that he doesn't even understand. The dragon and the warrior fight with bravery, but the SPFP floats in the air and is precise, although single. The stranger just hides behind a big rock and watches the fight, terrified. To be honest, he doesn't even seem that interested in killing the beast. Is he even watching the fight? He seems to be entertained with something else now! A game? What a fool!
Well, he did find a weapon that could maybe defeat the monster: http://floating-point-gui.de/formats/fp/ . But he feels "safe" enough holding it, that he's not even going to try it.
About the COBOLDS and Fortrans that approach, the fleeing stranger fears not. As he vanish in silence through the shadows of the dungeon. For the Dragon and the Warrior are both Veterans after all. And all those foes should be no match for them.

At the beginning I really didn't care what a "single precision floating point value" was. But now I know what it is. Thank you guys for answering me. thankyou Now you can have fun with the COBOLDS. I'm out.

Joined: May 2010
Location: Oxford
Duchess of Gorgombert
Offline
Duchess of Gorgombert
Joined: May 2010
Location: Oxford
Nobody has fun with COBOLDS. biggrin


J'aime le fromage.
Joined: Jun 2017
W
Wilker Offline OP
journeyman
OP Offline
journeyman
W
Joined: Jun 2017
biggrin True.


Moderated by  gbnf, Kurnster, Monodon, Stephen_Larian 

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