Download

Blueprint powered procedural terrain generation is now possible in UE4 4.20

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

Awesome I didn’t know that. Thanks for sharing!

Changed up how I’m sampling noise and stuff, got some better results.

Code is available for free at GitHub - hippowombat/BPTerrainGen

Happy New Year! I did try Your example - sure would be interested in more advancements of this :wink:

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!

Cheers!

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.

[0036,26] Compile of BP_LansdcapeTest failed. 1 Fatal Issue(s) 0 Warning(s) [in 134 ms] (/Game/TerrainEditor/Blueprints/BP_LansdcapeTest.BP_LansdcapeTest)

what version of UE4 are you running this project in?

I’m getting the same error… using UE 4.22

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.

Cheers!

Yes, please, do not abandon this :wink:

Intersting!

need to modify source to bypass "Cannot use the editor function “LandscapeImportHeightmapFromRenderTarget” error: (ue 4.22)

  1. 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);

Fortunataly it doesn’t break collisions.
Source: GitHub - KnIfER/UnrealLandscapeCopy: A copy of unreal engine landscape as a game module. (ue4.22)</tit

2 Likes

not sure but it’s not working anymore on UE4 4.22
executing the blueprint does nothing (in editor also playmode)

for me it still works as of 4.22. I just had to enable the ‘Editor Scripting Utilities’ plugin

btw I’m fairly certain that hacking it to make it work at runtime will not work on a packaged game

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.

Cheers!

Please do return to this later. Thanks. :slight_smile:

After some digging the best workaround for editing terrain at runtime seemed to be:
https://www.unrealengine.com/marketp…mesh-component

Although it appears to be discontinued…

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.