Hi people, I have an issue with PCG. I’m using some of the graphs from electric dream project in my own project.
I have couple of PCGDemo_Forest graphs into my scene in order to spawn some vegetation on the landscape, everything works fine in the editor, but when I hit Play or do a render there is bunch of trees spawning on random spot (maybe not so random…) this appears on flat surface at differents height, I’m not sure what going on because I made some test on other maps, it does not happen everytime. it seems that happens on openworld maps only.
Anyone could bring some light please?
I add two image showing the difference between editor and play mode.
I don’t know for sure, but just speculating here. Is that structure on a different sublevel or Data Layer? Perhaps in editor PCG is only spawning on surfaces inside of its “level”, but at runtime world partition is putting everything together and PCG is suddenly aware of those surfaces.
Of course you could also tell PCG to only work on meshes with a certain tag, or exclude some with a tag.
Also if you’re happy with your PCG results, you can temporarily bake it all out to HISMs and it won’t autocompute the graph again at runtime.
Yes indeed the structure is a level instance. But the PCG is setup to spawn only on landscape, there is no landscape on the sublevel, no PCG either.
This issue seems to be related to the height of meshes, in an other map with a normal cube bunch of trees are spawning on the cube ( and even on eachother), on a large assembly and on a flat surface witch is not that high…
Areas where those trees are spawning are not populated by any PCG volume bos or any splines.
Do you mind showing your graph?
I think the forest is using the World Ray Hit Query to find places to spawn the trees. If that’s the case, it could be possible that your bounds are not the same in Editor and at Runtime.
Thank you for this.
I’ve tried to get this in frame but it’s quite large.
I hope it would not be too compressed to still be readable. Otherwise, if you have the electric dream demo, it is PCGDemo_Forest graph asset. I’ve just migrated from there to my project.
It appears that it comes from the PCGWorldActor of my scene, witch I dont really know what is it. When I hit simulate, I can select those trees and I figure that the PCGWorldActor spawn the PCGDemo_MountainTrees graph, I dont know why, I’ve never setup any of this…
Here is some screenshots that shows what happen.
I tried to delete the PCGWorldActor from Tool/PCG Framework/Delete PCGWorldActor, but it delete it for 2sec and then it reappaer in the outliner.