02-27-2004, 09:31 PM
Jarulf,Feb 24 2004, 11:29 AM Wrote:The algoritm is basically to go through the TC, entry by entry and keep track of the probabilities until one reach base items. This is done by a recursive function that takes a probability value as its entry (and some other stuff). When we start of, we enter with a prob=1.0 value. When then call the function for any sub TC, and pass along prob=prob*abs(picks)*(chance/totchance), that is, we calculate the probability of that specific being picked and multiply by the probability that we have so far (that is having taken the path so far to the sub TC we are at). We also multiply by the picks value since if it is larger than 1, we will have multiple entries form here on). When we reach an entry that is instead an item, we store that "prob" value on the item (adding up all such prob values reached). We also store a total probability value which would indicate number of items. If this total value is larger than 6, we can scale all values down so that it becomes 6 (for all poistive picks only). This works great from what I have seen with the exceptions I have yet to implement mentioned above.There is a difference between what you are calculating and what Hakai wants.
By simply summing the partial probabilities you will get a number which is effectively the expected number of drops of item X from monster Y.
This is not exactly the same as the chance that monster Y will drop item X.
As a simple example, suppose these TCs
subTC1 1 ItemX 1 ItemY 1
subTC2 1 ItemX 1 ItemY 1
DropTC -2 subTC1 1 subTC2 1
The expected number of ItemX to drop here is exactly 1, 1/2 via subTC1 and 1/2 via subTC2. If you create 100 drops of DropTC you expect around 100 ItemXs.
However, there is no certainty that ItemX will fall on a single drop - in fact 1/4 of the time you will get 2 ItemYs.
The actual chance of ItemX dropping on a given instance of DropTC is not (1/2) + (1/2), but in fact (1 - (1 - 1/2)*(1 - 1/2)), as Hakai outlined in his post above.
For very very small probability drops, the two numbers are practically identical. The difference is the chance of getting 2 of the item at once, for example. Not very significant for Windforces. But more of an issue for Super Healing Potions from Pindle or TP scrolls from Duriel.
Which is more useful is also hard to answer. If you want to know your chance of finding a Windforce if you kill Pindle 1000 times, the chance per kill is what you need. If you want to know how many Um runes you expect from killing the Countess 1000 times, the expected number per kill is.
For a drop-calc that is to go to the general public, who won't know or probably care about this distinction, I think "the chance of one dropping per kill" is easier to understand than "the expected number of drops per kill". But as we have discovered it is a little harder to work out :P
BTW Samka, yes, the relative ratios of actual dropped items do not change with number of players, only the no-drop number changes; so for example a Wraith will drop 75 no-drops to 4 Good TC drops to 25 Magic TC drops in a single player game, but 31 to 4 to 25 in a two player game. The odds of a Good drop go up from 4/104 to 4/60, but there is still 4 Good drops for every 25 Magic drops.
Oh, and, hi all :)
"Thank you. We always have a shortage of unfounded opinions, so this will really help us. " - adeyke