How does loot table in games work

900 views

How does programmers do loot tables for millions of items that all have different chances to drop when you kill a enemy in big games like path of exile , Diablo, WoW.

In: Mathematics

3 Answers

Anonymous 0 Comments

Well, I’m not 100% sure, but I assume it works by having the game generate a random number, and for different ranges of of what the number is, a different item is obtained.

For a simple example, let’s assume there’s a loot table with 5 items, one really common, two equally uncommon, one rare, and one very rare.

The game would generate a random number between 1 and 100.

If the number is from 1 to 40, you’d get the very common item.

If the number is from 41 to 65, you’d get the first uncommon one.

If it’s between 66 and 90, you’d get the second uncommon item.

If it’s between 90 and 99, you’d get the rare one.
If it’s exactly 100, you’d get the very rare drop.

Instead of having just 5 items and the random number generated between 1 and 100, you’d have a higher number of items in the drop table, and the random number generated be between 1 and 10 million or something, with each item’s drop range being much wider than 1 number or even 40 numbers.

You are viewing 1 out of 3 answers, click here to view all answers.