Starbound

Starbound

100% Boss Uniques Drop Rate
 This topic has been pinned, so it's probably important
Azure Fang  [developer] 12 Jun, 2017 @ 9:55am
How It Works
Vanilla
All monsters call to treasure tables, called "pools", when determining drops. Here is the vanilla treasure pool for Dreadwing:
"dreadwingDrop" : [ [0, { "fill" : [ {"item" : "bossdreadwing-codex"} ], "pool" : [ {"weight" : 0.975, "pool" : "chestMoney"}, {"weight" : 0.025, "item" : "dreadwingaf"} ], "poolRounds" : [ [1, 1] ] }] ],

"poolRounds" is checked to determine how many items will be dropped. The first value determines the amount of items, and the second value is the percentage chance, reduced by two decimal places, that that amount of items will be dropped - in arrays with multiple possibilities the total chance, or "weight" can be greater than 1, and the game will treat the weights as adjusted percentage chances. An example of "poolRounds" with different amounts would possibly look like this:
"poolRounds" : [ [0, 0.5], [1, 0.3], [2, 0.2] ]

"pool" is checked after "poolRounds" to see what items fill those determined slots and at what "weight" or percentage chance. As shown, Dreadwing has a 97.5% chance to roll pixels from the "chestMoney" pool and only a 2.5% chance to drop its figurine. Here, "pool" could be used to set a 100% chance for the figurine by deleting the money line and setting a weight of 1, but for bosses with weapon drops and figurines this is not an option - changing "poolRounds" to 2 would give a chance for duplicates as each "pool" entry is checked for each item drop, but this could have consequences with other mods that add drops. That's where "fill" comes in.

All items in the "fill" aray will be dropped, period, in addition to item rolls from the "pool". In this vanilla example, "bossdreadwing-codex", the Dreadwing codex book, is set to drop on every kill 100% of the time, in addition to the chances for money and figurine.

This Mod
This mod uses a .patch to test if the "fill" list exists - if it does not it creates the fill with the proper items move the desired items, and if it does it adds the items to the existing fill. Then it tests to see if the moved items are in their vanilla places and removes them if so. The tests are in place to ensure this mod does not overwrite the effects of other mods. Here's the Dreadwing section of the patch:
[{ "op": "test", "path": "/dreadwingDrop/0/1/fill", "inverse": false }, { "op": "add", "path": "/dreadwingDrop/0/1/fill/-", "value": { "item": "dreadwingaf" } } ], [{ "op": "test", "path": "/dreadwingDrop/0/1/fill", "inverse": true }, { "op": "add", "path": "/dreadwingDrop/0/1/fill", "value": [{ "item": "dreadwingaf" } ] } ], [{ "op": "test", "path": "/dreadwingDrop/0/1/pool/1", "value": { "item": "dreadwingaf" }, "inverse": false }, { "op": "remove", "path": "/dreadwingDrop/0/1/pool/1" } ],
This results in the Dreadwing table looking like this:
"dreadwingDrop" : [ [0, { "fill" : [ {"item" : "bossdreadwing-codex"} {"item" : "dreadwingaf"} ], "pool" : [ {"weight" : 1, "pool" : "chestMoney"}, ], "poolRounds" : [ [1, 1] ] }] ],
As shown, "dreadwingaf", the action figure, is moved to fill to force it to drop, and then removed from the random drop list.
Last edited by Azure Fang; 24 Aug, 2017 @ 7:15pm
< >
Showing 1-2 of 2 comments
Azure Fang  [developer] 13 Jun, 2017 @ 10:28am 
6-13-2017
Adjusted to reflect 2.0 patch.
Azure Fang  [developer] 24 Aug, 2017 @ 7:15pm 
8-24-2017
Adjusted to reflect 3.0 and better personal understanding of the drop system.
< >
Showing 1-2 of 2 comments
Per page: 1530 50