Great information! Thanks for sharing as I've been digging very deep in your PCG Electric Dreams demo to break it down for my community. Great video for the 5.4. Keep it coming :)
Hi Adrien, thank you so much for doing the videos! It just means a lot to have learning resources from someone who has worked on the system. 5.4 was a breakthrough for PCG graphs IMO, arrays and data assets are just a game changer. You guys on the PCG team are amazing
This is so incredible! I was making some PCG and watching some TH-cam tutorial and UE version was 5.2 in the tutorial and I was using 5.4 and it doesn't works because of version updated. but this tutorial helped me to sole the problem. Thank you so so so much!
Excellent, thanks for this new serie. I'm working on PCG with data assets on 5.3 but sadly UE freeze randomly when I tweak values on data asset. I hope it'll be more stable on 5.4
Thank you very much for doing these videos! I am having trouble opening my map which contains a pcg volume with a graph, I get this error when opening it: "Assetion Failed: InstanceReorderTable.IsEmpty()" It is in the Engine/Source/Runtime/Engine/Private/InstancedStaticMesh/ISMInstancDataManager.cpp file, line 1021. When looking at the code, I couldn't really make sense of it except that it has something to do with the function "MarkForRebuildFromLegacy". I was wondering if this has something to do with the pcg as I get the same error when dropping the pcg graph in a new level. After deleting the pcg, I still cannot open the level though.
@@adrienlogut3482 Hmm, I am gonna look into it a bit more but I don't really think it has something to do with my meshes. It could be one of my blueprints though because I have some in the level that use instanced static meshes but I already disabled all of the code in those xD. Yeah, its really weird, thank you very much for answering though!
Hi ! Thank you very much for your great tutorial :) ! I have an error message on the static mesh spawner "Attribute 'Mesh' is not in the metadata" and because I'm a beginner I don't understand where the problem comes from :/ . How can I fix it please ?
Hey! It's pretty easy, it means you don't have an attribute named "Mesh" in the incoming point data of you static mesh spawner. In the tutorial, meshes are assigned to point with the match and set attribute, and you can inspect the result of the match and set to see the name of the attribute :) just use that one in the static mesh spawner!
Please tell me, these PSG cubes are tied to the slope of the landscape, parallel to the plane, and the tied trees stand stably to the plane of the slope (trees on the slope do not rise directly with the slope), but at 5.3 it was vertical. HOW to make trees stand vertically on a slope?
It has not changed between versions, if you need them to stay vertical, add a transform point with an absolute rotation of 0,0 on XY (and potentially any number for Z for random rotation)
Hi Adrien, great video as always! May I ask a question here: I struggle a bit with the "Attribute Filter" node - I simply want to filter all points against a threshold, lets say $Position.Z > 1000. I can easily do that using a "Constant Threshold" and set the value - but how can I parameterize that, e.g. using a parameter? I dont know what to put into the "Threshold Attribute" pin to achieve that without hardcoding it.
It's pretty easy actually! If you uncheck Constant Threshold you have a new pin Filter that appears. That's for another data that will be used as the threshold. So if you plug an attribute set (like with a Graph Parameter or a Create Attribute node) into the filter pin, you can set the threshold attribute to @Last or the exact name of your attribute in the attribute set for it to be used as a filter
Hello, thank you for your videos! Sorry if this is a dumb question but is it possible for the PCG to ignore certain collision shapes for point generation? For example a static mesh building with a pcg volume on top where the points generate around the static meshes boundries.
Great video! Maybe we could get a tutorial on how to make a loop graph? It would help my understanding a lot! I'm trying to get landscape layers by a string array in my BP to apply an attribute filter but I'm just lost. I have no idea how to even begin to set it up.
@@adrienlogut3482 great, cause I spent 2 hours trying to figure that out and had to just have like 10 variables instead of having the one array. Hopefully its my instance but I'll take whatever I can get.
I can give you a hint for your case. Use the Attribute Partition on $Index for splitting your single attribute set with multiple entries to multiple attribute sets with a single entry. Loop is looping on the data in the data collection (the dropdown in the attribute list view) not looping on the elements of a given data (like points or entries in an attribute set)
@@adrienlogut3482 I appreciate it but right now it’s gibberish. I can wait and see what you produce and try to figure it out from there. Sadly I’m a visual learner.
No it's the same cost (perhaps a little costlier because of the attribute indirection) It's just the basics to create generic graphs. If you don't need to have generic stuff, you can stick with the hard-coded way.
@@adrienlogut3482 Thank you very much for your reply. The problem I encountered was that pcg setting assets needed to be instantiated before it could be used normally, and this operation was completed automatically when I dragged pcg setting into pcg graph. I could not find a way to create pcg setting instance manually. And what I get through the path is only a pcg setting path reference, not the model and material path in it
Spawn actor can also use an attribute for spawning, it's Spawn Attribute setting on the node. The rest of the logic is the same, you assign a path to an actor to spawn to each point.
Hey man, I just wanted to say thank you for your videos and all that you do! I literally downloaded Unreal Engine 5 after learning about PCG, with no development experience whatsoever. Your videos are a HUGE gift, and are extremely helpful. If there's anything more we can do to support you, please say it! Otherwise, I'll keep looking forward to whatever you put out. If I could ask one question, and I know it isn't your expertise, but: I'm getting a bit discouraged with tree performance. Everything with development is going well, especially using PCG, but trees like the Spruce trees from your spline tutorials seem to destroy performance. Do you have any tips or advice for this?
Yeah I'm not entirely sure. I think I enabled Nanite on those, but I can't remember. You can see the very high density provided in the Electric Dreams Demo. You could try to use World Partition and partition your generation so it is less demanding at runtime.
Thanks so much, this is a great improvement! I'm wondering if you have any recommendation on how one might do this, but where each weighted mesh is pulled randomly from an array of its own kind (eg, when a tree is selected - it pulls randomly from an array of that type of tree)?
@@adrienlogut3482 Thanks, I but I'm thinking more of a per-array weight as opposed to a per-mesh weight, but I don't see how/if the data could flow? Imagine if the mesh variable in the struct is an array instead of a single mesh.
The selection could be first a weighted selection for a type of mesh. Here that would be Tree, Rock and Grass. Then when the selection is done, you chain another match and set with the array of meshes for a given mesh.
Thanks, I was waiting for this feature. Do you know how to filter meshes which exceed a spline? For example I sample on interior of a spline. Sometimes the bounds exceeds the spline because of transform or random point offset. I want to filter these things. It is very important for interior systems.
You can try to project the points on the spline interior sampler or the new Surface from Closed Spline, with the option to not Project anything in the projection node. Any point that is outside the interior will be discarded that way.
Hey Adrien, thanks for all the videos :) I’m getting better and better at learning PCG, without having any experience with blueprints or programming beforehand. I’m after a specific effect though, which I don’t know how to achieve in PCG. Basically I’m trying to build a custom node/ sub graph that has two inputs, which each take in a selected group of points: one is a group of points, in which each point is facing the nearest point of the group, that goes into the second input. Is there maybe a way to reach you for a more in depth look into that problem? That would be so great :) And I’d be very thankful!
It seems like you want the Distance node, with the same data set plugged in both pins. If you output the distance as a vector, you can then use a Make Rot from X, using this attribute and write into $Rotation, so that the point will look at the closest point.
There is nothing fancy, so either your volume is too small, you don't have a landscape, you haven't generated your PCG component or you haven't selected the right debug object.
I have been watching PCG for years, and I think it's essentially worthless without automatic LoD. I don't believe that PCG can generate Nanite meshes, so I could just ignore LoD. Am I missing something? RMC does this, but you have to guess your own documentation, which makes that fairly useless, as well.
We can spawn Nanite meshes, that's what was done in the Electric Dreams demo for example. Building HLODs for the whole world generated with PCG is not yet easy to do, but we provided a builder in 5.4 to automate the generation on very big worlds. After that, it's pretty much what UE is capable of with World Partition. You can see in the State of Unreal how we generated the tiles for Lego Fortnite.
@@adrienlogut3482 But nanite meshes set using pcg graphs don't recognize the nav mesh. Not sure if I'm missing a setting in the nanite mesh or in the nav mesh. There's no issues using non-nanite meshes.
@@adrienlogut3482 I misremembered. My actual issue is that you can't create Nanite meshes at runtime, so you can't build a procedural world out of Nanite meshes unless they are 100% prefabs (which I am considering doing). I would imagine morphing a Nanite mesh at runtime would either error out, or break all the Nanite features, creating an unpredictable visual mess.
@@chaosordeal294 Depends on what you want to generate. We don't have landscape generation (since landscape is read only from PCG point of view), but you can run the generation at runtime. We also have Hierarchical Runtime Generation for 5.4
@@adrienlogut3482 Unfortunately I can find almost zero information about HRG, as it is very new, but I will keep an eye as docs are created. very much appreciate the responses
Not sure which series you are talking about then ^^ as stated the tuto assets are on my GitHub and it has all the material from the previous videos, starting from the Short Episode 1.
They are standalone "maps", and all available in the repository :) But I plan to have at some point a gathering of all techniques to something a bit more complex.
WARNING : It is best to not get the Data asset (get property from object path) from the data asset pin, it will cache it and no matter what you do, changes you make on the data asset wont be reflected, best to browse directly from the property node
Not sure what you mean with the "Browse directly from the property node". But yeah we have a few issues with refresh, which is gonna be fixed in the final version of 5.4.
@@adrienlogut3482 you can either plug the node or select it directly in the node itself. When I plug the node, all the changes I made in the data asset were not reflected. I do not want to wait for the official release to start working on it, I will have a headstart and just migrate it
I do it in the video and it refreshes normally. But yeah there are instances where it doesn't refresh as expected. You can force the Regen with a ctrl click on Force Regen in those cases. Or use the static option indeed
Great information! Thanks for sharing as I've been digging very deep in your PCG Electric Dreams demo to break it down for my community. Great video for the 5.4. Keep it coming :)
Glad it was helpful! But it's not my demo haha more talented people than me worked on this x)
@@adrienlogut3482 Never the less love your work and info you provide. Learned a lot from you and I'm spreading the knowledge. Keep it up!
Hi Adrien, thank you so much for doing the videos! It just means a lot to have learning resources from someone who has worked on the system.
5.4 was a breakthrough for PCG graphs IMO, arrays and data assets are just a game changer.
You guys on the PCG team are amazing
This is so incredible! I was making some PCG and watching some TH-cam tutorial and UE version was 5.2 in the tutorial and I was using 5.4 and it doesn't works because of version updated. but this tutorial helped me to sole the problem. Thank you so so so much!
Man, you're a lifesaver. Thanks so much.
Excellent, thanks for this new serie. I'm working on PCG with data assets on 5.3 but sadly UE freeze randomly when I tweak values on data asset. I hope it'll be more stable on 5.4
Great tutorial and nice presentation!
Amazing! Thank youuuuu
Thanks Adrien!
Avesome. Thank you very much
thanks for all vids dude
Thank you very much for doing these videos!
I am having trouble opening my map which contains a pcg volume with a graph, I get this error when opening it: "Assetion Failed: InstanceReorderTable.IsEmpty()" It is in the Engine/Source/Runtime/Engine/Private/InstancedStaticMesh/ISMInstancDataManager.cpp file, line 1021. When looking at the code, I couldn't really make sense of it except that it has something to do with the function "MarkForRebuildFromLegacy". I was wondering if this has something to do with the pcg as I get the same error when dropping the pcg graph in a new level. After deleting the pcg, I still cannot open the level though.
That's weird, especially if you have deleted PCG. I've never seen that error unfortunately :(
Could it be an issue with your mesh?
@@adrienlogut3482 Hmm, I am gonna look into it a bit more but I don't really think it has something to do with my meshes. It could be one of my blueprints though because I have some in the level that use instanced static meshes but I already disabled all of the code in those xD. Yeah, its really weird, thank you very much for answering though!
Pretty cool! Thanx!
Hi ! Thank you very much for your great tutorial :) ! I have an error message on the static mesh spawner "Attribute 'Mesh' is not in the metadata" and because I'm a beginner I don't understand where the problem comes from :/ . How can I fix it please ?
Hey! It's pretty easy, it means you don't have an attribute named "Mesh" in the incoming point data of you static mesh spawner. In the tutorial, meshes are assigned to point with the match and set attribute, and you can inspect the result of the match and set to see the name of the attribute :) just use that one in the static mesh spawner!
Thanks!
Please tell me, these PSG cubes are tied to the slope of the landscape, parallel to the plane, and the tied trees stand stably to the plane of the slope (trees on the slope do not rise directly with the slope), but at 5.3 it was vertical. HOW to make trees stand vertically on a slope?
It has not changed between versions, if you need them to stay vertical, add a transform point with an absolute rotation of 0,0 on XY (and potentially any number for Z for random rotation)
@@adrienlogut3482 Thanks a lot
Hello, I don't see any points generated - how should I fix it?
Found: I use default floor instead of landscape
wow
Thank you Adrien, any way to configure the DataAsset file using a BluePrint ? (Set ??? Parameter or Get Actor Property) ?
Yes Get Actor Property is the right way to query the value on a given actor :)
@@adrienlogut3482 Thank you and very usefull features + very good video
Hi Adrien, great video as always! May I ask a question here: I struggle a bit with the "Attribute Filter" node - I simply want to filter all points against a threshold, lets say $Position.Z > 1000. I can easily do that using a "Constant Threshold" and set the value - but how can I parameterize that, e.g. using a parameter? I dont know what to put into the "Threshold Attribute" pin to achieve that without hardcoding it.
It's pretty easy actually! If you uncheck Constant Threshold you have a new pin Filter that appears. That's for another data that will be used as the threshold. So if you plug an attribute set (like with a Graph Parameter or a Create Attribute node) into the filter pin, you can set the threshold attribute to @Last or the exact name of your attribute in the attribute set for it to be used as a filter
@@adrienlogut3482 Perfect - "@Last" was the part I was missing - thx a lot, worked like a charm!
Hello, thank you for your videos! Sorry if this is a dumb question but is it possible for the PCG to ignore certain collision shapes for point generation? For example a static mesh building with a pcg volume on top where the points generate around the static meshes boundries.
Yes of course! Have a look at Episode 4, close to the end, I show how to exclude a house from the generation
Great video! Maybe we could get a tutorial on how to make a loop graph? It would help my understanding a lot! I'm trying to get landscape layers by a string array in my BP to apply an attribute filter but I'm just lost. I have no idea how to even begin to set it up.
It's the next video in the pipes ;)
@@adrienlogut3482 great, cause I spent 2 hours trying to figure that out and had to just have like 10 variables instead of having the one array. Hopefully its my instance but I'll take whatever I can get.
I can give you a hint for your case. Use the Attribute Partition on $Index for splitting your single attribute set with multiple entries to multiple attribute sets with a single entry. Loop is looping on the data in the data collection (the dropdown in the attribute list view) not looping on the elements of a given data (like points or entries in an attribute set)
@@adrienlogut3482 I appreciate it but right now it’s gibberish. I can wait and see what you produce and try to figure it out from there. Sadly I’m a visual learner.
감사합니다!
Is there any optimizations gains to do it like that? Instead of the "old" way to use static mesh spawner and put the meshes there?
No it's the same cost (perhaps a little costlier because of the attribute indirection)
It's just the basics to create generic graphs. If you don't need to have generic stuff, you can stick with the hard-coded way.
@@adrienlogut3482 Thanks, you nailed the answer ✌️
Is there a way for me to use pcg setting similar to mesh array in video and change the pcg setting instance at any time
The logic I show there works for any Object, as I'm working with paths. It would work with Actors, or any object actually.
@@adrienlogut3482 Thank you very much for your reply. The problem I encountered was that pcg setting assets needed to be instantiated before it could be used normally, and this operation was completed automatically when I dragged pcg setting into pcg graph. I could not find a way to create pcg setting instance manually. And what I get through the path is only a pcg setting path reference, not the model and material path in it
IIRC you can right click on a node and create an instance out of it
Great video. Is there perhaps any way to do this with Packed Level Actors instead of Static Meshes?
Basically is there a way of achieving this with Spawn Actor node instead of Static Mesh Spawner?
Spawn actor can also use an attribute for spawning, it's Spawn Attribute setting on the node. The rest of the logic is the same, you assign a path to an actor to spawn to each point.
Hey man, I just wanted to say thank you for your videos and all that you do! I literally downloaded Unreal Engine 5 after learning about PCG, with no development experience whatsoever. Your videos are a HUGE gift, and are extremely helpful. If there's anything more we can do to support you, please say it! Otherwise, I'll keep looking forward to whatever you put out.
If I could ask one question, and I know it isn't your expertise, but: I'm getting a bit discouraged with tree performance. Everything with development is going well, especially using PCG, but trees like the Spruce trees from your spline tutorials seem to destroy performance. Do you have any tips or advice for this?
Yeah I'm not entirely sure. I think I enabled Nanite on those, but I can't remember. You can see the very high density provided in the Electric Dreams Demo. You could try to use World Partition and partition your generation so it is less demanding at runtime.
Thanks for this great video! but I want to know if I added new variables in the Structure, how to get it in the PCG Graph?
Might want to have a look to the next video in the series ;)
@@adrienlogut3482 Thank you ! I got it !
Thanks so much, this is a great improvement! I'm wondering if you have any recommendation on how one might do this, but where each weighted mesh is pulled randomly from an array of its own kind (eg, when a tree is selected - it pulls randomly from an array of that type of tree)?
You could extend the data asset with a weight for each mesh. Then you can provide this weight attribute in the match and set settings :)
@@adrienlogut3482 Thanks, I but I'm thinking more of a per-array weight as opposed to a per-mesh weight, but I don't see how/if the data could flow? Imagine if the mesh variable in the struct is an array instead of a single mesh.
The selection could be first a weighted selection for a type of mesh. Here that would be Tree, Rock and Grass. Then when the selection is done, you chain another match and set with the array of meshes for a given mesh.
@@adrienlogut3482 Oh interesting, thanks I will give that a shot!
Thanks, I was waiting for this feature. Do you know how to filter meshes which exceed a spline? For example I sample on interior of a spline. Sometimes the bounds exceeds the spline because of transform or random point offset. I want to filter these things. It is very important for interior systems.
You can try to project the points on the spline interior sampler or the new Surface from Closed Spline, with the option to not Project anything in the projection node.
Any point that is outside the interior will be discarded that way.
10:55 Does this attribute have data type Soft Object Reference?
It's the type of my Data asset, and it is an object reference here, but it can be a soft too.
Hey Adrien, thanks for all the videos :) I’m getting better and better at learning PCG, without having any experience with blueprints or programming beforehand. I’m after a specific effect though, which I don’t know how to achieve in PCG. Basically I’m trying to build a custom node/ sub graph that has two inputs, which each take in a selected group of points: one is a group of points, in which each point is facing the nearest point of the group, that goes into the second input. Is there maybe a way to reach you for a more in depth look into that problem? That would be so great :) And I’d be very thankful!
It seems like you want the Distance node, with the same data set plugged in both pins. If you output the distance as a vector, you can then use a Make Rot from X, using this attribute and write into $Rotation, so that the point will look at the closest point.
how to make a landscape consisting of hexagons using PCG?
That's pretty complex and not really suited for PCG at the moment. You'll have to create your own nodes to create/manipulate hexagon shapes.
Can the data asset value be changed at runtime?
Yes it can! But you'll have to manually regenerate because there won't be any callback at runtime
I do till 1:44 but there is no preview cubes
There is nothing fancy, so either your volume is too small, you don't have a landscape, you haven't generated your PCG component or you haven't selected the right debug object.
@@adrienlogut3482 Correct, I forgot debug mode, thanks
I have been watching PCG for years, and I think it's essentially worthless without automatic LoD. I don't believe that PCG can generate Nanite meshes, so I could just ignore LoD. Am I missing something? RMC does this, but you have to guess your own documentation, which makes that fairly useless, as well.
We can spawn Nanite meshes, that's what was done in the Electric Dreams demo for example.
Building HLODs for the whole world generated with PCG is not yet easy to do, but we provided a builder in 5.4 to automate the generation on very big worlds.
After that, it's pretty much what UE is capable of with World Partition. You can see in the State of Unreal how we generated the tiles for Lego Fortnite.
@@adrienlogut3482 But nanite meshes set using pcg graphs don't recognize the nav mesh. Not sure if I'm missing a setting in the nanite mesh or in the nav mesh. There's no issues using non-nanite meshes.
@@adrienlogut3482 I misremembered. My actual issue is that you can't create Nanite meshes at runtime, so you can't build a procedural world out of Nanite meshes unless they are 100% prefabs (which I am considering doing). I would imagine morphing a Nanite mesh at runtime would either error out, or break all the Nanite features, creating an unpredictable visual mess.
@@chaosordeal294 Depends on what you want to generate. We don't have landscape generation (since landscape is read only from PCG point of view), but you can run the generation at runtime. We also have Hierarchical Runtime Generation for 5.4
@@adrienlogut3482 Unfortunately I can find almost zero information about HRG, as it is very new, but I will keep an eye as docs are created. very much appreciate the responses
Could you make this series in continuity of the serie of how to use PCG i could be great to show case these feature on the precedent project
Are you talking about the small project I did for the splines?
@@adrienlogut3482 No I was talking about the last series about PCG, you could update the project with the new features
Not sure which series you are talking about then ^^ as stated the tuto assets are on my GitHub and it has all the material from the previous videos, starting from the Short Episode 1.
@@adrienlogut3482 I'm talking about the series of videos you made on the PCG on TH-cam, your previous videos
They are standalone "maps", and all available in the repository :) But I plan to have at some point a gathering of all techniques to something a bit more complex.
are the new clonners pcg graphs?
New clonners? What is that?
@@adrienlogut3482 the motion design mode now has cloners and effectors. Wondering if they are just PGC under the hood
Not that I know no
WARNING : It is best to not get the Data asset (get property from object path) from the data asset pin, it will cache it and no matter what you do, changes you make on the data asset wont be reflected, best to browse directly from the property node
Not sure what you mean with the "Browse directly from the property node". But yeah we have a few issues with refresh, which is gonna be fixed in the final version of 5.4.
@@adrienlogut3482 you can either plug the node or select it directly in the node itself. When I plug the node, all the changes I made in the data asset were not reflected.
I do not want to wait for the official release to start working on it, I will have a headstart and just migrate it
I do it in the video and it refreshes normally. But yeah there are instances where it doesn't refresh as expected. You can force the Regen with a ctrl click on Force Regen in those cases. Or use the static option indeed
@@adrienlogut3482 I did force Regen but nothing changed, I even restarted your video 4 times to see if I was doing something wrong
You need to do it with a Ctrl + Click so it clears the cache :)