Having Trouble Spawning Spline Actors With PCG

For the life of me I can’t seem to figure out where I should Put the spawn actor node to maintain the difference between the splines points and the landscapes points have been at it for 4 days now haha. *ugly cries . if place the spawn nod before the difference the spawned spline castles result in trees being generated inside if I put it after it just doesn’t spawn or requires a force generation however oddly enough it works as intended if i hand place the splines in the already generated pcg graph volume also for some reason the generated castles get rid of the tress in side them if I move the graph manually in any direction.im at a loss if any smart souls would be willing to help it would be greatly appreciated goin to be leaving some screenshots down below and a video of the issue :slight_smile: i’m also following Adrian Loguts spline video for reference when it comes to sampling the interior.
heres a video of the issue with my PCG castles Spawning with pcg trees inside them :,(

here’s my PCG graph Logic. The warnings on the spawner seem to be becuase it thinks im missing an actor but when the generation happens the get spline data warning goes away since the actors are generated on demand and present in the level after I pass through the door. The spline sampler warning is due to it thinking that my spline doesn’t have 4 points even thought the castle spline has 8. the warning is reproducible however even with another spline actor containing 4 points.

hopefully a solution arises. many thanks :disguised_face:

oh my the image quality is super poor here are the used nodes in closer detail.

mesh remover:

Steepness:

Castle spline actor spawner:

Castle spline wall mesh and doors pcg randomizer:

Tree Spawner:

So I guess you want your castle spawned first then use the bounds of this actor to exclude from the trees.
Here your logic branch for spawning the castle has nothing pluged after the Spawn Actor, meaning that the other branches will be computed at the same time. You need to force a dependency for your tree spawning after your castle is spawned.

1 Like

if you don’t mind or have some time im brand new at UE5 and these pcg graphs could you show me an example of the nodes needed to force a dependency after the castle is spawned. I feel like I understand however I currently have a work around that is less than optimal and dont want to mess anything up until I fully understand haha

just for laughs this is my current work around :laughing:

I did similar thing, and can be found on youtube.
You can drop down actors that have a closed spline and have a tag for example NoTrees.
In the forest generation PCG you can get the splines from world actors by (this particular) tags. After that you need only remove these areas before static mesh spawning by the Difference node (binary mode).

1 Like

Hm could I have the link to your youtube video pulled an all nighter and im kinda not all there at the moment ahah

It was not my video, I found them in the latest weeks as well. Jut try out that Difference node as I wrote.

1 Like

Thank you this worked and pushed me in the right direction

awesome!! I tried this out as well so and it worked I dropped down the actors like you said and it also solved the issue. The original solution that I did was combining the spline data to come from one spline node, and then I moved the actor spawner before the difference node. thanks a bunch hope you both have a wonderful day.