Hardmode Wooden Crate contents question (fishing). Wiki error?

Bethany

Empress of Light
The wiki shows the following quantities for normal and hardmode ores, normal and hardmode bars when opening a Wooden Crate. I suspect an error, which I show in red.


| Ores | Bars | | | | | |
Pre-hardmode | 8–20 | 2–7 | | | | | |
Hardmode | 8–20 | 8–20 | | | | | |

Can someone who's opened Wooden Crates in hardmode tell me whether you get 2–7 or 8–20 bars per crate? Thanks!

(Pardon the blank cells. Seems to be the only way to avoid stretching the table all the way across the page.)
 
Looking into this, 8-20 is wrong, but apparently so is 2-7. It looks like the effective range is 1-6* hardmode bars. (This is based on reading code.)

* Edit: 1-7. Rechecked this, offered a correction and explanation below.
 
Last edited:
Interesting. Thanks for looking into it. Does the code also show 1-6 for pre-hardmode as well, or 2-7? I'm wondering whether that's an offset to be added to a base of 1 or the entire "gimme". All other items that you can get both before and after entering hardmode have the same loot count range before and after, which makes me wonder.

I'd rather not get or read the code in case I end up writing a similar game in future.
 
Interesting. Thanks for looking into it. Does the code also show 1-6 for pre-hardmode as well, or 2-7? I'm wondering whether that's an offset to be added to a base of 1 or the entire "gimme". All other items that you can get both before and after entering hardmode have the same loot count range before and after, which makes me wonder.

After getting some sleep and looking at it again, I'll need to correct (and explain) my original comment. The drop count for bars (pre-hardmode and hardmode) is done in two lines:

Code:
int Stack = Main.rand.Next(2, 8);
// if it's hardmode and 50% chance...
Stack -= Main.rand.Next(2);

The first line picks a random number from 2-7 (used for both non-hardmode and hardmode bars), and the second line randomly subtracts either 0 or 1 from the stack size if hardmode is active (with a 50% chance to override the non-hardmode bars). Since 7 = 0 = 7, it should still be possible to get 7 hardmode bars from a crate. So to answer the follow up question, the base range of 2-7 for non-hardmode bars is accurate, but for hardmode, a random adjustment makes the range 1-7.
 
Follow up on this. I've spawned and opened almost 1400 wooden crates to confirm what I see in game is consistent with what I see in the code. I'm confident enough in the results (all ore fell within the 8-20 range, all pre-hardmode bars fell in the 2-7 range, and all hardmode bars fell in the 1-7 range) that I've corrected the wiki page.

My testing was aimed at just validating the minimum/maximum values and don't have any statistical value otherwise (ended up destroying a lot of stuff in the process of getting 20 piles of each kind of ore and bar). I don't see much point in providing any screenshots or data unless anyone's particularly curious.

(Edit: Crates, not chests.)
 
Back
Top Bottom