anon9 wrote: ↑Mon Oct 31, 2022 2:01 pm
I can probably see if I can take a look at it later and have it so that if a drop rate would be over 100, it is set to 100 instead of going over 100.
The problem with that is if an item is 100% drop, then even the default multiplier (5x) will change it to 1000% (500% x2 - the rate is doubled) - if you have a multiplier that is large enough (50+) everything becomes over 100% and will force the common drop. Even worse, if you have exactly 50% drop rate (not multiplier, so read this as...some arbitrary low multiplier that results in a 50% drop rate), because the game doubles the rate, that becomes 100%. It's weird, because drop rate can increase your chances at getting an item, but too much drop rate and you'll never get rare items.
In case I wasn't clear, your drop rate is a modifier to the actual rate for each item. Every loop your drop rate is modified, every drop chance is deducted from the new total, and the next drop uses a modified value of that. I didn't really look into how because I didn't want to assume every drop or enemy has the same modifiers. I wanted to eliminate them.
In the original code it does something like this:
DropRate x 2 (this seemed consistent), store into DropRate
Random 0-100
Subtract Random from DropRate, store into DropRate
DropRate Negative? Drop Loot
DropRate x (some value), store into DropRate
Random 0-100
Subtract Random from DropRate, store into DropRate
DropRate Negative? Drop Loot
...
As you can see, because the DropRate is deducted every loop, if it wasn't modified, there would always be a drop. What's more, because it is modified each loop, there is a chance that the DropRate value would be over 100 naturally. This is some kind of artificial difficulty to make getting drops harder to obtain. Perhaps 'droprate' isn't the appropriate word, maybe 'drop difficulty'. It just uses the DropRate as a base. Adding a general drop rate modifier on top of that would just accelerate it.
And if all this is just too much, TLDR; Drop rate above 100% is normal behavior.
If you attempt to bypass this, then there's a high possibility you skip a forced key item drop, and the game will crash. This is why I wrote the opposite. If the item's natural drop is 100%+, it ignores the code, and the item drops naturally. If it's not 100%, then it will use the values you input (even 100%, because this is after the check). For reasons, I've also done the same thing for 0% drops.
Because of this, there isn't even a purpose of the multiplier anymore. Every time an enemy is killed, it'll check for drops. As long as the natural drop rate isn't 100% or 0%. As the process loops over and over it kinda looks like this:
Is the item not 100%+?
Is the item not 0%?
Random 0-100, is the result greater than Drop0Rate?
Random 0-100, is the result greater than Drop1Rate?
Random 0-100, is the result greater than Drop2Rate?
Random 0-100, is the result greater than Drop3Rate?
Random 0-100, is the result greater than Drop4Rate?
If any result is no, it executes the drop. If it gets to the end, no drop occurs.
anon9 wrote: ↑Mon Oct 31, 2022 2:01 pm
Also, as a warning, if you have the No Item Decrease AND the Limit Items on, don't use auto compound or you'll freeze the game until you turn one of the two off. Also, note that with Limit Items on, it sometimes won't work (which is why I set mine to 16) because it sets first, THEN adds. So to fix that, you would need to do One of two methods:
1) First, set to X value, then SUBTRACT the add amount, then allow it to add.
2) Set to X value, then SKIP the add.
Yeah, I haven't gotten that far yet. I wrote it the way I did because I wanted things to auto-sell. I suppose if it's causing crashes/freezes I can just do one of the two you suggested.