Unreal Engine 5 Beginner Tutorial Part 14 - Clone Characters

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
by the end of this video you'll be able to turn your spaceship from an empty looking boring spaceship like this to one that actually has armies of Stormtroopers like this hundreds of Stormtroopers running in real time look at our FPS look at this yeah you're going to be able to do this so let's get started what is up beautiful people we are here at chapter 14 now yes that's a new soundboard that we got we are going to talk about how we can clone characters [Music] okay sorry guys we just started testing the soundboard of our roadter Pro yes not sponsored but it's just really cool cuz we got these default sounds so had to try them so in this chapter we are going to teach you guys how to clone characters create our army of Stormtrooper and also we are going to talk about a feature in andreal engine which is called nanite we are going to overuse the soundboard definitely let's go so today's gonna be really exciting because first of all if you look closely at our scene the one last thing remaining within our blockout is these little well not little these big giant rectangles on the floor because they are supposed to be replaced with the Stormtrooper armies and that is precisely what we're doing today so farad are we ready let's go okay so if you guys remember in the last episode when we had our little band of Stormtroopers here these guys if we click on them and look to the right they have this skeleton icon beside them because they are the skeleton the skeletal mesh of the Stormtroopers and they come in with the animation so if you were to use the initial position we'll notice that these guys actually have animation and what we want to go Ahad and do okay probably the first thing that comes to your mind is if you want to create an army of Stormtroopers we can pull these guys back here right and we can go ahead and hold alt duplicate hold alt duplicate isn't that going to kill out GPU absolutely I mean think about it if you were to choose between Stormtroopers without an Armature and Stormtroopers with an Armature the one with the Armature is going to be heavier and since these armies are going to be at the back and not going to be the focus of our camera shots because we're going to have some actual Stormtroopers with animation walking here these guys are going to be you know probably blurred out in the background so for that very reason you don't need all of them to have Armature so why do you want to gohe and create hundreds of Stormtroopers with armatures that are going to be super heavy in your scene where you can go ahead and use them as static meshes and static mesh if you still do not know is basically like something like this rectangle it's basically a mesh without any Armature it's static you can animated but it doesn't deform right it doesn't have an Armature attached to it so the goal right now is to go in and create static meshes from our Storm Troopers yes right so the one thing I'd like to note as well is that the reason why we brought in multiple rifle animations rifle idle animations in the beginning is because if you were to go ahead and duplicate the same animation 100 times your army will look super repetitive and we do not want that do we want that no we don't want that right we want to have some Randomness within the Army to make it look more realistic just like how in real life people are not going to be standing exactly the same way so the problem right now is if you were to go out and even try to duplicate these guys with the method that we'd like to use which is the pattern method the one that we used for the lighting right absolutely so let's say as faran mentioned we want to go ahead and duplicate these guys using the pattern method if you go to the modeling Tab and go to x form the pattern option is disabled disabled why do you think that is because you can't pattern them yeah because they're skeletal meshes you can only pattern static meshes can we turn a skeletal mesh into a stat M yes you can and it's actually fairly easy so I'm going to show you how to do it so right now we're going to delete this guys what our goal is is to go ahead to our Stormtroopers and we have all these animation sequences we have this guy we have this guy we have this guy and this guy we just open one of them any of them because technically if we maximize this window we have access to every single one of these animations right here now far Hood the sweet thing is at the top here I'm just going to stop the playback by just clicking somewhere on the timeline down here and let's say I am happy let me know Farah when you're happy with our pose happy happy this one okay cool happy if you're happy with the pose that you have all you have to do thank you all you have to do is look at the top here and it says make static mesh very intuitive very intuitive all you have to do do is now click this and then choose a location I'm going to create a new folder a whole new folder called it St D Storm Troopers I love this sound you should have had this it's so late in the the tutorial series but it's okay this is the price for you guys who made it all the way here those who are stopped at chapter 1 two and three they're not going to get the soundboard no they don't so I'm GNA call this STD for storm uh static mesh Stormtrooper right and then we're going to call this ST1 okay that's going to be our first static mesh right and what's really cool is that if you go and open sd1 right it's just going to open the static mesh that we just created and I'm just going to quickly close this open my content drawer check SD Stormtrooper and look at this I now have literally a static mesh of the Stormtrooper so if I were to go to sketch fap right now and download a stormtrooper without any animation this would be the static mesh that I bring in right and now I just created it from the animations that I brought which is really neat because I have hundreds of permutations right so at this Frame exactly 148 is one static mesh I want another Randomness right so I'm just going to pull this forward and that's already another St button let's go check it out make static mesh SD Stormtrooper S2 S2 so we made two static mesh from a single animation sequence yes absolutely so now I can go ahead and use this but I'm just going to go ahe to another animation sequence so it's slightly different cuz it's holding the rifle differently and I'm going to go to maybe fire tell me when you're happy yeah when when the rifle is looking down yes so here okay frame 82 make static mesh go to S Storm Trooper and then sd3 let's do another one with the last animation that we have okay we're going to go to Rifle 14 and fire limit when you're happy yeah I think this is good the GU is barely moving so okay so SD Stormtrooper SD four and it's as simple as last time just drag and drop all the SS into the scene and we are done that's it I'm going to go ahead and click save and then I'll close this guy right here and right now if I go to my S Stormtrooper I have four of them which I can shift select can I bring all four together absolutely I'm just going to bring them here and then check this out so I'm going to go to sd1 and then pull this guy using the X AIS slider go to sd2 pull this guy a little bit to the right and S3 here and just like that they all look different we have four different permutation amazing and this now right now it can be patterned in the modeling tab if I shift select all of them go to x form just like our lights I can go to pattern it's now enabled wait wait wait wait what are you doing why why they don't have rifles in their hand okay you're right you're a genius okay that was good that was good okay okay you didn't burn me why did you even do the BP because you didn't bring the rifle okay you're right you're right you're right well now you see the pattern Works yes the pattern works right but before doing the pattern we need to bring the rifle so for our rifle let's head over to sketch faap once again we have already found the one we want to use but all you have to do is just search for Star Wars Blaster and you can see there are loads of options for you to choose from we are going to be using this Star Wars Blaster 11 right here by Toll loss so thank you you to us for I'm going to put the link in the description so you guys can take it yes so once you download the glb file right we just won the glb all we're going to do is go to the content drawer create a new folder call it Blaster BL Blaster can type properly and then we're going to drag and drop the glb file remember to go ahead and check combine static meshes so you don't get multiple different parts to your gun and then hit import and just like that we have our blaster in our scene all I have to do is just drag it and drop it wow that's that's huge that's huge what it's okay it's good it's fun okay so we got the Blaster now farad I can go ahead and try to bring this in and try to line it up with their hands but the problem is right now the Blaster and the guy the characters are disconnected there's a way you can sort of connect these two together now we're not merging actors at this point I just want to make sure they're part of the same you know item in the outliner I don't want to have to deal with two right now when I'm making my patterns and in order to do that one thing you can do is you go ahead to your character and this works with any static mesh or any any object that is in your viewport by the way cuz so far when you go to the details panel we've taken a look at here you know the transform the the mesh itself the materials we've never really explored what happens in the middle section here so if you click any static mesh for instance you'll see the name and you'll see that it has a static mesh component that component holds the mesh right that is the the mesh enti mesh the entire mesh now you can go ahead and use the add function to add anything to that specific mesh and it will follow the mesh itself when you move it so it becomes part of the mesh not really part as it's going to gel with it but it's going to be like a group if you will so we're going to go ahead and hit add and see all of these options you can even add audio to your character you can add particles you can add lights like I'm going to try this point light and see what happens so I added a light so let's say if this was a lamp you just want to follow a light with a lamp this is how you do it so you have your static mesh now if I move my static mesh the light follows it really neat right really really neat so I can go ahe and delete the point light by clicking this what we want to do is go and add a static mesh now Farah do you see what it says after static mesh Blaster why do you think that is because it's selected in your content drawer absolutely so if I don't select this and I go to add it just says static mesh and I have to manually find it myself literally like this and then go and select it here but I don't want to do that why do I want to do that I'll just select my blaster go to add static mesh boom boom just like that it's there so now it's part of my mesh and if I go ahead and move if I hit st3 move it I can move everything together if I go to Star Wars Blaster which is this guy only and it's highlighted I can just move this so now the goal is to go ahead and manually line this up with our hand which is going to take a little bit of time but not too long so one thing I'd like to note is now you can see that rotating is going to be difficult I want to rotate it on its own axis its local axis I'm going to use the Gizmo here to rotate beautiful and F can I make it smaller yes I'm going to make it smaller for sure while I'm doing this and while I'm lining it up who do you think is a sponsor of this episode poam thank you polyam for sponsoring this video so we can give you this tutorial series for free on our YouTube channel polyam is a 3D scanning app you know what's the crazy thing so we could have 3D scan a blaster and bring it here absolutely if you have a Star Wars toy in your house you can absolutely go ahead take out your phone download polycam use the link in the description in like a few minutes yeah we got a link in the description with a with a sweet promo for you guys as well actually and you can go ahead and download polyam you can then go ahead and use your phone's camera to snap just a few photos of your model whatever it is if it's a figurine if it's a blaster if it's a lightsaber and then within matter of minutes you'll have that 3D object that you can then bring into your scenes and it will look even more photo than anything we've got here because all of these were created in 3D they're lacking some real real life texture but your one probably has real life texture so if you do decide to do it we would love to see the results so share it with us okay so I've finished one f as you can see this is a rough one it's not placed perfectly in his hand but it's pretty good you know from someone who's looking from this angle and I'm using C if you can notice right click and C to zoom in you see it looks perfect looks really good so how do we take it to the other ones so here's how you can take it you can either manually do exactly what I just did multiple times or you can go Ahad to this guy and says Okay I want to select my blaster go to add static mesh Star Wars Blaster okay cool but what I can do is here's a neat trick if I go to this guy make sure you select the Blaster if you go to the location rotation and scale this is now in reference in local axis to the Stormtrooper absolutely it's not to the world origin so if I were to go ahead and right click copy this location right this is and then go back here go to my Star Wars Blaster and right click so click here right click and paste it's not going to go to the location of the previous Blaster it's going to go to the location in reference to the object so check this out paste right and then I go back here go to the Blaster right click rotation copy go to this guy go to the Blaster go to rotation right click and paste it's almost there go to this guy guy go to the Blaster right click on the scale go back to this guy go to the Blaster right click on the scale paste now all I have to do is just make a few more manual rotations and it will be perfect so you can go ahead and quickly do that for the other two characters we're going to speed forward this [Music] section [Music] and there you have it this is now done you should also have your Stormtroopers maybe four maybe five maybe three depending on your preference with their blasters in their hands and now if you were to go ahead and select them and move them The Blasters should be moving with them as well well so if you're you know doing exactly what we're doing up until this point it's time to now go ahead and create our pattern are we allowed to do it now did I miss anything out nothing yet okay all right cool so I'm going to go ahead and quickly just before I lose sight of all of these things I'm going to go ahead and create a new folder call this SD Storm Troopers if you guys remember from our lights these guys will actually stay when we create patterns it will just create new ones so that's why I'm putting them in a different folder and then each of these blocks of the army are going to be in a different folder as well so that we're organized so I'm going to pull these guys back just to the edge of my first block I'm going to go to my pattern and farod for the pattern we remember we had multiple different ways we could create our pattern right let's do grid let's do grid so we can go with line we can go with circle which is also cool this is also really Dope by the way right this also super cool or we're going to go with grid grids right cuz this makes the most amount of sense for us too many too many too many right here I'm just going to quickly enable our FPS just so we know if we're dropping so right now we're at 60 and it's going to 20 but you know it's it's it's pretty much at 60 most of the time and we're going to teach you guys a really important method that is going to help you save your FPS in a moment but also one more thing that we already told told you guys about if by any chance your computer is lagging right now make sure you change your scalability settings to something lower than cinematic we're sticking to cinematic CU we want it to look great okay so fire definitely too many right so bring down the count on five I think yeah cuz it's it's a grid right so there X and Y so let's do maybe five and five and see what it's like five and five yes okay amazing actually there's this is no no no no there's too much space in between them I don't like this actually I'm just going to pull this back so we see how it is I mean the size is perfect but we want more let's do six maybe oh no no no we need to dois yeah so we need to do five here and on the y- axis we're going to do eight yes oh nice nice but how how do what do you think about the spacing I think there's too much spacing what about nine uh this is better what do you think about that okay yeah yeah nine and what do you think about the first one actually having a little bit of a different different shape cuz I do want these to be in a square shape but I want this one to be maybe something like like that like like three yeah you know how sometimes they're in different formations so I kind of like the first row first what first block to be three I think this is pretty good okay what do you think about this now how we can make them a slightly different from each other is there any way to do that so they are not look exactly the same okay so that's even the four that we made that's a very good question so the reason we made the four in the first place is so that these guys all have different poses but if you think about it the all of these are now a clone of the first four and then these guys are also a clone of the first four and so technically you would have some level of repetitiveness and there's this really cool option farad here called Jitter which basically does what it says it Jitters so it gives some different offsets to whichever value you're going for so either your rot ation your translation which is the location or your scale so technically we can try to make these guys either slightly smaller or slightly bigger slight slightly taller or slightly wider absolutely so they can be like fatter like fat Stormtroopers so let's enable Jitter for scale right and then we're given three values but technically we can only change they're locked together so if you were to bump this up to one let's see what happens just so you get an idea of what Jitter does right this is the weird short tall fat see we see what it does right you should go with 0 maybe n nine nine is a number so we tested this if you look closely let's see what happens do you see the height differences now yes and they are left and right a little bit is great actually for cinematic you can actually do that with the translation as well so no but then that would be standing in different positions no no no it's not really standing so if I were to change this to five and then copy this it's like it's it's it's still fine but it's maybe just small differences right so now the Army is slightly less repetitive but it's still uniform cuz you want your army to be uniform or else it's not a good-look army but it's still not exactly the same which is perfect so can you remove the panel so we can see all of them on the floor yes uh hide this so hide wow yes wow okay we are getting there this is looking good okay let's hit accept so that we know we're done okay hit accept boom just like that we now have created all these patterns so they're not exactly all the same so if you look at the patterns now it's separated right it's separated now what we're going to do is go ahead and put these patterns into a new folder called I like to call it front Army right so front right Army no I'll put all of the front armies together and then the middle Army and then the back Army that's just stupid naming but we're going to remember it so we want to go ahead and now duplicate all of this and and just mirror it for the left side but before we go ahead and do that what if my PC is crashing by creating this many soldiers storm that's actually a very good question how can I fix it and I and I already change scalability to medium that's a very good question so if you've done that and your FPS is still running low there's one function in unel engine 5 which is called nanite and that is a godsent alongside Lumen which was the lighting technology right that we talked about which is basically the reason why we have real-time lighting and Shadows that look really good there's another thing about Unreal Engine 5 which people love and it's called nanite nanite basically says okay you are now allowed to have millions of polygons these faces that we saw in the edit mode when we were making our spaceship we can have millions of them without the computer saying ouch so how does it do it well it's quite simple let's take a look at our Stormtroopers right now well it's simple in theory but a complex in calculation I'm sure it's not simple for the the EP developers yeah so far if we go to our wireframe mode we can actually see how dense our meshes are so I'm just going to go to wireframe and then we can see if you go out this is our spaceship remember our spaceship looked exactly like this when we were looking at the edit mode and if you go closer to our Storm Troopers you can see how dense the mesh is right and we're creating hundreds of these if you come from other 3D software just duplicating all these guys is going to break your computer so so here if you go back to LIT mode and then just see down here there's something called nanite visualization and if you just go to overview it's going to also be kind of laggy because it's trying to bring all of these at the same time we're just going to go to triangles and if you go to triangles nothing changes this is supposed to become black and you're supposed to see only your nanite meshes but because we have none nothing happens so how do we turn meshes into nanite and what does nanite actually do what nanite does is it's going going to say okay if this is my mesh if my camera is here I want to see it in full I want to see it with all of the polygons that it has but then if my camera is all the way here do I really need my Stormtrooper to have all of those polygons no right so I'm going to go ahead and create multiple levels of detail right from really high level of detail to really low level of detail and then as the camera moves further away I reduce it I reduce the polygon count smart so you can basically have millions of polygons but then when you're far away they're not millions of polygons anymore and so your computer can handle gigantic worlds and still be able to run very impressive epic games and they did it because they have games right in video games you have massive worlds and you need to have a refresh rate of minimum of 60 FPS so 60 frames per second needs to be rendered for you to enjoy your game and that's why they created Lumen and nanite so now far what do we do right click okay so right click on the static mesh change it to Nite yes so instead of right clicking here because there's so many of them we just go to the source right find the source we're going to go to the Stormtrooper sorry SD Stormtrooper you can only for now there's only a couple of things you can turn to nanite static meshes are one of them so we're going to go to static mesh shift slick all of them right click and then Nite nanite enable nanite so you can either check this or check this okay so we're going to enable nanite so once we do that it's going to recalculate things and then your mesh is going to start looking ugly and you'll understand why so we're going to explain to you how you can fix it as well so right now before we go Ahad and fix that let's go to our lit go to our nanite visualization and go to triangles and let's take a look at what has happened do you see this they're all nanite so they're all nanite they look like these but the Blaster is not nanite can we turn the Blaster into nanite 2 absolutely we can and if your FPS is dropping low right now don't worry it's just a nanite visual ization method that drops your FPS but look at what happens to triangles as I move further away do you see them changing look closely do you see them do you see it it's changing right yes so as I go further away right now the triangles are dropping in count which is exactly what Nite does and our goal is to go ahead and turn as many of our static meses into nanite to make our scene as optimized as possible and you should also see once you have many of these Storm Troopers right when we create the entire Army you can go ahead and enable and disable nanite if your computer can handle it and you will be able to see the FPS difference so the next thing we have to ask ourself is first let's go ahead and create nanite for our stor Troopers uh Blaster and then try to fix those ugly Shadows that we have and explain to you why exactly they're happening so let's go to our Blaster right here right click nanite enable nanite and it's going to load the asset once more and we have it solved so the question is now why do we have the ugly Shadows well let's find out we're going to go to our settings we're going to go to Project settings and then we're going to go to our rendering you don't have to do this I'm just trying to show you something and then we go all the way down to a setting that we enabled earlier on which was Ray Trace Shadows we're going to turn it off and then see it's gone so rate Trace Shadows basically is literally throwing out rays and then trying to see how the light reflects bounces and creates realistic shadows and that's what we want to turn on because we want those realistic Shadows but the problem is it's destroying our texture destroying our texture it's creating ugly Shadows why well let's go to one of our static meshes right here for example let's open this guy the problem is if we go to the top left view here and look at an option called nanite fall back look at what happens to our mesh do you see do you see how low poly our mesh has become do you see the helmet I'm going to turn that off pay close attention to it okay the ugly Shadows are there but our mesh is fixed this is the original mesh go back again Nite fall back right this is basically that lowlevel detail that dropping shadow on the main one and that's why it's broken absolutely so when nanite is creating that low-level detail not only is it doing that when it comes to the viewing of the mesh itself but also how light reacts to that because if the light hasn't react to the original mesh it's going to be more expensive so it's now reacting to the fall back mesh which is the lowlevel detail and so it's causing those ugly Shadows so for us there are many different ways you can fix this one of the quickest ways you can fix this is by saying to andreal engine hey I want you to keep my nanite meshes right and I want you to lower the level of detail as I move away from the camera but when it comes to lighting them and looking at their Shadows I want you to use the original mesh so we're still using nanite we're still using the performance save but not as much because we want our shadows to still be realistic so in order to do that we have to introduce you to another function of Unreal Engine which is called console variable which is down there yes the console commands console variables so it's basically a line of command and Farah you're familiar with commands right yes basically you are just updating a value a parameter in the engine for example in the entire engine you want update value you just update it over there and it reflects everywhere absolutely and the thing is when you go to the content folder sorry not the content folder when you go to the engine folder of every project there's a notepad file multiple notepad file that come with the default values that are set when you open up every un engine project you can go and change those default values using single lines of commands and we've already have our saved but again don't think that we know this number because we are geniuses every single time we used the console command it's been a Google search because we faced a problem so when this happened we searched and we found out that if we use this code right here which I'm going to copy and we're going to leave it in the description box below which is r. rracing nan. mode. U sorry space one so I'm going to piece it right here one is the variable that we're trying to change which is going to fix this so I'll hit okay see what happens boom gone we're using nanite so go to LIT check nanite is is still on but our shadows are fixed perfect so if you want to know exactly what happen you can go to the output log which has basically all of the the the last things that have happened within the engine and you can see at the very bottom we've turned on the nanite mode the rate tracing nanite mode but I actually don't know what that does p how can I figure out what each command does instead of one put a question mark So when you've got a command before changing it you can go ahead and go ahead and press question mark hit enter and then go to your output log and then it's going to tell you what that command has done F can you read that fall back M default yes so it says if you go to zero it's going to use the fall back mesh and by default it says default it was on zero so it was using the fall back mesh for Ray tracing but if you go ahead and changes to one it's going to use the streamed out mesh which is the mesh we have visible in our scene so by changing to one the rate tracing is now using this mesh which then fixes our shadows now that is just a tiny lesson about console commands I'll just let you know usually they start with the letter R so if you go to R and then Dot and then you can put down whatever you looking for and then it will follow so if the command is there you're going to see it if it's not there it's probably just not going to show up so you know you're putting down the wrong command now we'll cover commands later on during the rendering settings right yep okay cool so we can move on wait listen did you know that you can create highly photo realistic scenes with photogrametry by taking in what exists in the real world into 3D we've been using polycam to do exactly that using our phone and drone yes that's right and guess what they sponsor this video to give you guys 30% off their Pro Plan so you guys can go ahead and try it for yourself use the code bad decisions in the link in the description back to the course so farad now that we fixed the Shadows what is next let's populate our space with an army of Stormtroopers let's go I love that so I can see now these characters are inside each other because I have the original St selected so I'm going to go ahead to SC Stormtroopers turn this off and then I'm going to select everything I have in the front Army and then all I have to do is duplicate go to my Global Gizmo alt drag and then right click mirror right transform mirror y y boom just like that we have now the front-facing Army and I'm going to go ahead and delete this block out now and we've gotten ourself the two sides of the army let's go to the middle part I love that so for the middle part I'm going to go ahead and bring back our original Storm Troopers which are hidden right here and I'm going to pull them out to the side cuz we want to create a different pattern right and in order to create a different pattern I also want to switch up their original position so that they're not standing in the same order so I'll pull this guy out to the right and then pull this guy here and that's already a different position right just a little bit of a difference so far for this one I think we should go for a full grid what do you say let's go okay so shift select all of them go ahead to modeling you should already know how this works at this point it's not about technicalities anymore it's about your design choice so we're going to go and pull this guy back so that we're in this right position and then I want to go ahead and make this five nice I think this is looking good yeah what you saying J is on so bring it a little bit lower yes nice what' you say yes perfect I think this is perfect okay do you want to make him larger no why why you want to make him lar what do you mean like longer a little bit like maybe 12 no no no no no no the other one maybe like eight and then pull them no they are oh okay no maybe six seven six too many too many five I think this is good what do you say are okay yeah yeah it's fine yeah okay perfect yeah looks good good hit accept I can then go ahead and hide this delete it and then this pattern all of these patterns right everything selected now I'm going to go ahead and create a new folder I'm going to call this middle Army okay and then then select everything duplicate duplicate mirror Y and we are done mirror Y and we are done cool now that we're done with this we still have one last block to create but I just want to leave this up to your own preference so we're going to go fast forward the section and meet you when we're done with our [Music] army [Music] [Music] and just like that we are done with our army formation guys look at that seriously look at how beautiful your spaceship looks please go ahead and use the hashtag we told you guys to share your results with us at the end of every episode we cannot wait to see what you guys have created honestly this is looking really sick and I cannot wait to set up some cameras in their F I cannot wait so guys we are done with this chapter next chapter we are going to talk about a topic which can help make your scene even more realistic we are going to talk about decals so see you guys in the next chapter ciao CIA
Info
Channel: Bad Decisions Studio
Views: 5,525
Rating: undefined out of 5
Keywords: unrealengine, unreal engine 5, unreal engine, ue, ue5, Unreal Engine Tutorial, Unreal engine for beginners
Id: FQQy2tLncpE
Channel Id: undefined
Length: 35min 21sec (2121 seconds)
Published: Mon Mar 11 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.