Number of items given by a chest

Explanation

There is no direct evidence found by reverse-engineering, but data analysis with a lot of samples suggest that there is 25% chance of getting only 1 item, and then an equal chance of there being either two or three items.

The game probably uses some kind of logic like this pseudocode:

from random import random

def get_item():
    # Some logic to get items with weighted RNG
    return item

def get_chest_items():
    items = []

    items.append(get_item())
    if random() < 0.25:
        return items

    items.append(get_item())
    if random() < 0.5:
        return items

    items.append(get_item())
    return items

get_chest_items()

This makes sense, since the devs probably wanted it to be progressively less likely for there to be more items, with the cap being at 3.

Conclusion

The probability of getting n items is as follows:

One item 25%
Two items 37.5%
Three items 37.5%

Getting a certain from free chest

Explanation

Every biome seems to have a different weight associated with a each item type. In general the further a biome is, the probability of higher value items improve.

Here is the weight tables used by the game for each biome:

| Item Type | Village/Huns/Mines (Base - Iron) | Aqueduct/Academy (Base - Bronze) | Tower/Temple/Port (Base - Silver) | Garden/District (Base - Gold) | Palace (Base - Gold) | | --- | --- | --- | --- | --- | --- | | Weapon | 40 | 30 | 30 | 30 | | | Weapon (+1 tier) | 40 | 30 | 5 | 3 | 30 | | Tool | 10 | 10 | 10 | 10 | 10 | | Common Medallion | 80 | 60 | 30 | 10 | | | Rare Medallion | 10 | 15 | 60 | 70 | 40 | | Legendary/Corrupted Medallion | | 15 | 25 | 20 | 20 | | Medallion Slot | 10 | 10 | 20 | 10 | 10 | | Anahita’s Blessing | 15 | 15 | 15 | 15 | |


Shop RNG mechanic

Explanation