Let's Build the RPG! - 61 – Torch Fire Full Tutorial - Fire and Light in Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
episode we are delving into the mysteries of Fire light and of shadow [Music] hey guys welcome to today's episode and today we're putting the finishing touches on our cave environment at least the visual part of it and I know we've already done a ton with fire over the course of this series but fire is pretty Elemental so we're gonna Master it we haven't yet done any sort of environmental fire in the game that we're making so this is the first and my goal with everything that we set up this episode is that you're going to have the various components for fire that you'll need for any fire actor so you'll have obviously the Niagara system but also the Light component and also a pretty good meta sound to use and then we can use those various components in any kind of Fire actors that we have throughout our game so here are the key concepts for today and there are a few new things in this episode but really it's about bringing together all these different facets all these different areas that we've covered over the course of this series into one cohesive optimized actor blueprint and along with the old during the course of this episode there's a lot of little hacks and tips and tricks so I hope you enjoy it and lastly here are the free assets from quixelbridge that you'll need to follow along this episode and as of recording this on 5.1 it's important that we don't use nanite on these assets and I'll explain why over the course of the episode this might change in the future but really it's not going to matter to get the really nice torch light effect that we're going for so let's get to it all right so to start this episode we're once again going to convert our starter content fire over to a Niagara system and I know I keep using the starter content fire but I really like it I've looked at other fire assets out there and at least for free content it's the best thing out there and that makes sense because it's unreal engine's standard starter content so we're going to start by going to content drawer in a Niagara environmental effects I'm going to create a brand new folder for fire and then I'll navigate back over to content into starter content into our particles and we'll right click on P5 and say convert to Niagara system if you don't have this option just a reminder we've done this in a lot of previous episodes but if you search for Cascade to Niagara system converter Cascade to Niagara converter you'll need to check that and restart the engine if you don't already have it and then you'll be able to right click on this if you have starter content enabled and then convert to Niagara system it'll take a few seconds here and then right click rename we're going to name it torch fire underscore NS and then what I'll do is I'll expand under Niagara environmental effect X and we'll move it into our fire folder move here so we'll go into that folder we'll open up that system so there's a couple of emitters here that we're not going to need so the first thing is I'll pause the system we can disable the flame001 emitter and also our spark submitter we won't need that so I'm going to select both of these emitters move them over consolidate these down to the four and the first thing I'm going to do I know we've done this a ton of times before guys I apologize we are going to acknowledge and clear all the issues and also down here under Niagara log acknowledge and clear these and then we see under the Embers emitter we have this GPU emitter properties the emitter is GPU and is using dynamic balance mode so we have to update this to be fixed and I'm also going to switch the other emitters over to GPU because since these are just torch lights we're not going to have Collision we don't need to use CPU and that's going to make our performance a lot better so Sim Target GPU computes them and make sure this is set to fixed and do that for the other emitters as well and we'll see that for the Flames emitter when we switch that over to a GPU then we can't do our light renderer and that's okay because if we're rendering lights for each particle that's pretty performance intensive so we're going to take care of the lighting in the second half of this episode but let's delete this out for now so in our flame submitter now we can update the things we need to so under spawn rate we're going to up this to seven in initialized particle we're changing our lifetime a little bit giving it a little bit more variance 0.5 to 1.0 for the shape location we want all this fire to spawn basically at the same point right around our torch wherever that's going to be so the sphere radius is just going to be one not 30 centimeters so we don't need to add velocity notes I'm going to disable the second one this add velocity001 I'm just going to switch this so instead of the fire going off sideways with the X's we're going to make those zero and the Z that's our upward velocity I'm going to change that make it a little bit higher 8 to 13. and now if I zoom in a little bit we see our fire is basically straight up I can hit play and there it goes we can disable both of these Dynamic material parameters we won't need those and also we can disable the Cascade conversion light properties now the main problem that I see with the emitter is that it starts the fire very very small and realistically it's not going to start that small it's not going to look realistic if it starts at zero so under scale Sprite size here we have to change this to I'm going to move it up to 0.25 and this is our normalized time this is the lifetime of the particles so at 0.25 time I'm going to add a key so right here it's at point one so at 10 percent of its lifetime we're going to change that value to be 0.275 so it starts off getting larger at a very slow rate and then instead of ramping up all the way to one we are going to make this only 0.6 so it's not going to grow that large because we're talking about just a torch light effect the fire is pretty small but the acceleration force down here I want to change this a little bit so I want to give it a random range Vector so we can hit the arrow search for random range vector and then the X I'm going to make this vary between negative 5 and 5 that's going to vary it to the left and right just a little bit and for the Z I'll keep the zero and one so it's just a very slight acceleration but then when we play we're getting a little bit more variation to the sides I'm going to do one more thing to give it variation and that is under particle update we are going to add some curl noise and I played with these curl noise settings a little bit I don't really understand the difference between these obviously strength is the intensity of the curl but I got the best effect with the noise strength of about 10 in the noise frequency of 200 and I also switched this noise quality cost to baked low here just so that this is really performant the very last thing I did under particle update I added a point attraction Force Point attraction and the idea of this is that the fire is being pulled upward and so I want that point to be slightly above the flame so the attraction strength is going to be 10 traction radius is 100 and I'm going to check this attractor position offset and to get it slightly above the flame we're going to give it a z of 10. so 10 centimeters above the origin all right so now on to the Smoke emitter for this one we're going to give it a spawn rate instead of 2 10 under add velocity I'm going to change this up quite a bit so instead of X being 35 to 60 we're going to make that 0 and 0 and upwards is just going to be two to five so basically percolating straight up now the interesting thing we're doing with the smoke is under scale Sprite size here we are going to start it at zero but we're going to add a key at 0.5 add key and at 0 0.5 it's going to be a value of 0.4 slightly less than it is but up here instead of continuing to grow we're going to select the key at 1 1 we're going to change this to actually get smaller with time this is going to be 0.225 and then also to give the smoke quite a bit of randomization under this uniform curve scale here instead of being a uniform scale I'm going to do a random range random range float and that's going to be from 1 to 3 and all of a sudden our smoke just got a lot bigger a lot more interesting but you see our smoke is still kind of drifting off there to the left so under acceleration force we got to get rid of that X and instead actually we're going to do a random range Vector it's going to be a minimum of negative 10x maximum of 10x and same with the Y we're going to do negative 10 and 10 and with the Z it is going to drift upward it's going to accelerate with time so 30 to 40. so some variation in the acceleration so the smoke is mostly going upward but it is going off a little bit to the side some randomization so then on to the Ember submitter this one we're going to give a spawn rate instead of 30 just 5 under initialized particle lifetime we're going to keep that at 1.2 to 1.6 but the big thing or I should say the little thing is Sprite size we're going to make this a lot smaller so this is going to be 0.5 0.5 and a maximum of 1.0 to 1.0 so very small Embers shape location again we're going to make that sphere radius of 1. we're going to disable both of these add velocity nodes for acceleration force here we're going to up the Z to 300 so those Embers are going to percolate up pretty quick so now if we play here and you might need to zoom in to really see them but you see the Embers they're kind of zipping out pretty far out from the fire what's causing them to zoom out so far is this Cascade conversion orbit here and it's specifically this offset right here so to bring them in a little bit more we're going to make this smaller so instead of negative 30 negative 20 instead of 30 20 and that's going to bring them closer to the fire so if you hit play zoom in a little bit yeah they're still zooming out a little bit but not much mostly just around the fire and then up and actually I think they're zooming up a little too fast so acceleration force I'll reduce this down to 200. okay on to the Distortion emitter this one's pretty straightforward so a spawn rate right going to increase this to 10 in the shape location sphere we're going to reduce this down not to 1 but just to 10 so right around the fire add velocity instead of again being 35 and 60 it's just going to be 0 0 and we're going to keep the Z 5 to 10 so the Distortion is going to move up slightly and then we're keeping everything else exactly the same so acceleration 60 that's fine scale's bright size just like that all good the last thing I'm going to do for all these emitters is I'm going to switch the emitter State over from self to system and I don't think this is actually necessary but I've heard it's just good practice to keep them all in the system that it's more performant that way so if your fire looks like this if you got a little bit of smoke emanating mostly upward but also outward then you're ready so now on to creating our torch actor and for this I'm going to use two free meshes that you can find in quixel Bridge right here now if you're following this series you know exactly how this goes so Linked In the description below you'll find a spreadsheet with codes that you can copy and paste directly into qixel bridge and it'll take you directly to the asset that we're using now for both of these assets you don't need to download of them at nanite quality and I'll explain why we can't use nanite at least as a 5.1 so for this I found medium quality it looks just fine and then once you download and hit add then you have to move them into a folder and I move them under a folder under Mega scans 3D assets and actually this is where they land when you download them but I just put them under Earth quadrant and then I also created a new folder for underground here and I just put them both here so now let's create a new torch blueprint so back to content back to blueprints under environmental I'm going to right click create a new blueprint class the parent class is going to be actor and we're going to name it torch fire one one word we'll go into that so I'm going to start by adding a component it's going to be a static mesh static mesh component here and I'll name this the torch stick and for this one the static mesh this is where we can pick our Palisade Spike and for this I'm going to rotate it upside down so that the pointy end is down so that's going to be wherever our torch is stuck so 180 on the green axis and then the scale we're going to make this a lot smaller for the torch so 0.5 0.5 0.5 and when we place this blueprint in into the level we can actually adjust the scale especially making that torch stick a lot longer if we need to and then to that torch stick we're going to add another static mesh component so static mesh and this is going to be our torch top and over here on static mesh I'm just going to search for burnt firewood and that's the other one we just downloaded and that one I'm going to change the location so the Z is negative 72 and it's going to be a little bit too high and that's okay because we're going to change the scale here to 3 by 3 by 3 and that's going to bring it directly in line with the rest of the torch but you see it's a little bit crooked so I'm just going to change the rotation slightly so e and then I can tilt tilt just like that e and w on your keyboard are my two favorite keyboard shortcuts because it just goes from translation the rotation right back to translation alright so now as a child component of torch stick not the torch top but if torch stick we are going to add a Niagara system Niagara particle system component and I'll just name this the Niagara system and this one is going to be what we just created so torch fire underscore NS and there's our torch fire but obviously we want to put it in a position so we can just move it up up and I'm going to put it a little bit higher so negative 70. and the reason this is negative is because we flipped our Palisade stick around so compile and save this and we are ready to actually put our torch fire into the world so content drawer we can just drag it in and you can adjust your camera just so you can zoom in very closely and actually what I'm going to do I'm going to delete it there I'm going to put it exactly where you saw on the intro which is on my sidewall shortly into the entrance of the cave so right about there and we can change the rotation a little bit so e move that over and out so we got the start of our torch but we have a few issues right so you would expect that the fire would be sorted would be prioritized in front of this torch top here and the other thing I'm noticing here is that there's no light emanating from the torch aside from a very faint glow behind it and if I go out a little bit this way then I See the Light way out into the distance but that doesn't make a lot of sense so we'll talk about the lighting but let's first fix that culling let's first fix the Sorting order of the fire and this mesh right here so I tried all sorts of things to adjust this I tried setting different things in the Niagara system so in the system over here I tried setting this to fix bounds and I tried doing that for the emitter as well I tried updating the fixed bounds to be much greater that didn't have any effect and I also tried all sorts of settings on the torch top here so all sorts of visibility settings I tried playing with none of them worked except for one setting that I thought was pretty cool if you search for the word coal there's this reverse calling here and if you check that what it looks like is that the mesh is only rendered on the opposite side of the mesh now this does have some issues because you see the stick here actually poking through that now so we can also set reverse calling here on the torch stick as well so I'm going to adjust the torch top to be a tiny bit smaller so let's make it 2.5 2.5 and 2.5 and that's looking pretty solid so compile and save this and then if we go back into our level there we go now if anyone has a better way of addressing this I am all ears so please post in the comments below but I think this looks pretty good with the reverse calling it basically switches the order in which Things Are are cold so the fire is in front but now let's talk about the lighting issues so there's really two issues we got the radiating and the distance out there even over on the walls over here and then the fact that there's basically no light close to it so let me talk about this problem first and I still don't have a great solution to this either but I'll show you what I did find out and then we'll go from there I think I got a pretty good solution to the local lighting so to begin to understand the emissive lighting issue here we got to go back into the blueprint and specifically we need to go back into the Niagara system and in the Niagara system it's in the Sprite renderer down here specifically this material but instead of going right into the material let's make a duplicate of it so we can play around with it so let's go into the folder just going to right click we're going to duplicate M fire sub uv1 I'm going to rename that and I'm just going to call it sub UV without emissive lighting because I do have a way of turning off the emissive lighting but it's not nearly as good looking as our fire is currently so let's go into that so with this duplicated then what I'm going to do is I'm going to go back to our torch fire NS and I'm just going to switch it out right here sub UV without a missive lighting save that and then this way what we can do is we can make this in a small window and we can actually watch our torch fire while we adjust this I'm going to expand out the details panel here so I played with all sorts of these settings and I came up empty with every single one except for one so what we're looking for is getting rid of this lighting effect on the edges of meshes in the distance so we have to go down in the details panel under translucency and under Advanced and the only setting here that I found had an effect was under translucency pass and this after depth of field here instead of after depth of field if I selected after motion blur and then applied that when I do that no more emissive lighting off of the size of materials in the distance because it's not occurring until after motion blur is applied but you'll notice your fire it looks a lot worse than it did before and in my mind the trade-off isn't worth it I really like the fire the way it was before and actually I think I like it even better with this before dof checked but I'm willing to live with it if you are but I'm hoping that one of you out there knows a way of turning off that Lighting in the distance when it's nowhere near our mesh here that we we could apply some very basic settings somewhere in this emissive material and that would solve the issue so if you know how to solve that please post in the comments below the last thing I'm going to do here is I'm going to change the name of this so I'm going to say right click rename and instead of without emissive lighting we're going to say apply before dof but now let's talk about the other lighting problem which I think we have a pretty good solution for and that is the fact that there's no light around the fire here but even before that with lighting we're always worried about performance so let's turn on our show FPS and let's see what our FPS specifically our milliseconds does before and after adding a light to this so back in our blueprint we can close out of our torchfire NS won't need that we can close out of our material here so the first thing is I'm going to add a point light and I have a friend on the Discord you know who you are Clyde and Clyde says never ever use Point lights and I think he's right but I think he's right in terms of rendering as seen because they're not real lighting they're basically high performance lighting that's simplified we're going to call this the flame point light and what we're going to do is we're going to contrast this with spotlights which look really good but performance is not so good so for this Flame Point light I'm going to change the intensity here to 1000 I'm going to change the light color to be a lot more flammable so something like this a bright orange maybe even a red right about there I'm going to give it a source radius so that's the radius around the fire of about 10 centimeters so 10 then I can move it up move it up be right around our fire and then I'm also going to give it a soft Source radius of 50. so we'll compile and save that and then let's look at our performance so pretty good so our frame rate went from in the 80s to just below 80. not too bad but the actual light is not doing well because we see this huge Shadow right here there's really no reason that the light should only be up there and not down here but the problem is it's colliding with this mesh in this General vicinity so how do we solve that well we have to go to our torch top here and search for shadow just for the torch top and for the torch top I'm just going to say because this is surrounded by by fire there is no reason for this top to generate a shadow so I'm going to turn off cast Shadow and that's actually going to help with performance as well so compile and save this and then let's look at it yeah so now we got a pretty good light all around but we still have the shadow of the actual stick here and for that I'm also going to do the same so torch stick I'll select that and if you search for shadow up here I'm just going to make this smaller so we can look at it side by side so we can again uncheck cast Shadow and that looks pretty good because the fire is emanating around the overall area and I don't think it'd be realistic to have a shadow in the vicinity here so we can improve performance by not having a shadow on the stick and also make it look more realistic I think so compile and save this minimize this so we're back up to 80 some FPS but let's contrast how this looks with the spotlight instead so what I'm going to do is back in our blueprint I'm going to add a spotlight and I'm going to move the spotlight up to the same location now the thing about the spotlight is it does shine in one particular direction so what I recommend is we can make one Spotlight that shines up and one that shines down so I could rotate this 90 degrees so that'll be the downward one and what I could do for the color I'll just select our Flame Point light here select our light color and we'll click and drag that over to Color Picker okay and then over to our Spotlight we'll select it right from our Color Picker make sure we got the same exact kind of light and I'll lower this intensity down to let's do 1000 and I'll make it a little bit higher than the light so something like this maybe outer cone angle I'll make it to 90 degrees and maybe the intensity only like 500 for that one and then we could duplicate it right click duplicate and this one will flip over to negative 90 so it's pointed upward and I'll move it down move it below the fire and this one I'll raise the intensity to one thousand and so this is going to be much more performance intensive so let's delete out our Point lights compile and save this let's see how that looks yeah and to really get the right effect I wanted to zoom on it in play mode here and you see the quality of the lighting the lighting just feels more real and especially if you add a flickering effect to it but the problem is performance so you see our frame right there it jumped up a full millisecond so you could go with spotlights and in fact if I was making cinematics with flame I would stick only with spotlights and I would do the same exact stuff that we're going to do now with Point lights but I do intend in multiple scenes in our game to have multiple torches and I want them to be as performant as possible so we're going to make the lighting as efficient as we can and I think the point lights still look pretty good and we're going to save about a millisecond to a millisecond and a half for each of the Torches but now let's create the means by which our torch light is actually going to be able to Flicker and I've seen a lot of ways of doing this online some with the timeline where the intensity goes up it goes down but we're going to do it in a material and the reason for that is that anytime you could do something in a material it's just much more performant it's running entirely on the GPU and the reason we can do that is because if I go back into my torch fire blueprint and I expand this so both on a spotlight but also a point light there's the opportunity of putting on a material light function material here and for our final torch we're going to set this up on a point light but I want you to see it on the spotlight first see the flickering and then we can switch it so to create this material I'm going to navigate back to our content drawer back to content under Mega scans under surfaces I'm going to create a new folder here for light function materials light function materials and we'll go into that and we'll right click we'll create a brand new material and I'll call this the M underscore firelight and we'll go into that so the first thing we got to do for this is switch over our material domain to a light function and this is really simple all it is is an emissive color so all we're going to do to start is get a texture sample texture sample and what I found to work well here is a noise node so if I just search for noise and you could pick this one that's good 64 by 64 tiling noise I'm glad they named it good and not bad tiling noise so we'll select that that's a joke so we've got to add the RGB here add and we're going to hook that up to the emissive color and we can already see kind of a discoloring in certain parts of our noise here but now the question is how do we make the flickering actually random and the way we're going to do that is with a Time node so time is exactly what it sounds like it's passing in the time and we're also going to use a scalar parameter so scalar parameter we're going to title this the flickering rate and from time we are going to divide this so divide and from the flickering rate we're actually going to divide this by 1000 so this is 1000 and then hook this up here but if I hook this up here to UVS it's not going to cause flickering what we're going to use to cause flickering is a sine node and this is using math which quite frankly is the furthest thing for my strong suit but the way I understand sign is it's kind of an oscillating wave basically something gets weaker and then it gets stronger and it gets weaker and it gets stronger and if you remember a couple of episodes back when we did the indoor Niagara 2D water it worked off of a sign to move that ball across the water and we can control the rate of that sine wave based on the time here the time is going to really randomize it and the flickering rate the multiplication here is going to determine for that randomization how fast is it so this value I'm going to set to a default value of about 10 and it can go from about zero to a thousand so I'm going to put in a note there 0 to 1000. now you're probably wondering why do we have an ad here we don't need this ad well I found that to give it some more randomization or really some more control we could do a one minus and from the one minus we're going to do another scalar parameter and this one is going to be flickering additive amount and we can hook this up here and by default this one's going to be 0.2 but I want this one to vary between 0 and 1 and apply and save this so we'll go back to our content chart we just want to make a child material for this so we'll right click on it we will create material instance and if you look at this you'll be able to see a slight flickering now if you want to up that you can change the default value here but we're actually going to do that in our child material so we'll go into that and we've got our two scalar parameters right here so we can check that off flickering additive amount make this 0.5 and then we see a lot more flickering if we go back to our torch fire back to the spotlights and I search for a material in the details panel make sure you got Spotlight selected here then we can search for our firelight firelight and I'll choose our instance and I'll also choose that for spotlight one down here so firelight choose our instance and if they're using the same material then they're going to Flicker at the same rate because they're both using time as a randomizing factor so we'll compile and save this and then what we can do is we can actually make this smaller and you could play with the child material parameters right if you up this to something like 0.8 then it's flickering a ton but I just found that that doesn't look realistic for a fire you can also increase the rate here so if we go up to a thousand that has less of an effect I found the additive amount really matters so I'll put this down to 10 again and if you want a very very subtle flickering keep it at 0.2 and then you can see it but only if you're looking carefully all right so the last thing we're going to do for visual effects before we move on to the meta sound is we are going to switch out our spotlights with a new Point light component but what I would like to do for the first time in this series I'd like to create a new component blueprint we've created a ton of actor blueprints in this series but we never created a component blueprint and the benefit to using that is then we can use that component in any actor and the reason I think this is useful is because then we can assign like our material our lighting intensity our lighting color and anytime we assign that component to any fire actor in our game then it'll use all those settings so what I'm going to do is I'm going to come to our content drawer over to content we got a folder here for blueprints and within the blueprints folder I'm just going to right click create a new folder call it components and within components going to create another new folder and I'm going to call it light components go into that and right click we're going to create a new blueprint class and you see where we have actor and pawn and character here then we can also search for a component like Point light so we have a point light actor class here we don't want that to be the parent class because instead we're going to use Point like component as the parent class and that way this is going to be able to be put in any blueprint so Point light component select and we'll call it a fire light component and we'll go into that and I'm just going to maximize this window by default it has all the same settings as a typical Point light but I can change those settings by default so intensity is going to be set down to 1000 our light color I can use our Color Picker here and pick that color and just like we did earlier our source radius is going to be 10 in our soft Source radius is going to be 50 and last but not least I'll search for material up here and we'll give it our Fire Light material so if I search for firelight pick our instance compile and save this so if you've got all those settings if you've got your light function material in there then we are ready to assign this to our torch fire actor so back to our torch fire actor I'm going to cut out our spotlights and instead we are going to add our Fire Light component so if I search for firelight component boom right there and in the viewport just make sure it's in the right location so we got to put it directly over our fire so right about there and the nice thing about this is when we assign it to other Fire actors we can change the intensity we can change the attenuation radius Source radius all that stuff so we'll compile and save this and then let's take a look so we've got some flickering there and to be honest I know the spotlight is more realistic but I just like the look and feel of the point light I don't know it's just got a warm earthy glow to it so the last thing with our torch here it's not the last thing for this episode but the last thing for the torch at least it wouldn't be realistic unless we gave it a sound and let's do that let's go back into our blueprint and let's add an audio component audio and you could put this as a child of the Fire Light because they're going to be in the same place I'm just going to rename it to be Fire audio and initially when I was thinking of the audio of this I was like oh man we got to go back to zap Splat we got to look for more free sounds but then I realized we have some pretty good fire that's already in starter content so on the right hand side here under sound if I just search for fire we get this fire zero one and fire zero one Q so I'll select that and let's go into that folder because I I want you to hear that [Music] so it's a pretty good fire sound but it sounds like the fire is a lot larger like it's got this air rushing into its sound this kind of deep sound and you only get that on a larger fire than something like this so then I was kind of disappointed because then we can't use the sound right but then I saw this low pass filter frequency and I was like what if we could cut out the Deep sounds so I checked this off and then I set it to something like 5000 and compile and save this and let me show you what this does because this actually has the opposite effect it's going to cut out the high pitched sound but it gave me an idea so now we hear it and it's mostly just that in the crackling the high-pitched stuff is kind of gone so then I went back in the blueprint here and I searched for a high pass filter because maybe we could filter it in the opposite direction and nothing and then it came to me why not do this in meta sounds and sure enough metasounds has a high pass frequency filter so let's create the sound in meta sounds so if we go over to content drawer over to content I'm going to go into sounds into Ambiance and right click we're going to create a new folder for fire and we'll go into that and then we'll right click and then under sounds we'll select metasound source and I will name this torch fire one we'll go into that now the first thing is this sound is just going to loop it's going to go and go and go so it's never going to finish meaning we don't need output on finished and the warning here is on finish should be connected for one shot meta-sound sources for sources with an undefined duration I.E looping remove the One-Shot interface and use an audio component so all we're going to do is over on interfaces we're going to remove the one shot interface so we'll hit the trash can here and then all we got is our output and that's totally fine so we'll right click here we'll search for a wave player wave player mono we'll hook this up to play and we'll just search under wave asset search for our fire fire01 I'll set it to Loop and instead of just hooking up our out mono here so here's the magic so we got to drag out from out mono and search for a high pass filter one pole high pass filter and then connect that up to the out mono and I played with a cutoff frequency here it's like what frequency of the sound do we want to set such that those really low pitched sounds they don't play and what I landed on the magic number was about six thousand so six thousand and then if I play this it's just that light crinkly sound and that's it and you could play with changing this right so if I set it down all the way to something like 1000 then I get more of that Airy sound so we're going to keep this somewhere between five and six thousand I'm going to set it to five thousand because the other thing I'm going to do is I'm going to do a very subtle pitch shift in the sound but instead of doing that here in the meta sound I'm just going to do it right in the torch fire blueprint so over here search for our fire come down to the bottom torch fire and we'll just do a pitch multiplier multiply it 1.2 1.3 something like that say that and that's just going to raise the pitch up a little bit make it sound like a smaller fire the other thing I'm going to do here is this checkbox for play multiple instances and the reason for that is so that if multiple torches are in the same vicinity that we're going to be able to hear all of them and last but not least I got to give this an attenuation setting and what I found to work well is our footstep soft surface attenuation that we set up all the way back in episode 19. location I'm going to set this back to zero and let me just show you that attenuation it's very simple so enable volume attenuation in a radius 50 follow-up distance 450. compile and save our blueprint and we are ready to test this it's just a light crinkling and none of that really heavy air sound so in short what that means is we can filter out the background noise of any sound with like a low pitch background or a high-pitched background and this is awesome I never knew you could do that for sounds and meta sounds one more reason to use meta sounds so for the last part of this episode we are going to get this point light this fire light component up and running on our gameplay ability torch and this is the very first gameplay ability that we set up all the way back in episode 23 and although it was a cool looking Niagara effect it didn't actually emit light in the local vicinity so let's Rectify that so I'm going to navigate to the content drawer back to content back to gameplay abilities and then over to blueprints under gameplay abilities and we'll specifically set this up on gameplay ability fire so on our gameplay ability fire we are going to add our Fire Light component right there and I'll call it our Fire Point light so compile and save this and then what we need to do is we need to change the transform because what's going to happen is it's going to attach itself to the hand but for whatever reason I couldn't get it to snap to our actual hand so it attaches to the hand but we still need to change the transform such that it is on the hand and so for that I'm going to give it a location of 40 30 85 and I just figured that out based on trial and error with this light and so then we can navigate over to our event graph here and I'm going to zoom out a little bit because we have to come down to our activate fire ability and specifically display only we got to use this string right here so this is our Torchlight so at the very end of this string what I'm going to do is I'm going to get a reference to our firepoint light and I'm going to set the intensity of this set intensity and it's going to be based on our gameplay ability intensity so I can get intensity and then drag out a pin here multiply this by let's do 10. so if our intensity is 100 then it's going to be a power of 1000 and then connect this up here and then I'm just going to copy both of these and at the end of deactivate ability so down here deactivate ability display only at the end of this string paste them in and we'll keep our new intensity 0 because whenever we deactivate yeah intensity should be zero so let's compile and save this and then we can test it out and the easiest way to test it out I'm going to take one of our gameplay abilities here that we've already created last couple of episodes and we'll just copy paste and we'll do a new one over here and we'll just change some details of it over to details panel Niagara system will be our Torchlight and our torch light pickup and by the way if you're not following this series then you're going to look at all this and be like what where is this it's all from previous episodes in the series so our ability icon is going to be torch Torchlight ability primary Niagara system again search for torch it's going to be the Torchlight NS and instead of how gameplay ability is used being Channel you can't see that but let's select our display only and then if I right click play from here and we can pick it up but the problem is our light is on by default and it's not attached to our player it's just sitting there in space we can be running around our invisible light here so let's actually attach the actor to our player when we pick it up so for that I'm going to go to the gameplay ability parent blueprint so gameplay ability here and because our gameplay ability fire when we do a begin play it's getting everything from our parent here then we can go to our gameplay ability parent and on our event begin play what we can do is we can attach this actor to a particular component so I'm going to move this out that we set up last episode and I'm also going to zoom out so I can move all this up a little bit what I'm going to do is I'm going to get a reference to our third person character get and that's happening right here and now we can specifically get the mesh and from here we can do an attach actor to component and then we can hook that up right here socket name is going to be hand underscore R socket location rule is going to be snap to Target rotation rule keep relative all these keep relative is fine and then we can connect this up here so then we can compile and save and that's going to attach our gameplay ability pickups to our actual character but then over on the gameplay ability fire the one other thing we have to do on event begin play we have to just say Okay this Fire Point light set the intensity to something well zero just so that's not activated the moment we pick it up last thing here we need to get a reference to our firepoint light and then from there attach component to component because we need to attach the Fire Point light specifically to our player's hand so I'm going to get a third person character reference scroll all the way down get third person character reference specifically we need to get the mesh and from the mesh we'll hook that up to the parent and the socket is going to be hand underscore R socket and location rule we have to snap to Target compile and save this and then maybe possibly we're ready for the final test all right moment of truth ta-da we've got our Torchlight and it is actually shining on the ground and we see the Shadows when the player moves actually let me full screen that let's see how it interacts with our torch over here yeah so we got a light on light there that's pretty cool and if we get really close to the wall yeah we can actually see our hand making Shadows there which I actually kind of dig we can still blow dry our hair from episode 23. so one very last thing to finish up our torch actor here is if we go to edit torch I just want to set the torch stick itself to have Collision so if we search for Collision Collision presets are set to block all Dynamic that's looking good but we should also go into the static mesh and we should just add a simple Collision to this so Collision I always add a 2060 op simplified Collision that's looking good save this and now we can exit out of all of these because what we can do is we can literally duplicate our torch fire here copy and paste I'm just going to put it on the ground see if our player character can run into it rotate it slightly upward maybe make the scale a little bit taller 1.5 last test yeah so our character can't run into the torch fire does that look Triple A quality I don't know guys we're still just flying by the seat of our pants here but hopefully you're enjoying the series so that concludes our episode for today and I know I've been saying it's been many episodes back now but we're getting to a gameplay prototype and we've been kind of distracted the last five or six episodes on our indoor environment here and I just got one more episode I want to do on indoor environment and then we're going to go right back to Ai and gameplay and you might have heard those water drops in the background and if you look very closely the sounds are coinciding with the water drop there getting the Reverb effect of our cave and we're going to set up all of our gameplay sounds to work properly in indoor environments starting with this cave so I hope to see you there
Info
Channel: NumenBrothers
Views: 16,706
Rating: undefined out of 5
Keywords: Fire flickering, Material Light Function
Id: ZceJPOMDLSA
Channel Id: undefined
Length: 36min 20sec (2180 seconds)
Published: Sat Mar 25 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.