Tag Team Matches (Part 4)! | How To Make YOUR OWN Fighting Game | UE4/UE5 & C++ Tutorial, Part 233

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 fighting game tutorial series we are going to be going over tag teams part four in this episode of tag teams we are going to be improving how our tag characters actually work so in the previous episodes we spawned additional characters to match our game mode so if we're in a solos mode we only spawn one character per team trios three so on and so forth the first thing you're going to notice when we come in here is that the characters are facing the same direction in the previous episode they were not doing that in the previous episode the characters were facing the right directions only the main characters that are being controlled the other characters were not so you can see they do abide by the same rules and they're actually facing the same direction as the characters that are being controlled at the moment Additionally you can see that they'll actually take damage and their stun frames will occur and then they'll be out of them we can also launch them now so if we make some space here I can launch this opponent they get back up all that good stuff so they're basically handling combat the same way that any of the controllable characters are there is one exception and that is going to be throws so if I throw them it is going to work but it's actually going to throw both the enemies because the way we set it up it's not too bad of a fix but we're not going to include it in today's episode because it is a little bit more complex than the other things we're going over additionally one issue you will see is that the camera edges move and they have no regard for the other characters on the screen now normally when you're playing your game you're not going to have these characters sitting here they're going to be off to the side hidden because they're not active so this isn't something we really need to worry about but if you see the characters kind of jumping around when you move from side to side so for example I have a good good condition here so if I I am to take my second character and move over here you can see the characters are kind of jumping behind them that is because the camera edges are trying to move with our basic logic and now these characters are in the way so it's kind of pushing them in and out of the way that's okay actually because there's nothing wrong with this again we're not actually going to have these characters sitting here so we don't have to account for that situation but we are going to be handling that type of tag team behavior in another episode when we have them actually coming in from outside of the boundaries and being possessed and controllable by the player there's a few other things we'll cover today but that's the gist of it so anyway before we get into this episode if you want to get caught up in the entire fighting game tutorial series and check out everything we've done from our commands like this one to our hit boxes our match flow and all that fun stuff you can go ahead and click this iard at the top right corner that's the entire playlist of all the fighting game episodes alternatively if you don't care about that you only care about tag teams I do recommend you watch the previous episodes because this is tag teams part four parts one two and three are going to be relevant for this episode we're going to be building on that logic so I'll link you to the first episode of tag teams right here in the top right corner now with that all the way we can go ahead and get started so this is a code and blueprint tutorial series we are going to be working in both the code and the blueprints today starting out let's go to the code so I'm going to go to visual studio and I need to go to my fighter template game mode. CPP so in the previous episode I had mentioned we were going to fix the stun frames and the hit stop for the non-p possessed characters in this episode and we are going to do just that so in the game mode if hit stop is active this is the period of time after a hit occurs where everything kind of slows down or stops completely then we want the characters to have a brief moment where they can't do anything and so because of this the game mode is what manages when the hit stop ends so if we scroll down to the game Mode's tick function you should see this Behavior here this behavior is for the timer we can skip past that safely the next logic is this Behavior right here so everything I have highlighted was in here from before this episode but I've commented out these two sections now and I've changed them for these two sections so in the previous episodes we were checking to see if player one and player two existed if they were valid and if they did end their hit stop once their hit stop frames were less than or equal to zero now this is important because player one and player two do want their hit stop to be ended however now that we have multiple characters on a single team it's not just player one and player two we have to set we have to set all those characters that end their hit stop when hit stop itself ends there's a few ways we could do this very simple way right now is just to disable the logic that we had that's why I've commented it out and instead Loop through each of our characters aray so team one characters and team two characters and then call and hit stop on each character in those arrays player one is part of Team One characters and player two is part of Team two characters so it won't break anything it will only add to our functionality so starting off here I have a standard for Loop we have four integer I equals z i is less than team one characters. Nom increment I and then I grab team one characters at index I and call end hit stop it's that simple just call end hit stop for all the characters on Team One the same is for team two just four integer I equals zero I is less than team two characters that numb increment I team two characters index I call end hit stop so again this is just end hit stop for all characters on team one and the second one here is end hit stop for all characters on Team 2 and now I'm going to remove the previous logic that we had and this is what my tick function looks like so that's your first issue solved the hit stop and stun frames issue that should be working now for all your characters including the non-p possessed ones the next issue we're going to solve is in our fighter template character. CPP so I mentioned in the previous episode and at the start of this episode that the characters were not using their physics so they didn't have gravity you couldn't launch them they weren't actually touching the ground when they loaded in all of this is because their physics weren't actually running when they're not possessed by default character movement component on a character is not using physics if they're not possessed by a controller there's a very simple toggle for this that we can enable for now we just want to enable it for the entire duration of the match that could change as our game progresses but for now let's just make sure that physics are always enabled even if they're not possessed so to do that we can scroll down to our Constructor and our fire template character and there's a section where we set parameters on our character movement component we use get character movement and then we grab a variable and set it I've added one today get character movement and I'm changing the B run physics with no controller to true so as it says if there's no controller attached basically if this is not possessed we still want to run the physics on that and so that's what we're doing by default this is false that's why all those issues with physics were coming up but now it's true you won't have those issues anymore let's go to our next issue so we can actually start the editor again at this point because we're done with the code for today the editor is back open so now we can go into our default game mode BP that's where our next issue lies so default game mode VP let's go over to our level streamed event in this blueprint so level streamed in is essentially when we load up the map it's an event we have for when we load into the level for the first time but also when we do a rematch at this point we do a lot of things like spawning the characters determining what camera to use we were checking to see if the players were Balan and then in the previous episode we were setting the other player variable correctly for all the characters in the teams and one thing we were normally doing in the series was setting player two to be facing right by default now this is kind of silly because if they're facing right they have to flip at this thir of the match but it started because we originally had this variable called is flipped and that was accurate for player two at that time and then we never came back and changed it so at this point it was just setting is facing right to be true for player two and that was working fine but we need to do this for all of our characters if we want them to all start the same direction and so we can do that by using our previous for loop from the previous episode so you can see I have my team two characters and I'm looping through them and in here is where we were setting other player for each element in there we also want to Now set them to be facing right at this point I can drag off my array element set is facing right and we can set it to be true and we can do this in the loop body because we want to occur for everyone now we want it to do that and we want to set other player we don't want to connect the loop body into the main line here or it will keep doing this logic we only want to do it on completed so make sure you don't connect the loop body into here like I did there that was a mistake on my part so make sure it looks like this now where it's empty and not connected completed should be connected to the next node here now player two is facing right I disconnected though because now it's going to be set in this Loop we don't have to do it separately so we can remove that and make some space here and something like that we'll do so just as long as we do that now all of our characters on team two will rotate properly at the start again the naming is a little weird here because it originated as is flipped and we never changed it but by setting this to true in the character's tick function it will check if it needs the flip at that point and they do need to flip so it will trigger that on that first tick so you won't notice anything wrong about it but we technically should update it so that they're facing that direction to start that way we don't have to flip them here but otherwise it doesn't really matter just for a conceptual reason it's a little confusing but otherwise it's okay anyway we should be good to go there now the last issue that I want to fix but we're not going to fix in today's episode is the throw and that is because of the has landed throw Boolean so in the anbp for your character has landed throw is what is being determined to perform the throw animation so if we actually get to our get thrown rule here we look at the character reference we grab the other player and see if they've landed the throw has landed throw is set to True when the throw hit box collides with this character however that is not going to work anymore since we have multiple characters on our team so this is what we'll be addressing in the next episode and then after this episode everything that works for one character should work for the other characters as well there will be updates through our camera and we will have to possess them but all the actual combat for these characters will work together I'm very excited to see that so anyway guys if this helps you make your tag team in your game then please subscribe it does more for myself in the series than anything else you can do and I really appreciate that I also want to give a huge shout out to to my YouTube membership patreon and Discord subscriptions thank you all so much for the love and support I am very grateful and it helps the channel more than you could ever know if you had any issues with this tutorial or any of my tutorials feel free to join the Discord community and reach out to me I'll be happy to help you otherwise guys that's all I got 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: 108
Rating: undefined out of 5
Keywords: stb, how to make a fighting game, unreal tutorial, unreal engine 4, ue4, unreal engine, unreal, engine, tutorial, make a video game, fighting game, fighting, fighting game template, template, unreal engine tutorial, ue4 fighting game tutorial, ue5, unreal engine 5, unreal fighting game, c++, ue5 fighter, code, fighter, game, fighting game unreal engine 5, fighting game ue5, fighter ue5, the fighter, tag team matches, tag team match, tag team, tag, team, 2v2, 3v3, duos, trios, solos, swap, in, out
Id: A7gklKgKcEE
Channel Id: undefined
Length: 12min 7sec (727 seconds)
Published: Sun Jul 14 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.