Let me try to go through all your questions in turn.

1. Checking whether or not a drop occurs given a certain drop chance

Just use a pseudo-random number generator and compare the result with the drop chance, just as you suggested in your question. For example, if you specify the drop chance in percentage points with up to two decimal places, you could ask

rand = generatePseudoRandomNumber(0, 10000) // between 0 and 10,000
if(rand <= dropChance * 100)

2. Checking which events happens given a set of possible events

Try to use a data structure that is more flexible than hard-coded switch expressions. I coded a basic version of a Lottery class here: https://gist.github.com/3368046. Lottery allows you to do stuff like this:

$Lottery = new Lottery();
$Lottery->addEntry($item1, $dropChanceOfItem1);
$Lottery->addEntry($item2, $dropChanceOfItem2);
$Lottery->addEntry($item3, $dropChanceOfItem3);
$drop = $Lottery->getWinner();

With my implementation, the drop chances do not even have to add up to 100%; the lottery determines the winner based on the number of lots that each participant has in relation to the other participants of the lottery.

3. When to check for drops and how to communicate the result to the player

I'd decide based on what the most critical bottleneck is: If bandwidth is expensive and if your service has a good latency (Amazon?), go for variant 1. If your service has latency issues, go for 2.

Answer from BerndBrot on Stack Exchange
🌐
Old School RuneScape Wiki
oldschool.runescape.wiki › w › Drop_rate
Drop rate - OSRS Wiki
The drop rate is the frequency at which a monster is expected to yield a certain item when killed by players. When calculating a drop rate, divide the number of times you have gotten the certain item, by the total number of that monster that ...
🌐
Game Developer
gamedeveloper.com › home › game platforms
What does it mean when players complaining about "low drop rate"?
December 9, 2023 - This article reveals the method of researching the problem of low drop rate and how to make it right. ... Drop rate, refers to the probability of obtaining a particular item from a loot box or booster pack in some video games...
🌐
Urban Dictionary
urbandictionary.com › define.php
Urban Dictionary: drop rate
drop rate: The probability that an award will drop from an enemy when killed by a player in most RPG based video games.
🌐
Wikipedia
en.wikipedia.org › wiki › Drop_rate
Drop rate - Wikipedia
May 17, 2019 - Packet drop rate, the rate at which packets are lost in a network connection · Category: Disambiguation pages · Search · Drop rate ·
Top answer
1 of 3
4

Let me try to go through all your questions in turn.

1. Checking whether or not a drop occurs given a certain drop chance

Just use a pseudo-random number generator and compare the result with the drop chance, just as you suggested in your question. For example, if you specify the drop chance in percentage points with up to two decimal places, you could ask

rand = generatePseudoRandomNumber(0, 10000) // between 0 and 10,000
if(rand <= dropChance * 100)

2. Checking which events happens given a set of possible events

Try to use a data structure that is more flexible than hard-coded switch expressions. I coded a basic version of a Lottery class here: https://gist.github.com/3368046. Lottery allows you to do stuff like this:

$Lottery = new Lottery();
$Lottery->addEntry($item1, $dropChanceOfItem1);
$Lottery->addEntry($item2, $dropChanceOfItem2);
$Lottery->addEntry($item3, $dropChanceOfItem3);
$drop = $Lottery->getWinner();

With my implementation, the drop chances do not even have to add up to 100%; the lottery determines the winner based on the number of lots that each participant has in relation to the other participants of the lottery.

3. When to check for drops and how to communicate the result to the player

I'd decide based on what the most critical bottleneck is: If bandwidth is expensive and if your service has a good latency (Amazon?), go for variant 1. If your service has latency issues, go for 2.

2 of 3
0

Yes, you take each percentage and map it to one or more numbers in that range. E.g. if there's 50% chance of getting a killer rabbit, and 20% chance of getting John Lennon glasses, and 30% of getting chainsaw fuel, then you would have 1...50 be the range for the rabbit, 51...70 for the glasses, and 71...100 for the fuel.

Now you generate a random number (e.g. using rand() or whatever your language offers, limiting it to 1...100 using 1 +(rand() % (100-1)), and depending on what range it falls in, you know what to drop.

Now this only gives you a single item. To get several items, you just draw several times*. So you'd be guaranteed to get one of the three above items from draw one, and one of four other smaller items from draw 2. You can even have draws where one of the items that can drop is "nothing". So to have a 2% chance of this dropping the Super Mega Ultra Grooveshark(tm), you'd have range 1-2 be the shark, and 3 to 100 "nothing" and just do an extra draw (generate another random number between 1 and 100) with that.

So your data structure would probably be a list of draws containing a list of items and their percentages, one of which could be a "nothing" item. Then your items (e.g. enemies) would simply reference one of those data structures as their "drop this when I die" structure.

*) Of course, if you want to always drop two items together, you may need to define some sort of "box" item that just contains those to items, then just draw once to get those two.

🌐
Softwareprocess
softwareprocess.es › homepage › posts › stats-for-games
Statistics and probability for randomized games (loot shooters, roguelites, roguelikes, etc.) | Abram Hindle's Homepage
Players refer to the idea of drop-rate as the frequency that a particular item is “dropped” from a chest or a boss, that is how often will a player get that item as a reward for a particular quest. There are many videos and guides online about these games and particular items in these games ...
Find elsewhere
Top answer
1 of 1
1

Simply dividing the number of successful drops by the number of drops will give you a proportion. For example, 20 successful drops out of 100 drops is a 20% chance of getting the successful drop. This is the sample proportion.

You are correct that you will have to do it over and over, as any statistics you calculate are based on the sample, and you cannot have 100% confidence in them. You can, however, repeat it enough times to get a confidence level of 95%, 99%, etc. Also, if you know that the developers have a tendency to use nice numbers in their drops (1/32, 1/64, 1/2048, etc), you could use that to have more confidence in your answer.

This is assuming a few things, however:

  1. All drops are independent of each other. For example, in the game Overwatch, the odds of receiving the rarest tier of item increases every time you do not receive one. This would already be hard to calculate. Now imagine a system where each tier of item may add or remove the cumulative probability of the good drop. Calculating the percentage begins to border on impossible when you know less and less about the system.
  2. All drops are simply based on a drop percentage. For example, in the game Runescape, enemies may have a chance of dropping from the Rare Drop Table, as well as their own drop table. Some rare drops are shared by the enemy's drop table, as well as 'no drop' being shared by both, so without knowing the RDT's rate for that enemy it will be incredibly difficult to predict drop rates to a good confidence level. Other factors may include number of players attacking, items equipped (e.g Runescape's Ring of Wealth), or anything else the developer wants.

You should be able to perform a sample proportion confidence interval, that reads something like "I have 95% confidence that the drop rate lies between 0.79 and 0.81", where your sample proportion would have been 0.80 (in the middle). If this is a bit much effort, just use your sample proportion for a good estimate once you're happy that it's stable. At the end of the day, even if you eventually calculate that probability to be 0.5%, the drop rate doesn't guarantee a drop every 200 kills. Even with 2000 kills, the probability of receiving exactly 10 drops is 12.5%.

🌐
Thegamingdictionary
thegamingdictionary.com › home › drop rate
Drop rate · The Gaming Dictionary · Where DLC is free
June 23, 2020 - The amount of times (usually out of a hundred) that an item has the chance to drop.
🌐
Calculator Academy
calculator.academy › home › drop chance calculator
Drop Chance Calculator - Calculator Academy
November 15, 2021 - A drop chance is a term used in video games to describe the rate at which a player will receive an item on average per number of attempts.
🌐
YouTube
youtube.com › watch
Understanding Drop Rates & Loot in The First Descendant: Probability Explained with Examples - YouTube
*Support me as an Official Nexon Content Creator by CLICKING THIS LINK, it is FREE:* https://creators.nexon.com/s/REALAR#3748?serviceId=74*Console users* c...
Published   August 4, 2024
🌐
Reddit
reddit.com › r/runescape › can someone explain drop rates
r/runescape on Reddit: Can someone explain drop rates
September 2, 2022 -

I've never really understood the drop rate system....

Currently I'm aiming for the 'Sandy' title and collecting the Insects of the desert.

There are particular one's which have a drop rate to them.

The one im currently aiming for says 1/200 drop rate. What does that even mean? a 1% chance of getting the drop per every 200 done?

If someone can explain it a bit more in depth, it would be great.

Top answer
1 of 1
1

Try randomly checking "will this item drop?" for every item. You could store the information for item and drop chance as pairs in a list:

drops = [["sword",5],["hp_potion",35],["mp_potion",35]]
loot = []
for i in drops:
    if random_chance(i[1]):
        loot.append(i[2])
give_player_loot()

...but this does not account for quantity, and maybe you'd like to prevent one item from dropping if another does. My solution for this would be nesting lists even further, with an item name, chance, and min/max quantity going in list A. List A is put within pool B, within the drops variable, C.

So, this would look something like:

# SLOW BUT EASY WAY TO BUILD LOOT TABLE
# You do this when the monster is created, if you are keeping a list of monsters
# that is made at the start of the game, this is also where you'd put this.
# this example loot pool has a 35% chance to drop 1-3 HP potions, OR, failing
# that, a 35% chance to drop 1-2 MP potions.
A = ["hp_potion",35,1,3] # individual item drop chance
A2 = ["mp_potion",35,1,2] # another one, to help describe the concept.
B = [A,A2] # the loot, A and A2 is going into pool B.
C = [B] # B goes into the final drop pool
monster_drops = C
# COMPACT WAY:
monster_drops = [[["hp_potion",35,1,3],["mp_potion",35,1,2]]]

Next, we have to iterate between all drops like so:

loot = []
for i in monster_drops: # go through all pools
    for j in i: # go through all items
        if random_chance(j[1]):
            loot += [j[0]]*random_range(j[2],j[3]) # add this item to the loot,
                                                   # multiplied by the number of
                                                   # items it should drop.
            break # exit the loop
give_player_loot(loot)

Sorry for the poor formatting, it's based on python and I don't really know how to use StackExchange, but I hope this was helpful! (Also, I noticed you are using JS, but hopefully the same concepts apply there!)

🌐
Reddit
reddit.com › r/learnmath › item drop rate probability in video game
r/learnmath on Reddit: Item drop rate probability in video game
January 1, 2020 -

So my friends and I were doing a raid in Destiny 2 so we could maybe have a chance to get a gun that has a new 10% drop rate. We have 5 people who all have a 10% chance to get it. Someone said theres a 50% chance that at least 1 person gets the gun, which seemed to make sense but I'm not sure. Sorry if this is simple but I thought it was interesting and wanted to know the definite answer. Maybe I'm just overthinking It. Thank you in advance

🌐
Quora
quora.com › What-techniques-are-used-to-calculate-item-drop-probabilities-in-games
What techniques are used to calculate item drop probabilities in games? - Quora
Answer (1 of 2): World of Warcraft has different drop rate schemes for different parts of the game. It is impossible to to capture the complete complexity of drop rates in the game in the scope of one answer, though a summary is as below. This information is a few years old so some of it might b...
🌐
Fandom
asphalt.fandom.com › wiki › Drop_rate
Drop rate | Asphalt Wiki - Fandom
JavaScript is disabled in your browser · Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
PoE Wiki
poewiki.net › wiki › Drop_rate
Drop rate | PoE Wiki
The player/skill category has diminishing returns; its actual drop rate multiplier is smaller than the sum of its quantity modifiers.[4] For example, a character equipped with items totalling 50% increased Quantity of Items found might receive only a 1.35x multiplier (not 1.5x), and another character with 200% increased Quantity of Items found might receive only a 1.77x multiplier (not 3.0x).[5] As monsters can drop multiple items, drop rate has no known maximum. If a monster's chance to drop an item is scaled beyond 100%, it gains a chance of dropping a second item.[6][7] Note this is not necessarily observable from an average pile of loot: the game culls a percentage of normal and magic equipment that would realistically never be looted,[3] and common currency items may be deferred to drop in a larger stack later.[8] Additional hidden mechanics may exist.