Claude Game Studio

Loot table generator

This loot table generator turns item weights into drop chances, simulates rolls by item and rarity, and exports the table as JSON.

Editable drop weights, rarity labels, expected chances and observed results
Item, rarity and weightRemove item

Expected 60.00% · Roll to see observed

Expected 25.00% · Roll to see observed

Expected 10.00% · Roll to see observed

Expected 4.00% · Roll to see observed

Expected 1.00% · Roll to see observed

Rates by rarity

Common: 60.00% expected

Uncommon: 25.00% expected

Rare: 10.00% expected

Epic: 4.00% expected

Legendary: 1.00% expected

Chance of no drop

36.60% chance of zero Sunken key drops in 100 attempts.

Each roll picks one item, with replacement. A rarity name is a label; its weight sets the odds.

Edit the example, then simulate. Old results clear whenever the table, seed or roll count changes.

Set weights for one drop

Give each item a name, a rarity label and a nonnegative weight. The example has 5 items with a total weight of 100. Copper coins occupy 60 parts, healing salve 25, the moon compass 10, the storm cloak 4 and the sunken key 1. Each roll returns exactly one of them. An item's share of the total is its probability.

Add an item named Nothing if a chest should sometimes be empty, then ignore that id when creating inventory objects. Set a weight to zero to keep the row while disabling its drop. Adding a positive-weight item reduces everyone else's chance, even if you leave their individual weights alone. The percentages update together so that change is visible before you roll.

Compare expected and observed rates

Press Simulate rolls to draw between 1 and 100,000 items with replacement. The Observed column shows both the count and its percentage of all rolls. The rarity chart groups those results by label. If you add a second Rare item, the chart combines both Rare weights and both observed counts. Renaming a tier does not quietly apply another multiplier.

Changing the table, seed or number of rolls clears old observations. That keeps a previous run from appearing beside new odds. Seed 2026 always repeats the same sample for the same table; another seed produces a different one. Use multiple seeds to understand variation. A small observed gap is a possible outcome, not an instruction to alter the expected rate until the numbers match.

A rare drop can take time

The sunken key has a 1% chance per roll. After 100 independent attempts there is still a 36.60% chance of no key. The calculation is (1 − chance) raised to the number of attempts. Choose an item and an attempt count in the workbench to see that tail. A long run of misses does not use up the chance of another miss.

If your game needs a guaranteed reward after a fixed number of attempts, implement that rule separately and test it. This table has fixed probabilities on each roll. A pity counter, a quest reward or a selection without replacement changes the design. Keep the fixed table as a baseline before adding those rules so you can explain exactly what the player earns and when.

Use the exported weights

Export JSON after your last edit. Match the item id to your inventory data and use the weights directly. For a JavaScript game, this picker walks the weighted intervals in order. Keep zero-weight rows in the file if useful; the picker skips them. Supply the same seeded sequence to reproduce a test.

export function rollLoot(entries, random = Math.random) { const total = entries.reduce((sum, e) => sum + e.weight, 0); if (!(total > 0) || entries.some(e => !Number.isFinite(e.weight) || e.weight < 0)) throw new Error("Use finite, nonnegative weights and a positive total"); let x = random() * total; // random() must return a number in [0, 1) for (const entry of entries) { if (x < entry.weight) return entry; x -= entry.weight; } return entries.findLast(e => e.weight > 0); }

Godot's RandomNumberGenerator provides rand_weighted for selecting an index from weights. Its random sequence is an engine detail; a matching numeric seed in Godot and this browser does not promise identical results. Copy the exported weights for matching probabilities, and use this page's picker and random algorithm when exact replay matters.

Toolbench's generator also covers multiple rolls per chest and C# export. This page focuses on editable rarity totals and the chance of a player still missing one item. Use the game idea generator to choose the loop around the rewards, then describe the item ids and win condition to Claude Code.

Questions

How do loot table weights work?

Divide an item's weight by the sum of every weight to get its chance on one roll. Weights 60, 25, 10, 4 and 1 add to 100, so the first item has a 60% chance. Multiplying every weight by the same number leaves all chances unchanged.

Do rarity tiers change drop chances?

Here, rarity is a label. The weight alone determines an item's chance. The rarity summary adds the weights and observed drops of every item with the same label, so you can see how much of the table is Common, Rare or Legendary.

Why does the simulation differ from the expected rate?

A finite random sample varies. A 1% item need not appear once in every hundred rolls, and previous misses do not increase its next chance. Reusing the same seed and table reproduces a simulation; changing the seed shows another possible sample.

What does the loot table JSON contain?

The file contains stable item ids, display names, rarity labels, weights, total weight and the current simulation settings. It records observed counts when you have run a simulation. Each roll selects exactly one item with replacement; a zero-weight item is never selected.

Put your assets into a playable game. Try the ten game templates or get the kit.