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!
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.
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’
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.