Item Gamble

by Maxilo

Stake an item, pick a target and let the wheel of fortune decide. Item values are computed from recipes and research, chances from the value ratio, with consolation prizes and a multiplier.

Utilities
4 hours ago
2.0
0
Manufacturing Cheats

Changelog

Version: 0.24.0
Date: 2026-10-07
  Balancing:
    - Biter eggs are worth 15 instead of 165: a captive spawner lays them nonstop for a bit of
      bioflux. This fixes overgrowth soil (8780 -> 1302), biolab (12.6k -> 5.2k) and the captive
      biter spawner (14.2k -> 5.9k), and eggs are no longer the best stake.
    - Promethium asteroid chunks are worth 30 instead of 165.
    - Promethium science packs have a minimum value of 1500 (was 3290), about twice the
      cryogenic science pack.
    - Quantum processors have a minimum value of 1000 (was 650): their ingredients are cheap, but
      they need Aquilo, the cryogenic plant and fluoroketone. Railgun, fusion reactor and fusion
      generator get more expensive accordingly.
Version: 0.23.0
Date: 2026-10-07
  Features:
    - Statistics at the bottom of the window: value staked, value returned with the ratio (the
      house edge made visible) and your best hit. The tooltip shows spins, wins and free spins,
      the button next to it resets everything.
    - Free spins play automatically one after another while the window is open, with a short pause
      to read the result. Clicking Spin starts the next one right away.
Version: 0.22.0
Date: 2026-10-07
  Changes:
    - Free spins keep the multiplier of the spin that won them, like on a slot machine: a x20 miss
      gives a x20 free spin. In return a miss rolls the free spin chance only once instead of once
      per multiplier step, so a free spin is worth the same per staked item at every multiplier.
      Changing the multiplier afterwards does not change pending free spins.
Version: 0.21.0
Date: 2026-10-07
  Features:
    - Free spins: a miss gives a free spin with a 5 % chance (mod setting, at most 25 %). At xN it
      rolls N times, so bigger multipliers bring more free spins. Free spin fields are green on the
      wheel.
    - A free spin plays exactly the bet it was won with (stake, target, amount, chance) at x1 and
      costs nothing. Switching to a more valuable target does not carry free spins over. Pending
      free spins are played first, the Spin button shows how many are left.
  Balancing:
    - Free spins and consolation prizes together bring the average return from 50 % to about
      52 to 56 % of the stake value, measured over 120,000 spins. Gambling stays a loss on average.
Version: 0.20.0
Date: 2026-10-07
  Balancing:
    - The maximum win chance defaults to 1 (was 0.75). Together with the stake value factor of 0.5
      a 1:1 gamble (same item, same amount) is a coin flip at 50 %, more valuable targets are
      rarer from there.
  Info:
    - The mod is licensed under MIT.
Version: 0.19.0
Date: 2026-10-07
  Features:
    - "Take all" button: moves all prizes to your inventory. Ctrl click on a prize takes all items
      of that kind, like in the vanilla inventory.
  Info:
    - Updated the mod description for the mod portal.
Version: 0.18.0
Date: 2026-10-07
  Balancing:
    - New setting "Stake value factor" (default 0.5): for the chance the stake only counts with half
      its value, like buying and selling prices. The target still has to be worth more than the
      full stake. Trading items of equal value is no safe deal anymore: the chance is at most
      37.5 % (was 75 %), e.g. 20 promethium science packs for 600 uranium fuel cells drop from
      73 % to 36 %.
Version: 0.17.0
Date: 2026-10-07
  Changes:
    - The prize area only grows when a prize actually lands in it, by exactly the rows it needs.
      It never keeps empty rows: taken-out gaps close up and empty rows disappear.
Version: 0.16.0
Date: 2026-10-07
  Changes:
    - The multiplier no longer spins several times. It multiplies stake and prize of a single
      spin: x5 stakes five times the amount and wins five times the target (consolation prizes
      too). The chance stays the same. The totals are shown next to the stake and target slots.
    - Stake and target have their labels back, with clearer tooltips. An empty stake or a missing
      target shows a short hint above the wheel.
    - The prize area grows with the possible prize, one row at a time (scrolls beyond 8 rows), and
      shrinks again over empty slots.
Version: 0.15.0
Date: 2026-10-07
  Changes:
    - The multiplier is a green button next to Spin: click steps through x1, x5, x10, x20, x50 and
      x100 (right click goes back). Steps the stake cannot cover are skipped, if the stake runs low
      the button shows how many spins are left.
    - Much less text in the window: no captions for slots and inventory, no hints for an empty
      stake or target, shorter messages and tooltips. Item values moved into the tooltip of the
      chance, problems are shown in red in place of the chance.
    - The prize area is one row of ten slots below the wheel.
    - Author is Maxilo.
Version: 0.14.0
Date: 2026-10-07
  Changes:
    - Release preparation: English description, thumbnail, homepage, README and a packing script.
Version: 0.13.3
Date: 2026-10-07
  Changes:
    - "Spins" is called "Multiplier" now.
    - Shift + right click on the stake and prize slots moves half of the stack to your inventory,
      like in the vanilla inventory.
Version: 0.13.2
Date: 2026-10-07
  Changes:
    - Fixed the window failing to open in 0.13.0 and 0.13.1: the ten prize slots shared one element
      name, which Factorio does not allow among siblings. They are told apart by tags now.
Version: 0.13.1
Date: 2026-10-07
  Changes:
    - Fixed the window failing to open in 0.13.0 (unsupported operator in the prize area layout).
Version: 0.13.0
Date: 2026-10-07
  Changes:
    - The prize area has 10 slots instead of one. Prizes, consolation prizes and wins of several
      spins have room, only a completely full area blocks the spin. Old single-slot content moves
      over automatically.
    - New "Spins" row (slider and field): spin up to 100 times at once, as far as the stake lasts.
      Every spin stakes the amount per spin and rolls on its own. The wheel shows a win if any
      spin won, otherwise a consolation prize or an empty field. The result line sums up wins and
      consolation prizes.
Version: 0.12.0
Date: 2026-10-07
  Changes:
    - Consolation prizes: on a share of the losing fields of the wheel (35 %, mod setting) lies a
      random item worth about a tenth or a hundredth of the stake. If the wheel stops on one you
      get it despite the miss, the other fields stay empty. Set the share to 0 to switch it off.
Version: 0.11.2
Date: 2026-10-07
  Changes:
    - Items with a minimum value now show the earliest way to make them (space science pack
      showed the research time of the Aquilo ice route instead of the asteroid route).
Version: 0.11.1
Date: 2026-10-07
  Changes:
    - Balancing pass based on the first full value list: yumako and jellynut seeds were worth ~126
      each, now they are a cheap by-product (10).
    - Space, agricultural and cryogenic science packs were barely worth more than the red pack
      or less than military. They now have minimum values (250, 200, 700) so the order feels right.
Version: 0.11.0
Date: 2026-10-07
  Changes:
    - The gamble is its own window again, about as wide as a chest window: your inventory on the
      left, the wheel of fortune on the right, spin button at the bottom. E and Esc close it, and
      it remembers where you dragged it.
    - The inventory in the window moves your real items with the usual controls: left click picks
      up (the slot is marked with the hand, Q puts it back), places or swaps, right click takes
      half or places one item. Shift click moves a stack into the stake slot (shift + right click
      half of it), Ctrl + click collects all items of that kind into the stake slot.
    - Esc closes the target selection first, like vanilla popups, before the window itself.
Version: 0.10.0
Date: 2026-10-07
  Changes:
    - ALT + G opens the normal character window with the wheel of fortune attached to the right,
      like a building. The odd empty box next to the inventory is gone.
    - The stake slot is a supply now: a slider and amount field next to it set how much is staked
      per spin, the rest stays for the next spins. After a miss you can spin again right away.
    - The target amount moved out of the selection dialog: slider and amount field sit next to the
      target slot. Clicking an item in the dialog takes it immediately.
    - All qualities can be chosen as target, like in "Select signal", not only researched ones.
    - The prize slot only blocks the reel when it holds a different item or its stack is full.
      Whatever does not fit goes to the inventory.
    - Win fields on the reel are spaced irregularly, but evenly overall.
Version: 0.9.0
Date: 2026-10-07
  Features:
    - Prize slot: wins land there instead of going straight into the inventory. Closing the window
      moves uncollected prizes into your inventory, whatever does not fit drops to the ground.
      Like a machine with a full output, the reel will not spin while a new prize would not fit.
  Changes:
    - The stake slot now sits in the gamble panel next to the target and the prize slot instead of
      inside the inventory window. Stake and prize slots behave like vanilla slots: left click to
      put in, take out or swap, right click to put in one item or take half, shift click to move
      to the inventory.
    - Larger spacing on the reel: win fields are further apart (every 3rd to 6th field) and there
      are small gaps between fields.
    - Near misses are rarer (about one spin in five) and less extreme; only very close ones hang
      on the edge for a moment.
  Bugfixes:
    - The reel clicks from the very first moment of a spin again, rattling while it rushes by.
Version: 0.8.1
Date: 2026-10-07
  Bugfixes:
    - Fixed a crash when opening the target selection ("Expected Table or Flow or HorizontalFlow
      style type but was Frame").
Version: 0.8.0
Date: 2026-10-07
  Changes:
    - The target is a slot like on the constant combinator: left click opens the selection dialog,
      right click clears it.
    - The selection dialog follows the vanilla "Select signal" dialog and uses its own styles:
      item group tabs, slot grid with one row per subgroup, quality buttons (only researched
      qualities), slider with amount field and the green confirm button. Double click or Enter
      confirm as well.
    - Search in the dialog finds translated item names, like in the game.
  Bugfixes:
    - The click sound of the reel is in sync now. It clicks exactly when a field passes the arrow
      and stays silent while the fields rush by too fast for single clicks.
Version: 0.7.0
Date: 2026-10-07
  Features:
    - Spins vary in length. Short, brisk spins are almost always a miss. Long spins crawl slowly
      at the end so every click is audible - usually a win, sometimes a painful near miss.
    - Near misses: the reel hangs on the edge of a win field for a moment and then tips back onto
      the miss, or slips off a win field it had just reached.
    - Close wins: after a long spin the win field creeps over the edge, hangs there briefly and
      then clicks into place.
    - No extra effects; the tension comes only from speed, pauses and the clicks.
Version: 0.6.1
Date: 2026-10-07
  Changes:
    - The target is chosen with the vanilla item selector again (item groups, quality and a search
      that finds translated names), with the amount field right next to it. The home-made target
      window from 0.6.0 is gone.
Version: 0.6.0
Date: 2026-10-07
  Changes:
    - The window works like a chest now: the stake is a real slot next to the vanilla inventory.
      Left click, right click, shift click and splitting stacks all work as everywhere else. The
      gamble panel is attached to the right of it. The home-made inventory grid is gone.
    - Target selection works like the constant combinator: click the target slot, pick an item
      from the item group tabs, choose quality and amount, then confirm (double click or Enter
      confirm too).
    - The reel always comes to rest exactly in the middle of a field. It stops slightly off, then
      settles into the centre of the nearest field.
    - Win fields on the reel are evenly spaced (every 2nd to 5th field, depending on the chance).
  Bugfixes:
    - With time paused (e.g. in the map editor) the reel no longer freezes the window; the spin is
      resolved immediately instead, since nothing can move without ticks.
    - The reel counts its own frames, so a save loaded mid-spin carries on where it left off.
Version: 0.5.0
Date: 2026-10-07
  Features:
    - Reel animation. A row of fields rushes sideways and slows down until the result stops under
      the arrow. Win fields show the target item in yellow, misses are empty. The reel moves pixel
      by pixel, clicks softly as fields pass the arrow and plays a fanfare on a win.
    - The result is decided before the reel starts; the reel only shows it. The prize is paid out
      when the reel stops, so the inventory in the window does not give it away early.
    - The spin state lives in the save, so saving mid-spin and multiplayer are safe.
  Changes:
    - While the reel spins, stake, target and the spin button are locked.
    - Closing the window mid-spin pays out at once and posts the result in chat.
Version: 0.4.0
Date: 2026-10-07
  Changes:
    - One window instead of two. Your inventory is shown inside the gamble window, so there is no
      need to open the character screen and pick up a stack first. E and Esc close the window.
    - Staking works like everywhere else in the game: left click an inventory slot stakes the whole
      stack, right click stakes a single item. On the stake slot, left click takes everything back
      and right click takes one item back.
    - Staked items stay in your inventory until you spin. The grid shows what is left and
      highlights the slots involved. Spinning takes from the clicked slots first; freshness is the
      average of exactly the items that are taken.
    - Items without a value and armor with equipment inside are greyed out in the grid, the
      tooltip says why.
  Bugfixes:
    - Items still lying in the stake slot of 0.3.0 are given back when the save is loaded.
Version: 0.3.0
Date: 2026-10-07
  Features:
    - Gamble window, opened from the shortcut bar or with ALT + G. Stake slot, target item with
      quality and amount (one stack at most), live win chance with the reason when a spin is not
      possible, and a spin button.
    - Spinning below the minimum chance is blocked.
    - The window remembers its position.
Version: 0.2.0
Date: 2026-10-07
  Features:
    - Later items are worth more. Value = material value x (1 + weight x log10(1 + research time /
      1000 s)), counting all research up to the recipe, its ingredients and the building it needs.
    - Map setting "Value factor for game progress" (default 1.5, 0 turns it off). Changing it
      recalculates all values right away.
  Changes:
    - Because of the progress factor, foundry casting no longer undercuts the Nauvis recipes.
    - Pentapod eggs got a base value (the biochamber needs eggs, eggs need a biochamber).
    - Biter egg and promethium chunk base values lowered to 165, so 1 red science for 100
      promethium science stays close to the minimum chance.
    - /gamble-values lists hidden items without a value only as a count.
Version: 0.1.0
Date: 2026-10-07
  Features:
    - Item values calculated at load time from base values for raw resources and the cheapest
      recipe for everything else, including items from other mods.
    - Map settings for maximum and minimum win chance and the value factor per quality level.
    - /gamble-values [search] writes every value to script-output/item-gamble/values.txt.
    - /gamble-recalc recalculates the values (admins only).