Latest Diablo 3 News
DiabloWiki Updates
Support the site! Become a Diablo: IncGamers PAL - Remove ads and more!

MF Diminishing Returns Calc

Discussion in 'Theorycrafting and Statistics' started by Shadow_247, Jan 28, 2004.

  1. Shadow_247

    Shadow_247 IncGamers Member

    Joined:
    Nov 10, 2003
    Messages:
    391
    Likes Received:
    0
    Trophy Points:
    77
    MF Diminishing Returns Calc

    Last thread went corrupt, so I thought I had better re-post.

    I wrote up a little diminishing returns calculator. It takes your MF from equipment and works out the adjusted MF for each item quality. I wrote it after realizing the table on this site had incorrect values. This calculator is up to date with the 1.10 patch. It's written in sun java so if you only see a grey box, download the newest java platform from www.java.com

    See the calculator here (no download required)

    Questions, comments if you have them. Also if anyone knows how to compile this applet so that people don't have to run over to get the newest sun java platform, please let me know.
     
  2. Jerkazoid

    Jerkazoid IncGamers Member

    Joined:
    Jun 24, 2003
    Messages:
    401
    Likes Received:
    0
    Trophy Points:
    98
    great job.

    i was just looking for something like this last night!
     
  3. Shadow_247

    Shadow_247 IncGamers Member

    Joined:
    Nov 10, 2003
    Messages:
    391
    Likes Received:
    0
    Trophy Points:
    77
    Yay, it works then? Excellent. You are quite welcome, any other such smallish calculators you are in search of? I'm code-happy this week.

    If anyone can't see the calculator just say so, i can post the formula in a second.
     
  4. Jerkazoid

    Jerkazoid IncGamers Member

    Joined:
    Jun 24, 2003
    Messages:
    401
    Likes Received:
    0
    Trophy Points:
    98
    just out of curiosity
    how do u know those formulas to be acurate? where are they from?

    i remember the code on the calc section of Dii. but those are not right...and these are a bit different...

    (250*mf)/(mf+250)
    (500*mf)/(mf+500)
    (600*mf)/(mf+600)

    ? are those basicly it?
     
  5. Shadow_247

    Shadow_247 IncGamers Member

    Joined:
    Nov 10, 2003
    Messages:
    391
    Likes Received:
    0
    Trophy Points:
    77
    I spend some time everyday over at the phrozenkeep. You'd be surprised what they dig up over there. It's the same formula i keep seeing posted, so I'm only assuming it is correct. I believe the formula originally came from Jarulf, he pokes around in the actual game code and knows his stuff, so I have full belief that this is the actual formula.

    The formulas you posted above are them. In order of unique set rare.
     
  6. Thrugg

    Thrugg IncGamers Member

    Joined:
    Jun 23, 2003
    Messages:
    1,527
    Likes Received:
    0
    Trophy Points:
    105
    Zoid, the "wrong" formulae on the dii.net stats site were only wrong in so far as they were counting the player's base chance to find stuff as 100% (ie so wearing 100% MF gave you 200% total, which is a reasonable way to consider it in some respects, because you have then got double the chance of finding something magic). So they had a couple of +100 and -100s sprinkled in their numbers. Essentially the same though, you just had to remember to put in 100 + your worn MF.
     
  7. Shadow_247

    Shadow_247 IncGamers Member

    Joined:
    Nov 10, 2003
    Messages:
    391
    Likes Received:
    0
    Trophy Points:
    77
    Yes, the dii calculator is fine as long as you accomodate. This calculator automatically works it in.

    I have also written this calculator in excel for those who can't get it working with java. Get the microsoft excel version of this calculator here. It was written in excel, viewing it with the excel 97/2k viewer should work, get it here.
     
  8. DaVinci

    DaVinci IncGamers Member

    Joined:
    Jun 22, 2003
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    You might want to add the set and rare MF caps to that calc. else it becomes wrong for all but unique and magic items over ~600 MF

    DaVinci
     
  9. Shadow_247

    Shadow_247 IncGamers Member

    Joined:
    Nov 10, 2003
    Messages:
    391
    Likes Received:
    0
    Trophy Points:
    77
    From what I hear the caps are no longer needed. They are only used if mLvl=qLvl (and this calculator's aim is not to get qLvl input). If mLvl!=qLvl caps are not needed as no one can realistically get a high enough MF to hit the caps.

    This is just what I have read, if there are indeed caps that can take effect in the case of mLvl!=qLvl and are within the boundaries of a realistic MF amount please post them and I will add them.

    (!= means does not equal for all you non-programmers)
     
  10. Thrugg

    Thrugg IncGamers Member

    Joined:
    Jun 23, 2003
    Messages:
    1,527
    Likes Received:
    0
    Trophy Points:
    105
    OK, the caps do require some explanation.
    Ruvanal posted here and probably elsewhere showing values at which you will hit the caps, assuming mlvl = qlvl. That's not because that is necessary for the cap to come into effect, only because (mlvl - qlvl) is used previous to MF being applied, so depending on what (mlvl - qlvl) is, the cap will hit in a different place.

    It is not an MF cap, strictly, it is a chance cap. So since you have a better chance to begin with if (mlvl - qlvl) is bigger, you will hit the cap with less MF in that case.

    It is a bit hard to work into a simple input-output script.

    However, Shadow, if you are looking for projects, the next logical extension of what you are doing is to actually calculate odds of uniques/sets/rares etc dropping with the MF you have on. You would need additional input, namely the qlvl of the item in question, and whether it is class-specific, and the mlvl of the monster, and whether it is an act boss/unique/regular/special.

    Quite a big project really :) But I can provide the formulae as needed.
     
  11. DaVinci

    DaVinci IncGamers Member

    Joined:
    Jun 22, 2003
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    ^^ what he said gg thrugg ^^

    DaVinci
     
  12. Shadow_247

    Shadow_247 IncGamers Member

    Joined:
    Nov 10, 2003
    Messages:
    391
    Likes Received:
    0
    Trophy Points:
    77
    I take it these are the caps you are referring to, but again I wouldn't be able to currently implement them without qLvl input.

    Another day for that one.

    I'm up for it - as long as you are ;)

    I have an idea of some of the formulae from looking at the phrozenkeep, I know where all the info comes from. Are these them below?

     
  13. Thrugg

    Thrugg IncGamers Member

    Joined:
    Jun 23, 2003
    Messages:
    1,527
    Likes Received:
    0
    Trophy Points:
    105
    Absolutely. I know everything I know from following the posts of the guys you quote above :)

    The first of Myhrg's formulas is the unmodified chance of a unique version being dropped. As you see, it involves (mlvl-qlvl) in a necessary way. The other numbers come from itemratio.txt, a fairly simple file.

    The next line is just application of the adjusted MF you calculate in your existing calculator.

    The final line is the cap applying. If your MF is enough to bring your chance below the cap (also found in itemratio.txt), it will be set to the cap. Because both MF and (mlvl-qlvl) are used to work out your MF chance, you can't work out exactly where the cap applies without the (mlvl-qlvl) info.

    There is a further step after that. Certain monsters have bonuses to dropping and these apply now (after the cap). All monsters have a value "cu" found in TreasureClassEx.txt. For most monsters (regular rmonsters) this field is blank, or 0. For Champs, Uniques and SUs, it is 800. For bosses it is 983 for their normal drop but higher for their quest drop. There are also special cases. It is used like this:

    unique chance = "final" unique chance - ("final" unique chance * cu / 1024)

    That is essentially chance * (1024 - cu) / 1024, but we write it the way we do to make sure you get rounding correct - D2 only uses integers, after any division you should round down.

    Now, all these "chances" are actually the denominator of fractions like this: 128/x
    The 128 factor is added in Myhrg's first formula and is so that we can keep some accuracy using only integers. The final test is to take a random integer up to "unique chance", and if it is less than 128, it is a unique.

    If it is not a unique, exactly the same logic applies for sets, then rares, then magic. Of course, you have to remember to include the chance the item is not a higher quality first (so for example, actual chance(set) = (1 - chance(unique)) * chance(set).

    Ah, just realised there is a typo in Myhrg's first formula - I recall he worked out the error later in the thread he posted it in - it should be:

    unique base chance = (ItemRatio[Unique] - ((mlvl - qlvl) / ItemRatio[UniqueDivisor])) * 128

    It doesn't really make sense the way he wrote it.
     
  14. Shadow_247

    Shadow_247 IncGamers Member

    Joined:
    Nov 10, 2003
    Messages:
    391
    Likes Received:
    0
    Trophy Points:
    77
    Thanks for the explication and correction of the formulae. A question about Itemratio.txt - which version should i be looking at - my best guess is version 1 but do I need both 1 & 0? Also I have never completely understood what the "uber" row refers to. I will start putting all this into code when I get back to my home computer - it shouldn't take long once I get started.
     
  15. Ruvanal

    Ruvanal IncGamers Member

    Joined:
    Jun 22, 2003
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    5
    In this file the versions are 0=D2C and 1=LoD.

    The "Uber" listings are for the exceptional and elite versions of items while the other "non-Uber" listing is for the normal versions of an item. Really only makes a difference in the games determinion of if these items are normal or low quality as the higher magical qualities all have the same listings for both cases.
     
  16. Shadow_247

    Shadow_247 IncGamers Member

    Joined:
    Nov 10, 2003
    Messages:
    391
    Likes Received:
    0
    Trophy Points:
    77
    Thank Ruvanal, Thrugg. I believe I'm done, but before I go and publish it, I'd like to make sure I am arriving at correct end results. I'd just like to post two examples if I may, if anyone could verify them, I'll be done.

    Example #1 - Windforce (qLvl80) from a regular BoneWarrior in the pit (mLvl85) with 500MF

    unique base chance = (400 - ((85 - 80) / 1)) * 128 = 50560

    unique Magic Find chance = 50560 * 100 / (100 + 166) = 19007

    final unique chance = max(19007, 6400) = 19007

    ratio ~1 wf:148 hydra bows
    percent ~0.0067%

    Example #2 - Aldur's Armour (qLvl70) from a champ Devilkin in the pit (mLvl87) with 200MF

    unique base chance = (160 - ((87 - 70) / 2)) * 128 = 19392

    unique Magic Find chance = 19392 * 100 / (100 + 111) = 9190

    unique chance = max(9190, 5600) = 9190

    unique chance = 9190 - (9190* 800/ 1024) = 2010

    ratio 1 bstar:15 devil stars
    percent 0.0636%

    Assuming the above are correct, I can find the chance an item will be of a certain quality assuming that base item is chosen to drop. If this is correct, I will move on in search of TC selection chance formulas (if such a thing exists)
     
  17. DaVinci

    DaVinci IncGamers Member

    Joined:
    Jun 22, 2003
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    'm can't tell if it's right, but one thing tho.

    in example 2, you start with a shadow plate, and end up with the chances of devil stars, quite a nice base jump :)

    unless i'm reading it wrong ofcause.

    DaVinci
     
  18. Shadow_247

    Shadow_247 IncGamers Member

    Joined:
    Nov 10, 2003
    Messages:
    391
    Likes Received:
    0
    Trophy Points:
    77
    Whey-o. Thanks, just a misprint in the title, calculations are still the same though. I was going to do an example for a set item, but it was late. I'll be posting the calc hopefully today, maybe it will have to be tommorow though.

    Example #2 - Baranar's Star (qLvl70) from a champ Devilkin in the pit (mLvl87) with 200MF

    unique base chance = (160 - ((87 - 70) / 2)) * 128 = 19392

    unique Magic Find chance = 19392 * 100 / (100 + 111) = 9190

    unique chance = max(9190, 5600) = 9190

    unique chance = 9190 - (9190* 800/ 1024) = 2010

    ratio 1 bstar:15 devil stars
    percent 0.0636%
     
  19. Thrugg

    Thrugg IncGamers Member

    Joined:
    Jun 23, 2003
    Messages:
    1,527
    Likes Received:
    0
    Trophy Points:
    105
    The qlvl required is the level of the base item, not the unique or set item. At the point that is used, you don't know that the item will be unique or set quality yet, you only know it is a Hydra Bow or Devil Star. Base item qlvls are listed on www.d2data.net, or you can check the "level" column in armor.txt, weapons.txt and misc.txt. You will notice base item qlvls are always in the range (TC-2) to TC (ie items in TC87 will alwyas have qlvls 85-87). This is actually how the TCs are built.

    The unique/set level is also used, but later on. A simple check "is mlvl >= unique/set level"? is done at the end, if that fails then the item won't drop, a high durability lower quality item will instead (rare for unique, magic for set). So eg if you test Windforce from Quill Rat in Blood Moor (mlvl 67) you might as well return 0% automatically.

    Apart from that your Windforce example is correct.
    You Bstar example, is using the set itemratio values (160, 2, 5600) for a unique item. Also, you need to round down after dividing (87-70) by 2 but before subtracting from 160. It is otherwise correct for a unique item. For a set item though, you know you will have to go through the unique calculation first, to get the chance that it is not unique, then do the set calculation and multiply the two. An item can't be set until it first fails the unique roll.

    The TC formulae are not individually hard, but they form a recursive structure that is a pain to traverse every time. I keep a big table in an Excel file so I don't have to keep working them all out.
     

Share This Page