PCG graph not generating in runtime even when force generated

In my game, I’m trying to procedurally generate roads. I already made an algorithm that I quite like, and they heavily rely on splines. The PCG Graph is supposed to look at these splines and sample them to create areas that buildings will not generate. This works great for all the splines created before I generate the PCG for the first time. After the PCG is generated, it will refuse to sample any splines created afterwards, even if I call the generate node again in the blueprint. (this causes buildings to spawn over second series of generated roads). It will work flawlessly if I hold control and click the “Force Generate + clear cache” button in the PCG Graph window, which lets me know that it should be working, but for some reason is not. Also, I can use the debug feature in the PCG graph to see that the spline sampling node is simply doing nothing until I flush the cache and regen the graph at the same time, but there is no way to flush the cache with blueprint nodes. (unless there is, I have tried for a long time and couldn’t find such a node)

image

^ Showing that after my city is generated with the force generated tag enabled, it still wont sample the spline

image

^ After I ctrl + click this button

image

^ Showing that the node works as it should

The issue is that I need this to be automated, and I do have a node for this

But this node doesn’t seem to do anything… I know its being called because I can see it during runtime. (This is the force generate node in my second step, I explain more below)

image

Basically the city is generated in two steps. the first step generates the thick road in the middle, then it goes through the first “force generate” node in the blueprint. It has to do this because I need some output data for use in the interior road algorithm in the second step. The second “force generate” node seems to do literally nothing at all, but like before if i use the “force generate + clear cache” feature in the PCG Graph window it works.

TL;DR How do I flush PCG component cache so that I can “update” it with new information? Why isn’t the “force generate” node clearing the PCG cache like it implies that it should, according to the “force generate” button in the PCG window?

If someone knows the solution but feels they need me to post more complex pictures of my whole blueprints/in-game I can, but the road algorithms are super messy and I didn’t want to confuse people by putting in a bunch of irrelevant information.

image

^ I have no idea what this node does or why its called whatever it is, but adding this to the blueprint made everything work. I assume this node clears the cache like I was wanting it to do but I can only assume. If anyone else gets stuck like I did please enjoy this solution :3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.