Talk:Chest loot/Archive

From Minecraft Wiki
Jump to: navigation, search

Method?[edit]

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, Seahen. – Sealbudsman (Aaron) SealbudsmanFace.png t/c 06:33, 26 May 2015 (UTC)

Anomie x, would you perhaps be able to comment? GoandgooTalk
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[edit]

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,

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

Questions, comments, yea or nay? – Sealbudsman (Aaron) SealbudsmanFace.png 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. GoandgooTalk
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)
 Done. Always open for further comment, of course, at Module talk:LootChestSealbudsman (Aaron) SealbudsmanFace.png T/C 21:34, 16 July 2015 (UTC)

Golden apples[edit]

Since I'm hopeless with coding, can someone add the fact that golden apples always generate in igloo chests? - MinecraftPhotos4U (talk) 19:02, 28 October 2015 (UTC)

I'll do it.
The main issue is they changed the way they do chests: they use multiple pools of items now. Example in this case: igloo chests have pool #1 which grabs all the random stuff you see in this chart, then they pick from pool #2, which is 100% a golden apple. Another example: in 15w44a, they just changed four chests so they now use 3–4 pools apiece. The module can't handle this multiple pools business, so I'll be upgrading that.
So right now I'm in the middle of that, and juggling a few things IRL, etc. Should be no more than a few days tops. Hopefully! Thanks. – Sealbudsman talk/contr 19:22, 28 October 2015 (UTC)
Would you mind if I just take a shot at updating the module? Anomie x (talk) 23:23, 28 October 2015 (UTC)
Please do! – Sealbudsman talk/contr 23:30, 28 October 2015 (UTC)
Looks great, thanks! I like how it handles dev versions. – Sealbudsman talk/contr 14:31, 29 October 2015 (UTC)
Yeah, one of the things that was bugging me for a while was that we were updating the module and therefore articles to dev info without that being indicated anywhere, contrary to the usual practice. Anomie x (talk) 19:13, 29 October 2015 (UTC)