| Last updated | a month ago |
| Total downloads | 58 |
| Total rating | 1 |
| Categories | Tweaks |
| Dependency string | mtsukn-True1_5x-0.0.1 |
| Dependants | 0 other packages depend on this package |
This mod requires the following mods to function
denikson-BepInExPack_Valheim
BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.
Preferred version: 5.4.2333README
NOT TESTED IN MULTIPLAYER
DOES NOT AFFECT DROP CHANCES, ONLY AMOUNTS
True 1.5x
Patches drop scaling to roll for the remainder instead of rounding up. In 1.5x resourceRate this means a dandelion for example won't always drop 2 items. It will drop 1 and flip a coin to drop another.
Also includes a fix for a discrepancy in the code causing wrongly scaled drops when playing with modified resource rates.
FAQ
Is it laggy?
Probably not. I couldn't see a difference even when popping objects with 50+ nodes.
Does it work in multiplayer?
I haven't tested it in multiplayer but I assume if you own the GameObject that's handling the drop method it should apply the patch accordingly.
How does the rounding patch work?
By default the game rounds float values up. So if the resourceRate is set to 1.5x, items that usually drop 1 will drop 1.5 items. Of course you can't drop half an item so it rounds up to 2. Even something that drops 1.01 items (theoretically) would be rounded up to 2. This mod replaces the rounding method with a method that rolls the remainder to add one or not. So if something drops 1.5 items, it will drop one and then roll a 50% chance to add another. If something drops 1.25 items, it will drop one and roll a 25% chance to add another, etc.
What does the range patch do?
There's a discrepancy in the game code where different methods are used to calculate a random range depending on the resourceRate. By default (1x resourceRate) the game uses integers when rolling how many items to drop. For example, the Deer prefab drops 1-3 deer hide. So it puts the minimum drop and the maximum drop into Random.Range(min, max) which generates a random number between 1 and 3. But wait, deer only drop 1-2 hide right? That's because the Random.Range(int, int) method is non-inclusive. Meaning that, although you put 3 as the max, it truncates down to 2. So deer only drop 1 or 2 hide, averaging to 1.5.
However, when modified resourceRates are active (any other than 1x) then the game uses Random.Range(float, float) which IS inclusive. So now the result is any float between 1.0 and 3.0. Just this discrepancy, before the resourceRate multiplier is even applied, changes the average to 2.0 when the default is 1.5.
Here's an example: We kill a deer and it rolls to drop 2.6 hide. At the default 1x resourceRate this value would be truncated to 2. With 2x resourceRate it multiplies it to be 5.2. Then it rounds it up to 6. So somehow, by turning on 2x drop rates, something that usually can only drop 2 items drops 6! That's not 2x. To fix it I added a patch to the method that minuses 1 from the max. This is combination with the rounding patch fixes the discrepancy and the average.