|
If you want to know how RS does it..
(Yes, that's actually what RS does)
I personally suggest keeping it either percentage or weight based. Percentage-based is harder to maintain as you need to ensure that the rate of all drops added up comes to precisely 100%; as far as weight-based system goes, it's more scaled than anything.
Percentage-based is simple.
A) 100% drops - these are always dropped as long as you mark the percentage as 100.
B) Any percentage between 0 and 100. Generates a random drop every time, based on the percentages given to every drop. Only one drop is given at a time, although this allows extreme precision, albeit a bit difficult to maintain due to the need to keep track of the total percentage added up.
Weight-based system is something I personally prefer, even though it has a fairly big downside.
Weight based is similar to percentage based, with just one exception. Instead of it being a total of 100% (all drop rates with the exception of 100%'s added up) you would have a dynamic drop rate chance. For example you could add in three drops:
1) 90%
2) 80%
3) 70%
(Before someone quotes me, yes, this is what the original Matrix has)
Generating a drop based on that is fairly simple. You would loop every single drop on the drop table; whilst doing so, you first generate a random double between 0 and 100 every time. If the random number is below the drop's rate, you would add it to a list.
After the loop is finished, you'd pick a random item from the list and that's the drop you receive.
The downsides to this system are that you don't really get a visible drop rate (the true rate) right off the bat by looking at the "rates" or weights. To generate that, you'd have to go through a simple formula of (drop_rate * 100 / sum_of_all_drop_rates), which would then give you the true drop rate (You can confirm it by running simulations afterwards).
This pretty much sums it up. I didn't give an example on how the percentage-based system works because I don't have it written right now but basically, it'd work in a similar manner. You'd generate a random number from 0 to 100 and then loop through drops, constantly adding the rates of the drops looped up until the first occurrence in which the sum passes the random number previously generated, at which point you'd throw the drop at the person's face.
Educate yourself before fucking with me.
https://www.rune-server.ee/runescape...unescript.html
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |