Talk:Chest loot/Archive 1

Method?
Hello, I was wondering how the values on the page were calculated. I got somewhat different ones.

My method was as follows:

And god bless you if you follow that. I only describe it so that maybe a person can qualitatively say whether I'm down the wrong path or not.

And you know, I wanted to know if there was an easier way, or what your way was,. – Sealbudsman (Aaron) t/c 06:33, 26 May 2015 (UTC)


 * , would you perhaps be able to comment? –Goandgoo ᐸ Talk Contribs 09:20, 27 May 2015 (UTC)
 * The data on pages like Dungeon and Stronghold was taken from the code of the game. I'm too tired right now to do the math myself to see whether the table on this page is correct or not or whether Sealbudsman is on the right track, or even to try to figure out whether it's actually useful to say you'll get an average of 0.652 bread per dungeon chest over the long term versus just stating the stacks per chest and the weights and quantities of the possible items. Anomie x (talk) 12:14, 27 May 2015 (UTC)
 * I personally find calculated values like 'chance to get at least one of this item' (from pages like Dungeon and Stronghold) and 'expected number of this item per chest' (from this page) to be more directly useful than the raw stack sizes and weights -- for example when considering which kind of chests I might look in for a certain item, which is something I might do during gameplay.
 * Anyway all I really want to know from Seahen is, how Seahen got those numbers. Ideally, I just think if those numbers are going to be there, and updated as the game changes, the method of calculating them ought to be spelled out somewhere like on this talk page.  And right now I would just like to audit the page, but am finding it difficult.  I could be totally trying to do it conceptually wrong, the long way, or anything.  Nobody's shortcoming but my own, I'm sure, but I am just hoping we could eventually put together a bit of documentation. – Sealbudsman (Aaron) SealbudsmanFace.png t/c 15:11, 27 May 2015 (UTC)
 * My method was to take the average number of stacks per chest as the middle of the range (except for the dungeon chest, since that's documented as filling 8 slots chosen with replacement and then deduplicated, for which I used a specific formula from here with n=27, k=8). Then I took the average number of items per stack as the middle of its range, and the probability of each specific item per stack (given in each structure's article). Then I multiplied all three numbers together:
 * Copies of item A per chest = copies of item A per stack of item A × stacks of item A per stack of anything (i.e. probability that a given stack is of item A) × stacks of anything per chest
 * (Note that enchanted books in a village library chest are unstacked after they're generated.) I believe Sealbudsman's error is assuming that 2 stacks of the same item are just as likely as 1 stack of that item; that would be the case if the probability and then the number of stacks were rolled separately for each item (which would result in some chests generating empty and others overspilling, because no items or too many items had happened to be chosen). Seahen (talk) 06:56, 10 June 2015 (UTC)


 * Great to hear from you. Thanks so much.  I think my biggest problem was a failure to recognize that if you're trying to come up with the average number of items when using two random variables, you just need to multiply both averages, as I think you are describing.  My method was pretty unusably convoluted, although your method gets the same numbers as I get.
 * For instance, iron ingots in a village chest, the chest fills from 3 to 8 stacks, and iron ingots come in stacks of 1 to 5, with a weight of 10/94. So that, given your method (as I understand it), is (1+5)/2 × 10/94 × (8+3)/2 = 3 × ~0.106 × 5.5 ~= 1.755
 * Whereas you have it on the table as 1.350. Am I misunderstanding you? – Sealbudsman (Aaron) SealbudsmanFace.png t/c 02:36, 11 June 2015 (UTC)
 * It looks like the source table, at least for village chests, has changed since I made the table. (It used to be probability per slot, with the number of slots uniformly distributed within a range.) I'll re-read the relevant articles and either update my calculations or explain the discrepancy over the weekend. Seahen (talk) 05:42, 12 June 2015 (UTC)
 * And I'll double check the tables for accuracy this weekend. – Sealbudsman (Aaron) SealbudsmanFace.png T/C 14:54, 12 June 2015 (UTC)

Loot Chest as a module
Now that Seahen and I have largely worked this out above (I believe),

I put together module that would:
 * hold the raw chest statistics
 * hold the functions that arrive at the values that are commonly referred to on the chest tables
 * generate the Master Table for this page
 * generate tables for the different pages like Village and Bonus Chest,
 * generate text summaries of loot-chest availability, to go under the 'Obtaining' sections of items like Bread or Apple, just like already appear there.

See: Module:LootChest and its implementations at: Template:LootChest and Template:LootChestItem,
 * The range of functionality of the module is demoed at User:Sealbudsman/Chest Loot.

All this, so that if the game changes the chests, updating all that is one-stop shopping.

Questions, comments, yea or nay? – Sealbudsman (Aaron) T/C 03:24, 29 June 2015 (UTC)


 * I think it would overall be helpful to use a module. Since this stuff is directly pulled from the code and used on multiple articles, keeping the source data in one place helps. It also would remove inconsistency caused by slightly varied formulas across chest loot articles, along with the lack of weight or chances on some articles. – KnightMiner  t/c 04:50, 7 July 2015 (UTC)


 * Support the usage of this module to keep consistency among articles and a central place to store loot values. –Goandgoo ᐸ Talk Contribs 06:55, 7 July 2015 (UTC)


 * Ok, not much in the way of concerns; so I will probably switch things over, later next week. – Sealbudsman (Aaron) SealbudsmanFace.png T/C 19:40, 11 July 2015 (UTC)


 * . Always open for further comment, of course, at Module talk:LootChest – Sealbudsman (Aaron) SealbudsmanFace.png T/C 21:34, 16 July 2015 (UTC)