Changes

3,330 bytes added ,  19:39, 17 September 2022
→‎Quarry Levels: thanks and praise
Line 112: Line 112:  
Also, there seems to be a 4.4% chance of a level being a quarry level, but I found that levels 22 & 63 were consistently quarry levels (until I drank Oil of Garlic). This is also odd to me. I'm stumped. [[User:Margotbean|margotbean]] ([[User talk:Margotbean|talk]]) 19:34, 11 September 2022 (UTC)
 
Also, there seems to be a 4.4% chance of a level being a quarry level, but I found that levels 22 & 63 were consistently quarry levels (until I drank Oil of Garlic). This is also odd to me. I'm stumped. [[User:Margotbean|margotbean]] ([[User talk:Margotbean|talk]]) 19:34, 11 September 2022 (UTC)
 
:That last bit, about quarry levels and where they appear, changes on a daily basis. Next day they will be on different levels. This can be checked in the Predictor site located... somewhere :-/ The other bit with Oil of garlic is a bit odd, but maybe those enemies are seen as not dangerous enough, and therefore the Quarry won't spawn at all? [[User:Pangaea|Pangaea]] ([[User talk:Pangaea|talk]]) 20:00, 11 September 2022 (UTC)
 
:That last bit, about quarry levels and where they appear, changes on a daily basis. Next day they will be on different levels. This can be checked in the Predictor site located... somewhere :-/ The other bit with Oil of garlic is a bit odd, but maybe those enemies are seen as not dangerous enough, and therefore the Quarry won't spawn at all? [[User:Pangaea|Pangaea]] ([[User talk:Pangaea|talk]]) 20:00, 11 September 2022 (UTC)
 +
::I used MouseyPounds' predictor utility to find the levels to check before I started testing. ;)
 +
::(Side note: I have messaged Mousey about a couple of updates to the site (like the fact that Quarry levels can no longer be infested as of v1.5), but the site hasn't been updated yet. He may be waiting for v1.6, or some other reason...)
 +
::The other code about spawning flying monsters offscreen and populating the level happen after the level type is set, and the monsters do update every 10 in-game minutes, but again, only after the level type is set.
 +
::I literally hit '''<samp>this.isQuarryArea = true;</samp>''' each time until I drank Oil of Garlic, and then the whole block got skipped. Something in the <samp>else if</samp> conditions didn't get met, and I don't see what it is. I guess my next step is to break the code up into separate "if" statements, so I can check each condition separately. :/ [[User:Margotbean|margotbean]] ([[User talk:Margotbean|talk]]) 20:40, 11 September 2022 (UTC)
 +
:::I broke the <samp>else if</samp> conditions up into separate <samp>if</samp> statements, and the failure is happening on <samp>if (r.NextDouble() < 0.044)</samp>. But, only after drinking Oil of Garlic. This doesn't make sense to me at all.
 +
:::Therefore, I'm going to add it to the page without a code reference. It's repeatedly reproduceable in-game, so I believe it's a true statement. If anyone can provide any insight into the game code, it will be appreciated! [[User:Margotbean|margotbean]] ([[User talk:Margotbean|talk]]) 15:27, 13 September 2022 (UTC)
 +
 +
:::: Ah! It's subtle, but explainable! Randoms always produce numbers in a specific order. So what was happening was roughly:
 +
::::* Without Oil of Garlic: passes !this.AnyOnlineFarmerHasBuff(23), asks the Random r for a random number, fails somewhere in the next few checks, goes to else if, asks the Random for another random number, passes that check.
 +
::::* With Oil of Garlic: fails !this.AnyOnlineFarmerHasBuff(23), doesn't ask the Random r in the if statement and goes to the else if directly. Because the random wasn't queried, the numbers produced will in effect shift by one, which then caused it to fail (which is very likely, given there's only a 4.4% chance of passing).
 +
 +
::::I suspect it's perfectly possible to get a quarry floor with Oil of Garlic, what you're seeing is just a consequence of how Random works.
 +
::::Anyways, the `Game1.MasterPlayer.hasOrWillReceiveMail("VisitedQuarryMine")` part of the check was added in 1.5, otherwise it seems date from 1.4.
 +
::::[[User:Atravita|Atravita]] ([[User talk:Atravita|talk]]) 19:11, 17 September 2022 (UTC)
 +
 +
:::::O.M.G. and holy tamales... I stepped through that code for 3 days! Genius, Atravita, genius!! When you say "subtle", you aren't kidding.
 +
:::::I'm going to revert my edits now that we have an explanation. I'll be floored by your insight for quite a while. 👍
 +
:::::And thank you to IBugOne for the assistance offered on my talk page too! I do have the v1.4 decompiled code, it's just a matter of finding a LAN cable and transferring it from the old PC to the new one. (For context, it's been almost a year and it's still on my "to do" list.) 😁
 +
:::::Wonderful work, guys! Really wonderful! [[User:Margotbean|margotbean]] ([[User talk:Margotbean|talk]]) 19:38, 17 September 2022 (UTC)
106,017

edits