MudPull — Cast your magnet. Pull your fate.

Runtime Architecture

Four chat commands fan into Streamer.bot, which orchestrates the full pull sequence — two TRNG calls, a MySQL query, a WebSocket push to OBS, and two chat messages. n8n is no longer in the critical path.

MudPull runtime architecture — updated with !mudstats and dual TRNG calls Four chat commands fan into Streamer.bot. Streamer.bot calls mudpull-service. The roll endpoint makes two TRNG calls: one for item pick, one for market rate 50–100%. Streamer.bot pushes results to OBS overlay and chat. !pull !upgrade !mudpool !mudstats Streamer.bot orchestrator broadcast · chat mudpull-service POST /mudpull-roll TRNG ×2 POST /mudpull-upgrade-info GET /mudpull-count GET /mudpull-stats MySQL weighted roll approved items TRNG API item pick market rate 50–100% OBS overlay WebSocket chat messages
mudpull-service on Node.js/Fastify · MySQL server · TRNG server

True Random Number Generator

Every pull makes two calls to a hardware TRNG — a dedicated machine running a FM radio card as an entropy source, harvesting atmospheric radio noise between stations. The host is a retired AMD Phenom II X4 940 running headless Linux, verified with the Dieharder test suite. Almost everything PASS — a few results flag as "too good", which is exactly what you want from hardware entropy.

Call 1 — Item pick: a random integer between 1 and the total pool weight. Used to walk the weighted item list and select the pulled item.
Call 2 — Market rate: a random integer 0–7, converted to a payout percentage. The merchant has moods.

How Weighted Rolls Work

Every item in the loot table has a weight value. Higher weight = pulled more often. After filtering by gear tier, the service sums all eligible weights, asks TRNG for a number in that range, then walks the list until it finds the item at that position.

How loot weight works in MudPull Diagram showing how the gear tier filters the loot pool, then a true random roll picks an item proportional to its weight. You cast your magnet Your gear tier decides reach Items beyond your tier are skipped Only items where minGear ≤ your gear Your loot pool Bigger slice = more common. Smaller slice = rarer. Rusty nail weight 140 Old coin weight 70 w 35 Junk (140) Common (70) Uncommon (35) Rare (18) Epic (6) Legendary (2) Total weight in this example: 271 A true random number is rolled e.g. pool weight = 271, TRNG returns 175 The roll lands inside one slice 175 falls in Common slice (141–210) → Old coin is pulled That item is your pull Better gear = more items in the pool
Gear tier filters the pool first · TRNG picks a position · walk finds the item
Rarity Typical Weight Pull Chance (approx)
Junk 80–100
Most common
Common 50–70
Frequent
Uncommon 25–45
Occasional
Rare 10–20
Uncommon
Epic 4–8
Rare
Legendary 1–3
Very rare
Mythic 1
Almost never

Gear Tiers & Item Pools

Each item has a minGear value. Before rolling, the service filters to only items where minGear <= your tier. Higher tiers don't replace lower pools — they stack on top. A tier 5 player still pulls junk. That's realistic.

Card tiers visual
Card style changes hand in hand with the Tier needed for the item
Image Generation Prompts
T1 — Solid dark background. Signs of water wear: rust, algae, moisture, grime. Recently pulled from a lake.
T2 — Murky underwater depth — muted blues and greens, subtle light rays, gentle bokeh. Water wear still visible.
T3 — Ethereal underwater background, deep teal with soft golden light rays. Item is flawless — no rust, no wear. Subtle luminous sheen.
T4 — Deep purples and electric blue bioluminescent glow. Perfect condition. Glowing edges, magical aura suggesting powerful enchantment.
T5 — Cosmic deep-sea void — swirling blacks, gold and crimson light erupting from behind the item. God-ray effect. Otherworldly power.
TierRigUnlocksUpgrade Cost
T1 Fridge Magnet + Pasta Noodle Junk & Common pool Starting rig
T2 Hardware Store Magnet + Nylon Rope + Uncommon pool Keep grinding
T3 N52 Neodymium + Braided Line + Rare pool Keep grinding
T4 Dual-sided N52 + Dyneema + Epic pool Keep grinding
T5 Industrial Electromagnet + Steel Cable + Legendary & Mythic pool Keep grinding

Market Rate

After rolling your item, a second TRNG call (0–7) determines what the merchant pays. The formula maps to six discrete steps — 100% can happen in 3 out of 8 rolls. The merchant is not always generous.

Math.min(trng(0,7), 5) × 10 + 50
50%
60%
70%
80%
90%
100%
TRNG rolls 0–4 → 50/60/70/80/90% (one step each) · rolls 5, 6, 7 all cap at 100% — so full value is 3/8 odds.

Magnet Charm

Activated with !charm, a charm tilts the weighted roll toward rarer loot for the next 10 pulls. It does not guarantee anything — it shifts the pool in-memory before the TRNG roll, then the database weights are left untouched. Only one charm can be active at a time.

Weight Multipliers
RarityMultiplierEffect
JunkExcludedFiltered completely — will not pull
Common× 0.5Halved
Uncommon× 1.0Unchanged
Rare× 3Three times more likely
Epic× 4Four times more likely
Legendary× 5Five times more likely
Mythic× 5Five times more likely
Cost by Gear Tier
TierCost
T11 000 SC
T22 500 SC
T35 000 SC
T410 000 SC
T520 000 SC

Full Pull Sequence

1
!pull in Twitch chat Streamer.bot catches it, checks per-user cooldown (60s), reads MudPullGear + MudPullScrap from user vars.
2
POST /mudpull-roll to mudpull-service MySQL returns all eligible items (minGear ≤ tier, approved, weight > 0).
3
TRNG call 1 — item pick Random integer 1–totalWeight. Walk the list, subtract weights until ≤ 0. That's your item.
4
TRNG call 2 — market rate Random 0–7 → 50–100% payout. Final value = baseValue × rate.
5
WebSocket → OBS overlay Streamer.bot broadcasts item data. Overlay plays gear bubble, card animation, rarity effects.
6
Cast message → chat "@user casts their T3 rig into the murky depths…" — 10 second suspense delay.
7
Result message → chat Rarity, item name, scrap awarded, market rate note, flavour text. Scrap balance updated in SB user vars.