Spielerando

Loot Table

A loot table picks what drops from a list of items, each with a weight. A bigger weight means the item drops more often. Each item's chance is exactly its weight divided by all the weights added up. Use whole numbers for the weights, and make sure the random roll is fair.

Also called: Drop table, Weighted drop table, Weighted random table, Treasure table.

A giant amethyst crab has burst apart in a voxel cavern, and its loot fans out across the floor: many plain grey stones, a few green flasks, some blue gems and one golden prize under a beam of light, watched by a small round robot.
Shardcrab Hollow, an invented cavern dungeon 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 "Loot Table" to my game.

What it should do: Random rewards with chances you control, so most drops are common, some are rare, and the odds are exact and easy to change.

Use these starting values:
- seed: 1
- rollsPerOpening: 1

Watch out for these common mistakes:
- Weights with decimals: Tell your AI: use whole numbers for weights. For a table in percent, use weights that add up to 100, or to 10,000 for finer chances.
- Low rolls come up too often: Tell your AI: draw again when the random number falls past the last whole multiple of the total.
- A table with nothing in it: Tell your AI: if the total is zero, drop nothing, and check every table when it loads.
- Changing one weight changes every chance: Ask your AI to show you the final chances, not only the weights, and add an item for nothing whose weight can soak up a change.

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

Random rewards with chances you control, so most drops are common, some are rare, and the odds are exact and easy to change.

Good starting values

ValueStart withWhat it changes
seed1The starting number for the randomness. The same seed always gives the same drops.
rollsPerOpening1How many rolls one opening makes, so a chest can give several items.

What usually goes wrong

Weights with decimals

Weights such as 0.1 do not add up exactly. A roll can run past the last item and give nothing, and the real chances differ from the ones you wrote.

Fix: Tell your AI: use whole numbers for weights. For a table in percent, use weights that add up to 100, or to 10,000 for finer chances.

Low rolls come up too often

The usual shortcut for cutting a 32-bit random number down to size favours low rolls, a little for small tables and a lot for very large totals.

Fix: Tell your AI: draw again when the random number falls past the last whole multiple of the total.

A table with nothing in it

An empty table, or one where every weight is zero, has nothing to roll for, and dividing by the total fails.

Fix: Tell your AI: if the total is zero, drop nothing, and check every table when it loads.

Changing one weight changes every chance

Raising one item lowers all the others, because each chance is a share of the total.

Fix: Ask your AI to show you the final chances, not only the weights, and add an item for nothing whose weight can soak up a change.

How to check it works

Works well with

Common questions

how do you make a loot table

Give each item a whole-number weight and add the weights up. Roll a whole number below the total, then go down the list, subtracting each weight until the roll falls inside an item.

how do weighted random drops work

Each item's chance is its weight divided by the total of all weights. An item of weight 5 in a table with a total of 100 drops one time in twenty.

what do i tell my ai to add a loot table

Paste this: Add a loot table. Give every item a whole-number weight, never a decimal, so the chances add up exactly and every roll lands, and make sure the random roll is fair.

how do i add a chance of no drop

Add an item for nothing, with its own weight. It works like any other item, and it gives you one number to raise or lower how often anything drops at all.

Where it comes from

Earliest example we could find: Dave Arneson's Loch Gloomin stocking tables (Blackmoor home campaign) (1972). Arneson stocked a new adventure area from his own tables, rolling dice for gold and using random tables for items. This is known second-hand: the notes were reprinted in First Fantasy Campaign (Judges Guild, 1977), and the date comes from the researcher DHBoggs reading that reprint. The reprint itself was not seen for this entry.

  1. 1972 Dave Arneson's Loch Gloomin stocking tables (Blackmoor home campaign): Arneson stocked a new adventure area from his own tables, rolling dice for gold and using random tables for items. This is known second-hand: the notes were reprinted in First Fantasy Campaign (Judges Guild, 1977), and the date comes from the researcher DHBoggs reading that reprint. The reprint itself was not seen for this entry. [The Magic of Treasure! (DHBoggs, Hidden in Shadows blog, 2015)][Character Growth and Dungeon Stocking (DHBoggs, Hidden in Shadows blog, 2020)][Reactions to OD&D: The Arnesonian Dungeon (The Alexandrian, 2018)]
  2. 1974 Dungeons & Dragons, Volume 2: Monsters & Treasure (Gygax and Arneson, Tactical Studies Rules): Earliest printed rules seen directly for this entry. A table gives each monster a treasure type, and each type lists dice ranges and chances for coins, gems, jewelry and magic. Follow-up tables turn a magic result into a specific item, so a hoard is built by successive rolls. As printed, the treasure applies to encounters in a monster's lair. The rulebook was read in an unofficial copy, which is not linked here. [Dungeons & Dragons (1974), Wikipedia, bibliographic reference][Loot Drop Tables (Daniel Cook, Lostgarden, 2014)]
  3. 1980 Rogue (Michael Toy, Glenn Wichman, later Ken Arnold): Computer dungeon game that generated its level layout and placed objects at random on each run, so treasure could not be memorized. The designer's own history confirms the generated dungeon but not the item rules; the statement about objects rests on Wikipedia, and the year is the approximate one given there. [Rogue (video game), Wikipedia][A Brief History of Rogue (Glenn R. Wichman, 1997)]
  4. 1996 Diablo (Blizzard North, formerly Condor): Moved random treasure from turn-based dungeon games into a real-time action RPG in which monsters drop items. The 1994 pitch already planned for treasures to be placed at random. Brevik later said the game was built around loot from the start and compared killing monsters to pulling a slot machine lever. [Diablo game concept (Condor, Inc., 1994), hosted by David Brevik][Here's a look at the original design pitch document for Diablo (Alex Wawro, Game Developer, 2016)][Diablo (Jimmy Maher, The Digital Antiquarian, 2023)][Why Video Game Loot Is So Addictive, According To The Creators Of Diablo (Nathan Grayson, Kotaku, 2021)][Diablo (video game), Wikipedia]
  5. 2009 Borderlands (Gearbox Software): A shooter whose guns are assembled from randomly combined parts, rather than chosen from a fixed list of hand-made items. The developers describe the starting question as how to make a lot of guns. Generated weapons and items reach the player from enemies, chests, vendors and quests. [Interview: Gearbox Software explains their love of guns and Borderlands 2 (Ryan Kuo, Kill Screen, 2012)][Borderlands (video game), Wikipedia]
  6. 2014 Loot Drop Tables, essay by Daniel Cook: Design essay that describes the structure in general terms: items go into a bucket with weights, and a roll selects from the bucket. It also links the method back to tabletop D&D. It is a late written explanation of the technique and does not date the origin of the term. [Loot Drop Tables (Daniel Cook, Lostgarden, 2014)]

Strength of the sources: the 1974 rulebook and the 1994 Diablo pitch are primary and were read directly. The 1972 point is second-hand, from one specialist blog, with The Alexandrian independently confirming that First Fantasy Campaign dates from 1977 and contains original campaign material. DHBoggs spells the area both Loch Gloomin and Loch Gloomen. Disputed: DHBoggs argues that Gygax built the Treasure Types tables by expanding Arneson's dragon treasure tables and that they were meant for general use, not only for wilderness lairs. That is his reading; the printed 1974 note limits treasure to lairs, and Delta's D&D Hotspot reads dungeon treasure as possibly coming from level-based tables instead. MeinMMO's German headline says Diablo's creators invented loot in video games; that is the outlet's framing and it does not fit the tabletop and roguelike material above. Maher (Digital Antiquarian) credits Diablo with bringing the phrase 'loot drop' into gamer vocabulary. Diablo's date is split: Wikipedia says it shipped to some retailers in December 1996 and was widely available in January 1997. Rogue's date is loose: Wikipedia says it was developed around 1980. Could not document: who coined the term 'loot table' or when it entered designer vocabulary, and whether EverQuest or another MMO used it earlier in print. Could not document: Brevik's reported remark that Diablo's items were loosely based on Moria. It appeared only in search snippets of a TweakTown report on an Ars Technica interview, and neither page could be opened. Maher instead records Angband as Brevik's favorite roguelike. The rulebook was read in an unofficial copy with some lines missing; that copy is not linked here. No probabilities or table values are reproduced here, on purpose.

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