TheMorningStar-Valuable_Rebalance icon

Valuable Rebalance

Stops one loot mod from flooding your maps. Gives every installed loot pack an equal shot at each modded spawn, keeps each map's own themed loot, and rarely themes a whole level around one pack.

Last updated 5 hours ago
Total downloads 30
Total rating 0 
Categories Valuables Server-side AI Generated Quality Of Life
Dependency string TheMorningStar-Valuable_Rebalance-1.0.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100
Zehs-REPOLib-4.2.0 icon
Zehs-REPOLib

Library for adding content to R.E.P.O.

Preferred version: 4.2.0

README

Valuable Rebalance

Stops one loot mod from flooding your maps.

Normally the game picks every valuable from one shared pool, so a mod with 800 items crowds out a mod with 3. This evens the odds. It only changes which valuable fills each spawn slot.

What it does

  • Every loot pack gets an equal shot when a slot rolls modded, whatever its size.
  • About 6% of slots roll a modded item, so roughly one or two per map. The rest stay vanilla.
  • Each map keeps its own themed loot. A Minecraft map still spawns Minecraft items.
  • About 2% of maps draw all their loot from one installed pack, so once in a while a whole level is themed around a single loot mod.
  • On the first level it logs every loot pack it found with its item count, and flags any item that shows up as a blank box because its own mod failed to load its model.

Configuration

Setting Default What it does
Enabled true Master switch.
ModdedChancePerSlot 0.06 Chance from 0 to 1 that a slot rolls a modded item.
RethemeChance 0.02 Chance from 0 to 1 that a whole map draws from one pack.
Verbose false Log pool sizes, detected packs, and per-map re-theme rolls.

Only the host's config matters. The host decides every pick.

For developers - detailed breakdown

GUID: themorningstar.valuablerebalance, requires REPOLib.

Four Harmony patches.

Postfix on Valuables.RegisterValuable(ValuableContent). Records each PrefabRef against its source AssetBundle name as a fallback tag.

Postfix on Valuables.RegisterInitialValuables, REPOLib's one-time drain. Builds the pools by walking every LevelValuables preset in memory. A modded bundle with items in a preset whose name contains "Generic" becomes a sprinkle category, the shared pool every map uses and the flood path. Everything else in a preset is native to it: base-game items, which have no bundle and can never be sprinkle, and a custom map's own items. Category resolution goes PrefabRef.Bundle, then the recorded tag, then a leaf-name lookup across every loaded bundle's .prefab assets. An item that matches nothing is native.

Prefix on LevelGenerator.Start. Resets per-level state and rolls RethemeChance once for the map.

Prefix on ValuableDirector.SpawnValuable(ref PrefabRef, ValuableVolume, string). The swap. Size class comes from ValuableVolume.VolumeType, one of tiny, small, medium, big, wide, tall, veryTall, and swaps stay within class. When a map is re-themed it picks from that pack and falls back to native if the pack has nothing in that size. Otherwise it rolls ModdedChancePerSlot. On a hit it picks a sprinkle category uniformly, excluding categories with nothing in that size, then a random item from it. On a miss it picks from the map's native pool, the union of its own Level.ValuablePresets, rebuilt on level change.

The swap only commits when pick.Prefab resolves non-null. An unresolvable PrefabRef makes Instantiate(null) throw inside SetupHost and the level loads forever, so on any doubt it keeps the game's original pick, which is always valid.

With no "Generic" preset present it cannot tell theme mods from global packs, so it treats every tagged bundle as sprinkle and logs a warning. Flood control still works, theme-scoping does not. The first-level check flags valuables whose renderers carry only default or error-shader materials as [broken-render], which points at a dead loot mod. SpawnValuable runs host-side. Clients need the same content mods but not matching config.