Programming base defense for my survival-craft game

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
by the end of this vid I'm going to have this attack feeling nice and juicy so stick around and see what that looks like if you know around here what's going on my name's Randy let's get to work so step one is going to be getting these enemies to attack the base properly so I got that working he's just bouncing off the wall now the next thing I need is just a feedback on the hit so step one for that we'll B open the best door in the world bring in a couple of sound effects so that works all right but it could be better so what I like to do is just throw a kick drum on NE it for a bit more impact I'm going to make it two out just nice and subtle so just got a little bit more of that oomph now we'll pack those up wood impact rent them out and we'll [ __ ] them in F mod cheack a little bit of random modulation on the pitch play that there we go like that kick actually feels a little bit too loud also I forgot to shorten these a bit there we go that should be a little bit better that's feeling all right sound effects are so much Bank B I love it but we can do better by the way I'm about to do a patreon Q&A so if there's some questions burning in the back of your mind and you want to ask him follow the patreon link down in the description and uh you'll see some more info over there it is finally time to figure out how the hell to do a good impact visual effect so I think Step One is the particles so that's the impact point right there I think that might work I have no idea what I'm doing I'm just making this up yeah actually doesn't look too bad I think it's a good step the next thing I want to do is see if I can just make it jiggle a little bit on the head cuz the other day we got the Slime stretching and squashing so let's do the same thing for everything else so I'm going to clean up the entity rendering a little bit make everything hit this one single render entity and I'm going to make use of the new way of doing transforms and just convert that over and see how it goes there we go we got the entities rendering again so now that everything everything hits a One path basically just going to put in like a hit squish timer nice there we go nice and subtle I don't know if squishing it is the play like maybe we do the inverse like just stretch it up I don't know I'm sure you guys in the comments will tell me what to do now we just make that happen for every hit and look at that we got a little stretch going yeah I think the squish makes more sense cuz it's like horizontal that looks so strange on the trees like it looks fine on the bushes but like the tree maybe it's just a matter of like reducing the effect with like a hit squish scale Sorry by default 1.0 then we can go into the setup of the oak tree and then just like change that to scale it down a bit make it more subtle there we go think I might also need a different easing curve for that so right now what we're doing I don't know how to Cle into a range like this oh look at that so this line right here is the hit squish timer so as soon as we hit it starts here and then plays out for 200 milliseconds and then it's complete up there so what I'm doing right now is taking that line and bending it into that it's hit then right in the center at 100 milliseconds we're at the peak of the stretch and then the time it completes and it goes back to normal so we can watch that in slowmo the screen Shake kind of ruins it a bit but I just want more control over this I almost want to like split this up into two so we've got this function here and then we've got this function here I don't know what I want man oh it feels so much better without the screen check I'm not going to be sick anymore there we go I think that's doing what I want to now I mean look that's that's more than good enough we can just leave it at that that's hit feedback done at least the first pass good enough for now this is kind of confusing but basically what I just did there is I broke up the animation into two segments so we have the St here and then we have the end here pretend I'm good at drawing lines so now they're broken up into two segments the start and the end so now I can take this and ease it into whatever shape I want so I just did like an ease out back and then I just left the end as like a linear drop off because I want like that instant hit feedback right stretching straight out away but then like a slow kind of return to the normal I'm sure I could have done that differently and better and I'm sure you guys have some better ideas for how I could do this but uh this is what I thought of and this works so [ __ ] you now what I want to do is basically fix it so that when there's a bunch of enemies attacking it doesn't break and you know people slip through that's just happening cuz of the damage cool down at the moment and I think I know how to fix that so I think we can just flip the idea on its head and make the Slime have an attack cool down rather than the target entity having a damage cool down I think that'll work but there's like [ __ ] five different cool Downs in here and then we can just if that off with the attack cool down now we spawn a bunch in look at that oh that's sick so now we just need some proper feedback for when the walls get yeated I mean to be fair like it's actually good enough it just works right now cuz in future I don't actually want to destroy it I want it to just break down and then you repair it actually that's like too complicated why the [ __ ] are we even doing that we're actually going to cut that simple or like the only issue now is chill bro chill so the only issue now is what happens when we take care of the enemy and we want to repair the wall what do so let's make some repair functionality real quick oh this is going to be a bit tricky time for a programming time [Music] lapse okay so I think I've got the first step here like that should give us an array of everything we need to repair the structure and we'll actually just calculate that every frame for all the repairable entities and stuff it in the entity frame state for each entity I basically have this little struct called frame uh and it just zeros it out every single frame which is kind of Handy in fact like this is actually allocating memory as well but like why're not having to worry about freeing it or anything because the allocator way using is the frame allocator and that's just a memory Arena or linear alloc whatever you want to call it that gets zeroed every single frame as well who needs memory management memory management is for Chumps just pick your lifetime which is memory management still it's just like a different kind of memory management it's like lifetime management I guess I don't know want to give a big shout out to all my ra II homies so now these in theory should have a nice list of items that I need to repair them uh so the next step is just rendering that so let's get it going wow it's really amazing what you can do if you just sit down and start something for like a couple minutes I didn't even feel feel like sitting down and doing this but I was like you know what let me just do it for a couple minutes and then like and then before I know what you know an hour is passed it's like oh wow just getting over that like initial hump of not wanting to do the work but just doing that anyway like pushing through that you just slip straight into the flo simple as that and then of course got taken out of Flo by trying to explain how in FL you are oh what the [ __ ] was I doing the content must be recorded go all right so that was the things is working well so what we're going to do is Loop through the player's inventory and then check if the inventory item is equal to the item that we need if so then we can interact just a little bit funky but that's all right so now if we go and collect a little bit of fiber sweet that consumes it now the next thing we need to do is just like give it back health so we go this is going to be a little scuffed but it'll work so I think that'll work we're just like restoring a little Health chunk let's go that is is repairing and if it's the final one we'll just nudge it to be Max Health that way we don't have to worry about even divisions so I think that'll just work so we're taking the wood now we need some Fiber look at that we are now ready for an army of slimes all right that's going to be beone for the day see you in the next one
Info
Channel: Randy
Views: 50,348
Rating: undefined out of 5
Keywords: randy, game dev, indie dev, devlog
Id: wqZy71FCFqY
Channel Id: undefined
Length: 8min 23sec (503 seconds)
Published: Tue Dec 12 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.