How We Solved the Worst Minigame in Zelda's History

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

There's something very satisfying about them breaking down a complicated algorithm in a way that anyone can understand it.

πŸ‘οΈŽ︎ 41 πŸ‘€οΈŽ︎ u/ChronoX5 πŸ“…οΈŽ︎ May 19 2020 πŸ—«︎ replies

Feel like this should have been posted in /r/math too

πŸ‘οΈŽ︎ 81 πŸ‘€οΈŽ︎ u/blueboybob πŸ“…οΈŽ︎ May 19 2020 πŸ—«︎ replies

Speedrunners could probably cure cancer if there was a leaderboard for it

πŸ‘οΈŽ︎ 280 πŸ‘€οΈŽ︎ u/LinearTipsOfficial πŸ“…οΈŽ︎ May 19 2020 πŸ—«︎ replies

Well for me, 1 kaboom is always followed by 3 splooch.

πŸ‘οΈŽ︎ 32 πŸ‘€οΈŽ︎ u/Baarek πŸ“…οΈŽ︎ May 19 2020 πŸ—«︎ replies

OMG sploosh kaboom is solved? Holy crap I can't wait to watch this!

πŸ‘οΈŽ︎ 26 πŸ‘€οΈŽ︎ u/thelehmanlip πŸ“…οΈŽ︎ May 19 2020 πŸ—«︎ replies

Sweet, Bayesian analysis FTW.

πŸ‘οΈŽ︎ 26 πŸ‘€οΈŽ︎ u/kpjoshi πŸ“…οΈŽ︎ May 19 2020 πŸ—«︎ replies

I think the discussion on whether this is TAS or not is not as open and shut as Linkus made it seem. Sure, you are inputting into the program manually, but it's not "fully manual" like he says it is. The computer is doing many billions of calculations that you absolutely could not do by yourself manually.

What is everyone else's feelings? I am not trying to downplay this achievement at all. It's absolutely stunning the work that went into this, but I do think it's really pushing up to the edge of what I think I'd consider being assisted by a tool.

I do also see an argument for allowing leniency in the rules if it reduces pointless RNG, like in this case, but it seems to get away from the ideals of speedrunning to me. In my mind, speedrunning is about sitting down at a game and completing some goal in it very quickly. This requires you to have some additional tools to help you beat the game quickly, which feels like it's going away from the idea of just sitting down and beating a game real quick.

πŸ‘οΈŽ︎ 54 πŸ‘€οΈŽ︎ u/itsaworkalt πŸ“…οΈŽ︎ May 19 2020 πŸ—«︎ replies

That’s amazing. Great video, and great job to everyone who worked on this tool.

πŸ‘οΈŽ︎ 9 πŸ‘€οΈŽ︎ u/Regalus27 πŸ“…οΈŽ︎ May 19 2020 πŸ—«︎ replies

The math nerd in me is eating this up

πŸ‘οΈŽ︎ 9 πŸ‘€οΈŽ︎ u/LunaticJ πŸ“…οΈŽ︎ May 19 2020 πŸ—«︎ replies
Captions
finally over 10 years after release we have finally figured out how to solve the worst minigame in Wind Waker thanks to reverse engineering now how this is even possible how does this work and most importantly oh how is this important to begin with well I'm gonna break down all of that in today's video but first before we get into the actual details of how the RNG works in this video game I'm going to break down what sploosh kaboom actually is so if you don't know sploosh kaboom is a minigame that can be found in the center of windfall island and it's being played by a character named as the Salvatore and the Salvatore has a bunch of minigames spread out throughout the wind maker itself now this specific version of battleship uses squids three squids to be exact a four squid a three squid and a two squid now you have 24 shots to find these three squids over an 8x8 grid there is a total of three rewards you will obtain from defeating these three squids you will get one for beating the game the first time a second one for beating at a second time and then one time if you're able to beat his high score which is 20 so 19 or below now why is this bad well even if you're able to shoot the statistical best shots possible you have a very low likelihood of being able to beat this due to the limited amount of shots of the game provides and on top of that a small especially in a speedrun you want to spend as few times here as possible and this is 30 minutes in so in average with how long we can sacrifice time in a speedrun that meant that only about 1/4 of all runs actually got past this point meaning that we basically spent two hours to get a single attempt going which wasn't the most fun and definitely end up a lot of resets now how do we go from this to actually reverse engineering this well I think the first we need to breakdown is basically giving you a broad understanding about how RNG is being generated in Wind Waker itself and I'm actually gonna get a friend by the name of sea Sunday in the video and he's gonna help me explain exactly how wind waker generates its RNG you the key discovery we made was that Wind Waker uses the waichman Hill pseudo-random number generator and always starts with a fixed seed Weichmann Hill starts with 3 numbers that we call the RNG state values each time the generator is called the state numbers are changed and a random number is produced the state changes follow predictable pattern based on multiplying and dividing prime numbers these values keep changing and more random numbers are produced until the our energies period is exhausted and waichman Hill has a period of about seven trillion values before repeating now normally software that uses a random number generator like this we'll start with unpredictable state values often based on the current time we call these starting values the rng seed since they determine all the random numbers the R&G will produce in wind wakers case however we found that the console always uses a seed of three 100s during the Buda process and never resets this seed with this in hand we can predict every RNG value that wind waker will ever use and the game will always receive this same sequence of random numbers from the Weichmann hill generator since the squid positions in sploosh kaboom are based on these random numbers we can calculate what squid positions you would get for each point in the orange ease period now just knowing what our energy values wind waker will use and the board you get for each one isn't enough to solve sploosh kabooms during normal gameplay the RNG function is being called dozens of times per frame and the number of calls depends on what's on screen what the players do in and so on for example in the splish kaboom room we know each rupee behind the board causes one orangie call per frame Lincoln Salvatori caused one oranjee call per frame each and the board lighting causes two calls per frame so by the time a run gets to sploosh kaboom about 30 minutes in there's no real way to know where we are an rng cycle at this point we had finally figured out exactly how the RNG was working how the RNG is being generated and we had made great progress however there's one problem as you can see towards the end of the video with Sunday there is one major issue and that is how many calls per frame that orangy is making for example 20 times a hundred times per frame how could we possibly manipulate RNG in this way well we actually don't need to manipulate RNG because since the order will always be the same we didn't have to manipulate it we just have to figure out where we are in the RNG cycles and that's where this new tool that was being developed comes in to an effect now this is a much more advanced part and I'm gonna let Peter the main developer of this tool exactly explain how this knowledge was taken into consideration for developing this app that we're currently using to this day ok you see the tool in action let's explain how it works so there are about six hundred and four thousand possible squid layouts and it turns out that the game generates all of them with approximately equal probability but let's say we magically knew that only a handful of squid layouts are possible say these 12 boards we'll call them our candidate boards what we can do is generate a heat map of where squids are likely to be from our candidate boards thus our play ignoring which squids are which and only pay attention to which cells actually contain squids so here I've produced a heat map for each board individually then we can average these heat maps together to produce an overall heat map so this percentage in each cell says the percentage of bores that contains squid in that location and because we assume that all these boards are equally likely that's therefore also the probability of finding a squid in that given cell so here we average all these boards together and when we're done we're gonna find that this one particular cell right here has 58 percent chance of containing the squid so let's say the user fires on that cell and gets a Miss well then what we can do is we can rule out every board that contains a squid in that location which happens to be these now that we have ruled out these boards as impossible we can actually generate a new heat map by averaging the remaining boards so here we can see that happening and once we've done that we now know that this cell right here has 60% chance of containing a squid let's say that the user fires on that cell and gets a hit this time now we can rule out any board that does not contain the squid in that location which would be these two and again we can compute a new heat map that's compatible with the information we now have we then can fire on this cell let's say we got a hit we can rule out this board because it does not contain a squid there we now have two boards left and at this point we can fire on any of these 50/50 cells let's say we fire here and get a miss we can rule out this board and now we know exactly what the squid layout is and now the user is free to shoot the remaining squids as quickly as they can so it's clear that the name of the game is limiting the set of possible boards but how can we do that Wilner to do that we're going to need to understand the RNG as was mentioned before the wind waker uses a fixed seed for its RNG so in particular the first random number generators will always be the 0.69 number and in fact these will always be the first 10 random numbers it generates so what do these random numbers get used for and which ones will get used to generate this blue sky boom board well it turns out that we can't quite know immediately this isn't enough information we actually need to know what's going on normal various frames of the game let's say the first frame of the game called for three random numbers shown here as these three well it turns out the next frame of the game could actually call for four random numbers I'll say another options interview so now in addition to those three calls we also need to do an extra call for the lighting of that object and so on every frame of the game can use a variable number of calls depending on what's going on as few as 0 and as many as many hundreds so based on this it's actually even more precise than frame-perfect to manipulate which are in G value is used to generate the board let's give a simple example I'll put all the possible RNG step values across the top and screen here and then I'm going to show which are in G values are zoomed by which frames so let's say the first frame of the game consumes his first 13 RNG values if magically we were to teleport to sploosh kaboom on the second frame of the game then we would actually get this board shown right here and in fact generating that board would itself consume some random number as shown here but if we had shown up sploosh kaboom just a single frame later then we actually would have gotten a totally different board frame after that another board frame after that another board and okay so far this just sounds very perfect but as I said before it's worse than that if there'd been a little bit more going on in frame four then maybe it would have called for a few more random numbers and we would have used even yet a different board so you can't even just do like a frame perfect setup resetting the game to get to that 100 100 100 RNG State and then getting to sploosh kaboom it's a particular number of frames no it's much more precise than that but you might be thinking okay we don't need to know exactly when we're showing up so swoosh kaboom as we said earlier we only need to be able to have a limited set of possibilities for the board so let's zoom in on how we might do that let's say we instead of just having a specific RNG value that we want to show up to sploosh kaboom at we're gonna have a range of possible RNG values that a probability distribution over them we're gonna show that on the y-axis here with a probability distribution so let's look at what board we would get if we showed up to sploosh kaboom each of these RNG step counts here we can see that for every RNG step count you just get a completely different board it's not like if you show up at RNG stepping out 15 you get a board that's similar to this board you would get you showed up at 14 steps so given all these boards maybe we think that we're gonna show up to sploosh go boom around RNG step 15 could be less could be more could be as little as 10 as much as 20 probably not anything outside of that region then we can do exactly what we showed before of making a heat map and this time we're gonna take a weighted average all of the board's under this bell curve so first we're going to convert each board into its own heat map by ignoring where the squid's are and then we're gonna average together all the heat maps under the bell curve okay this sounds great so far you might think we're in business all we have to do is show up this blush Coulomb at plus or minus a hundred or a thousand orangey steps and then we can produce a heat map like this and do the process shown before to try to beat sploosh Kubo well it turns out to be a bit worse than that we don't just show up to sploosh kabuemon like a thousand RNG steps we don't even show up to it in like ten thousand or a hundred thousand orangey steps top runners on world record pace typically show up to sploosh kaboom at around five point five million steps shown here let's zoom in on this bell curve so it turns out that for a typical bell curve for when top runners might show up to sploosh kaboom there aren't just hundreds or thousands of boards there are literally hundreds of thousands of boards that are possible and if we were to do that same averaging process I showed before across all these boards we would get a heat map that looks more like the vests it would be basically flat sure the corners are a little bit less likely because it's harder for a squid to fit in there but this is basically just the information that you would get without any knowledge about the RNG so this is clearly not going to work we have to do something a little bit more sophisticated so let's zoom in on what that more sophisticated thing is in order to explain this I'm going to go through a video of Linkous actually using the tool I'm going to apologize in advance this is going to be the most complicated part of the video in order to try to make it a little bit easier to understand I'm going to put a timeline along the bottom of the screen all the way at the left of this timeline be that critical moment when the game starts and we initialize the RNG to 100 100 100 I'm also going to put a little red cursor on the timeline that should correspond to where we are in the video this video is already about 29 minutes into the run right before Linkous gets the sploosh kaboom so let's catch the red cursor up with the video okay I'm gonna start the video playing and we can see what happens first link us is gonna item slide to the sploosh boom door open it the screen is going to fade to black and I'll pause the video so it turns out right as the screen fades to black entering the sploosh kaboom room is when the game generates the first board using the RNG this is an extremely important moment so let's mark it on our timeline I'm now gonna start the video playing again and we're going to see Linkous play on this first board so first he talks starts the game and Linkous is actually just going to throw this first board shooting a totally arbitrary places just to learn where the squids are okay I paused the video again this is a key moment Linkous is about to press a to exit out of the board after having completed it and that turns out to be the exact moment that it generates the next board I know this sounds a bit weird you might expect it to generate the next board at some point in the dialogue but no it actually generates it at this moment this is also very important so let's mark it on our timeline okay I'm start the video playing again let's see what happens then cuz talks to started another game and then gets into the board okay so this is the first game we would actually like to help Linkous win do we have enough information let's think about the information we have I'm going to put Linkous in the top right corner and let's draw that axis we had before for RNG steps against probability so we know that link has probably showed up to sploosh kaboom and the first board was generated at around five point five million steps that's just because that's typically when world-record pace runners do in particular note that this five point five million number comes from the duration between when the game started and the first board was generated shown here on the timeline in addition there's some variability in when Linkous shows up so that's going to be indicated by this bell curve of our belief Linkous could have shown up at plus or minus say a few hundred thousand steps additionally we also know the first board that was generated and that's this board right here and also we know that certain orangey step counts will generate certain boards so this first board was all possible at some subset of the possible orangy step counts let's say for the sake of argument it was only possible at these four step count amounts so the leftmost match and the rightmost match seem extremely unlikely given our bell curve of when we think link has showed up to sploosh kaboom so let's just disregard those completely we're left with these two matches and we can actually estimate their relative probability from this bell curve so in particular we think that this left match which occurs at about five million three hundred eighty nine thousand two hundred and seventy-six steps is about thirty percent likely whereas the other match is about seventy percent likely so to reiterate these two candidate RNG step counts are the only possibilities for when the first board could have been generated and these were their relative probabilities additionally we know the amount of time between when the first board was generated and the second was generated shown here on the timeline as was mentioned earlier in this blue Shaboom room the game uses about eight RNG calls per frame so from this amount of time we can extrapolate a pretty good estimate for how many RNG steps occurred between the first board being generated then the second board being generated putting all of this information together we can produce an updated probability distribution for the RNG step count at which the second board was generated this updates are one big bell curve into two little bell curves each of these spikes is actually a little bell curve with much narrower variance and there are two spikes because we're not sure yet at which of the two candidates step counts the first board was generated to emphasize the point it's the time between the second board generation and the first board generation have been a little bit higher than we would instead estimate the spikes a little bit further to the right this is what we actually have given this probability distribution we can do the whole heat map averaging process from before to help Linkous beat this board let's take a look at the video so I'm going to play it now it goes by fast but watch how quickly the heat map shown in the bottom left narrows down on the actual board as Linkous takes shots after just a handful of shots the tool actually knows the exact or layout so here we're also going to see Linkous intentionally shoot a bunch of misses because pollution kaboom gives bonus rupees for beating your own record so he's intentionally trying to make his record easier to beat on the next board okay let's make this small again so we're about to press a to exit out of this second board and note that that's exactly the moment at which it generates the third board same as before so let's mark that on our timeline now we also now know the second board so let's update our knowledge here of course the second board itself can also only occur at certain specific RNG step counts let's take a look at what those are here we have three possibilities now the leftmost and rightmost don't occur inside of our bell curve at all so we can just completely ignore them I think it's also really important to note here that we've just learned something very interesting so this second board only occurs in the Wrights bell curve spike not on the left bell curve spike so that means that we actually now know when the first board was generated was actually the 68.4% likely candidate the one corresponding to the right spike let's update our knowledge of that so now we actually know exactly when the first board was generated and when the second board was generated additionally we know the amount of time between when the second board was generated and when the third board was generated shown here on the timeline so of course we can do the exact same thing we did before we can extrapolate the number of RNG steps between the second board generation and third board generation and update our belief a second time now note that we only have a single bell curve spike because we know exactly when the second board was generated let's make the video big again and here we can watch Linkous play using the heat map information from this probability distribution so first we get some rewards from being the second board and another reward now Linkous talks to start the next game and watch how quickly it figures out exactly what bored wrong so first forget a single miss then we get a couple of hits and already knows it to within a pretty small set a few more hits we know it within one or two and now we know the exact board and we win and that's how the Tool Works now after this incredible breakdown from C Sunday and Peter going over how we figured out how the RNG worked how this program works and everything you might be asking yourself how is this even out loud in this speedrun well I'm happy to say that we actually a community vote if this should be allowed and it won by a two to three majority of this program being allowed in official speedruns now I want to clarify a couple of questions that some people might have if you either want to try and use this to yourself or just in general why this is even a lot in the first place first of all this is available for anyone yes absolutely it's publicly available and website anyone can access this I will link it in the description of this video so anyone can try this out of themselves second of all how's the program even knowing where you have shot if it was a hit or miss or if a squid has been killed so a lot of people think that it's taking basically memory addresses from the game console by using homebrew or from using a screen capturing tool but it's using none of that it's actually all done completely manual and this is the only reason it is allowed to begin with this because everything is done manual now I might be asking yourself wait but how did the program update so quickly well it's basically just a lot of practice I basically hold my control room with one hand and then I put my other hand on the keyboard so I'm one handing it so I'm shooting and that I'm using my actual fingers in my keyboard to a hotkey on hit miss or killed squid so that I can much quicker actually input if they were hits or misses so that's basically how you get down the speed to make it so fast in the speedrun you basically just practice to one hand the controller but obviously you can do two handed it's just slightly slower you might also be asking yourself what versions that says work on and I'm happy to say that this will work on every version of the game now this will work on every GameCube release of the game and every single be your release of the game HD and Gamecube so any version can use this anyone can do that use this program it's absolutely amazing I also want to say quickly that I think that everyone that came together here to actually make this possible to serve as a huge child I'm gonna put a list up on the screen now of every single person that helped with this and that includes everyone like Peter Christ gingko Trog Lang C Sunday shout max the beautiful at the NSA that developed a tool that we were actually able to use to actually decompile the code of the game the beautiful developers of dolphin that made as possible and the people developed a memory engine to read memory values while the game was running everyone that came together to make this thing possible thank you guys so much this would have not been possible without everyone else and I want to make it very clear that this was a huge community effort and not this could not have been done by a single person so huge shout-out to everyone that came together for this now I quickly want to show you guys a clip of the result of all this hard work so enjoy this clip quickly now with all that being said this is where I'm going to end this video if you want to see more breakdowns of glitches or RNG in general feel free to leave a comment down below suggesting what we might breakdown in the future because I really enjoy making this video it took a lot of time but I think that end up doing very well and I think that in general having the visuals to better understand these more complex things you definitely work as a foreman for the future so feel free to leave any comments down below giving me advice or tips or in general your suggestions for while I might actually make a video on in the future and I'll definitely take a look at that but either way thank you guys so much for watching don't forget to subscribe to the YouTube channel and if you want to watch all these speedruns alive of when we created you with this tool in action you can obviously check out my twitch channel at twitch.tv slash like a7 but without further ado thank you guys so much for watching I love y'all tons and I see you guys in the next one later everybody
Info
Channel: Linkus7
Views: 934,855
Rating: 4.9260302 out of 5
Keywords: Worst Minigame, Zelda, The Legend of Zelda, The Wind Waker, The Wind Waker HD, Zelda Speedrunning, Nintendo, Reverse Engineering, Speedrun RNG, Worst RNG, Speedrun Luck, TWW, TWWHD, The Luckiest Zelda Speedrun Ever, Luckiest Speedrun, 100% Speedrun, Zelda 100% Speedrun, Zelda Minigame, Zelda Solution, RNG Solved, Speedrun, Speedrunning
Id: 1hs451PfFzQ
Channel Id: undefined
Length: 24min 32sec (1472 seconds)
Published: Tue May 19 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.