 Hello guys, it's crypto grounds here. Welcome back to another unity anti-matter dimensions video this episode 10 it Hello guys crypto grounds here. Welcome back to another unity anti-matter dimensions video this episode 10 and today We're going to be doing infinity upgrades. Whoo. We're at that 10 milestone. We're finally getting somewhere. So Yeah, we're pretty much just gonna be doing the first 17 upgrades here Yeah, so let's get started so what I'm gonna do real quick is I'm gonna actually just cop actually whoa I could just copy and paste all of these Maybe I Guess that works now that looked really weird increase the multiplier normal. Yeah, I guess this worked for the most part So I'm going on the side. I'm going to copy all of these down and Yeah, so I will yeah copy all of those actually Okay, I'm trying to process what we're gonna do how we're gonna do this So I think this infinite. Oh, yeah, this infinity upgrade is a prefab if you guys remember from last episode So I think what we're gonna do is Just copy and paste the 16 times I'm gonna like do the interface and all that on the side and then we're gonna Put all these inside the script in a string list. Okay, so I'm going to set up the user interface I will be right back Okay, so I have a grabbed or I have made all the upgrades obviously they have the same text We will get to that later on We have upgrades 1 through 16 and we have our infinite upgrade. Okay So let's get started on a new script here. So let's see. We have infinity manager, right? We have infinity upgrade which we can move this to the scripts folder So keep ourself organized and let's create a new script called infinity upgrades. This is where we're gonna Once you need loads once. Oh, yeah, so this will be for Neatly managing all the upgrades and of course, we're gonna store everything inside the data of the data class But this will just kind of help us out here And I just don't want to throw it in infinity manager because there's a lot of stuff in Infinity and it's only gonna get bigger especially when we get to eternity if we even get there But yeah, so we kind of just want to keep stuff organized So again, we're gonna call the script infinity upgrade manager Okay Okay, we're gonna load it right up Okay, so in here We're gonna delete all the default stuff to add it back in later. That's just what I tend to do But also all jokes aside. We need to add a few things. We're we know we're gonna be using I think we're gonna be using TM Pro I think because I know we have like our we have our infinity minute or infinity upgrade prefab So what we're gonna do here is we're gonna create it We're going to create an array of Infinity upgrades, okay, and we know the size of 16 So we're just gonna call this infinity upgrades and we're going to initialize it with the size 16 Infinity upgrade array just like that. Okay. Oh Okay, so now in here we want to create a new string and this is gonna be a cut of infinity Upgrade names are just infinity names, honestly Okay, and actually we're gonna make this a list Yeah, a list will be fine. No, no, no, let's do it. Let's just do an array. Okay. I tend to change this up I'm not like very consistent on what this is. Okay, and then now we're gonna create a separate method or we're gonna start our start method here and We're going to initialize this string array with all of our upgrade names. Okay, so I will be our back I will do this on the side Alrighty, so like I copied and pasted all of these in here and it honestly might have taken you a really long time If you did this as well So I'm gonna give you some tips and tricks real quick So what I did here is I simply just dragged all of these over and you can see that when you start to select things It still goes in a row just like selecting individual lines himself. It goes from top to down or up down So it's just like this one right here. So you see how it goes from Left to right top to bottom. It's the exact same way with the upgrades, right? So that we start from upgrade one all the way to 16 right here, okay? So you just copy all of these paste them in a notepad and just kind of Space them out like this. Obviously, they're gonna be a little messy when you copy and paste them So that's why you want to divide them Correctly before you want to do this and then once you have formatted it correctly just copy all this and paste it into here and then just you know I like to put the print or here. I'll kind of show you what I did here I'll go back quickly. So I kind of had him like this, right? And then I looked for the ones that have the currently and I just copied a pasted Slash new line currently space and then the parentheses right here for all those that currently and then another one was like This right here. I just pasted this one at the end with the new line before that and then I Start deleting all the useless cost and all that stuff because we can do that ourselves All of them have a cost so we don't have to display that in here and then I Put parentheses all at the beginning of them and then the comma and yeah I went by a lot faster rather than just typing them out individually again That's up to you if you want to do it this way, but that's just a little hack a speed hack Okay All right, so well now what we need to do is we have the names, but we also need the cost too Okay, so they're all listed here. That should be pretty easy. So I'm gonna also copy and paste those over now before I do that I actually want to create the public public big double infinity cost array Infinity costs I think I like infinity upgrade costs right here and this is also a size 16 But we don't need to implement that here. You can do that as well right here. So I will be right back Okay, so I have copied and pasted all this cost over and I think I just looked at I Just went from left to right top to bottom like that and also you may have noticed I haven't included this upgrade yet just because I really don't need to I don't I don't really I want to keep this separate because it's Not really part of the system that we're going for here You'll see why later. It'll be just kind of easier to separate it and Let's create also actually we don't need to do that. Let's see um You know what we may we might as well just Expand this to 17 and add this extra one in here. And what does this say? Multiply all yeah Okay, well, let's just add this because why not I think we should Kind of how to think about it So multiply infinity points from all sources this is by two and Oh, wait a minute. Currently. It's a lower case. Come on heavy Capitalization man or consistently at least Okay, consistency is what I meant to say. All right. So now we have this one and the cost for this one We're not going to include for this one. All right and for cosmetic effects. Let's You remember last episode when I when I added all of the colors, right? Well, the thing is that I Don't think we need the red and purple. I mean we on that's honestly not that important so what I'm gonna do is Leave those out and only have the three colors that we have which is white dark gray and green Okay, so there's three states where where we display colors. First of all, it's white, which means we can buy it So it's unlocked Gray is where it's unlocked where it's pretty much locked. We can't buy it. Okay and green is where we Purchased it Okay, so we need to make sure that implement that and also another thing we need to implement is that upgrades work in A kind of a weird way, right? So you start here and you go this way, right? And then if you start here you go that way and then you go down this way, right? So if you go this way you can go left or you can go right on all of them And if you start with a top row, you can go down. Okay, so it kind of works in like You can't just buy this one. All right. It kind of works in a certain direction where you got to follow So we got to be sure we got to be sure to do that. Okay Let's start with adding our variables in here and we're gonna eventually move this to our data class All right, so this is as well a big double No, this is a bull actually And now instead of this being a size 17 This is going to be a size 16 just like the cost because this is infinite right here. Okay So we're gonna call this one infinity Upgrade levels are unlocked. I guess we can say our upgrade bot. Let's just that that's a better name. I think Okay And this will be a new bull 16 and again, we're gonna have to rearrange this in here Let's see actually let's take a look in here. Well, since we have this create list here. Let's let's create a Bull list instead. Okay. Oh, yeah, we need to implement Yeah, let's see what did we add here? What's going on? I don't know what just happened. That was really weird. I Don't like this Okay, but it's not it doesn't seem to want to add by itself But at the top we add system dot collections dot generic. Okay, and we should be able to use lists. Oh That's why we're getting an error here Okay, so now we can use lists here and we're gonna create new Boolean list The capacity of 16 again, this will all change once we move this over to data, but just for now We're gonna leave it as is Okay, so what we're gonna do now is get ready with displaying the the buttons and all that okay, so let's let's create a public void update and Before we do this we need to create for optimization purposes we obviously need to Only update our UI once when we were looking at it and we also need to create a canvas to For this purpose and to be able to go to it for navigation. Okay, so let's see What do we do this we do this in the game controller? So we are so far We have dimensions achievements and Yeah, that's it. Also. I think we have an infinity canvas somewhere. I think Where is this Okay, so I guess we haven't done like we haven't done that yet, okay But anyways, we're going to create a we're gonna create two canvases actually we're gonna call this one The first one in the nitty canvas and we're also gonna create a sub canvas, which is the infinity upgrades canvas Now this won't be added on to our current navigation system because it will disable everything else and we don't want that to happen So let's start with infinity. So we're gonna add this to our Canvases to disable right here at the top which we're gonna have infinity right here and this one right here in The switch we're gonna add our Infinity right here, and then we're gonna label this one as infinity. Okay, so at the locations infinity Then we're going to toggle on the infinity canvas. Now, let's create a new method Called infinity navigates. Okay, so we're just gonna do everything related to navigation in here since we're already doing it And we can't just have it all in one spot rather than putting this in the infinity manager And we're also gonna do the same location thing Okay, so we can just pretty much add our infinity upgrades canvas in here set it to false and We only have one thing to switch between these so it's really gonna be kind of pointless or we need to set this up for later So we're just gonna do this now And for our first case, we're gonna call this infinity upgrades Okay, colon and we're just gonna set this to true and don't forget the break like that All right, so we have it navigates and infinity navigates So now what we can use this for is in our infinity manager or infinity upgrade manager Okay, so at the top we're gonna add our game controller our label as game and In here, we're gonna put make an if statement called We'll probably make a variable called data because I have a feeling that we're gonna use this eventually But if Game dot infinity upgrades canvas dot game object dot active self Okay, so if it's true that we're gonna start with this UI and We are going to be messing the with the UI Via for loop. Okay, so we're gonna do quite some stuff in here So we're gonna create a for loop of our eye equals zero. So we're sorry at zero and As long as I is less than 16 on our 17 And we'll just keep adding and keep going. Alrighty, so now in this for loop We're gonna do infinity upgrade at index I and we have a description Which we added the last time and an image. So let's just start with the description And we're gonna set the description to the infinity names. Okay, so at the infinity names at index I Now you notice that we didn't add any of the cost in here, okay? But some of these do have the currently so we're gonna have to kind of Experiment with this let's see what why is it like that? That's cool So I feel like we need to make a Switch case here because we only need to add the currently boost right here to certain things And honestly now that kind of think about it. We might have not needed to add this but it's okay This will work either way So the switch is gonna be I and we're gonna do case zero. So that's this one right here zero one two Four five so three four five I mean just at a break temporarily So let's say we skip one. So we have one. Yeah, you do two four five Two four five and right now I'm choosing these numbers based on the index of this currently, right? So we have zero one two three four five and so on. We also have six eight nine Six eight nine All right, so six eight nine. I think this is nine right here ten eleven twelve Thirteen fourteen. So this is fourteen fifteen sixteen. Okay. Yeah fourteen sixteen that sounds correct Fourteen sixteen, okay, so now in here. Oh, yeah, we also add a default in here So if it's not any of these then we can do the ones without the currently in here Okay, so we're gonna set the description equal to Infinity names, let's actually do this in via string interpolation so we can put our variables inside Alrighty so our variable will be infinity names at index I oh, yeah, the descriptions of text so don't forget that you have to add the dot text attribute the end of that and Infinity names at index I Okay, so now we need to add our cost We don't have the cost yet. So we're just gonna leave that as is actually no, we do have the cost big brain Yeah, that's correct Yeah, that's correct We're just got to figure out. Yeah sixteen is difference. Remember we have our because our cost is basically an equation And I think it just grows by ten each time Let me let me take a look actually Console Game dot infinity points. Oh I think it's player player dot infinity Points yep is equal to a new decimal Okay, so let's see what this is going on Yes, you see how this works. Oh, okay. So it actually goes by rows So now I know that you but you buy these and it goes down Cool, so this multiplies by ten. I see now Okay Alrighty, so we will have to make an equation for that All right, so now for the rest of these I'm just going to copy and paste this Oh Yeah, I forgot we have the currently here So I will copy and paste these and show you what we do next Actually, now that I think about it I think an easier way of doing this is making a method because we're gonna be doing lots of copying pasting here So let me create let me create a Public yeah, let me create a public void here actually No, we can't it's just void. Okay, so here this will be set currently text With an ID and in here. We just set or replace with I replace I with ID I with ID Same thing here now instead of adding the cost right after we have to display this currently value here, okay? So I'm just going to leave an empty An empty curly brace right here and also I added space at the end of every currently right here So that's up to you if you want to keep that or not if you don't then make sure you add a space right here So completely up to you, but I didn't so the boost will be right next to the variable here and So we can ignore that Trying to think how this is really weird Now that I think about it. Okay, so what I'm doing here is I'm adding an Array right here called currently swap and I only have a good name for this but what it's gonna do is We're gonna take in the variable We're gonna take an ID and we're gonna locate where it is in this array and we're gonna Output the index, okay, and we'll use this as a way to create a An easier way to access this currently boost because it's gonna it's gonna be based on a Here, let's actually show you real quick. So we're gonna create a big double currently Infinity upgrade currently, or yeah, we'll just call this boost actually Boost currently, yeah, so in here will be an int ID, right? So we're gonna be basically searching Actually, that's a silly idea I just realized it's not gonna matter because we're gonna have to access this level in the first place or that least at least This bull right here. Okay, so Scratch what I was saying there, but we're still gonna have to access this right here So for now, I'm just gonna return zero because we don't know what these boosts are we will get to that eventually And in here and they're currently boost right here we're going to copy and paste the method name for our infinity upgrade boost currently and We're gonna put in the argument ID Okay, and again, we'll manage all this after a little bit. So now back to the texting here We're basically just gonna call set currently text and just put in I okay And now the cool thing about Reducing this is that we can just bring this to the bottom right here Replace all these breaks right here and make this a little shorter. Okay, so now basically Any of these above We'll do exactly what K16 is doing. Okay, if it's one then it's still gonna be default if it's zero Then it's gonna do exactly what K16 is doing, which is a little efficient Not really efficient, I guess but cleaner because we don't have to copy and paste this all These times. Okay, and it doesn't just look like a block. Okay So I think we have our UI almost done. We still have to do the image though. So let's do that So I think we should do this in our infinity upgrade Let me take a look. Okay. So what I'm gonna do is create another list Just basically copy and paste this and we're gonna call this infinity. Oh, no, I have an idea better idea Instead of creating a new list. We can just create another method So let's create a bull method called infinity Yeah, infinity upgrade unlocked. Okay, so basically what we're gonna do is we're gonna check to see if it's unlocked And again, we need to check to see if so if this one right here We need if this is unlocked only if this one is right and this is only if this one is and so on Okay, so we're gonna have to basically just calculate each specific one Okay, so I'm gonna open up paint real quick and show you how this works. So we have a four by four plane So I'm just gonna create little circles here Here, let's actually get a little better here So I'm only gonna show you a four by three And I'm going to label all of these as well Okay, so I have labeled these from zero to eleven because again, we are accessing from a list which starts at zero So it's a zero index So basically what we check to see it it goes like this, right? See it goes in a down it goes down, right? But we also have to it goes from left to right at the very top as well. Okay, so basically what we do here Let's take three for example right here. Let's just take this one for example So three has to check to see if two is unlocked. Okay, and two has to check if one is and Zero and it just goes back, right? Let's choose four now. Okay, so four is Unlocked when zero is right. So that's pretty easy and eight is unlocked when four is let's choose a little more complicated one Let's choose six right here. So six is unlocked if two is unlocked, okay But we got to see if two is unlocked if one is unlocked. Okay, so it goes in this momentum here So we get I kind of replicate that So instead of just checking each individual ID, we can just do some math. Okay, so We can just do this but with a bunch of if statements, okay And I'm sure there's a little maybe a better way of doing this But I'd rather have a few if statements rather than 16 Switch case statements, so I'm going to construct this if statement system or click Okay, so I've started a little bit, but I want to show you something called recursive Recursion, okay Recursion tends to be evil, right, but it can be used in a good way. Okay. I'm just like what we're doing right here So basically how this works is that we are calling methods It's we're calling its own method inside Inside like this, right? So if ID is less than four we're basically just going to check the previous ID So we're basically just gonna run this all over again and Except with a different ID, right a different number and just keep running through it till we have a result Okay, and at some point we will have a result and now the issue now The thing is where it becomes evil is if it keeps going forever and ever and ever it's gonna create some stack overflow error Okay, and basically it just keeps going it keeps calling itself recursively infinitely and it creates an infinite bug and or an Infinity no he was like mostly man It's a bug where it just basically freezes. I tell that to my tongue. I literally just lost the name But basically it just keeps going forever and ever and it just completely goes to poop Okay, so we fix that by eventually have any of a statement where it returns true and of course that zero zero is always true Okay, so this one's always unlocked. All right, so we have the first row But what about four five six and seven? Okay, so this one's a little different. So let's see four. So basically Well, we know four minus four is zero, right? So we can just let's do if ID is equal to four minus four Or no, if ID is equal to four Then we are going to check to see if four minus four The ID minus four which is zero right here is unlocked and of course, that's true So what about five now again? It's the same thing five minus four is one six minus two is Four or five minus four is one six minus four is two seven minus four So again, it's the same thing for eight nine ten eleven. Okay, so this is pretty simple We're just gonna create another if statements actually We don't even need it if statement here because we're still returning stuff true Or sorry, I cannot talk today. We're still returning stuff here as well So what we're gonna do here is we're going to basically just return Infinity upgrade unlocked ID minus four. Okay, pretty self-explanatory Now, why do we do this at the end? Well, we're not checking to see if We're not doing anything like this, right? We're not doing any of this like wizard magic here. Okay We're not doing any of this right here This would be pretty Weird if we were to check to see if ten and seven is unlocked, right? We don't do any of this weird stuff Okay, so we can just simply just ignore that and we could just keep going down and it's the same thing for 12 13 14 and 15 the last four upgrades here. Okay So what we can also do is save us a bit of work or the computer some work So let's say this upgrade is bought right? So this is just actually let's change the brush So let's say this one is just bought right This one's automatically active. Okay So we only need we don't need to just continue and check all the way to the end, right? Because that's pretty much what it's doing So basically once we get to 11 and we check to see if it's unlocked It's gonna go all the way from 11 to 7 to 3 2 1 and 0 all the way back to 0 Okay, that's a lot of work for the computer. So instead of we can just see if that we can just see if This one spot, right? I think I'm I Think I have an issue here. Hold on. Let me see. Okay. I see the issue here Well, even testing we already see an issue here It's checking to see if the previous one is unlocked and you can only imagine what's gonna happen if we keep checking this This one's unlocked Okay, is this one unlocked? Yeah, so then we're just gonna make ourselves unlocked Unlocked unlocked unlocked. It's just gonna make all of them unlocked. Okay So we need to actually check to see if the previous one is bought. So this will also Save us some work. Okay, so let me fix this up real quick. So simply I just replaced the recursive method with Infinity upgrade bot list. Okay, so now this is just automatically gonna save us lots of room or lots of Usage and we don't even have to do any risky recursive calls right here So basically we just simply check to see if this one's bought. Okay Uh I think that's it Maybe I This might not work, but we'll see we'll see once we get there. Okay. So now we have the upgrade system Unlocked and the bot system working. We can now finally Uh, determine the color of this, right? So let's just create a Actually, we don't need to create void. We'll just do the set currently text here. So we're going to do set currently We're just gonna replace it with that because we're also going to do the buttons here too So now for infinity upgrade at index i Image because that's the name of our image. We're gonna set the color to several things. Okay, so let's create um, some variables here public color gray, okay, so we have a gray color here. We also have a Uh, let's see. We also have a green and a public void of whites. That's pretty obvious. We don't need that we just need the green and the gray So remember those five things I saved earlier? That's what I'm using them for Okay, so these right here and I'm not going to use the purple and red because I really don't know what they mean Clearly they like the red one would be kind of obvious. Uh, it means you can't afford it But I guess that's just not the case. So now what I'm going to do is I'm going to go to this green right here and just copy and paste all the Oops I'm just going to copy and paste all the individual variables. I'll bear back enough Yeah, I'll bear back and do this myself Okay, so here are the color Um variables right here. Okay, so you can pause the video copy and paste those if you'd like unless you got a different color preference You won't Uh, so anyways, we want to set the colors in here accordingly So what we do here is copy and paste this infinity upgrade unlocked, you know I'm I need to stop doing that. Okay. I need to start typing because that's just I need to explain better that way Um, so what we're going to do is we're going to set the color if it's unlocked or not So let's start with the unlocked. Okay. So if any so we're going to do Infinity upgrade unlocked and we're going to type in the number or the variable i Okay, so if it's unlocked then we're going to set the color equal to Um white. All right. Otherwise if it's uh, if it's locked then we're going to do gray color dot gray That's a variable right here gray Okay So now the thing here is that it's either white or gray, but we want to make sure to see if it's a bot as well So we make a second question mark operator here If infinity upgrade bot right here and index i so if it's bot then we're going to do green Okay, we're going to set the color equal to green Otherwise it's white and also just to let you know we don't need parentheses in the middle of here Okay Sweet so now if the upgrades bot will set it to green if it's not if it's white However, if it's unlocked Then we're going to set it to either green or white But if it's locked then we're going to set it to green or a gray Okay, so we're going to be doing the exact same thing here Ah, I see. Okay. So basically, uh, let's move this out of default. Let's put that under the Under the switch statement right here But one thing Uh, right here this one right here. Okay. So this one's either gray or white. Okay, so we're going to have two if statements here Or we're going to have an if l statement here. So if i is less than 16, then we can use this right here Okay else We're going to set the color here And we'll we could probably transform this into a question mark operator Else we don't have this bots right here. Okay, so we're going to just get rid of this All right, so if it's unlocked Oh wait unlocked, right. This is different. Okay I see So this one's pretty much if we can afford it or not. Okay, so this one's a little special So here we have to make sure all of these are Um our bots. Okay. So what I'm going to do here is I'm going to make I'm going to make an int right here infinity upgrades bots instead of making a Um Instead of making something or a method that check to see if all of them are true I'd rather just add them up at the end. Okay. So what we do here. We don't have a buy yet, but we will So basically we're just going to check to see um If infinity upgrades bot Is equal to 16. Okay, because we're eventually going to buy 16 upgrades all 16 upgrades Um, oh, actually I have an even better idea So we don't we remember how we made this flow chart, right? This is pretty much the last upgrade right here in the bottom right corner That's this one right here. Okay. So this is upgrade id 15, which is the 16 upgrade So we're going to do that instead so we're going to get rid of all that And instead we're going to use this infinity upgrade unlocked And instead we're going to check to see if id 15 is unlocked. Okay And we also need to check to see if we can afford it, but we don't have a cost for that yet So let's add that real quick So we're going to make a brand new big double here called infinity upgrade Uh, let's see multiply infinity points from all sources We're just going to call this ip gain cost, okay, and we're just going to set this, uh, Oh, yeah, this doesn't have to be in data. Let's move this above Okay. Oh, yeah, this is a cost here Nope, it's not. Okay. Yeah. Oh, sorry. I'm just kind of Trying to figure this out here Uh, all right. So here we're going to make a big double Since this this will get big eventually So public big double infinity upgrade ip gain level, okay And basically we're going to set this cost equal to So initially the cost is 10. I believe I think that's what it was So the currently it's 10 We've bought four. Yeah, I think the cost 10. Okay, so we're going to do 10 times big double dot pal Um 10 to the power of level because we multiply it by 10 every time Okay, and we can also Oops, this is level not lev We can also use the same equation for our ip gain boost equation And we can let's see Oh, yeah, that's that And this equation starts at one so we can get rid of this right here and basically it's two to the power of the level Pretty self-explanatory, right? We multiply the sources by two Okay, so basically we're getting two times more xp per level Or not xp ip So now what we have to do is we have to Get all of our currently equations, right? So normal dimensions gain and multiplier based on blah blah blah blah So I'm going to do this myself and I will explain each of them when I come back And the reason why I'm like doing this afk because I kind of have to do some digging And finding what these equations are and maybe try to figure them out myself. All right, I'll be right back All right, I'm done. I kind of took a bit of time but I kind of I don't think they're correct. They're exactly correct, but you can see that this one right here 5.82 5.44 it's obviously not correct, but I did pretty good on this one though. It was a good guess I think I'm correct. I don't want to check Who knows like they might be using Square roots instead and I'm using log. I I don't know. I don't really think it matters Since this is 40 days of play time. I really don't think that's gonna matter all too much But yeah, I'm just gonna stick to these equations. I These ones are pretty easy to find actually this one was the harder that this one was also Um, a little troubling, but I'm just gonna leave it as this this one was the easiest This one took me like maybe a second to find But uh, again, I might it may not be correct. So we'll just leave them as is, okay So now we can finally use them in our infinity Upgrade boost currently, okay So once again, we're gonna be using this uh switch case here. I'm just gonna copy and paste this template right here And also just return zero at the end because I know And it's gonna give me an error. Okay, so let's just implement these equations. Actually, I'll do that real quick Well, actually just before one thing. I forgot. There's a few things that we don't have yet Seconds and infinities. Okay So this one right here is actually seconds in currents infinity And this one is seconds total. All right, we don't have those yet. So let's go to our data script and add those real quick And at the bottom right here actually at the top this one will be at the top. This one will be called a big double Uh This will be total playtime Okay, and this one right down here will be infinity playtime infinity playtime Okay, and let's get these going real quick because I I know I'll forget So in our game controller, let's just add this to our update infinity, uh Oh, yeah, this is data right data dots playtime. Let's do total playtime first We're gonna add this bias Yeah, yep. Yep. I'm doing everything right. Okay, and then we'll also do the same thing There's no if statements involved in this. Okay, so we're automatically starting our infinity playtime right off the bat, okay But we just need to reset this playtime on infinity and I think we still need to oh, yeah right here This big crunch right here. So at the right here We're just going to set infinity playtime to zero. Okay in infinity manager All right, so back to our upgrade manager. We need to uh, just transfer these equations, which I'll do I'll be right back. Oh One more thing one more thing. I promise we need to Uh, we need to add infinities right here public big double infinities And I'm going to add these below infinities will be equal to zero Infinity playtime will also be equal to zero on an inner constructor and total playtime will be set to zero as well Okay, now let me uh, move all these equations over Okay, so also before I continue I wanted to simplify some of this math here. So I'm going to implement the static Uh break infinity that big double Namespace and the reason why I want to do that is because I want to just get rid of all these big double dots Just to save me some typing because I know I'm going to be typing this a lot right here Oh, yeah, so I also forgot this one right here. So infinity point generation based on the fastest infinity. Okay So let's see the fastest infinity. Let's see in our stats. All right. My fastest infinity is 16 minutes This one is eight every two hours. So I think that's also Yeah, that's based off of this too So we get one We get eight every two hours and 46 minutes Now I really don't know how this is calculated So this one I might actually have to look up. So I will figure that out for you guys Okay, wow, this is actually really simple. It's basically just your fastest infinity times 10 Okay, so that's pretty easy and that means we got to go back to our data and add another variable another big double variable called infinity fastest playtime And we can also just call this fast run same thing so basically When we reset the playtime here an infinity manager, we're basically before we actually set that at all We want to set data dot infinity of playtime man Dot playtime is equal to um The problem with setting this to zero I think I should just set this to double dot max I'm just going to set that to double dot max because remember we're reducing this number. Okay So what we're going to do is Yeah in here We're basically going to check to see if Yeah, we need an if statement here. My apologies So if the player uh playtime is less than the fastest playtime Then we're just going to set that playtime equal to the current playtime. We're going to replace it Okay And we're done with that Okay, now let me finish these equations off All right, so I have all the equations in And it looks like this also I'm this meant to go on six So if you want to copy all these equations over and there you go And if you don't understand what log log 10 pow means uh here let me pull up the graph. So basically log Uh has a growth effect where it just eventually just decays over time, right? It is the inverse I mean, I've explained this in the past before but basically it's the inverse of the exponential equation of so for example Log 25 x so basically that's the inverse of 25 to the power of x. Okay, if you don't know what all that means You don't have to right. I mean Gain when if you're game developer then you really should know what this kind of math means, right? It's kind of important Especially if you're making an idle game, you're really going to need to know what these are And pow is basically just to the power of right so x to the power of 1.5 and it's just uh It's just a Um, what do you call this uh a parabola right x squared same thing, right? Just this is just uh a bit wider because it's uh, it doesn't grow as fast Well, if we make this x of the 10 it goes crazy fast, right? 10.5 and yeah same thing. Okay, so hopefully that makes sense If you have any questions or really just want to know what all this stuff means google will be your friend And also desmos is a very Uh useful way of visually seeing how things work Anyways, let's actually get boosting. Okay, so we have all of this right here um Let's see Yeah, we also have the infinity fastest playtime, right? So we gotta actually start applying some of these boost now again This is gonna take a really long time. So yeah, this video is isn't gonna be the longest or the shortest, okay? That's just how it's going to be All right, so let's start with the first one. So normal dimensions actually wait We gotta actually buy them first, right? Right? Okay, uh Yeah, my apologies. We actually need to buy these upgrades first Anyways, I'm gonna create a method call avoid method called buy infinity upgrade It's gonna have an id on it Alrighty Um Okay, so basically we're just checking to see if Um, if it's unlocked first, okay So if it's unlocked first of all and infinity points, uh, let's create And the var down here var data equals game.data. So if data dots infinity points Okay, is greater than or equal than the cost. So our cost is Right here and up infinity upgrade costs Okay, remember, this is a list. So it's at index id All right So before we actually continue remember this is an infinity upgrade or an infinite upgrade right here So we're gonna be continuously buying these ones While these ones are all just single buy So This one's a little different. So we're gonna have to create something else up here But we're gonna stick with these ones first the first 16 the 17th upgrade we will do later on We're gonna short or shortly after this So if it is then we're going to unlock this so We have our bool list infinity upgrade bots. We're basically going to set that to true Yeah, it's a list. So we got to access that index i We're gonna set it to true All right, so now we want to subtract our points from the cost So we just do infinity data dot infinity points minus equals the cost Pretty easy Okay, so now we're gonna do this permanent upgrade here And we don't have a buy max yet. So we'll eventually get all that done yet later on once we Unlock this in the first place Um, okay, so if Oh, yeah, so we're gonna return this afterwards. Okay. So if id is equal to 16 remember it's zero base. So this is zero This is one. This is seven 16. Okay So if id is equal to 16 Okay And uh, so the cost what's this cost right here? We have our cost up here, right? so Uh, we need to make sure that 15 is unlocked before we can even start buying them so Okay, so if infinity upgrade 15, that's the very last one right here once again is unlocked Okay, and infinity points Is greater than or equal than Our cost which is our ip gain cost here Then we will simply just buy one of these Okay, so we want to subtract the cost first because remember our cost it affects No, our cost is based off of our level. So before changing the level We want to subtract the cost because the cost will change if we adjust like the level first So then we can finally add to our level right here Plus equals one. I don't know what's going to happen here in the future. But let's just protect that And we also want to return because we don't want to access this if statement down here Okay, and we can also invert this if statement here So basically I just add an actually let's just keep it as is All right, I don't want to confuse you guys All right, so now we have all of our upgrades Viable we can now start applying our boost. Okay, so let's start the first one Normal dimensions gain a multiplier based on time played. Well, that's really easy So if we go to our dimensions class and go to our dimensions product property here Again, the property is where it has the arrow here And a variable is where we don't Set it to something like this, right? So this is a property This is a field, right? Okay, if we made this into an arrow, this is now a property. Okay, but we don't need to do that So we need to go to our dimension production Right here and simply multiply it By our infinity manager here However, we don't have access to it yet So oops At the top here, we need to add in our infinity upgrade manager Okay, and we're just going to call this infinity upgrade manager with the lower case i So now we want to multiply this dimension production Let's go to the very end here Again, there's a lot of math here. So we actually want to apply it next to this to the left of this division right here So yeah, there's a lot going on here, but we simply just want to do infinity upgrade manager And multiply it by our infinity upgrade boost currently And that is zero. Okay So if you go here, we can honestly close that That's this one right here. Okay All right, so now we can keep going. So now our first upgrade or ID one, which is our second upgrade Increase the multiplier for buying 10 dimensions from 2 to 2.2. Okay. This one's pretty easy as well So let's see look we got to find our Um, I think this is a power here actually i'm gonna i'm gonna close this And scoot this forward here Or scoot that to the left so we have more space here Um, I think this one is a dimension production thing here. Maybe it's a dimension boost Yeah, it's a dimension boost right here. Okay, so in our dimension boost property We want to Have a question mark operator here. Okay. Now all we do here is also Uh currently Our levels are existing in here. Okay, so we just want to do infinity upgrade manager Dot uh, oops Where's our levels? Where's our levels? Oh, right. It's bot. I forgot. Okay So infinity upgrade manager dot infinity upgrade bot It index one. Okay And if it's bot then we're going to set this to 2.2 instead of two. Okay So basically just switching between two and two point two point two Alrighty third upgrade Uh, normal dimensions gain a multiplier based on time spent in current infinity. Okay This is the exact same thing as the very first upgrade. So we're just going to go to the end again Copy this upgrade here And replace zero with two This is getting pretty lengthy now. Okay. So a good way to kind of organize this is to uh, simply space things out Oh, yeah, this is a question mark operator So we can just uh do this right here So what I like to do is to press enter at the The multiplication here And just kind of clean things up a bit Okay, so I can clearly see that This is um If id is equal to one and this is if it's not right here Again organize it however you like but this will get pretty lengthy fast. Okay And eventually I might convert this into a method and just do times equals and six just because it'll look better Okay, so for now we're just going to leave it as this Um Alrighty you start with the fifth dimension unlocked. Okay, so this one's going to be a little tricky And this will also kind of save our lives when it comes to this So unlocked gets reset at certain places So we have Um, oh, yeah, we need our infinity manager actually Okay, so what we're going to do here is we need to Uh, so we our dimensions unlocked gets reset there and Oh, you start with the fifth dimension unlocked. Okay, so this is actually but we're we're not I thought Uh, let me try to figure this one out Okay, so what I'm going to do here is just simply set these uh first ones to unlocked. Okay I think that's just the only easy way around this So after we reset it We want to set, um Dimension unlocked equal to okay, so Oh, man, this is a little complicated So if game dot Okay, so let's see. This is the third upgrade infinity uh, man This isn't dimensions Game not dimensions Okay, I see what we're gonna do here. So game not dimensions dot infinity upgrade manager dot Uh Oh, yeah bot Okay, so I feel like I've been doing something wrong here Where is this uh upgrade? No, never mind. We're okay Uh, sorry Okay, so if third upgrade or the id3 upgrade has been bought Then we can start checking for these. Okay, and Uh, basically we set the first four to true So we're gonna create a for loop real quick for var is equal to zero Um, I is less than four and we're gonna add increment this by one okay, so And for dimensions unlocked at index I we're just gonna set them the true after we've bought this upgrade or yeah After we've bought in this upgrade Then we don't need to then we can just start setting the rest of them to true because that's really what happens Is that when you after you buy this upgrade you do dimension shift the first four dimensions are already Unlocked for you or the first five and six and seven and so on Okay, so now we need to check for each one of these so Four Okay, so dimensions unlocked Yeah, that's the fifth dimension So we basically check Oh, yeah, this one's also true as well. So might as well just set that to five. Okay, because this upgrade's already bought And also since we're gonna be typing this a lot, let's just add our infinity upgrade manager up top And we already have the name here so we can just copy and paste that here Um, so if in yeah infinity manager like that. Alrighty So now we're going to set our dimensions unlocked at index four and we're going to set that equal to infinity upgrade manager dot infinity upgrade bot and that is it index uh No, this is not four. So we have three seven eleven 15 So we have three Zero one two three Yeah, three and then we have seven here. So this will be seven Okay five six What am I trying to do here? Yeah, so this is first to fifth six seven eight. Okay Yeah, that sounds right No, that doesn't why am I over thinking I'm overthinking this Am I? Yeah, so this is the sixth dimension here. Okay, so upgrade to seven eleven and 15 Alrighty, that should be good And we can get rid of this here too. All right. So now we also need to grab this right here and copy and paste it into Where's dimension shift? Where's dimension shift? Right here, okay Easy enough All right, so we have all of these done Right here Oh, wait a minute. Oh, you start with uh the eighth dimension unlocked and a galaxy. Oh, so we get an extra perk here So you start with um a galaxy on infinity So you don't gain one from here, but you start with one Okay, cool. So now we know that if we have this upgrade we get uh An infinity or a galaxy so basically we're checking for the same thing upgrade 15 if it's unlocked Then we get one anti-matter galaxies. Otherwise we get zero Alrighty, so we have nine more to go. We're almost there So the first and eighth dimension Okay, so first and eighth gain a multiplier based on infinity stats second seventh third and sixth fourth and fifth This one is annoying This is just annoying Okay, we can do this. So we basically need to multiply more stuff here Okay, so this is upgrade So zero ones. Yeah, this is four right here So we're basically going to multiply this by four Um only if Id is equal to let's see. I think this is How do I do this? Oh, this is a one index. Okay. I see so if id is equal to the first dimension, so that's one Again, I kind of messed up this and the eighth dimension. Okay So we got to make sure if it's oh, yeah, I don't want to these right And we want to do this in a caution mark operator. Okay. Otherwise, this is false All right, I think I need to wrap this around like that. Yeah Okay, cool. So basically if it's the first dimension or the eighth dimension, then we're going to get this boost Okay And we do the same thing for this one this one and this one these four So this is second and seventh This is third and six and we got four fifth four and five And this boost is Uh, what id is this? This is four five Six seven eight nine. Okay. So this is id eight. This is id nine Alrighty, remember I'm getting this from this chart here four five eight nine Alrighty Ah man, we got the bottom three to do and we're done Okay, so decrease the number of dimensions needed for dimensional boost in galaxies by nine Okay So basically we get the cost for our Dimension ship cost right here. So let's see what how do we calculate this? Oh right here Uh, right here. Yeah, okay. So basically just subtract this by Um infinity Upgrade manager dot Uh bot Okay, and let's see. This is id. So we have zero four eight twelve. This is twelve right here Yeah, is that correct? zero Yeah, yeah Had a little brain fire for a second. Okay. So if this twelfth upgrade is bot Then we are just going to subtract this by nine otherwise. We're gonna leave as is Subtracted by zero What's wrong here? Oh Right Uh, we will do the same thing for here and honestly we can just Grab this right here Uh, let's see I kind of like it like this It will just put parentheses around this entire thing and then subtract it by this statement here Okay, next Um galaxy cost Let's see. Where's our galaxy cost right here. This one's pretty easy. We just subtract it by this same thing And except this is level. This is upgrade 13 I think we need parentheses around these. I am not positive Nope, we don't okay So now infinity point generation based on the fastest infinity So this one's a bit awkward. This one just kind of starts a timer And just keep keeps giving you them. Okay, so we're going to do this in infinity manager And we don't have any update methods in here. So we're going to create one public void update Okay, and we're going to create a timer and actually we might want to save this timer because of offline progress So public void big double infinity generation timer Okay, and we're basically just going to set this equal to zero I don't know what else to set to that Yeah, zero is fine. Um, okay. So now in here, we're just going to keep uh Incrementing this all right game dot Var data equals game dot data, right? So data dot infinity generation timer plus equals um Time dot delta time. Okay. Now we only want to do this if we've actually bought the upgrade Okay, so we want to check the usuals If infinity upgrade manager dot infinity upgrade bot and this is upgrade 14 Then we're going to keep adding this And honestly, we're going to put brackets here because there's our curly brace here because we got more stuff to do So now we need to check to see if this time is greater than Uh, the boost. Okay, which is this time right here So, uh, it's the same infinity upgrade manager dot currently Current boost and this is at index 14. So now if we go here Uh, it's this one right here. Perfect So basically it's going to increment by so if it's, uh, greater than Then we need to reset this timer back to zero oops Reset this timer back to zero and we also need to give ourselves some infinity points based off of this right here So we're going to do, um, infinity upgrade manager dot gain boost yep like that Cool. So now if let's see is this correct is this equation correct? Yeah, this boost right here two to the power of level that sounds correct So now we can also take this right here and find where we Um add our infinity points. Where is that? Right here we can now replace this one with this infinity upgrade manager dot, uh, ip gain boost perfect I believe we are done I think we're done get out of here I think let's see currently Oh, right. We don't really display some of this stuff, right? Okay, so we forgot the notation. So we're just going to do dot psi And this automatically adds The using extendables to the top if it doesn't make sure you add that namespace to the top And we also need to add an x right here because otherwise it's not showing a boost Um, I don't think there's anything else to do Yeah, I think we're girl set Um, this video is long already. So I might continue this in a part two Let's see. Let's let's just test this out first of all And if it doesn't work, then we're going to continue this on a part two because I'm honestly really tired And my head hurts. So I kind of want to take a break. I still got lots of stuff to do tonight. It's nine o'clock. Anyways, uh Yeah, all these upgrades here all right So one more thing we forgot to do is to automatically attach these Upgrades so what we can add here is a public game object Not a game controller A game object Uh, a game object, uh, infinity. I guess this will just be our infinity panel, I guess we can call it And on start we are going to Uh, create a for each var upgrades In infinity panel dot get, um, I think it's is a game object dot get components. Yeah get components Oh, I think it's get components in children. Yeah And we're going to set the type to infinity upgrade. So basically it's going to look for all the infinity upgrades that we have So and at the end we need to create a list Oh, you know, that's this right here right Uh, man, I forgot. So you see how we made this in array. We actually make this into a list Okay, my mistake It's because we need to add to this list and I don't want to manually drag those myself So now we can do infinity upgrade dot add upgrade Okay, so now we'll search for all the infinity upgrades that we have in infinity panel and we'll add it to our list And that is this panel right here That we're referring to. I think we have an error. Nope Cool. So now let's go to our upgrade manager drag game infinity panel, which is this right here We have our upgrades names. Oh, it doesn't look like it's saved. Why not? Why not? Uh, I think that's fine Okay Names cos bot I think that's all good. We also need to drag our upgrade managers to various locations such as our dimensions And I think we need to this. Oh, yeah, we have our infinity canvas, right? I forgot about that So here's our infinity canvas right here We're going to drag that into the infinity canvas and our upgrades right here Okay, so we need to finish this navigation. So we're going to replace this achievements right here with infinity And we have an upgrades button right here. So we're going to assign this upgrades button with infinity navigates and we're going to call this infinity Upgrades even though we won't really use it. So Uh, yeah, we'll just keep that Also, I want to add a mask to this panel because I don't want things to overhang So to do that I go to your scroll Oh, yeah, we don't even have a scroll wrecked yet. Oops So we're going to add a scroll wrecked an image and a mask We're going to set this math of this image to I'm going to go to rgb 0.0 to 255 Set this alpha to one Okay, so now you can't see anything here The content is panel and our viewport is scroll Okay And last but not least We forgot to add a button component So let's go to our infinity upgrade prefab so we can actually just click this arrow here And add a button component right here inside the prefab Okay, just click this right here and we'll just back out of it Okay, so now each of them have a button component even the prefab And we need to drag this infinity upgrade manager into here Uh and set this to Buy infinity upgrade. All right, so now we've got to manually Uh replace these okay, so remember we start from zero and we go to one two and so on so I'll see what I'm done All right, so I set them all so let's see infinite it would be infinite would be 16 This will be 15 and so on All right, what else do we have to do? I think that's it. I think that's worth to test So I'm gonna close infinity and replace it with dimensions save it and hopefully we won't get any errors Oh, yeah We have an index out of range Let's see. Where is this being caused? Oh right here Hmm interesting interesting. Why here though? Why out of all the places? I think it's because we don't define bot yet right here Okay, so nothing's being saved right now. So I guess we should do this now So everything here that we have to move to data. We need to do that real quick. Okay so Alrighty Now let's go to our data here And let's create a new section Our region right here. I should have been doing that earlier, but I haven't we're gonna call this infinity upgrades Okay, we're gonna copy and paste all these here Hashtag and region Okay And we also need to add this under here too, but get rid of all this public stuff Okay, and we're gonna get rid of this new right here because that won't do us any good And we're gonna replace this new bool list right here With a create list bool right here, which we already have here. So I'm just gonna copy and paste it And we already have this method here Okay Oh, yeah, we have a semi colon there And we're gonna set ip gain level to zero Okay, so now we're gonna get a bunch of red lines. Everything's gonna go mad because remember how we did infinity upgrade manager I'm sorry, but we got to replace some data, which is a good thing because it's shorter So, let me do that real quick. Oh, what's wrong here? Oh, this is game dot data, right That's okay All right. Oh, we got one more red Right here. I think this is game dot data. Yeah Okay, and on infinity manager I'm sorry replace everything with data All right And same thing in infinity upgrade manager. This is actually uh game dot data as well Okay, and let's just simply replace all of these Okay, cool. So now We need to check to see if this is null or not. Okay So how we do this is by I think I've done this in the past I don't remember if it was in this series or not But what I like to do in the start Um, I actually need to replace this with start infinity upgrades And I need to move this method into our dimensions actually our game controller. Let me reopen that Game controller Okay, and after we load we oh it's achievements. That's why we did it, right? So we're gonna do infinity upgrades upgrade manager Lowercase I Looks like we don't have it yet and then start infinity upgrades. Okay, so we need to add this manager into our script here So public infinity upgrade manager and we're gonna call it The same thing with lowercase. So let's go to our achievement manager So There's our star thing right here Remember this try catch thing I made here. I basically just made it so that Um, we can readjust the size of this List safely, right? So we're gonna do the same thing here, but we know we have 16 infinity upgrades There's no more than that. So we don't need to do any of this unnecessary Um stuff right here Okay, unless you're gonna add more upgrades and be sure to do the exact same thing here right here Okay, so now back to our upgrade manager at the very top Basically do we're gonna very basically just set that the temp just a random temporary variable equal to Bar data equals game dot data Data dot achievements. Oh, no, that's not right. We got to replace this so, um It's infinity upgrade bots And we're gonna set it to the count. So it's a Intenture variable here Now we don't do anything with it because we don't need to okay because we can still Produce an error by just setting a variable. Okay, if we get an error here, we're gonna catch it We're basically not gonna do anything with the error. We're just gonna ignore it And create a new uh boolean list right here size 16. Okay, so now that should solve this issue right here Because basically our array was just our list was just a size zero. We were never initializing it Oh man I forgot to drag something here I think it was in here. Yep our infinity upgrade manager Okay All right now it should work Oh man We're still getting errors Let me take a look Okay, so I see where this is coming from So it's actually trying to access the upgrade costs in the wrong place. So Where is this doing it set currently right here? Yeah, so The cost for 16 is actually a bit different because we're not using an infinity uh Upgrade cost here. So what I'm going to do here is um Make a question mark operator because we need to put parentheses around this first And basically if I is less than 16 then we can use this cost actually it's id Otherwise we need to use a different cost And that is the ip gain cost right here All right, so that should fix our final issue. Hopefully it's our final issue It's our 15 minutes of recording time and I've been doing this for like two hours Alrighty big crunch Oh, we don't have any infinity points Okay, everything looks great looks great so far But I'm just curious on why we didn't get any infinity points Uh, let me try that again actually Let's go here data 360 Okay, so we have zero infinity points I feel like that's a lie um That's a lie. There's no way I I think we haven't added our infinity points text yet. Okay. I think that's it I know we have infinite points. There's no way that would have went wrong Infinity points right here. So we're just going to copy this text. All right, so we have two texts We have one in the infinity tab and one at the top right corner so infinity manager We're going to add two tmp text. Yeah, so we do need this tm pro at some point Uh, we're going to call this ip actually it's going to be an array We're going to call this infinity points text excuse me And it's going to be a new tmp text size too because we only need to access it two times so let's see I'm just going to paste out there for now. So we're going to set Uh, the first text we don't need to do this in a four loop because it's kind of useless But we're going to set the first one equal to or they're going to be actually equal the same thing Okay, so we're going to have a dollar sign because we're going to be using string interpolation Pastes in here and replace this zero with a variable. It's a curly braces and this is um, let's actually put this under So we're going to do data dot infinity points Okay dot psi again, don't forget to add your using extendables namespace at the top And we're also going to set the first are the first one as well So at the zero and the first like that okay So let's go back to unity and drag into these texts Infinity manager Yeah, right there. Okay improvement points and I think it's an upgrades Yeah, right here upgrades But where is it? Where is our points? It's infinity somewhere. Is this it? All right, it is okay. So this one's improvement points Oh infinity points not improvement points not crypto clickers you goof All right, so make sure you check both of your infinity points text into those into those boxes All right, there we go. You have our infinity points here Now the thing here is that we want to change the sign to zero because we are In anti-marrow dimensions, we only see one decimal Okay, so that will fix itself afterwards. All right, so let's just start trying to get these upgrades, right? So this should multiply itself Cool It looks like it's not multiplying itself though Maybe you just can't see it It's stacked so we don't have any infinities right now. I really need add stats page So yeah, this this seems wrong Because we also have achievements right here So that's not good All right, let's go take a look So I see we actually do this in dimension production. However, I'm still not really sure why it's not working Or why we're not even getting any more uh anti-matter because it should be More than what we previously get And obviously we're getting this boost. We're seeing it right here. So I'm really curious on why Oh, let's see. What is this id here? So this is the first dimension. I think it's because we have some Boost Let me let me investigate more Right, okay Actually, am I am I blind? Oh, I see. I'm blind. It's a 0.1 right here. Duh All right, so Alrighty, that's my mistake. I'm stupid. Okay. So anyways, we're going to copy and paste these all all these infinity upgrades right here Because right now it's only applying to this one right here. So if you buy this one, you'll see the effect occur However, we want it to happen to the first dimension too because right now it's not So I'm going to kind of clean things up again and I'll show you what will look like afterwards Okay, so now what I'm going to do here is I'm going to put parentheses around all of this Okay, this entire statement here and I'm going to multiply all of it by all of our upgrades. Obviously, this doesn't look good So let me fix that Like that, okay, and now if we play our game, it should be good Cool. It looks like it's working now However, it looks like it's applying the boost regardless if we have it or not Uh, okay Uh, so one thing here We need to make sure this is even unlocked first of all, okay, so at the beginning of this we're just going to put uh infinity upgrade unlocked at index id or our argument is id And question mark if it's unlocked and then we will put it there. If not, then we're going to set the boost as one Okay, and we're going to do that for all of them Okay, because we kind of don't want that to boost for free. We want to upgrade Uh, we want to buy the upgrade first Alrighty and actually I just realized instead of actually having all these question mark operators because that's kind of messy, I guess we can just do if um If it's not unlocked yet, then we're just going to return one, right We only need to do it for once because if you saw It'll have the same id, right? So that's kind of just pointless so we can just add it once to the very top Okay, so we don't need to check for any of these equations or we need to actually apply any of these equations Unless it's unlocked And it now it should work properly. Okay, so we're getting 3.2 seconds. So that is Oh Okay That's not good So it looks like it's working for that one, but why not this one? So it's still applying a boost. You see 1.5 times So let's see one point times times 2.2 3.3. Yeah, it looks like it's using this boost, which is off, which is very weird Uh, I'm gonna do some more investigating then Okay, so I see the issue already. It's not unlocked, right? It's actually bought I did another oopsie. I've done this a few times already today. I think So we want to check to see if we've bought the upgrade not unlock it that yeah, I get I get those two looped all the time Alrighty Oh man, what's wrong here now? index out of range right here Well You see here see what's wrong here interesting Um, okay, I think we have to do id minus one. That's my guess Okay, so once again, this is occurring in the 16, right? So we want to make sure this is not 16 Actually, I'm surprised I 16 is calling this Is that currently I see no well description text um Okay The currently is this but this is different Okay, so what I'm gonna do here Is if Id is equal to 16 because right now it's like it's gonna be one zero, I think And we're gonna get some other errors too at some point Uh, so if id is equal to 16, then we need to return this this boost right here So we're simply just gonna return this boost. Okay, and now we shouldn't have issues here. I promise Okay Ah man, it's still not applying the right boost Okay, and I see the issue here. So also, it's kind of cool I think this is a bug but you can look at see how this kind of like expands itself when I check this It's kind of cool, but you see when I buy this upgrade this third one right here See how it kind of just switches. It's because while I'm I I'd made another oopsie The thing is that it's if it's uh, if it's bought it's going to return one So we need to do it the other way if it's not bought then we will return one Okay, and this should all fix our issue And we can live happily ever after Okay, that looks correct. So now we can do 1.5 times 1.82 And we should get 2.73. Yeah Sweet. So now Yeah, I can't buy these upgrades, but Uh, yeah, I think that's what the purple and red is purples. We can buy it right as we can. I think I think that's what they are But yeah, so now this should be applied And everything should be beautiful. I think that's Okay, so 3.3 times 1.85 Divide by 10 Oh, no. Yeah, that's about six per second. Right? Yeah, that's right Alrighty guys, um I would test so let's actually test actually I think that's the smart thing to do So let's test these first before I end the video So we start with the fifth dimension, right? So we should get the fifth one After we do a shift. So let's let's get there So now we start the fifth awesome. So we know those work. These will all work and you start the galaxy So that will happen after an infinity Okay, so let's see If we keep buying these ones. Oh, that's that's not right. It's that one's unlocking this one Okay, so they're clearly unlocking the wrong ones and infinities that I think that's based on infinities, right? Yeah, okay, cool So Man, it's not doing the right ones Okay, that's not good It's this right here. Okay, so it's something related to this And I don't think it's minus four So let's see. So eight Let's say for example eight seven six five I don't know why it's like this one unlocked this one zero one two three four I don't know that's really weird Okay, so it looks like some of our stuff is incorrect So you see this is like flip-flopped This one is two Infinity point generation based on the fastest infinity right here These are also flipped and this is why this we're getting like a bunch of infinity right now So we have lots of stuff we need to fix Um, first, let's start with this one right here. So the fastest playtime It's clearly a massive number. I think that's what that is The fastest number. Okay. That's that's not supposed to be that fast. I don't know why it's set to zero Uh, okay, so let's just gonna set it to Uh, that's not correct Okay Um, we just need to reformat this So let's see. This is upgrade 14, right? So we need to go to our infinity upgrade manager and fix that And this one we really want to set by ourselves So actually we're gonna we're gonna move this one under k16 Just so we can manage this one ourselves all righty And instead of this being x and scientific notation We need to format this as a time So i'm really lazy to write out days minutes all that all that stuff So i'm just going to do time span not from seconds instead and then do what I usually do From seconds And that is uh formatted in his uh, I'll show you how I formatted it I'm missing a system dot time span. Yeah, so make sure you add system dot time span at the very top And we need to what's wrong here? Oh, yeah I think we need to convert this to double Yeah, we need to convert cast as a double, okay And now outside of this we need to do colon d backslash backslash colon h And then the same thing for m And s double m Okay, so now this will format our time as this like that Okay, oh, yeah, this is supposed to be i as well. What come on Okay Oh, man I'm gonna do an infinity real quick See what's our fastest play time now? Okay, that looks that looks better um So yeah, these some of these are just flopped. I don't I really don't know what we're wrong here Because this is let's check this out Zero oh, maybe it's the way I formatted these upgrades actually now that I think about it zero one two three four Oh, wait, why are some of these flipped? How did that happen? How did that even happen? Okay, so I guess it's nothing wrong with our code. First of all, that's good I'll have to troubleshoot that But I guess some of these just got flipped I don't know how so this is up not upgrade nine So this is like why did what even happened here? So yeah, make sure you pay attention to that Because that stuff could always like, uh Catch you by surprise Yeah, I don't know why some of these just got flipped. I don't remember that ever happening Here you go. This should be the correct order. Anyways, I'm gonna fix these. I'll bear back Oh, yeah, but don't forget to fix the ids too. These ones right here in the name So you don't get confused Oh, wait, you don't have to fix the ids. They were just mispositioned. Okay, that's good. Luckily, I didn't mess up with anything else Okay So I want to test these upgrades. So let's go to our, uh, let's just Let's just get rid of all these This looks very weird Okay So now one Yeah, we can start buying away Cool Just start buying in a random order Beautiful and we can't buy any of these yet, which is nice. Oh index out of range. That's not good. Oh, no Oh, no Oh, no Oh, no Oh, no Oh, no Okay, what's wrong with this one? Unlocked. Okay. I see unlocked. I meant to put bot here. Okay. So again, it's the data Uh, infinity upgrade bot at index 15 Yeah, that's correct. Okay. So that will fix that issue Why can't oh, I can buy it now. Sweet. So now we gain more Infinity Okay, but it's still showing up as as white. I don't like that Let's fix this text here Oh, yeah, the cost isn't in scientific notation. So let's fix that ids. Oh, yeah Um, sorry, it's game. No, it's just it's just dot psi I forgot because we have the dot x we have the extendable methods Yay Which is this right here the extendable is named class our hero um Okay, so why is this white? And Because we can't afford it Oh, I see it's white. Okay So we want to make sure we can actually Show it's gray if we can't afford it because that's how we do it anti-matter dimensions And Let's see. Where is this right here? Yeah Bracelet copy paste this cost thing right here. So If uh upgrade 15 is bought and We can afford the cost of infinity points is greater than the ip gain cost Then we're gonna set to white And also we got some error here when I couldn't afford it, which is looks like it's right here line 21 22 Um by infinity upgrade Oh, I see I see it's because we couldn't afford it. So it just skipped right away. Okay, so we want to make sure to Separate these two if statements to prevent future errors Uh, okay, and Basically, we're just gonna wrap this with this if statements Okay, so basically just splitting these into different if statements. Okay, so if it's id 916 And then if we can buy it we'll just buy it and then no matter what No matter what if it's 16 if you can or can't buy it, then we're just gonna return it. Okay. That will prevent our uh index out of range exception anyways We're finally done with infinity upgrades. Yes. It's a milestone um Oh, wait a minute I think we forgot some things Anti-matter galaxies are twice as effective Okay, well, I guess we forgot that one Okay, that's easy. So let's go to our dimensions Uh script right here And I think we have a galaxy boost somewhere Right here. So I know we have our galaxies here, but let's find where this boost exists Oh, man, are these galaxies really not doing anything? Oh, this is a tick speed right I forgot This is a tick speed boost What does it mean by twice as effective? Is that like actually what it is? I kind of forgot Tick speed anti matter galaxies Okay So I'm guessing in here In this equation here in this tick speed equation We multiply this by two if we've bought in this upgrade That's I'm get that's my best guess How did I miss this upgrade though? Like how did I miss that? Oh, I must have thought oh I see what we did here We accidentally made dimension shifts two times effective Okay So let's find that in our dimension boost property Uh, maybe I didn't I don't know where did I did I do something with that? I don't how did I miss that? There's no way I've missed that I okay, I guess I did Um Anyways back to our tick speed We need to do uh multiple multiply this by Uh, yeah, we need to do this in in parentheses as well data dot infinity upgrades bought at index, which one is this? We have eight 12 13 so this is upgrade 13 right here And if it we've bought it then we're gonna multiply by two if not one and I also another way we can find it is by finding it Our cost Subtracted by nine. Oh, so that's probably why I thought okay, so this is actually upgrade 12 Okay, so that's my apologies. This is upgrade 12 Not this 13 Alrighty I think we're all set now Anyways, that was a really long complex episode. I'm hopefully I didn't tire you guys out completely And I hope you that all made sense if it didn't let me know in the comments below your comments Your questions all that good stuff Whoo, this was quite a lot and we finally got it done I'm very proud of what we've made so far Anyway, guys if you enjoyed this video make sure you smash the like button comment What have you like for suggestions questions all that good stuff? And so we're out of my channel if you're new and Charles notifications for future live streams and videos Thank you very much for watching this video if you've watched this entire video You are a hero. You are a hero to cryptic ground channel. You're you are here to help this channel grow Anyways, I'll catch you guys in the next one