I am aware that I can do a Random Generated Number (RGN) in order to get a random number.
I can take that Random Number and mathematically set the drop rate of an item using conditions.
If the RGN is between 0 and 999
Then I know 0-499 will be 50% and so will 500-999.
When I have a low amount of items an enemy may drop, then it can easily be managed with a Random Generated Number. What do you do when you will constantly be adding to the list of dropped items. Every time you add a single item or change a single condition it changes everything. I should add that I am only giving one item out at a time. Is there an easier way to do this so I don't have to change every number in the conditions each time I add or change an item? I understand that every time you add in another item you change the percent of the other items. So if there isn't a way around this then I suppose I am looking for another tactic.
I guess I am asking how to keep a fixed drop rate on some items.
Does Random Number Generation tend to favor certain numbers over others?
The only other thing I can think of is using an Array.
Placing X amount of items into the Array to give each item weight.
I would then select a random item.
Similar to a sweepstakes or giveaway.
ItemA will be put into an Array 10 times.
ItemB will be put into an Array 20 times.
ItemC will be put into an Array 1 time.
ItemD will be put into an Array 15 times.
Every time I put in a new item or adjust a number of entries the percent of every item changes. I was trying to avoid that but at least I won't have to adjust nearly every number. Using an Array seems to be going off of weight instead.
Is this an accurate way of having a random item given?
Would using an Array be more beneficial than RGN?
I could do this without an Array, by using Cumulative.
By adding 10, 20, 1 and 15 I get the max amount of entries.
46 entries total.
The random generated number is generated. Lets say 32.
ItemA is 10.
32 isn't equal or below 10.
ItemA+ItemB = 30
32 is not equal or below 30
ItemA+ItemB+ItemC = 31
32 is not equal or below 31
ItemA+ItemB+ItemC+ItemD = 46
32 is equal or below 46
So the item generated is ItemD.
It is a bit tedious, but it would prevent me from having to change a lot by making a simple change or adding an item. It would also prevent the need for an extra Array.
I could probably set up a variable and just have it loop the correct amount of times automatically.
I just need a small bit of guidance on how to do drop rates if the items that can be dropped will be increasing over time. Right now I have about 14 planned and I will still have more to add.