Salvager config not working properly
ViRb3 opened this issue ยท 4 comments
Versions
- Silent Gear: 1.16.3-2.3.5+170
- Silent's Gems: N/A
- Silent Lib: 1.16.3-4.9.0+63
- Forge: 35.0.18
- Modpack: ATM6 1.3.1
- Optifine Installed: N/A
Expected Behavior
From the config:
#Settings for the salvager
[salvager]
[salvager.partLossRate]
#Minimum rate of part loss when salvaging items. 0 = no loss, 1 = complete loss.
#Rate depends on remaining durability.
#Range: 0.0 ~ 1.0
min = 0.5
#Maximum rate of part loss when salvaging items. 0 = no loss, 1 = complete loss.
#Rate depends on remaining durability.
#Range: 0.0 ~ 1.0
max = 1.0
The way I understand it, with full durability I will get half of the items back. With almost no durability, I will get nothing back. In reality, the behavior seems to be mostly random. Example, courtesy of @gogedo:
Shovel = 1 Stick
Sword = 2 ingot
Boots = 2 ingot
Helmet = 1 ingot
Pickaxe = 1 ingot
Leggings = 5 ingot
Chestplate= 2 ingot
@ViRb3 Are those outputs for vanilla items exclusively? I was using SGear items when I tested this.
@SilentChaos512 Vanilla items exclusively, yes.
Yes, it is deliberately random.
Loss rate for a given item being salvaged:
- If
ratio
is how damaged the item is (0.0 to ~1.0) - Loss rate is
(ratio * max) + ((1 - ratio) * min)
If you turn on debug logging for Silent Gear
you can see the calculated loss rate when you try to salvage something. As expected, loss rate with min = 0.5
and max = 1.0
is going to be 0.5 when salving a fully undamaged item.
The loss rate is applied against each ingredient. So yes, if you throw in a 100% durability iron helmet with min = 0.5
and max = 1.0
as in your example, here are your possibilities:
- 3.125%: 5 ingots
- 15.625%: 4 ingots
- 31.25%: 3 ingots
- 31.25%: 2 ingots
- 15.625%: 1 ingot
- 3.125%: 0 ingots
The mean yield of one fully repaired iron helmet would be 2.5 ingots, i.e., throwing in 100 of these iron helmets should get you around 250 ingots. There is a distribution here, so yes, throwing in just a few items could very well give you a number that seems very "high" or a number that seems very "low".
Not sure I see any sort of bug here.