Building the basics
Model card-pack draws, item rarity and drop rates using a simple Source and Pool setup. Loot boxes generate a random or semi-random set of items.
Loot boxes generate a random or semi-random set of items. These items may have different drop rates (i.e. the odds of appearing), and are often grouped into rarity classes. The higher the rarity class, the less likely items of that class are to appear.
In Hearthstone (our chosen game for this series), each card pack (i.e. loot box) contains five cards. We can represent this with a Source (Card Packs) that sends five cards each step into a Random Gate (Pick Card Rarities).
Each card can be one of four rarities: Common, Rare, Epic or Legendary. We want to individually track how many cards of each rarity the player has so far, which requires us to divide the cards into four pools, one per rarity. We also need a Random Gate to pick the rarity for each card.


By default, each Gate output is given a value of 1. This means there is an equal chance that a card will be a Common, Rare, Epic, or Legendary.
This is the same as saying that a card has a 25% chance of being any of these rarities.
After creating the above, we can define the true odds of a card being of each rarity. Here, we’ve set each output connection to a Chance, written as a percentage.
Hitting Play, we observe that cards are much more likely to be Commons, and increasingly less likely to be higher rarities.