Newbie tries making a fantasy city generator

I couldnt really figure out your BP graph, so I made a little example.

Here it is :slight_smile:

Start with a BP, based on actor, add a Spline component and make it the root. (why not :p)

Then we add a function that does nthing but adds a splinepoint to our spline. Yes, we could call the AddSplinePoints method of the spline also from our other code (commin up next), but Id like to keep things separated in functions… Thats just a matter of style. Oh, and dont get bothered that I named my function “AddSplinePoint” as well. Thats perfectly ok…

083010acb3c7877b5cbf6cadd38481b9745a22ee.jpeg

Next, create a function, called GenerateCircle that does the follwing:

5a465056d3a56b79a8aa6075f56c0f2419d803ac.jpeg

The local variable AbsoluteAngle has 0 has default value.

Now just call the function from your construction script. The length of the pointer dictates the circle radius. If you replug the float add node from fixed value to a random range, you can also get irregular shapes.

With fixed values, it looks like this:

const.JPG
583187d754248af4a7aea345bcab67bcb228e05f.jpeg

So, that gets the points going. Now the random modulation of our pointer length would give us the random distorted polygons that never fold over…

Just add a random scale multiplier:

47ee21f1a45e9c244908e080c35d5ec24ef7d776.jpeg

And you get this:

a050fa3c98cea7cd875e3385cef1ed9fd1a4871c.jpeg

Of course with less extreme paramters, you get more decent and natural shapes… :smiley:

To account for height changes, which will require square-root-2 more splinepoints for 45 deg inlcine for example.
This sis indeed a bit tricky. Taken the BP from above, you need to interpolate the delta elevation between two spline points.
That means you would need to store an array of spline point coordiantes and insert them appropriately.

A bit like Zak Parrish made the SplineTrack Editor tutorial.
https://www.youtube.com/watch?v=wR0fH6O9jD8

however in your case, since you want to insert, you dont need the add and remove logic he is using.
Just rebuild the spline from scratch each time… (like I do above)