Duplicate items
Add duplicate-item behavior to a card-pack model so repeated draws reflect an existing collection. Note In most card collection, loot box or gacha systems.
So far, we’ve modeled the basic rarity determination system for our card collection model.


The problem with the model in its current form is that it doesn’t account for the fact that the player can collect things they’ve already collected before.
In most card collection, loot box or gacha systems, the player has a chance to collect things they’ve already collected. Additionally, the closer they are to having collected everything in the set, the less likely they are to collect something new.
This mechanic drastically extends the lifetime of the content, as players are incentivized to keep striving for those precious few items they’re missing.
To model this in Machinations, we need to distinguish between new cards, and cards that have already been collected. We will do this using an extra set of pools, and a gate, for each rarity.


Now, there is a fixed chance that a card could be a completely New card, or one that’s been seen before (a Duplicate).
We want the probabilities to be influenced by how many cards we’ve already collected. In other words, for each New card the player collects, the probability that future cards will also be New ones should go down. Conversely, the chance that they will be Duplicates should go up.


It turns out that the % Collected Registers we created earlier define exactly the percentage chance that a future card will be a Duplicate:
When the player has collected 0% of cards, the next card they collect must be one they haven’t seen before (i.e. 100% chance of being New). Conversely, when the player has collected 100% of cards, the next card must be one they’ve seen before (i.e. 0% chance of being New).
Because the chance of getting a Duplicate is just 100% minus the chance of getting a New card, the chance of the next card being a Duplicate must always be equal to the percentage of cards that have already been collected.
We can achieve this with the following setup: the New pool and the % Collected register read each other through state connections, and the register overwrites the chance on the gate’s New and Duplicate outputs.


Initially, the chances for getting a New and Duplicate should be 100% and 0% respectively. Then, for every 1% of the collection we fill, we add 1% to the chance to earn a duplicate, and remove 1% from the chance to earn a new card.
Press Play and observe how the odds of collecting New and Duplicate cards change over time.
We can observe the effect more clearly by making some Forecasts. But first, make sure to copy the structure for all card rarities.


We get a characteristic leveling-off shape, identifying the negative feedback loop at play: the more cards you collect, the lower the chances of collecting New ones.
To make it easier to determine when the entire collection has been completed, we can count up all the four rarity pools, then turn this value into a percentage:


We can now answer our original design question: namely, how many card packs must be opened in order to collect the entire set?
Unfortunately, as seen in the chart above, the player struggles to collect even 15% of Legendaries.
Many loot box systems have some form of refund mechanic that compensates players for collecting Duplicates. We will explore one form of this mechanic in the next section.