JavidPack / RecipeBrowser

RecipeBrowser mod for tModLoader
https://forums.terraria.org/index.php?threads/recipe-browser.62462/
80 stars 51 forks source link

Display drop rate for items #26

Open cryzed opened 6 years ago

cryzed commented 6 years ago

Would it be possible to display the drop rate for items in this menu as well?

JavidPack commented 6 years ago

Drop rate isn't tracked yet because the way loot is calculated takes a lot of shortcuts that trick the game into dropping items more frequently. Tracking drop rates would mean not taking those shortcuts and possibly lengthening the time calculating loot takes.

I'll get around to testing this eventually. I might be able to figure it out.

cryzed commented 6 years ago

Hey, that sounds good! I'm not sure how the code for the item drop is actually implemented, but assuming that it's not just a variable you can query but rather a method you call with some custom (not programmatically accessible) code in it, you might consider calling this method at least n amount of times (or until the first drop occurs) and calculate the average drop rate from that -- I think that might be what you intend. I'm not sure how expensive this would be, but logic would dictate that it would need to be pretty fast anyways.