Spielerando

Item Rarity

Item rarity sorts drops into five tiers, from common to legendary, where each tier is rarer than the one below and stronger. One random roll picks the tier, a luck value tilts the odds toward the higher tiers, and the tier alone sets the item's power. Luck is capped so common drops never vanish.

Also called: Rarity tiers, Item quality, Loot grades, Drop rarity.

A clay badger shopkeeper shows five matching lanterns on a counter that glow brighter one after another, from dull grey to blazing gold, while an astonished otter points at the last.
Mirthglaze Bazaar, an invented stop-motion shopkeeping game. Invented game, image generated with AI.

Paste this to your AI

Copy it into Claude, Cursor or ChatGPT. It already has good values and the usual mistakes in it.

Add "Item Rarity" to my game.

What it should do: Rare items give the player something to hope for, and a clear ladder of tiers lets them see at a glance how good a drop is and what it is worth.

Use these starting values:
- rarityStep: 3 x
- luckCap: 1
- powerStep: 1.4 x

Watch out for these common mistakes:
- A legendary item with common power: Tell your AI: roll the tier first and get the power from the tier. If you want some variety inside a tier, keep it small enough that no tier overlaps the next.
- Luck with no limit: Tell your AI: limit luck to the range from zero up to a cap, and treat anything that is not a number as zero.
- A roll of exactly 1 gives no item: Tell your AI: keep the roll between 0 and 1, and if no tier matched, give the top tier.
- Percentages that do not add up: Tell your AI: store weights, not percentages, and divide each weight by the total to get its chance.
- The tier changes when the game is loaded: Tell your AI: roll the tier once, when the item is created, and save the tier with the item.

Do not change anything else in the game. Do not claim anything without proof: model what it takes, and show me what your solution rests on and how I can see that it works. If you cannot show something, say you do not know. When you are done, tell me in plain words how to try it.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP

What it does

Rare items give the player something to hope for, and a clear ladder of tiers lets them see at a glance how good a drop is and what it is worth.

Good starting values

ValueStart withWhat it changes
rarityStep3 xHow many times rarer each tier is than the one below it. At 3, about two drops in three are common and about one in 120 is legendary. It stays above 1, or higher tiers would not be rarer.
luckCap1The most luck that counts. At 1, a lucky player gets about nine times as many legendary drops, and common drops still happen. Keep it below the rarity step minus 1, or the higher tiers stop being rarer. Without a cap, enough luck would turn every drop legendary.
powerStep1.4 xHow many times stronger each tier is than the one below it. At 1.4, a legendary item is about four times as strong as a common one. At 1 all tiers are equally strong and rarity is only for show.

What usually goes wrong

A legendary item with common power

The power is rolled on its own, before or apart from the tier. Sometimes a legendary drop is weaker than a common one, and the player feels cheated.

Fix: Tell your AI: roll the tier first and get the power from the tier. If you want some variety inside a tier, keep it small enough that no tier overlaps the next.

Luck with no limit

Luck from gear, events and potions piles up. At a high enough total, every drop is legendary, or a negative total gives odds below zero and the game breaks.

Fix: Tell your AI: limit luck to the range from zero up to a cap, and treat anything that is not a number as zero.

A roll of exactly 1 gives no item

The tiers are walked with a plain less-than test. A roll of 1, or a running sum that falls just short of 1 from rounding, matches no tier, and the drop comes out empty or crashes.

Fix: Tell your AI: keep the roll between 0 and 1, and if no tier matched, give the top tier.

Percentages that do not add up

The odds are typed in as 60, 25, 10, 4 and 0.5 percent. They add up to 99.5, so half a percent of rolls land nowhere. When someone changes one number, the rest drift.

Fix: Tell your AI: store weights, not percentages, and divide each weight by the total to get its chance.

The tier changes when the game is loaded

The game saves only which item it is, and rolls the tier again on loading. A rare item in the backpack turns common, or the player reloads to reroll their loot.

Fix: Tell your AI: roll the tier once, when the item is created, and save the tier with the item.

How to check it works

Works well with

Common questions

how do item rarity tiers work in games

Each drop gets a tier from common up to legendary. Higher tiers are much rarer and stronger. The tier is rolled once when the item is made, and the power follows from it.

how rare should a legendary item be

Start with about one drop in 120, which is what a rarity step of 3 gives. If your players get dozens of drops per hour, make it rarer, and if they get a few per session, make it more common.

how much stronger should rare items be

A step of 1.4 per tier makes legendary about four times as strong as common. Go higher if rarity should change how a fight plays out, and lower if rarity should be mostly about looks and collecting.

what do i tell my ai to add item rarity

Paste this: Add five rarity tiers, common to legendary. Each tier is 3 times rarer than the one below. Roll the tier first, then set the item's power from it, 1.4 times more per tier. Luck raises the odds of higher tiers but is capped.

Where it comes from

We could not find a reliable origin for this one yet.

Where this mechanic comes from has not been researched yet.

Games are named only as references. Names and marks belong to their owners, and nothing here is endorsed by them.

What was checked

This is what separates the blueprint from a catalogue entry: the values on this page come from code that runs.

Your AI gets the code

Tested example code comes through the Spielerando connection, so your AI can use it right away. How to connect it