October 28, 2010, 19:13  #21 
Rookie
Join Date: Jun 2007
Location: Bristol, UK
Posts: 23


October 28, 2010, 19:23  #22 
Prophet
Join Date: Dec 2009
Posts: 8,448

Okay, from my reading of the actual code for m_bonus, it appears to be trying to generate a normal distribution with average value (max bonus * item level / 128) and standard deviation of (max value / 4). There's a lot of weird stuff in there to approximate floating point with integer math, but I believe that's broadly accurate. And of course, values are clamped to be between 0 and the max value.
Incidentally, I found this code by starting from the documentation in object.txt, which says: Code:
# Some fields accept randomized numbers of the form "10+2d3M4" where # 10 is the nonvariable base, 2d3 is a standard die roll, and # M4 uses the m_bonus function to generate a number between 0 and # 4 according to a normal distribution. 
October 28, 2010, 19:47  #23 
Prophet
Join Date: Mar 2008
Posts: 2,712

[edit] deleted my post, I read the wrong entry

October 28, 2010, 22:53  #24 
Rookie
Join Date: Mar 2010
Posts: 19

Is the item level the level on which the item is found?
If so, for a ROS at DL 128 the m5 enchantment should be a random # drawn from a normal distribution with mean = (5*128)/128 = 5 and std dev = 5/4 = 1.25 When I run this 1000 times in Excel using this function I found on the internet: =NORMINV(RAND(),5,1.25), I get 64.5% with a bonus of 5 or more. For the Amulet of the Magi, I calculated means for the normal distribution of the following: DL 50 = (3*50)/128 = 1.171875 DL 100 = (3*100)/128 = 2.34375 DL128 = (3*128)/128 = 3 Standard Deviation for each is 3/4 = .75 For 1000 random numbers these are the precentages I found for an Amulet of the Magi getting a +4 enchantment: DL50 = 0% DL100 = 7.1% DL128 = 51.1% 0% doesn't mean it is impossible, just for that this run of 1000 numbers, none achieved the max enchantment at DL50. 
October 28, 2010, 23:06  #25 
Prophet
Join Date: Dec 2009
Posts: 8,448

Only if the item is found on the floor outside of a vault. Items dropped by monsters use max(monster level, avg(monster level, dungeon level)), items dropped by chests use a hardcoded value depending on the type of chest, items in vaults get a boost applied to them depending on where they are in the vault, etc.

October 28, 2010, 23:08  #26 
Rookie
Join Date: Mar 2010
Posts: 19

If I'm doing everything correctly, chances of getting a ROS +23 at DL 128 IF the maximum of 10 is achieved from the d5m5 calculation are:
1/5(chances that rolling a 5 sided die results in a 5)*1/64.5(chances that the random number generated from the normal distribution with mean 5 std dev 1.25 is a 5)*1/8192(13 consecutive coin flips of the same result) = 1 in 2,641,920. To this must be added the chances of getting to +23 from each of the other possible results of the d5m5 check (1 through 9). This shouldn't add much to the total because the number of consecutive same coin flips required increases and those chances are small. 
October 28, 2010, 23:53  #27  
Prophet
Join Date: Mar 2008
Posts: 2,712

Quote:


October 28, 2010, 23:58  #28 
Rookie
Join Date: Mar 2010
Posts: 19

Nope, I didn't do everything correctly. +23 is not nearly that rare. I was counting 64.5% as 1/64.5, not 64.5/100. The revised chances for ROS +23 at DL128 are approx. 1 in 26702.
The numbers for the Amulet of the Magi should be correct. Sorry! I'm actually surprised we haven't seen higher then +23 with all the players out there (+24 is about 1 in 53407). Last edited by Nate; October 29, 2010 at 15:06. 
October 29, 2010, 00:07  #29 
Rookie
Join Date: Mar 2010
Posts: 19

My new number includes the chances for all the possible values (110) of the d5m5 calculation, i.e. d5m5=10, consecutive coin flips=13; d5m5=9, consecutive coin flips=14, and so on down to d5m5=1, consecutive coin flips=22. The addition of these contributed more than I expected to the total chances.

October 29, 2010, 00:10  #30 
Rookie
Join Date: Mar 2010
Posts: 19

And as it appears that the item level used in the m_bonus function is not necessarily simply the level on which the item is found, my calculation would only apply to ROS lying on the dungeon floor not in a vault. Yikes.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)  
Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Stealth or speed?  Sirridan  Vanilla  6  March 11, 2010 05:33 
Target in range indicator?  ChodTheWacko  Vanilla  1  November 28, 2009 16:14 
r1487  Stats values randomly exchanged.  marteo  Vanilla  5  July 15, 2009 04:34 
Now that I have speed, what to do?  Big Al  AAR  3  September 22, 2008 19:49 
Speed  Zero  Vanilla  9  January 9, 2008 02:21 