Talk:Crates
Contents
Usage question[edit source]
Do Sonar Potions and Fishing Potions (or boosting fishing power) help find these? I want to know if I should combine all three fishingrelated buffs or not. Macks2008 (talk) 14:29, 29 January 2015 (UTC)
 I'm not sure how old your I haven't noticed any increased chance to catch crates using any potion besides the Crate Potion. However, when using the Sonar Potion, you can ignore noncrate bites in order to save bait. The Fishing Potion (or increasing fishing power) will also decrease the rate at which your bait is consumed. ValornTheRed (talk) 19:10, 4 July 2015 (UTC)
"Portal" Reference[edit source]
The page as quoted, "It's improbable to be a reference, but the crate's sprite resembles Weighted Storage Cubes from Portal franchise." However I feel this is a bit misleading and very unlikely to be reference nor does it assist in the article in any form. They're crates, box shaped by nature, and the sprites do not, to me, resemble anything close to the portal cubes outside of minor details of them being box shaped, with a few styles being similar. Should this information be left in? I have nothing against the trivia bit afterwards indicating it to be used for adventure maps, etc. Kalbintion (talk) 02:20, 21 July 2015 (UTC)
 A lot of trivia is added by anonymous users, and is often questionable. You won't get into any trouble for removing nonsensical trivia; go ahead. As for the bit about its application in maps, a lot of things can be used creatively in maps. Unless there were to be a guide page for making maps, that info doesn't really belong on the wiki. –KM100 ^{(talk)} 02:27, 21 July 2015 (UTC)
Merging all the crates[edit source]
i feel as if the crates should be merged into 1 page, this one, Crates, the page may have the loading features of the fishing page, but it may fit.
Luigirox901 (talk) 00:32, 26 November 2015 (UTC)
Probability[edit source]
The sentence reads:
E.g with a Fishing Power of 100 in a Corrupted Biome the probabilities would be: Golden Crate: 6,57%; Corrupt Crate: 8,90%; Iron Crate: 28,37%; Wooden Crate: 56,16%
Speaking for those who never studied probability (or have forgotten because they never needed it), nor looked at the code... what in the world does 6,57% mean? At first I thought that comma was meant to be a decimal. If it's not, can we explain this in a way that a 12grader would understand?  Ferretwings (talk) 16:12, 19 July 2016 (UTC)
 Oh good. :) I was feeling really dumb, trying to figure it out. Now I fee confident again about my math skills, lol! Thanks for fixing it. :)  Ferretwings (talk) 19:17, 19 July 2016 (UTC)
crate probability wrong?[edit source]
I was looking for source online and found the one by Pryaxis on github. Looking at projectile.fishingcheck() the probability for crates seem to be different there. If this source is accurate the information on this page is wrong, can anyone confirm the accuracy of this source?
DJIKhaos (talk) 23:05, 25 July 2019 (UTC)
 I have taken a look, too, and luckily, crates are handled near the top of the function, so it is comparatively easy to determine the chances (assuming a fishing power of 100; in any of the special biomes, taking Corruption as an example here):
 Golden Crate: ^{[1]}^{[2]}^{[3]}^{[4]}
 Corrupt Crate (or any other biome crate): ^{[1]}^{[5]}^{[6]}
 Iron Crate: ^{[1]}^{[5]}^{[7]}^{[8]}
 Wooden Crate: ^{[1]}^{[5]}^{[7]}^{[8]}
Main.rand.Next(100)<num19, num19 being 10 without a Crate Potion
flag6  flag7
with flag6=true and flag7=true
flag6  flag7
with flag6=true and flag7=false
flag6  flag7
with flag6=false and flag7=true
flag6  flag7
with flag6=false and flag7=false
flag5
!flag5
, failing the biome crate roll
!flag4
 For Iron and Wooden Crates caught in a biome that does not qualify for a biome crate, the part is simply dropped from the calculation, because
is never being considered due to the second parts of those conditions (the biome checks) always evaluating to false.flag5
 With a Crate Potion,
is set to 20 instead of 10, so the initial is doubled to , effectively doubling all chances.num19
 Little disclaimer just in case: All of this is taken from the Desktop 1.3.5.3 source code,
, as you said. I have absolutely no idea about other versions or platforms. I have tested these chances extensively using an emulator of the fishing algorithm.Terraria.Projectile.FishingCheck()
 Rye Greenwood (talk) 00:05, 3 December 2019 (UTC)
is set to true ifflag6
returns 0. The probability of that event is , obviously.Main.rand.next(num17)
is , withnum17
being the fishing power (num6
int num6 = Main.player[owner].FishingLevel();
(yes, it is altered later on, but that does not matter since we assume a lake of ≥300 tiles)), so in our example 100. I don't see any variable named
inmaxValue4
, so I'm not sure what you're referring to there.FishingCheck()
 Rye Greenwood (talk) 23:49, 4 December 2019 (UTC)
 After reading your first message again, I realized we're using different decompilations of the game... So no surprise the variable names are different.
is calculated like this:num17
int num17 = 150 * 15 / num6;
 Rye Greenwood (talk) 00:33, 5 December 2019 (UTC)
Oh, you're completely right! Apologies! Let me update the calculations then:
Corrupt Crate (or any other biome crate):
Thank you very much! I will go ahead and update the page.
Rye Greenwood (talk) 01:05, 5 December 2019 (UTC)
 No problem. In C# int/int is generally integer division. Also if you think it's relevant information for either here or bait (or fishing) master bait sustain with crate potion, tackle box and high test fishing line starts at 76 fishing power, without tackle box it's 87, without high test fishing line it's 98 and without either it's 119. without crate potion isn't that interesting as it's 251 with both.
 DJIKhaos (talk) 02:04, 5 December 2019 (UTC)
 Hmm. Am I right in getting the sense that a function of crate probabilities against fishing power would be almost impossible to write out? MentalMouse42 (talk) 16:05, 5 December 2019 (UTC)
Great idea! Actually, that's not impossible at all, luckily! It just gets a little long:
(: fishing power)
Starting with the chances of the flags; they can be described as follows:
:
flag4
:
!flag4
:
flag5
:
!flag5
:
flag6
:
!flag6
:
flag7
:
!flag7
Inserting that into the formulas of the crate chances:
Biome Crate:
Iron Crate (if fishing in Corruption, Crimson, Hallow, Jungle, Dungeon, or sky level):
Iron Crate (if not fishing in Corruption, Crimson, Hallow, Jungle, Dungeon, or sky level):
Wooden Crate (if fishing in Corruption, Crimson, Hallow, Jungle, Dungeon, or sky level):
Wooden Crate (if not fishing in Corruption, Crimson, Hallow, Jungle, Dungeon, or sky level):
Please excuse the mathematically incorrect notation with these inequations in the middle, but they're there to show that a case differentiation is necessary. Depending on the fishing power, different formulas apply.
For the final functions, it is necessary to assert we are fishing in a lake of ≥300 tiles (it just gets too long if we want to make that variable, too) and have a fishing power >0, of course.

Biome Crate:

Iron Crate (if fishing in Corruption, Crimson, Hallow, Jungle, Dungeon, or sky level):

Iron Crate (if not fishing in Corruption, Crimson, Hallow, Jungle, Dungeon, or sky level):

Wooden Crate (if fishing in Corruption, Crimson, Hallow, Jungle, Dungeon, or sky level):

Wooden Crate (if not fishing in Corruption, Crimson, Hallow, Jungle, Dungeon, or sky level):

That's it! With these functions, it is possible to calculate the different crate catch chances for any given fishing power. If the Crate Potion buff is active, simply change the at the beginning of every function to .
Plotting these functions revealed some very interesting mechanics (here are just some examples I found particularly surprising):
 With a fishing power of 1, the chance to catch a Wooden Crate is 10% and to catch all other crate types nearly 0%.
 As fishing power increases, the chance for Golden Crates increases steadily up to the maximum of 750 (after which all chances stagnate; you can see in the functions that they're just constant at that point). The chance for Wooden Crates decreases steadily. However, the chances for the other two types fluctuate quite a bit.
 The highest chance to catch an Iron Crate is with 76 fishing power, to catch a Wooden Crate is with 1 fishing power, to catch a Biome Crate is with 211 fishing power, and to catch a Golden Crate is with >750 fishing power (within the bounds of possibly attainable fishing power that would be 282).
I really recommend you to take a look at these functions, too; the integer division has an interesting effect. Here are the functions in a form that dynamic geometry applications should accept (well, at least GeoGebra does):
golden(x) = 1 / 10 (1 / floor(2250 / x) 1 / floor(4500 / x) + 1 / floor(2250 / x) (1  1 / floor(4500 / x)) + (1  1 / floor(2250 / x)) 1 / floor(4500 / x)) golden1(x) = golden(x), 0 < x ≤ 100 golden2(x) = golden(x), 100 ≤ x ≤ 262 golden3(x) = golden(x), 263 ≤ x ≤ 450 golden4(x) = 1 / 10 (1 / 5 * 1 / floor(4500 / x) + 1 / 5 (1  1 / floor(4500 / x)) + (1  1 / 5) * 1 / floor(4500 / x)), 450 ≤ x ≤ 750 golden5(x) = 1 / 10 (1 / 5 * 1 / 6 + 1 / 5 (1  1 / 6) + (1  1 / 5) * 1 / 6), 750 ≤ x biome(x) = 1 / 10 (1  1 / floor(2250 / x)) (1  1 / floor(4500 / x)) 1 / floor(1050 / x) biome1(x) = biome(x), 0 < x ≤ 100 biome2(x) = biome(x), 100 ≤ x ≤ 262 biome3(x) = 1 / 10 (1  1 / floor(2250 / x)) (1  1 / floor(4500 / x)) 1 / 4, 263 ≤ x ≤ 450 biome4(x) = 1 / 10 (1  1 / 5) (1  1 / floor(4500 / x)) 1 / 4, 450 ≤ x ≤ 750 biome5(x) = 1 / 10 (1  1 / 5) (1  1 / 6) 1 / 4, 750 ≤ x iron(x) = 1 / 10 (1  1 / floor(2250 / x)) (1  1 / floor(4500 / x)) (1  1 / floor(1050 / x)) 1 / floor(300 / x) iron1(x) = iron(x), 0 < x ≤ 100 iron2(x) = 1 / 10 (1  1 / floor(2250 / x)) (1  1 / floor(4500 / x)) (1  1 / floor(1050 / x)) 1 / 3, 100 ≤ x ≤ 262 iron3(x) = 1 / 10 (1  1 / floor(2250 / x)) (1  1 / floor(4500 / x)) (1  1 / 4) 1 / 3, 263 ≤ x ≤ 450 iron4(x) = 1 / 10 (1  1 / 5) (1  1 / floor(4500 / x)) (1  1 / 4) 1 / 3, 450 ≤ x ≤ 750 iron5(x) = 1 / 10 (1  1 / 5) (1  1 / 6) (1  1 / 4) 1 / 3, 750 ≤ x ironb(x) = 1 / 10 (1  1 / floor(2250 / x)) (1  1 / floor(4500 / x)) 1 / floor(300 / x) ironb1 (x) = ironb(x) = 0 < x ≤ 100 ironb2(x) = 1 / 10 (1  1 / floor(2250 / x)) (1  1 / floor(4500 / x)) 1 / 3, 100 ≤ x ≤ 262 ironb3(x) = 1 / 10 (1  1 / floor(2250 / x)) (1  1 / floor(4500 / x)) 1 / 3), 263 ≤ x ≤ 450 ironb4(x) = 1 / 10 (1  1 / 5) (1  1 / floor(4500 / x)) 1 / 3, 450 ≤ x ≤ 750 ironb5(x) = 1 / 10 (1  1 / 5) (1  1 / 6) 1 / 3, 750 ≤ x wooden(x) = 1 / 10 (1  1 / floor(2250 / x)) (1  1 / floor(4500 / x)) (1  1 / floor(1050 / x)) (1  1 / floor(300 / x)) wooden1(x) = wooden(x), 0 < x ≤ 100 wooden2(x) = 1 / 10 (1  1 / floor(2250 / x)) (1  1 / floor(4500 / x)) (1  1 / floor(1050 / x)) (1  1 / 3), 100 ≤ x ≤ 262 wooden3(x) = 1 / 10 (1  1 / floor(2250 / x)) (1  1 / floor(4500 / x)) (1  1 / 4) (1  1 / 3), 263 ≤ x ≤ 450 wooden4(x) = 1 / 10 (1  1 / 5) (1  1 / floor(4500 / x)) (1  1 / 4) (1  1 / 3), 450 ≤ x ≤ 750 wooden5(x) = 1 / 10 (1  1 / 5) (1  1 / 6) (1  1 / 4) (1  1 / 3), 750 ≤ x woodenb(x) = 1 / 10 (1  1 / floor(2250 / x)) (1  1 / floor(4500 / x)) (1  1 / floor(300 / x)) woodenb1(x) = woodenb(x), 0 < x ≤ 100 woodenb2(x) = 1 / 10 (1  1 / floor(2250 / x)) (1  1 / floor(4500 / x)) (1  1 / 3), 100 ≤ x ≤ 262 woodenb3(x) = 1 / 10 (1  1 / floor(2250 / x)) (1  1 / floor(4500 / x)) (1  1 / 3), 263 ≤ x ≤ 450 woodenb4(x) = 1 / 10 (1  1 / 5) (1  1 / floor(4500 / x)) (1  1 / 3), 450 ≤ x ≤ 750 woodenb5(x) = 1 / 10 (1  1 / 5) (1  1 / 6) (1  1 / 3), 750 ≤ x (Hide the base functions; the ones without a number at the end of their name. They do not represent accurate probabilities.) 
Please let me know if something is unclear or I've made a mistake.
Rye Greenwood (talk) 02:05, 6 December 2019 (UTC)
 You took "nearly impossible" as a challenge, didn't you? "It just gets a little long", oy gevalt! ;)
 Initial thoughts:
 At least some of those groups of equations look like they're segments of a line; they might be easier to grasp if they were in a more switch/case like format.
 The flags you describe as "chances", but it's not clear if/where randomness appears or what it applies to.
Also simplifying the inequalities (e.g., flag4: fp/100 ≤ 1) would make them much easier to read.(I think we can take fp > 0 as a prerequisite.)  For display to normal readers (that is, the topic page), I suspect the graphs themselves would be much more understandable and practical than the series of equations, especially if integer division is putting kinks in the lines. Offhand, ISTM that the way to go would be separate graphs for the "biome crates" and "no biome crates" cases, each with a stacked plot showing the types accumulating vertically as fishing power increases horizontally.
 * I might have more thoughts later, right now I'm barely through my morning coffee.
 * Thanks for your efforts!
 MentalMouse42 (talk) 12:40, 6 December 2019 (UTC)
 ETA: Whoops on the idea of simplifying formulas; looking back, I'm seeing that most of what I thought were brackets are floors, which make things different. Looks more and more like those graphs are the way to go. MentalMouse42 (talk) 23:35, 6 December 2019 (UTC)
 OK, I think I've got a handle on it now. Five regimes, three of which can actually see play, and you're prorating between various flags that choose among different curves.
I can't see where the biome/nobiome distinction appears in the late equations.And I still think graphs are likely to be more useful. I may need to poke into this graphing site of yours, but I can already get the feeling it doesn't like Firefox very much. MentalMouse42 (talk) 02:54, 7 December 2019 (UTC)
 Well, after reading that last post of yours, I couldn't resist! To be honest, I didn't expect to get a result like this – being able to compute the probability of catching a specific type of crate with any given fishing power –, so I'm quite happy with it.
 Thanks for your feedback! Regarding the flags: The item that is caught during the fishing process is determined by a number of booleans, e.g.:
caughtItemID = ((flag6  flag7) ? 2336 : ((flag5 && Main.player[owner].ZoneCorrupt) ? 3203 : ...
 These flags are assigned
with a specific probability, expressed in the code like this (extracting onlytrue
andflag6
as an example here):flag7
int num17 = 150 * 15 / num6; // num6 is fishing power int num18 = 150 * 30 / num6; // these two following ifs are the caps that require us to do the case differentiation, by the way if (num17 < 5) { num17 = 5; } if (num18 < 6) { num18 = 6; } bool flag6 = false; bool flag7 = false; if (Main.rand.Next(num17) == 0) { flag6 = true; } if (Main.rand.Next(num18) == 0) { flag7 = true; }
 Generate a random integer between 0 and a variable that depends on the fishing power, and set the flag to
if that integer equals 0. Therefore, the probability of that flag beingtrue
is 1/true
or 1/num17
fornum18
andflag6
in this case, respectively.flag7
 I agree the graphs are important for visualization, but I'm not sure in what way they could be integrated best. I was thinking about simply taking a screenshot and uploading that as an image file, but displaying data in images is generally frowned upon (partly because they are so static and hard to update). We could also render the graphs with the Graph MediaWiki extension, but I think that's blocked by Gamepedia.
 Rye Greenwood (talk) 23:39, 8 December 2019 (UTC)
 I think imagefile graphs would at least be an interim step pending a suitable extension. I just glanced at Minecraft's Experience page, and yep, the graphs there are .PNG.
 ETA: Also it looks to me like each flag's probability just progresses to a maximum probability and then pins there. If so, the equations could be greatly simplified by defining variables accordingly.
 MentalMouse42 (talk) 00:06, 9 December 2019 (UTC)
So I've totally forgotten about this in the last five months, but finally remembered today and made a plot of the graphs:
Thoughts? (I chose SVG, not PNG, because that allows zooming in without losing quality.)
Rye Greenwood (talk) 11:49, 10 April 2020 (UTC)
 Belatedly: Those graphs look good, though of course now they may need to be updated for 1.4 MentalMouse42 (talk) 14:01, 17 May 2020 (UTC)
New Crates on 1.4[edit source]
I've merged a couple of previouslyunsigned comments into this new section. MentalMouse42 (talk) 20:18, 18 May 2020 (UTC)
(Pearlwood Crate and Mythril Crate) I found both them on caverns layer. There were Mushroom, Dirt, Stone and Ice biomes around. Not sure about biome trigger —Preceding unsigned comment added by Elder Axe (talk • contribs)
(Frozen crates) they exist —Preceding unsigned comment added by Ampls (talk • contribs)
 Elder Axe, were you in Hardmode? If so, then at a guess, the Pearlwood is Hallow (or perhaps a hardmode substitute for Wood), and Mythril is a Hardmode nonbiome crate. MentalMouse42 (talk) 20:18, 18 May 2020 (UTC)
Ore Inside 1.4 Sky Crates[edit source]
I have been opening a pile of Sky Crates in Journey mode 1.4 and have found gold ore, tungsten ore, lead ore, silver ore, iron ore. I think the item has changed if someone can confirm; if so, the text saying ores are only in Wooden and Pearlwood creates needs to be updated. I'm not sure if other biome crates can have ore; the Iron Crate did not.
 We already knew the metal distributions had changed; I think we'll need a source diver to get all the new contents lists. MentalMouse42 (talk) 03:52, 21 May 2020 (UTC)
Can the prehardmode Crates still have new items if opened in Hardmode?[edit source]
The respective pages and notes here still say that Crimson/Corrupt crates (and the normally inaccessible Hallowed crate) can have Cursed Flames/Ichor/Crystals in Hardmode. Izzit so? MentalMouse42 (talk) 22:12, 22 May 2020 (UTC)