SUDDEN DEATH (Part 2)! | How To Make YOUR OWN SSB Game | Unreal & C++ Tutorial, Part 64

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] what's up guys Sean the Bro here and in today's episode of the Super Smash Brothers and platform fighter tutorial series we're going to be going over sudden death part two so if I come into my game here and doesn't really matter what map I pick but I'll go ahead and pick the one with the map boundary set up properly I have my round time at 5 seconds so after 5 Seconds we are going to tie because the round ended and nobody had any score so we go into sudden death we had this setup last time but we're going to do a few things additional this time that's really going to clean up our sudden death first thing is we stop respawning when sudden death occurs this is particularly important in timed mode and coin mode so we have the stock mode and stock is where you have a certain amount of lives and you won't respawn once those lives are out timed mode and coin mode you have unlimited lives until the time runs out if we reach a tie in those modes and we want to go to sudden death we want to make it a stock based match at that point essentially everyone has one stock and once they get eliminated they can't come back to sudden death we need to disable the ability to respawn so that when we hit these opponents go flying off the stage like that they won't come back afterward and you can see they're not so they've been defeated but they haven't come back that's what we'd expect in sudden death if I come back into my game and I allow sudden death to occur again we want to do things like stop the character from being in the state they're in there's even more to that we actually reset all the blocking parameters durability of the block Shield remove any stun frames all these good things that we want to do because essentially when we go into sudden death we're starting with a clean slate yes we're giving them the 300% on the damage counter but otherwise it's like a normal match if you want to get caught up in this playlist and check out everything we've done before this point in time you can go ahead and click this icon top right corner right here which will lead you to the entire playlist of the Super Smash bers tutorial series and you'll be able to see how we implemented character select items respawning all these good things alternatively if you only care about sudden death that's perfectly fine but I do recommend you watch the first episode of sudden death which is the previous episode in the series and I'll link that right here in the top right corner in that iard with that out of the way we can go ahead and get started so this is a code and blueprint tutorial series we're going to start in the code today I'm going to my visual studio and specifically I'm going to my SSB template game mode. or my base game mode. in here I want to add a new parameter new variable today that I've called is sudden death so it's a Boolean determines if sudden death is active or not it's very simple but it's going to be very useful because when we are in sudden death there's certain things we do and don't want to do the main one for today's episode is what I mentioned earlier not being able to respawn so if sudden death is active in the game mode the characters can't respawn so you can see is sudden death active I've made it a U property of edit anywhere blueprint read write with a category of game mode again that is bull is sudden death the U property here just allows us to edit this in the blueprint and access the value in the blueprint which we are going to need to do now once we have this in the SSB template game mode. we want to go to the SSB template game mode. CPP and go to the Constructor where we set all the default values for variables and in here we want to set is sudden death so I've set at the bottom here is sudden death equals false when the game mode starts up sudden death is not active so by default it's false that makes perfect sense let's go down to where we were triggering some sudden death logic that's also in the game mode it's in a function called enter sudden death in here we were calling a function on the characters called prepare for sudden death so this is where we were resetting the character's damage counter to be 300% we also want to set is sudden death to be true in here so right below that I say sudden death is active is sudden death equal was true but before we go and stop the characters from respawning let's edit prepare for sudden death a little bit more because there's a lot more we can do with this than just resetting their damage counter so this is in my SSB template character. CPP and I'm going to scroll down to my prepare for sudden death function here we are so previously that's the only thing we were doing I've added a lot more in here today there's actually still a lot more that we want to do after this as well but I haven't covered all of it so the first thing I'm doing is setting the can move every would be false when sudden death starts I want to set the characters to not be able to move of course they will be able to move shortly after I just wanted to default them to not moving a it kind of breaks up the logic a little bit we know that we're resetting their state and everything but additionally we are going to transport the characters back to their original spawn locations and we don't want them to be able to move at that time so I'm just going to set Kimu to be false we'll reenable it once sudden death actually begins I've also set the lives variable to go to one now again in timed mode coin mode you don't have lives in stock you do if we are in stock we do want to set those lives back to minimum value which is one because it's only one stock until we're defeated that way if we have Hut elements like our stock counter that will be reflected properly there next up is the block Shield information that I mentioned earlier so the block Shield durability I'm going to reset it back to the max block Shield durability so when we enter sudden death it's like a clean slate for their block Shield as well so they have the maximum durability doesn't matter what state they were in Prior and I'm also going to reset their block Shield remaining regen frames this is how long it takes before their block Shield can regenerate again it starts out at zero in the Constructor when the character respond we're just going to set it back to zero stun frames is the same deal we don't want to be stunned when we enter sudden death so I'm just going to set the stun frames to be zero charge Time same deal we're not charging anymore if we were charging when it went into sudden death we're just going to cancel that we're going to say charge time is zero character State we're going to set them back to default character state so character State equals e character State col eore Idol I'm resetting the last attacker to no pointer so last attacker the last character that hit this character that way if this character falls off the map gets eliminated or even if they self-destruct afterward the last attacker will be credited for that kill or for that defeat but when we're entering a sudden death I feel like it's not fair to still count them afterward so I'm going to reset that to null pointer this may or may not matter depending on how you handle sudden death in your game but still I think it's better to reset it instead of just leaving it anyway I also want to go ahead and grab my block Shield component and set the visibility to be hidden which is making it invisible and we do so by calling set visibility on our block show component and pass in false the reason for this is because when we reach set the character State directly we don't actually call stop blocking and I don't necessarily want to call stop blocking because we may do things in that function that we don't want to do when resetting for sudden death but if we were blocking since we reset their state back to idle we do want to make sure that block shell component becomes invisible of course next time we go to block it will be visible again so no harm done here so let's go ahead and launch the editor once the editor is back open we can go into our game mode blueprint because the game mode blueprint is actually where we handle the the respawning of players so game mode BP go to my base game mode BP now to be quite Frank this will almost definitely be changed to code in the future like we do with a lot of our blueprint logic but for now we're going to keep it as is because that's outside the scope of this episode so we had this event respawn player where we were grabbing the proper player determining where the Revival platform should be spawning it attaching them to it all these important things for respawn but we don't want to do any of them if it's sudden death so the very start of the event before anything else I've added two nodes a getter to our Boolean that we made earlier in the episode is sudden death and a branch so get is sudden death and we want to bring this into a branch and only if it's false if it's not sudden death do we want to do anything related to respawn so you see true is empty we don't do anything here false goes into the logic that was previously linked up to event respawn player directly something else we want to do in here and that is to allow the characters to be able to move once the sudden death text goes away so I'm scrolling down to my other event here display sudden death info this is what we set up in the previous episode for sudden death in here we were calling a function on our HUD display sudden death text inside this function we were displaying the actual sudden death text to the HUD which makes sense but after that we were setting a timer so that in 3 3 seconds it would call another event that event simply just hid the sudden death text that we spawned because we only want to flash it on the screen for a couple seconds toward the player we don't want it to be in their way the whole time so we have to remove it I'm opting to allow the characters to move once the text goes away so we have this event here called hide sudden death text and in here we were just setting the text to be invisible makes sense after that I've added these new nodes the ones that I have highlighted right here and this is what's going to enable the characters to be able to move again and once that text goes away so for now I'm just grabbing my game mode reference which is something that we have in the character Hut it just is a reference to our game mode grabbing my players array which contains an array of all the players all the characters in the match looping through them and for each Single Character res setting can move to be true all of our characters can move at this point and begin sudden death there we go guys that's a short and simple episode but very important for our sudden death behavior in the next sudden death episode we're going to be going over moving the character back to their spawn locations when sudden death starts that way they don't just sit where they were last at like this I want to actually be able to respawn them move them back to those starting positions that way sudden death can begin for real if this video helps you make sudden death in your game please subscribe it does more for myself and the series than anything else you can do and it is free I want to give a huge shout out to my YouTube membership patreon members and Discord subscribers you guys are so kind and you have given me so much support I am so incredibly grateful f for all the love if you guys ran into any issues while following this episode feel free to join the Discord Community there's a link in the description and that support is also free anyway guys that's all I got for you so thank you so much for watching I'm Sean the bro and I'll see you in the next one goodbye guys
Info
Channel: Shawnthebro
Views: 160
Rating: undefined out of 5
Keywords: Shawn, the, bro, Shawn the bro, video, game, video game, stb, how to make a super smash bros game, unreal engine 4, ue4, unreal engine, unreal, engine, tutorial, super smash bros unreal, super, smash, super smash bros tutorial, ue4 super smash bros, super smash bros unreal engine, bros, fighter, platform fighter, platform, ue4 platform fighter, brothers, unreal engine 5, unreal 5, ue5, c++, ue, sudden death, sudden, death, tie, ties, tied, draws, draw, drew, extra time, extra, time, mode, modes, stock, timed, ye
Id: AkoyOZsx62c
Channel Id: undefined
Length: 11min 2sec (662 seconds)
Published: Fri Jun 28 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.