 Hello guys Crypto grounds here welcome back to another adult game tutorial video this up. This is episode 25 and today We're gonna be doing upgrades for our second planet now Your game may be different or maybe the same as mine But if you have upgrades, and I'm sure you know what to do But basically we're just gonna have a few upgrades such as production and the click of course just down to our basic So they should pretty a pretty self-explanatory video. Maybe we're gonna do some other things too Next episode will be soft cap. So since this is like a multiplicative thing. We need to have that soft cap All right, so let's get rid of our planet screen. All right, so we have our Mars and we're gonna have some upgrades So let's copy our upgrades button from Earth paste it into here And I'm just gonna put it right here and now our Upgrade screen. Let's see. What does that look like? Can we copy and paste this? Yeah, we can Okay, so we'll just do that so I just copied and pasted the The upgrade screen and we'll go off of that. So we only need one upgrade I'm gonna move this out and stretch this to if it's the whole screen because we need to be consistent with that Okay Now I'm not gonna make another script. Obviously, I mean we have we didn't do that for the main the main game manager So we'll do that in Mars So What we can do is that we can have like a little scroll right or actually, you know what? Let's do pop-up We haven't done any pop-ups yet So I'm gonna create new empty I'm gonna name it upgrades game object. Okay, let's add an image Now you can use whatever image you'd like. I'm just gonna use this one that I already have It's gonna make so you can see the Mars coin and I'm just gonna make it anchor to the center Put our upgrade in here So I don't think I've showed you how to use a scroller act. So we're gonna do that. Oh, yeah Yeah, the planet screen duh, and if you actually let's just create a new one. Okay, so we're gonna go to UI and I think we use scroll view Okay, so we have our scroll view here But we don't need an image. So let's get rid of that. Let's make sure it's stretched to the full thing actually Since we don't want the upgrades to crop out of this. It's our mask We're just gonna move it up to there up to this little Line right there Okay, I'm gonna get rid of our scroll bars unless you want them you can keep them by personally don't like the scroll bars We can get rid of this viewport Get rid of this mask It can just be an empty game object So make sure you have a viewport and our content. Okay, and that last about least we just need to Add a mask here. So then any of our contents Which we're gonna drive this upgrade into the content need to have 0101 alpha Just a little bit Unless we have a transparent image. Oh, I don't know the solution But now it will it won't move out see how it kind of cuts it off right there instead of all the way up there, you know cool So our viewport is here We have a viewport and content we don't need we don't need this viewport We just need content and then our our viewport becomes our scroll view. There we go And that should still work, right? Yep Perfect, it's just less less stuff It's for some reason unity makes a little more complicated than it should be and in our scroll rex We only want vertical Scroll so we can go up and down and we can just have a list here Cool So what's one of our upgrades? It's just gonna be the multiply. Obviously. It's not gonna be too much So we will call this We cannot should we do prefabs just like our achievements. I think we should So we're gonna do Mars upgrade Okay, this is our By max everything is the same except we're just gonna do this a little better and more appropriately than the first time we did this Great, okay, and then we have our progress bar All right now we're in Mars, so let's make this more red like that Cool so Let's stretch this to the edge upgrade button like this Skinnier Now let's call this Click power plus zero point zero one and this will cost. What was it before? level so personally, we don't need We don't need to display level Okay, or what we can do is have this as the level right here Okay, so our cost will be one there. It'll be it'll be 10 Mars coins Okay, and I feel like this will work out. Well, because we're gonna scale this a bit differently Then our normal upgrades because it's again multiplicative And next episode will be soft cap So that's basically where you don't want your progress to go insane, especially in our situation Why does that stretch? cool Okay, and our by max can go right here Now we can do a by max for all of them if you wanted to so before we resize this, you know what actually Let's do by max for all So this will not be in our scroll view This will be simply on top and then this button will cover only The progress bar. Oh, nope The upgrade will Sorry, the only cover these two and we will just drag those in here And move it down So then let's make our scroll view Right here. Okay So this will be a kind of our by max area Put that up here. Cool. So now it won't go out. This looks awkward. You can add a little tab thing But that's up to you. I'm not gonna do anything about that. I'm just gonna let it be Okay So Let's do another. Oh, yeah prefabs Okay, so we already have an achievement prefab. So we have our Mars upgrade prefab We're just gonna drag that into a prefabs folder. There we go Now the cool thing about prefabs is that you can change all of them at the same time So if you change the position of this, it will change all of them and then you can read just that All right. So if you change this If you change this Like that, see how it changes that So now if we copy and paste this and we go into here Even if we go into here, it's the same prefab, right? So if we Adjust the size of this And go back it will change the size of both of them. I think that's pretty cool. It's convenient So now I gotta go back and fix that. Okay Uh All right, we can copy and paste this and the nice thing is that we can change the text here Individually so if we want to resize this go ahead, we can do that But once we make changes to this one. So if we do this and we go in here We made changes to this Oh, that didn't do anything Yeah, that didn't do anything. We can't move these outwards. Crap. I didn't want to do that Okay, well, I'm stupid. You can't undo in a prefab, which is lame That's that's yeah, that's once you go out of it. You can't undo it. So I'm gonna I'm gonna unpack this prefab real quick because I made a big I made a big mistake. Okay, so now let's make this prefab again Okay, let's not do that again Okay, in that situation just make a new prefab Okay So this what this upgrade can be Gain 0.01 percent of your mars Coins per second Okay We'll do this one. This will be a production one. I think this will be a little more pricey since we can get higher higher up And what I'm gonna try to do eventually is that I mean we're using break and finny So we shouldn't fear of anything at all, but I'm gonna have like a little upgrade thing This this is again, this will be the soft cap. I'm gonna have like Uh A limit thing so something that's really cool about Uh A game called synergism is that They have like a tax thing where if you're making like, you know, you're growing so fast. They tax you which is basically the soft cap That's that's pretty much what it is. So we're gonna do something like that. Okay Uh, okay, let's hop right into the upgrades. I think these are the only two I'm gonna do today because I am kind of short on time and I got a game to work on Um, so let's just hop into our mars script. All right, so we're in our script. It's pretty plain right now But we're gonna code everything in here that we plan to Save okay Uh, so we're gonna do the same thing. I think we did this in I don't know what script we did this in But we're gonna make sure we did this efficiently. Okay. I'm gonna zoom in because I people complain about how the text is really small Close that a little bit Okay, hopefully that's a little better to read Always add I don't want an update. Okay, so we're gonna make I'm gonna scoot this forward Okay, all right, so we're gonna make two Arrays also the reason why am I typing so bad is because I switch between two keyboards every few days And this one it's a Corsair keyboard. They're both Corsair, right? But they're just different like this is I swear, I got the same cherry mx keys, but they both feel so different, right? Listen, the other one's better in my opinion. I can type way better there than I can with this one I always have so many problems typing Coding here because there's just two different keyboards. So that's kind of why I'm really inconsistent. I guess So this will be our mars upgrade costs And we're gonna make another big double. Actually, no, this is gonna be an int into ray mars upgrade levels okay And in our we're going to make a private void start In here, we're going to set our costs equal to a new big double two And our levels is going to be a new int Size two, okay, so we're going to be doing the same thing here About or below all this we're going to have a private array manager It's a private void And down here, we're going to have a public or a private void non array manager Because in our player data script, we're going to create variables for this. Okay So let's do that. Let's go hop into our player data script and go into mars and Let's have our upgrade. So let's make a new sub region Cod mars upgrades In region And in here, we're going to have public big double mars upgrade cost one We're gonna do it two And then we're going to do it the same thing for levels because I make these an int Okay Just like that and then in mars in the full reset We're going to do Actually, we don't need it. We don't need to save costs never scratch that I forgot We're going to make another sub region called mars upgrade in here We only need to save level Okay And in here We do this Get rid of these Okay, we're going to set them both to zero And now we have our save system set So the reason why I don't want to do this is because we set the cost in here in our array manager So let's do this real quick. So we know the first upgrade cost is 10 And scaling it is going to be quite tricky because again, this is multiplicative So we're going to scale things a little more severely. So We can do big double dot pow And I'd say we should double this maybe more but again soft cap will solve this issue later on Especially when the second upgrade comes in the place, we're going to have to scale that a lot Because 0.01% may not seem a lot, but if it's really cheap and again, that's exponential growth essentially And yeah that remember this is exponential growth right here You're getting 0.01% of your mark Your current coins per second Okay Now I can I should do Where it yeah, I mean, it's pretty much the same as this, but it's just auto clicking really fast Every frame So then in here we do mars upgrade levels And before we do the cost we want to set levels zero equal to ETH dot data Oh Sorry, it's game dot data Game dot data Mars upgrade level one And we do the same thing for the second the first index Okay Same thing for our next upgrade Except this is going to grow a lot faster I'd say Again, we'll adjust how this We'll adjust this so I'm going to make the scale every or it's going to multiply it five times every upgrade So the next will go 100 500 2500 So on And now in the non-array manager every time we buy an upgrade we have to update the array or the save Like that It's because when we do the upgrades we do it based on the array and if it changes the array it's not going to be affecting the level in the player data instead the player data is going to just re-overwrite the array Okay, now, of course, we can do it upgrade based on the non-array But however, it's not it's better to do it like this I have dinner in three five minutes. So this is going to be a little cut Okay, so now we need to do our public void buy upgrade And this is going to be an int index Also, we don't have any of the ui yet. I'll do that next after we get the fundamentals done So in here, this is pretty easy. We just do if Game dot data dot mars coins Also in here, we can do var data equals Game dot data and just get rid of these games Okay Also, I forgot we can just get rid of the power Because we have our static break infinity up a double namespace Okay, so if the coins is greater than upgrade costs at index Then we simply subtract them And then we get our levels Add index and we add it to one and then at the end of this we want to update our non arrays Simple as that. We don't need any switch statements. Just this right and now for our buy max public void buy max We just have to go through a for loop Uh, actually I forgot we got to calculate the costs. Okay, so this is the same thing as what we do here Isn't it an upgrade manager or is it in here? Oh, wait, do we have an upgrade to manager? I totally forgot. I'm making that Wait, automator. What's this? No, that's not in here Upgrade manager. I forgot that we even have an upgrade manager. Okay I mean we can use this It's the same equation Oh, it uses this instead. Okay. Well, we could we should make a pretty global method for this In our methods, um in our methods script, let's do that Let's go to our methods. Okay, so we have our Buy max Oh, okay That's an issue Okay Well, this is based off of here. So let's just this is based off of our Mars So we're gonna do buy max and this is gonna be our buy max count Okay So we have our int index We have our so the upgrade now This is obviously just gonna be our upgrade costs. All right We can just do big double array And just do cost and then we just put in this as a cost like that All right Oh this cost All right So we cannot we can do it like this and put it in our methods, right? Should we do that? Why not And we have our cost molds. So that's something we also need to Kind of be aware of so we're gonna make another floats. I can get rid of this comment We can make another one cost cost molds Costs molt And we don't need Oh base costs we do. Yeah, this is the same thing. Okay So this will be base costs. So we got two more arrays In here these are gonna be predefined Uh New this will be a new floats. Let's see. What's our cost molds here? Two and five Two and five Okay, and in here Our base costs are going to be 10 and 100 now we can adjust this whenever we want to Oh, this is cost Right Okay should look like this right now, right Okay, so we can do cost molds So what is this supposed to be? Can this be a float we're gonna do it we're gonna do a float array molt We're gonna do Or what we can end what we can do here is replace these costs right here. So this can be b Oh, this is base costs. So this is b Okay, we can get rid of that We have r which is our cost molds. So that will be r and get rid of that And then k that's an int. So into array k Get rid of that So now we should get some Oh, yeah So it's based on the index right So we gotta remember that so this levels So what is this k? Yeah, I did really bad abbreviation here. So this should just be l. I don't know why I did these But this should be l Yeah, we'll just keep it as k But this is basically a ref int k Because we need to act or directly edit our bimet or a level So do k plus int n which this is already an int so we can just actually know we need to we need to cast it In our power So we can get rid of the power And our mars coins, uh, we can do currency if we want to put this in the methods We're just going to do currency. So this will be c for currency And look, we already have that right here. So make sure this is a ref So we can get rid of that and we will do c minus equals cost There we go. So and then the non array manager Okay, so not every single Method is going to have this so we're going to have our own Okay, so just watch this is going to look confusing at first but just Follow along. So here we're going to move this to our methods scripts at the bottom here Uh data game about data Um, we can get rid of this Okay, this should be it for the by max and now in here we're going to call methods dot by max by max Is it a private? Is that why I can't access it? No, okay, so we have by max And we need to put all of our stuff in here. So we need our Uh, this will run on a for loop. Remember that So we're going to start with the first one And we need our our currency which is going to be game dot data dot Mars coins No, we need to make this a ref ref And then we have our base cost which is going to be base cost at Zero index zero And then we have our Molt which is r Again, these are terrible names. Please change them as you wish. They're terrible. I don't know why I came up with them Hopefully don't confuse you And make sure k which is our levels is our ref as well Cannot access and okay, all right, we got to make this a static void Okay Cool. So this is our by max okay So first it's going to buy the first upgrade and then it's going to try the first the The second upgrade which is index one Just like that. All right. I have to dinner. I'll be back after this cut All right, I am back. Let's get back to this. So we have our by max, but we still need to do the by max count Actually, let's go to our interface So the by max, I'm not going to include this counter here. It's just gonna be a by max So we'll just get rid of this. So that means we really don't need this counter at all Okay So we can get rid of this and if we want to include in the methods then it's pretty much doing the same thing as this but Replacing the variables and also we don't need looks like we don't need this index here In some cases if we use the right here, we could use it But we don't need that so we can just get rid of this and also this could just be used like I know But we have our index right here. All right So now it'll buy max zero and then one. Okay, so start from top to bottom. You can arrange the order however you'd like Okay All right. Also, we should probably just run this twice actually Not array. No, we don't need to do that. We don't need to do that cool All right, another thing here We can uh Clean this up a bit. I've done this already in the past, but we can use our arrays and like so we did in our normal upgrade manager Just like that just to make it look clean. Okay Okay, cool. So I think this is all done. We just need to actually it's not done. We just need to do this So this will ease. This is a pretty easy one. This is just 0.01 times levels at index zero And we can get rid of the parentheses. So every level is another plus 0.01 effect Okay so All right Also, remember once this cost molt gets to just remember The coins is doubling each time each click, right? That's pretty fast So we kind of just want this. This is why the soft cap is going to be very important the next video, which will be tomorrow morning Also, I am side notes I am publishing my videos on a kind of a schedule almost on a daily basis at 6 30 in the morning and mountain time So I'm not sure what time it is for you What time that is for you, but just know that these videos are premiered at 6 30 in the morning mountain time Okay So if you want are interested in tuning into those I personally am not really watching those because I don't get up at 6 30 in the morning That's just what most of my viewers are pretty much active Which is kind of strange but Uh, yeah, just that just a heads up All right, and now in the updates we're going to do data dot mars coins plus equals Uh upgrade levels at index one So 0.01 So remember if we do one percent that is basically one one hundredth. So 0.1 Percent is your point or one over a thousand And then we have one over 10,000. Okay. So this upgrade may not seem good at first. We can adjust this to one percent or Point one percent, but just know that 0.01 percent is one over 10,000. Okay so, uh You can just do it like this or you can just have it in decimal form either it works. Okay Now let's just do it decimal form So, no, this is just one point zero one percent. Okay How do you know just do times a hundred and you get zero point zero one, which that's the percent cool, uh Okay, so mars coins. We are just going to multiply it by One plus this Okay And we can actually add it all we can also add a If If this level is greater than zero, then we're going to do this Okay Now let's add the user interface. So we got two texts Which we're just going to do a text array and this will be the Mar, we honestly don't need to have mars for all of these. We can just do upgrade text Okay, and what else do we have? I think we just have the products bar and that's it Yep, that's it. Okay, and a lot of ray for the public image upgrade fill And remember we have a smooth for this. So how do we do the smooth? Well, let's go back to our main script We have a temporary value in order to successfully do this right here So we have coins temps or coin or coins temp. So We're just going to copy this method here So we got methods dot smooth number now the coins temp. We can easily just do Public big double public big double actually we can make this private because we don't really need to access this anywhere else So private big double Mars Coins temp And now this will be accessed only in this script or in this class And we can do the same thing for that and the actual value is data dot Mars coins So here we go. We got our smooth number ready And this only needs to be accessed in the UI, which we will do once we're done Okay So, uh, we don't need to pre-define this because we will do that in unity So we're gonna set we're gonna do Upgrade text at index zero Let's see now we can do. Oh, why is unity doing this? This is very annoying Okay, so let's do a string of the Upgrade names let's go up here We're gonna create a public string and this can be private as well private string Honestly, these can all be private, but I want to be able to see these Inside the editor in case we want to edit those. So that's the only reason why I would keep those public otherwise they could be private. So anyways private string array. This will be upgrade names And we're gonna set upgrade names Is equal to a new Uh, we don't have to put string because we're obviously putting strings in here So the nose is a string, right? So we got click power plus plus 0.01 x yep And then for our second string we have gain plus 0.01 percent of your Mars Coins Per second now I'm just gonna have it like that instead of slash s because it made a scene like Of our current like 0.01 percent of our current Mars per second Mars quartz per second. So we're just going to do it like that And that's it. So now we can run this in a for loop So we could just do four var i is equal to zero and we're going to cap it at two So we'll never hit two because we only have two upgrades And so that means the max array is one and we don't want to go to two So we could just set upgrade text at index i Dot text is going to be equal to so we have our level right here So we can just do that and inside here we could put curly braces And then we'll just do our levels at index i Okay, and then we're going to space We have our upgrade names. So we just put that in here and do a new line, which is back slash n And then we'll have our cost And that'll be at mars coins Now let's do did I do is it game not notate? Where is it methods dot notate? Notation method yet, okay And in here Okay, so that's our y and for here We just put the cost The mars upgrade costs At index i and that's it Also We need to We also need to do our fill. So this will be methods dot big double fill And for our first variable it's going to be So we have our so we have two We have two fills. So we have our actual fill and our smooth fill Our smooth fill So our upgrade fill is just going to be data dot mars coins, right? That's our actual that that's our x Our y is going to be Data dot or it's not data. It's just cost upgrade mars upgrade costs at index i And then for the fill we need to do ref Smooth not smooth fill our upgrade fill at index i And now we need to do the same thing except for Except with mars coins temp And we have our smooth fill at index i That's it. That's our entire ui. There's our buy upgrade method our buy max Our array manager Oh, yeah, we might want to call array manager inside the update method So what we're missing is our navigation So we can easily let's see. What's what's the Ui here right here? This is all ui right here, right So here we can just do if game dot nav nav nav nav nav nav nav Uh, yeah for our navigations and then the script because I forgot to separate it, but we're gonna do game dot mars Oh wait, okay So let's check how this navigation is So we don't have a change tab. So let's just get this Let's grab this real quick So let's get our Okay, so let's copy that Let's put it here So now these aren't the correct groups, right? So right now we have our upgrades group. So we can just make a new one Then pretty much our upgrades is our pop-up So we can toggle everything off in the background, but we really don't need to do that So our disable all really we don't have one yet because there's no like prestige in here So we're gonna put none yet. So that means you don't have to do to type this in yet But right now we only have an upgrades. So we only want to um Toggle this But to close it, okay, so this is different because this is this is a pop-up, right? So let's actually do public void Toggle pop up And then a string id Again, we're gonna need this eventually. So let's just comment this out for now And we can take this right here So let's say we have our upgrades, right? We're just gonna set let's create this group real quick before I forget At the top public Is a canvas we can do canvas or not It's just gonna be a game object because we're not gonna create a whole new Let's canvas I can't decide so this is gonna be our upgrades group Now this is just our pop-up. So we're gonna set this set active is gonna be um not Upgrades dot game object dot active self. So basically if it's true, then we're gonna make it false Okay, that is pretty much it Now this is just for our pop-ups. We might not have pop-ups for everything like for prestige We might or maybe not. We'll have a separate tab what we will see. Okay Uh So we have our we have this so that means we can go up here and we can do If upgrade group dot game object dot active self if it's true But since it's the ui. Okay. Yeah, we'll just do this So if it's false If we don't see it, then we're just gonna return otherwise we will return the ui. Let's make a void ui method And the road all in here So then we can close this And call ui at the top. Okay Just like that What's the problem here? Oh Right. Yeah, we want to put this at the top. Cool. That's it We have our user interface, which is updated only if the upgrades group is enabled. Otherwise it will return Cool. I think we have our entire script on Okay, let's get it to it So another thing I forgot about the prefabs is that we still got to drag everything right So let's make a script. Let's go into here. We can take our mars upgrade and let's make a custom script So we can do mars upgrade Actually So now we don't have you okay I'm just not gonna do it The reason why is because we already have our array system all set up and now it kind of required me to kind of redo that And we already have that so that's okay It's all good So let's go to our mars script wherever it is right here And we will drag our upgrades group, which is It's not really an upgrade screen This is just kind of like the pop-up Sure that works too. We also need a back button. So A by max and we can have a close for close window And in here we will do close Okay And we'll put it right next right there cool So this by max, okay. Yeah, we will sign all this stuff Next So mars manager our upgrades the thing is just going to be upgrade screen In our ui right here. We have two upgrades. So we're just going to make the size two Okay So we have our upgrade text what even is the upgrade text that's supposed to be the upgrade name Yeah, that's just supposed to be the upgrade. I kind of that was kind of a vague name But we will do it with it. We'll do with it Okay, so we have our first upgrade our second one. We have our smooth smooth Yep And our background actually is this it? Nope. That's not it The progress bar is this Yep Okay And now we need to assign the buttons so The upgrade button We will drag our mars manager into here We will do by upgrade This will be zero and this will be one cool So what about By max by max the same thing we got to drag mars manager and assign by max Now I think we're done. Actually, we need we need to close We need to do close and the upgrades button. So let's drag bars manager And we'll do toggle pop-up Okay, and this will be labeled as upgrades cool Now if we save it we can close this Let's run it. All right. No error so far What's wrong? I think it's because we're supposed to be in earth. Yep. All right. So we're in plan It's currently let's go to mars Nothing's clicking. That's not good Okay, I see the issue the issue here is that we are for the ui Our mars coins tech is a text is updating only when the upgrade panel is open So if we upgrade uh, if we do this to see how we're getting mars coins now Okay, so let's fix that and why does that not say mars coins? I thought I made it so it said mars coins should say mars coins Yeah, like that and for here We can just update this ui if if game dot Mars or planets. Where is this? Is this is this a planet manager, right? There's a planet manager. Okay. Do I have access to this? planets dot mars, okay, we'll just do game dot planets on mars Dot game object dot active self I hate that Set active and active self I don't like that. I wish it was just dot active. So if it's active Well, I like the invert method where if it's not active No, we don't we can't do this anymore Okay, I forgot because we have another Thing down here. So we got to get rid of this This only works if it's the last method and the entire thing or else the rest of won't the rest of the ui won't updates So we can do it here though because that's at the bottom of the the Why did I put this here? I am not paying attention. We can do this here since it's at the bottom of the method, right? I don't know what i'm doing. I am just like lost right now Cool, so that works We can get or we can just put all of this in this method and we should be good to go All right, so good thing. We haven't got any error so far or no reference stuff like that We're good Oh, that's weird. That's doesn't look good. I don't remember making it look like that. Oh, I don't remember it being like this at all I thought I fixed all of this. All right, so Mars coins. Yeah, I like that. I like this better Okay, now this should work cool So we can definitely buy some upgrades. So let's try it. Oh system dot string But let's try this. Yeah, see how fast this is going to get already Get crazy. This is why we need soft cap. So what about this upgrade? Does this work? Yeah Oh, so it's actually doing a lot faster. It's because we forgot to add the time dot delta time So it's just doing a much faster Approximately 144 times faster than it should be So what else it's the The string. Where is the string? I had this issue earlier Upgrade names. I see Okay, we got to do at index i No, that's not what we want. We want index i Cool. So now it should display correctly And we also got to have the text for this too because you know what? Let's do that now public text Mars click text Now is this one text? I believe it is The annoying thing about writer is that you it automatically saves So if you're not ready for it to update just jumps right in but that's also kind of a safety thing too All right So we'll put this down here It is equal to dollar sign click new line backslash n And we will do Now I don't expect this to go into the thousands right because that would be kind of crazy Just a few hundred clicks and you'll be in e thousand. So we're just going to do colon f2 And in here We will do Now I don't like copying this you can just put this here Obviously we could make a variable called public This is again, this won't be big or we can just do public double we can really do float, which is what we should do You know, let's do float public float click power And we can set it equal to This oh we gotta put the f Put the f in chat And we'll just put click power here Click power here done And I think that's just mars coins mars coins Oh, we got an error. Yep. I know why it's because we forgot to drag this text in Okay, so yeah, see this is just crazy because if we do by max like the smooth See this gets expensive though, but it looks like it bought way more than it should have And this this is pretty slow Is it adding I guess that's how it is Yeah, that's all right See to see this is the problem with multiplication is that See we're already at very high numbers. So we're have to add this off cap See we're already at e20. So let's use it by more. Oh my gosh See now it's double like almost doubling every single time This is still very difficult to get but like once we get enough of these upgrades This is already yeah, it's buying way more upgrades than it should. Okay. Well, let's take a look at that. Why is it doing this? Okay, so let's compare to this one. So we have b Which is our base costs. All right We have c which is our currency We have float r which is our cost mult and we have k which is our levels It just seems it just seems like it's adding way more than it should No, everything seems the same. So maybe it's our input. That's an issue Okay Okay, I see our equation right here is incorrect because we're doing power to the levels to the levels Right, that's not right. It should be our cost molds That's why so it's not the bimax. It was the equation themselves. They're incorrect Yeah Look at that. We're doubling our currency every freaking click That's crazy. No, I don't want that Sure players love the large numbers, right But yeah, that should be that should fix it So just know this is not ready Mars is not ready. We need to have soft cap. We need to maintain this exponential growth Because break infinity can't handle it and if you're using a doubles for this Yikes Because why don't you get to eat 308 you are done for you are done for So, let's see this is work. Yeah It's still buying more levels than it should right It's buying three. Why is it buying three? Because I can only buy one two three four five six seven eight nine Okay Maybe it's right. I don't know that's pretty extreme That's actually I think that's right Wow And we need to get our mars coins per second text working Okay, so let's do this for quick just for Just because it's why not mars coins per second text And we are going to have a temporary variable private big double mars coins per seconds And that's just that's basically this Okay, well, this is going to be kind of weird Because we're not adding we're multiplying So let's just take this it's basically game.data.mars coins times times this plus one And I think we don't I think we can just get rid of both of these Nope, we just need it here. All right. So I don't know if this is exactly correct Yeah, this actually seems right And then here we set the text equals to I'm going to see what is it mars coins per second Okay Yikes Oh, it's definitely we need our notation method without a doubt And we'll do mars coins per second Wow It's getting kind of freaky. Oh, that's so it's growing so fast So this right here So that's 2.73 percent per second If you divide that by 100 So, yeah That's basically yeah If we let this all night, of course, it's going to grow a lot, right? So let's see if this coins per second thing work. Let's get me kind of cool. It's because it's going to grow What I think the soft cap is going to be I think it's uh, man I think I'm going to make it entirely based on the On like a prestige system. So basically you got to get the prestige in order to get past a certain limit, you know Or something like that and I'll probably have another soft cap like as a natural one To prevent it from going crazy You know, we can make this be the big one, right and remember this is let's check this out Let's check out universe real quick. This is too big See this is incorrect though Okay I think I see the issue Save that I think that it's the plus one. That's the issue That's why it should just be without it If you're enjoying this so far, make sure you leave a like comment down Anything you want to if you want suggestions leave them down below subscribe if you're new and turn on notifications Also, five thousand subscribers merch not this exact shirt, but something cooler All right Seven times. Wow. So once we get that 10 times every click is an exponent, right? Let's get that let's get there. Okay Wow, we're very close. This is terrible Yeah, these need to scale a lot more. There we go. So now we're getting an exponent every click and you know what the issue With this is let's go to planets Not bad of a boost I was expecting a lot more pretty good Still a pretty extreme boost, right? This will make Remember ethereum now is a hundred times faster. Okay. It's a lot It's not crazy, but it's definitely a lot Nice. So let this grow Every click now Soon enough. Oh, we're already at infinite infinity. Let's lie How do we get to infinity? Oh, that sucks. Is it the cosmos? I think it is I think it's our cosmos is screwing us up. It can't be the levels though I don't know We can try Okay. Well, that means in our notation within our bimax, we need to change float to r I think that's why I think Some casting issue Within break infinity. I them guess that's my guess So if you got upgrades, it should be why is infinity though? Why? Shouldn't be infinity. Oh, that's kind of awkward. It should not be this way Okay This is big double This is a big double multiplying by another big double. Why is this infinity though? This was handling higher costs Just fine Let's make I really don't think this is it There's no way I hate to have to do it like change stuff around, but there's no way No freaking way That's the reason why that's infinity So levels are infinity the base cost doesn't change at all Great We're gonna comment these out real quick now. I'm gonna try to solve the issue on my back end. I'll I'll update you guys once I'm done Okay, so for some reason I guess if your level isn't in that it's just gonna screw everything up still It's gonna make everything infinity never seen this issue ever Don't know why this is actually happening Now I hope this doesn't interfere with anything in the future because if it does and that's not good That means I always be screwed and you guys would be screwed because I thought something invalid So that just really blows that means all of these upgrades all the levels Int intent intent it's gotta be a big double now It's gonna be a big boy now Okay Well, let's change stuff So mars is good Uh player data we need to make our levels a big double because for some I don't know why that happens Casting it what about casting can we cast it? Instead of having to change everything Let's try this instead. So let's make this an int Because I really don't feel that's the necessary way to kind of solve this issue Now cosmos sure let's make that to a float again to float And now honestly this can be an int because we're using whole numbers, but who knows we'll probably use some decimal in the future That's up to you It's really how you're using it. So just know Don't do exactly what I'm doing if you want if you know that your cosmos are forever going to be Whole numbers then use int. Okay I don't want you guys to just use it because I use it, right? I want you guys to have a reason behind it. So Okay Let's go here We don't need to change any of this by max stuff. I don't think We're just gonna have to cast it. Yep. Like that that works perfect. Wow. There's casting Uh This is a float though Can this be a float? So I guess it's not this. It's the issue. It's the level. That's freaking weird Okay Hopefully I didn't screw anything else up. Let's try it Now I'm afraid that I'm gonna have to cast this too Should I No Let's just give it a shot Okay, so now we got to cast more stuff We got to cast this mars per second because it's an integer. Okay So that should fix our per second issue our cost issue is fixed So we don't have to change everything in the whole script. We just need to cast the integers, which is good Oh, why is it still not working? Oh, it's because our infinity. Oh, I see now. Okay. Well Let's just change to one. Okay seems like we're back in the business cool So I don't know why that happened so late Uh, is it the by max really broken too? I have never I don't remember ever having this issue Well, probably because I've never had this issue personally because I use big doubles for everything Even though I should be using ints and casting them so we can buy these upgrades just fine, right? These upgrades are no issue It's the by max. So we're gonna have to cast int inside This too and once we're done we recast it So let's go to our methods class Let's go to our by max In for k for every k we're gonna cast as a big double No, I don't know what that right outline was that was pretty severe Oh, okay weird. So we recast we cast k as that and we recast and That should fix our issue Didn't expect for this to happen Hey, we're okay now I love the smooth feel it's so satisfying to watch Like a planets. Yeah, this is every click is like another multiplier Oh, wow. I'm guessing this is because of the infinity Yeah Before you start commenting na na na na am infinity infinity infinity make sure you Go back a few minutes and just do what I do Cast all the ints as big doubles inside the by max the equation itself the cost the equation itself Stuff like that or else you're gonna be screwed So let's just do 33 one Okay, cool. We're back Hello All right. Anyways, thank you very much for watching. Hope you guys enjoyed this video. I definitely sure did. I think this was a pretty interesting one Anyways, next episode will be soft cap. So daily question of the day Let's see What's your favorite drink Comment down below and I'll be sure to answer I'll be sure to reply to every single comments and heart them. Anyways, thank you for watching Leave a like if you enjoyed subscribe to my channel if you're new and I say this a million times But every single subscriber means a lot to me turn on notifications for future videos Next video soft cap tomorrow 6 30 am mountain time. Stay tuned. Thanks for watching. Peace 5,000 subscribers merch