Hello there. I am currently creating a infinite procedurally generating landscape entirely in blueprints and progress is going pretty good so far, but I’m running into an issue. I want to have handmade areas (small buildings, houses, towers, etc.) in the world also procedurally generating. Now, the problem is that if I just spawn them via a linetrace, part of the building will often be floating or in the ground of the landscape. This means I would need a way to adjust the terrain around the building, but I’m unsure of how to do this. Can anybody help me?
Hey there @DragonheartedX! So the Unreal landscape system itself isn’t meant to be modified at runtime so it’s not the best for procedural generation at runtime. You could fake it and just add displacement in the areas under them, but it would lack collision.
In any procedural generation system, there are often multiple rules that need to be check before an object is spawned. You could add one more layer to the rules for specific buildings in that that they could only spawn if the face normal they hit with the cast is relatively lower incline or if you want to get more granular you can then do a set of traces after the first to determine if all 4 corners of the building are within tolerance. if not you lower it until it does or move on to the next viable location.
Hey! So first off, im not using unreals default landscape system (my bad, probably shouldve said terrain instead of landscape). Instead im using unreals procedural mesh component to generate my terrain. Now, the method you describe would work with more flat terrain, however, if i had more steep terrain it would be very unlikely, if not impossible, to find a suitable place to spawn the structure. I would optimally need a way to blend the terrain around the structures, but I dont really know how to do that. I’ll look into it some more, but I would probably need to modify the heightmap.