Continuing my investigations in PCG and slowly getting my town to take shape. After the last devlog, my next step was to get rid of criss-crossing streets.
Due to PCGEx helpful nodes, this turned out to be not too bad – once I got my head around the Path x Path Crossings node. I fed Main Road points in, along with the generated streets, and this node identifies ones that cross. I had a bit of fumbling around, but realised it allows you to tag Crossed and NotCrossed paths. The Filter by Tag then allows you to just strip out crossed ones, and continue with non-cross paths.

Therefore, I’ve got a number of streets running in various directions, and the shape is looking ok-ish. Certainly in a way that if I fill in gaps, get the landscaping better etc, it might be usable.
My next challenge was to work on the other overlapping – houses spawn, but cross roads in between. The below screenshot has the houses, but also the white cubes to show the points I’m sampling on each road.

Therefore, I wanted to try and cherry pick points to remove.
I created multiple streams – starting copious use of the very useful “named reroute” node. I had 3 streams, for each road “class”, and would feed the other points into that stream for comparison.
Using PCGEx Distance Filter into the Uber Filter node worked well, and allowed me to pick out certain points to ignore them.

My worry was that I had gone a bit spaghetti junction on it all. Multiple filters, multiple spawners, and particularly annoying was having to mesh about with multiple meshes in each spawner.
I tried to chop bits out to their own function. This seem to work out – plus I started using the PCGEx Staging approach. This involves creating a Data Asset with Static Meshes or Actor in it, then loading them by Attribute into the static mesh spawned. Feels like a far more flexible way to manage the assets.
I could then simplify a bit of the spaghetti with these sub functions, though I still had the separate streams.


This gave a much better result. I’ve just used a couple of basic meshes for houses, random weighting using the PCGEx asset staging, and at least it’s starting to look like a town/village.

Next up – a bit more around aesthics, and trying to remove the angularity of it all. Doesn’t feel very organic at the mesh joins and houses need some sort of the blending to the landscape – and figuring out how improvements on that will align with the PCG(Ex) framework.



Leave a comment