There's also a chance that 1 is added to the number. There's a part in the code that converts the number to an integer, and I misunderstood what's going on, as it's a little confusing, but the random number is multiplied by the abundance before it's converted to an integer, and so yes, it can be other numbers in that range. If each of the items is another loot list with a count that then leads to another random roll, the abundance factor of 2 would again apply and you would get 2 * 2 = 4 times the items.Īre you sure the code uses integers when rolling for items? If they use fractional numbers, your first example could still result in any number of items between 0 and 10 at an abundance of 2 you would get 2 times the items in the container. Hardcoding an abundance of 1 after rolling for the number of items makes absolute sense as you don't want abundance to multiply. I wonder what it would be like if this function was prefixed in a Harmony patch to always use the game setting abundance. I was rather surprised seeing that an abundance of 1 is hardcoded for the actual items. As 12 is the maximum for a garbage can, the highest loot abundance value that will have an effect would be 1200, as that will spawn either 0, 12, or 12 items (0*12, 1*12, 2*12, with maximum of 12).ĭoes this make any sense? I've not spent a ton of time looking at the code and the code is rather loopy (meaning there are several loops involved here and it gets a bit hard to follow, especially when recursive), but that's the sense I got from it. So yes, a higher loot abundance than 500 will have a slight effect, as 600 will spawn either 0, 6, or 12 items. This is never exact because during the spawning of the items there is the probability that nothing spawns in a slot. 500% LootAbundance will spawn either 0, 5, or 10 items. For a garbage can, for instance, the min/max is 0,2. So loot abundance only comes into play for the amount of items spawned, nothing more, and large values are a bit meaningless. Once it figures out how many items to spawn, it calls a method named LootContainer.SpawnLootItemsFromList and tells it to spawn that many items, but from here on out, it uses the abundance of 1 (100%), ignoring the game setting. This is the number of items it will spawn, but the maximum it can spawn would be the size of the container (as defined by the size attribute of the element). Gets abundance and multiplies it by 0.01, gets a value between the min and max of the count attribute for the element and multiplies that by the abundance. It seems loot containers more or less work like this: Or are you saying nominal max value is never exeeded but the random number at higher loot abundance would be much more often nearer to that max value? (PS: If loot abundance is then also applied to the quantity of items it would explain why people at 25% loot abundance get the impression that they get even less than 25%.) Is there an explicit statement where loot abundance is capped at 500 ? But it doesn't explain where the 500% limit comes from. That would be my natural guess how it works. Items= random_number_between(actual min value, actual max value) From the brief look I took it would seem that the loot container uses the loot abundance value to generate a random number between the min and max and that's how many items are spawned, and the same thing happens for the quantity of each stackable item.Īctual max value = nominal max value * (loot abundance/100).Īctual min value = nominal min value * (loot abundance/100) I looked into the game code and it would seem that the amount of loot that is spawned is limited by a min/max value specified by the count attributes of and elements in loot.xml.
0 Comments
Leave a Reply. |