Simple Instanced Spline Mesh UE4 Plugin Overview

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi um in this video i'd like to show you my new plugin that will be available on marketplace um in fact it's probably already available as you watch this video um it's a simple plugin that introduces um spline component but with instant static meshes for better performance so unlike the regular spline that modifies the meshes but consists of a lot of draw calls and this one uses instant static meshes under the hood so it's quite efficient to use it um and it offers some cool features it's very simple and lightweight plug-in so i highly recommend you check it out but let's get to it so there are two ways to get this plug-in working with your project there is not much you have to do obviously but um you can access it from the the place actors tab and you just type simple and it's going to be called simple instance spline actor you just drag and drop it in level as you can see there is like two points over here so if i kind of just grab the second one and move it around it's just like a regular spline right now uh what we're gonna do okay i'm gonna put it back to be very short and then um in in the actor details panel you'll have settings and there there will be a couple of settings over here um each of them is very well documented when you hover over them so if you don't know something there's probably a lot of good information about it when you hover over it so um what you need to do right now is or what you can do is you've got the meshes array here if you put um press the plus button you will see the new entry in the array just like a regular thing and you have the entry for the mesh that you want to create here you've got a local location and rotation of the mesh which is something you'll see later um and you have two options whether or not to align it to ground um for the rotation and location you'll see what that means in a bit so uh we're just gonna grab a simple cube for now as you can see nothing appeared right here right um it's not that it's bugged or something remember that the spline needs to be long enough to contain at least one mesh of this type so when i expanded you'll see you'll be able to see um to see the mesh um and if you expand it even more you'll see another one and another one and another one right so um so that's how it works if you have a huge mesh let's say you want to put place around the buildings or something like this something big then remember about this fact it needs to be long enough to to contain the building or whatever mesh you have so you can add more entries here um that's not an issue all of them needs to be valid so if it's invalid it's just not going to show up so let's say i'm going to go with the sphere um maybe not this one yeah there you go and as you can see now they're kind of working um like one keep one sphere one keep one sphere um it's because that's how they place in the array right so it's cube sphere and then it's gonna go back to cube and sphere back in cuban sphere if you want to randomize them because you can you just press the um you just highlight the randomize boolean here as you can see nothing changed really but that's still correct behavior because there is another another thing here it's called allow equal neighbors because there is only two meshes and this is not enabled it means that it won't allow the same two meshes next to each other that's why this randomization with two meshes doesn't make any sense so if i highlight this you will be able to see a couple of measures in a row um so if you've got a button here you can refresh this randomization by just dragging it around and will regenerate the entire array of things but you can also press the button if you want to so it's just up to you if you wanna if you don't wanna move it around so have it placed in level you can still just randomize it by pressing generate meshes um so that's one thing um if i was to add another mesh that would in this case be for example uh cone yep then you can already see that the randomization with three meshes even though this allow we call neighbors is not highlighted it's already much better so the more meshes you have the better randomization is obviously going to be so that's it for the randomization of the meshes the next thing i wanted to talk about is the ground alignment feature for each of these meshes you can ground align them so if i wanted to ground align this cube i'm just going to go with this and if i wanted to ground a liner it's rotation i'm going to hide this as a rotation it's probably going to be better if i if i go around like that um and i just as you can see they just go through the mountain here if i just highlight it like that you'll see the the location being snapped to the ground uh if i do it with the rotation as well you'll be able to see that they kind of match the the rotation of the of the ground at this point right so sometimes you want to use it sometimes you don't if i do it for all of the meshes you'll be able to see for all of them there you go another cool thing is as you can see your spline right here is kind of underground right now so there is a feature it doesn't make any difference if you do ground alignment for for the the meshes but you also can do ground alignment for the spline itself um it doesn't add anything to the um to how it looks generation but it adds to how um how you can work with it right because it's deep below the terrain level some might be hard to click later or something so just go with this and each point of this spline will be now ground aligned and except probably better accessible like that so so that's something to keep in mind um there is also another feature which is the mesh gap and these meshes have their bounds very specifically so you might not be able to see this so what i'm gonna do is i'm gonna remove those meshes as you can see there is no gap between them if you want to create a gap you can go with this feature and the x-axis is basically just a minimum and y-axis is maximum so basically if you want them to be randomized the gaps and you just type different values values in here um so if i type 20 and 20 it oh it's always going to be 20. so the gaps are equal everywhere but if i do like 0 and sorry 0 and let's say 100 you'll be able to see that those those gaps are quite random now um to a degree so so yeah um so that's also a cool feature if you're creating like a fences or um you know kind of something something more meaningful than just the cubes it's probably gonna gonna add some variety to your level design i think um there is another cool feature with this um so if it's worth noting that if you wanted to add another spline point you just highlight one of the points hold alt key left alt and drag it like that you're gonna add another point right so now i have third point here so as you can see it starts curving just like the spline shows so as you can see it's not really um exactly where the spline is right now and it's because the meshes are created based on the um their location is calculated based on the previous where the previous mesh ends not not exactly where the spline is which which causes this behavior um so to fix that you can just increase the sharp corner accuracy it's probably not visible right here because let's let's try it out maybe what i could do is add another spline point here so you'll be able to see that they kind of don't really match this okay um it's hard to show because there is sometimes very very like sharp corners with this ah it's probably visible right now um it's there's like quite sharp corner over here so it's gonna go out um it's not a bug it's uh it's something that um i was aware of while coding this i wanted this to be matching the previous mesh position not exactly the spline so that's why they kind of very nicely match but also if you want to fix it to be on the spline you can just increase the accuracy and if you go maximum five accuracy it's pretty much exactly where the spline is so um so if your staff doesn't match just go ahead and use it this way so um another feature of this would be centrifugal force um it's not a real centrifugal force but it's something that um might be useful for some people and i don't know how visible it's gonna be with the cubes but let's see um centrifugal force how it works um i'm gonna show you and draw you something here so basically what happens if you have a sharp corner like that normally let's let's assume that you are building um like kind of barriers on the side of the road which means that um if there are cars running around this road it's highly possible for them to kind of hit the barrier and and bend it outside so um the centrifugal force here the way it works all of the meshes are like oriented like that they're looking up and up and up and the closer they get to the actual sharp corner the more um outside oriented they will be so they will kind of bend outside not really bend but they will be just rotated you'll see and then we go back to the normal rotation so in practice you can um scale the the strength of this force so you can go like say 30 maybe 100 so i knew this is not going to be visible in the cubes um it's not going to be visible in cubes very well uh damn it let's see maybe we can make it it's gonna be more of it the more the more sharp the corner is the more visible that's going to be it's multiplied by this corner sharpness let's say so as you can see they're already getting um rotated towards outside if i just decrease that you get straight cubes and if you increase that you can get them to kind of rotate um in the corner like that it's it might not be very very visible with the cubes but if you create fences or bias that's gonna definitely be visible very well i use this plugin for my game and i tried to to build some cool stuff and fences with this and it was really really good um it added some variety and unnatural feelings to the game so i thought why not add it to the plugin as well um so um yeah there is one more thing i want oh sorry two things i wanted to talk about there is a feature called first mesh and last mesh um you can if you wanted for example to create a let's say it's a fence and it's um you want to to put some um like uh i don't know a gate in the end or at the beginning of it um for the purpose of of this um talk i'm just gonna use sphere you can set a first mesh to be something something particular something different to everything else or the same like something else anyways you can set the first mesh to be something particular as well as setting the last mesh to also be something particular so you don't have to use those you can use one of them you can use two of them but it's uh definitely possible to use them and they're right there for you so the last thing i wanted to talk about and i only enabled this i only um exposed this from c plus plus in case somebody has some issues with the cpu but but normally you want the best first feature to be always enabled so basically it's a synchronous generation basically what it means that if it's enabled this very first one it means that the whole math mathematics of this spline will be calculated on completely separate thread and it's not gonna bottleneck your level design so if i disable this and i drag it around and the the the the longer it gets you will be able to see maybe if i do start fps you'll be able to see i've got 120 frames per second if i start dragging this it goes significantly down and the longer it gets there is more maths to it there is more calculations and there is more meshes and therefore it's just going to go down the meshes are instanced so this is the entire thing here is just one draw call so that's cool however the generation itself can get pretty nasty when you kind of do it like that and you get the ground alignment and everything there's quite a couple of um heavy things for the cpu probably nobody wants to build the the spline along like this but um it's definitely not not very pleasant um to work with when you do have to do it this slow so asynchronous generation what it basically means it will move entire mass to the separate thread if i enable this as you can see i'm not losing any frames i can do it very very quickly and without any um any hiccups and hitches in the editor so that's cool i think um you should use this feature at all times it's definitely in stable state right now it shouldn't shouldn't crash and shouldn't cause any problems if it does though please let me know and as i said i use this for my personal project as well so it's constantly in development if i find any bugs with this or my level designers i'll address it straight away but if you do find some bugs with it you can definitely go ahead and you know hit me up with this and we'll see what we can do as you can see i already generated quite a long spline and i don't really have any hitches in the editor so obviously it breaks here because we don't have any um any ground here to align to so we're gonna go like that yeah as you can see it's this generation right now takes a few seconds let's say so um i wish i could make more but my my terrain is just not not big enough for to encompass this the spline but if you make it big enough it will take let's say a couple of seconds for your generation um that's when you wanna you're gonna see uh i'm probably not gonna be able to see that to show that here but if it takes longer than two seconds to generate it you will see notification right here on the right bottom and it it will just show you that the meshes are being generated so if this whole thing disappears for a couple of seconds because you have very very very long spline don't be worried about it because that's a normal thing it's a separate thread so the separate uh thread of your cpu works um does that work and and that's why you have to wait for it but um at least you don't get your computer completely frozen um so that's a thing to keep in mind um i think that's everything for this video um i don't think there is much more to talk about it's very simple plugin um there is a couple of cool features with this but it's mainly built to create some kind of fences walls maybe a list of buildings or something like that so you can definitely kind of like you know see and um definitely use it for many purposes at the moment the ground alignment works only on the on on this on the terrain on the landscape it is something that i will be changing in the near future so you'll be able to to ground align this to also another static measure so if you have like a floor in the building or something you'll be able to to align this to the ground as well however at the moment it only aligns to to the landscape um but yeah uh it's gonna be quite simple change so it's it when i do change it it's not gonna break your current levels because in order for this to snap to the ground again you need to you would need to modify it or press generate meshes again so you don't have to be worried about it at all um so yeah i think that's it for this video and uh hit me up with any questions with it and ask for features if you need to and if i have some spare time i'm definitely happy to improve this and see you later
Info
Channel: Furious Production
Views: 4,720
Rating: undefined out of 5
Keywords:
Id: FIgxPlm1K1w
Channel Id: undefined
Length: 21min 11sec (1271 seconds)
Published: Thu Oct 07 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.