Hey, I didn’t know if this was widely known as I don’t remember reading it in any changelogs recently, but Epic added a bunch of blueprint-callable landscape editing functions, including updating the landscape heightmap, both in editor and at runtime! What’s better is that they support render targets, so we can use material expressions to drive noise-generated procedural terrain! I’ve written a little blurb about it, which has a link to a github repo of what I came up with this evening after finding out about this. Feel free to download it and play around with it, I’d love to see what people come up with! Christian Sparks — Blueprint-Powered Landscape Edits in UE4 4.20
Thanks for giving it a go! Sadly I’m knee-deep in other projects at the moment, I likely won’t return to it until I either clear stuff off my plate or Epic supports runtime terrain heightmap updating. Sorry for any inconvenience!
Thx i just switched from unity and need some basic terrain, also in unity i was using a tool that create, and texture the terrain and was pretty simple to use
What make a terrain look realist, is a big valley crossing it from an edge to another, with a river on the bottom.
So to make a terrain look realist, you have to make the water able to flow down to the ocean from everywhere, and add some natural erosion as well
One or more blueprints has an unresolved compiler error, are you sure you want to Play in Editor?
BP_LansdcapeTest
Cannot use the editor function “LandscapeImportHeightmapFromRenderTarget” in this runtime Blueprint. Only for use in Editor Utility Blueprints and Blutilities.
I just tested it, both in 4.21 and then in 4.22. In 4.21 it just crashes upon the attempt to run. And in 4.22, yeah - it’s an “editor function”. I sincerely hope they are working toward implementing the runtime landscape functions, because this and the Apply Spline (which is “Editor Apply Spline” now) would be an ultimate solution to so many great game ideas.
I will check in on this when I get some time. No word from Epic on whether runtime terrain changes will be supported out of the box, but the mesh drawing pipeline overhaul inspires hope for sure.
need to modify source to bypass "Cannot use the editor function “LandscapeImportHeightmapFromRenderTarget” error: (ue 4.22)
make a copy of LandscapeImportHeightmapFromRenderTarget named LandscapeImportHeightmapFromRenderTargetmy.
2.move LandscapeImportHeightmapFromRenderTargetmy out of ‘#if with_editor’ block, and remove ‘UnsafeDuringActorConstruction’
3.compile.
but it’s not runtime, it has no effect in the play mode
After some weird source modification I can make the method viable in the play mode.
But there’re glitches and the second call of this method will crash the engine, throwing an Unhandled exception from landscapecollision.cpp:1159
I hope someone can report to ue maintainers to make the lanscape procedural in the play mode runtime. The code is too intricated.
Now I just comment out that line:
//HeightfieldRef->RBHeightfieldEd->modifySamples(HeightfieldX1, HeightfieldY1, SubDesc, true);
Hey guys, just letting you know that I’ve paused working on this actively while I’m finishing other projects, anyone who would like to give it a go can absolutely feel free, but unfortunately I can’t offer much in the way of support at this time.
recently I’ve write a simple blueprint layout system, which will spawn small procedural landscape and place them around player.
sadly it’s nearly impossible to package out the modified landscape module.