Not A Bug Hit Lower Defense = Additive or Multiplicative?

Magus Zeal

Expert II
Supporter
WHen you have both HLD glasses and weapon, uoguide implies that you do not add them together, but instead they scale each other multiplicatively:

unknown.png


On Servuo code, it seems additive (adding 30 + w/e HLD is?) Maybe im reading that wrong.

Code:
 if ((hldWep > 0 && hldWep > Utility.Random(100)) || (hldGlasses > 0 && hldGlasses > Utility.Random(100)))                {                    DoLowerDefense(attacker, defender);                }

If I'm reading it wrong: NOT A BUG. otherwise I think this warrants some exploration.
 
OP
Magus Zeal

Magus Zeal

Expert II
Supporter
After more testing, we found:

On UO.com wiki, HLD is supposed to drop DCI by 25. On heritage it is 30.

ON uo.com, the effect should not stack. It doesn't stack here either (Good). BUT it's supposed to be multiplicative. Which our code is not (it's exponential) due to to two rng checks.

On heritage, the debuff timer DOES reset if you hit it again within the 8 second cooldown. Need to confirm if that is the case (since im pretty sure debuffs need to time out before you can re-apply)

Based on the code, there are actually two HLD checks. One checks the helm against a random number, the second checks weapon against a random number. if either of those ring true, hld is applied.


I propose that the code that we have should multiply helm and weap (depending on which has greater hld) and come up with a blended hld, then it should check that number against a single rng check (as opposed to 2). This would agree with the idea that these value are "multiplied" as stated below on uo.com:

1588882451467.png
 

GiantFreakishApe

Newbie III
Supporter
Wanted to add, that 2 people I know who play OSI currently who are primarily PvPers, have told me HLD timer reset on every application

They didnt provide video or anything, but thought I'd toss that out
 
OP
Magus Zeal

Magus Zeal

Expert II
Supporter
That's good that we have some kind of confirmation though that its working right on servuo in that regard. The dci debuff is a definate bug. The formula doing two checks is still kinda whack to me. Seems to me it should get one check from the blended total of your HLD. But that's just my take on it from uo.com
 

Jester

Novice III
Supporter
The end math will be the same, using probability using P(A ∪ B) = P(A) + P(B) - P(A ∩ B) then:
P(A) = 30/100 = .3
P(B) = 50/100 =.5
P(A ∩ B) = .3 * .5 = .15
now using the formula above:
.3 +.5 = .8 - .15 = .65 (65%)

now using the UOguide formula:
ItemA= 100 - 30 = 70
ItemB= 100 - 50 = 50
ItemA*ItemB = 3500 / 100 = 35
100 - 35 = 65 (65%)

The DCI does need to be adjusted, but i dont see any reason to change the code for the probabilities personally if the outcome is the same, but just my 2 cents

Edited: I started one thought and changed the topic mid-sentence which left the end of the post making no sense, i should have proof read it before posting, either way fixed now.
 
Last edited:
OP
Magus Zeal

Magus Zeal

Expert II
Supporter
Two separate instances of a random number does not agree with your math :) But I liked it. It wouild only hold true if that random number was the same in both scenarios. It isn't. Call random number x and y. P(a)x +P(b)y is not equal to P (a*b)x

if the code started with:
randomnumber = utility.random(100)

and proceeded to use "randomnumber" i would agree it is identical :) But everytime that utility.random shows up its a new roll which is where our ideas differ I think.
 

Jester

Novice III
Supporter
I am not sure what you meant by "Two separate instances of a random number does not agree with your math" are you saying that because the roll is done twice that the math is incorrect? because that is literally what the formula is for, Probability of A 30%, Probability of B 50%, Probability of either but only 1 is 65%
 
OP
Magus Zeal

Magus Zeal

Expert II
Supporter
I mean that the possible outcomes of 2 100 sided dice are much more complicated than a single 100 sided die. There is a lot of dice theory on this. At the end of the day im good with the probabilities as they are as well. I just was having fun with the math :)
 

raveX

Neophyte II
C# Nerd
Supporter
The end math will be the same, using probability using P(A ∪ B) = P(A) + P(B) - P(A ∩ B) then:
P(A) = 30/100 = .3
P(B) = 50/100 =.5
P(A ∩ B) = .3 * .5 = .15
now using the formula above:
.3 +.5 = .8 - .15 = .65 (65%)

I'm not sure I agree with this. The two chances are mutually exclusive, shouldn't it be simple addition of probabilities? The one chance has no effect whatsoever on the second.
P(A or B) = P(A) + P(B)
80% = 50% + 30%
 
OP
Magus Zeal

Magus Zeal

Expert II
Supporter
He's assuming each dice is the same single outcome (lets call it x). If you had .3x * .5x you could do what he suggested. Unfortunately we are dealing with two independent dice rolls, so its .3x * .5y, and you cannot multply those the same way because x is not related in any way to y.
 

Jester

Novice III
Supporter
Edited: Looking into it more, perhaps i applied the wrong formula. it seems right in my head, but maybe its just that i want it to.

re-edit
I'm not sure I agree with this. The two chances are mutually exclusive, shouldn't it be simple addition of probabilities? The one chance has no effect whatsoever on the second.
P(A or B) = P(A) + P(B)
80% = 50% + 30%

So this would be under the assumption that they are disjointed, but that in every "chance" is applied to 1 roll, so like 1/4th chance a card i draw is a heart or 1/4th it will be a spade. then it will be .25 + .25 = .5 i will get either event (since you cant draw a heart and spade together in one card), I think of it more as, you have 2 deck of cards, what are the chances you draw hearts or spade in deck A, and if not then what is the chance the card you draw from deck B is a spade

Still disjoint, however the result of A effects the chance that you will even get a B chance.
 
Last edited:

Dexter

Staff Member
Administrator
Game Master
You're overthinking this. Its talking about how its applied in respect to hit chance increase.
 
OP
Magus Zeal

Magus Zeal

Expert II
Supporter
Why is this not a bug?

On UO.com wiki, HLD is supposed to drop DCI by 25. On heritage it is 30.
Post automatically merged:

You're overthinking this. Its talking about how its applied in respect to hit chance increase.
We aren't discussing how DCI works with HCI, we are discussing how HLD works....it has a chance roll to apply the "HLD" debuff. We are discussing how that chance is currently working. We also noted that the actual DCI debuff is incorrect....I mean I summarized this above pretty concisely cause we were having too much fun with probabilities :)
 
Last edited:

Dexter

Staff Member
Administrator
Game Master
I get it. But its working how its supposed to. Its actually simplified to the point where it looks confusing. Its counting each equipment as a separate roll.
 

PLAY NOW

Heritage

Address
play.trueuo.com
Port
2593
Uptime
6 hours
Players Online
18
Houses
852
Vendors
297
Gold
5,019,539,886gp
Top Bottom