Download

Getting terrain at runtime

Is it possible to edit the terrain at runtime ideally with Blueprint?
I have search the forums and found this was asked a long time again and few people also added to it in 2019.
I am fairly new to Unreal (completed a couple online courses) and coming from Unity background, which you can alter the terrain at runtime. Ideally be nice if you can do it Blueprints as that’s what I have used mostly with Unreal, although I have used C++ many years ago if required.
I’m looking at starting a project, which I would like to use Unreal and in the process gain some more experience, but I want to be able to alter the terrain at runtime.

Many thanks,
Lee

Looks like you want things to happen in the construct part of a blueprint rather than in the event graph.
have a look at this

Thanks for the reply, however I’m not quite sure how this helps me. Unity has a GetHeights and SetHeights method of the terrain data which you can use to get and set the terrain height at runtime.
For my project, I want to be able to generate a world on game start then allow the player to raise and lower the terrain. It seems crazy that given how feature rich Unreal is for it to lack such functionality.

Many thanks,
Lee

Try to search “Voxel plugin” or similiar for Unreal Engine 4

A custom system with octree and height maps is probably the way to go.
You need to fine-tune performance and triangle count on it, as well as a material/layering system.

At a base level you can always just use the same concept of the current landscape.

The heihtmap is used to offset verticis.
An alpha mask image is applied to provide the “layers”/material system.

You won’t find any good solutions out there specific to the engine.

voxel plugins are the way to go if you aren’t proficient in c++, and even then, honestly.
Much easier to just use a plugin that’s already optimized - assuming it is, ofc.

I did briefly look at the Voxel plugin prior to posting as that was another route I was thinking about going. I haven’t played with it yet, but it looked like from the stuff I have seen that Voxel stuff is just built of a Actor generates a landscape on construct and is fairly self contained away from the Unreal system.
The new experiment water system looks pretty awesome, and would be cool to add in but I figured that as that’s based off the terrain system using any other system such as Voxel plugin or generating your own terrain from meshes would mean that might not work?
Not sure how much real time control you get from the free version of Voxel plugin. need to look into it a bit more.
Just a little frustrating that Unreal ticks so may boxes but seems to be lacking in this area compared to Unity.

Make your own water thing. Epic’s take won’t really work until ue5 maybe even later.
in less then a month you can make a shader with real-time spashes, flow simulation, and shoreline waves (which their solution doesn’t offer).

Plus, the single layer water material base is actually OK. Eliminates about 20 hours of solving bugs from doing the transparency manually… and performs better too.

I think you over estimate my abilities :slight_smile:
The over solution of course is do what ARK did and used a customised version of Unreal. How hard could it be…
I think I’ll start with looking Voxel plugin, all good stuff for learning Unreal anyways which I want to do.

do you have a link to any resources on how to learn this? I’ve been looking for surface simulation specifically for quite some time, with no luck. Marvel-master’s solution people seem to turn to has very poor performance.

not really, and I’m not aware of his solution - his cloth stuff isn’t exceptional either, but it was a good starting point.

I’m running my shorewaves based on an algorithm that’s mixed in with distance field gradient. So they are purely visual since the cpp can’t sample those spots, not knowing what the shader knows.

the best solution is to create an actor you place that defines the shift in frequency of the waves for cpp to account, and for the shader to use.
you can see samples of that in the Edios Hitman ocean system.

ac odyssey also has a cool implementation, but not many talks on it.

When shifting the waves you have to remeber that the same process you reach visually needs to be accessed by the cpu without sampling pixels or any such nonsense.
Straight up math is usually best.

Same for flow actually. You cannot expect a hand drawn vector filed to affect physics (outside of niagara).

Ah I see. Thanks for the heads up, anyways. MM’s solution is here, just in case you were curious:
https://youtube.com/watch?v=pX82z77TZc4](https://www.youtube.com/watch?v=pX82z77TZc4)
Probably the reason it doesn’t perform so well is that it uses blueprint, and render targets.

this is very true and i’m learning it’s true of most things, lol.

I feel like faking flow with volumes might be the quickest/easiest option. and any objects overlapping them could just average the forces of all overlapped volumes.

Visually, just looks like the base render target content example.

I have been rendering trails via flow map at runtime in the material for over 6 month.

Render target res barely matters. You can use any base shape you want by changing the sprite/vector field you render.
Ms cost for the render at 2k is about .2ms which is next to nothing.

Because it’s driven by niagara you can get complex effects that collapse over time. Or, that are always visible.

There’s almost no cap to how many GPU sprites you can spawn around at least I have yet to hit one over hours of testing.
you can put a footprint down in the snow 80km away, return to it and still find it there…

Anyway, you can probably simplify both the mesh and the materials in that sample to gain some performance. As well as the RT res. No reason it shouldn’t be running at 120fps.

Is there a official way to do feature requests?

Yep. Make them and be completely ignored because they absolutely do not care about the engine users base. Not even the paying one, unless you are a major publisher and they happen to send you an evangelist.

You think you’re the first to ask for this feature?

[spoiler]
https://forums.unrealengine.com/unre…ing-in-runtime
https://forums.unrealengine.com/deve…ain-at-runtime
https://forums.unrealengine.com/comm…ueprints-based
https://forums.unrealengine.com/deve…ion-of-terrain
https://forums.unrealengine.com/comm…ain-on-runtime
[/spoiler]

You’re just the latest dude. Epic sadly DGAF… Basically unless Epic are keeping developments super secret (and there’s no evidence of that) its never going to happen. Even after they released the planetary atmosphere demo (which was tantalizing), they said that’s it! So what can you do? Get behind projects like this and join the voxel plugin discord…

Apparently even more so with the latest release.

Chaos is a mess. The latest version actually has an ~200% performance loss on physics.
GFX is a mess. The latest release lost 20fps for many projects.

The new features are a mess. There’s nothing but forum posts with “water don’t work”, “clouds don’t cloud”, Reflections don’t reflect. Etc. Etc. Etc.

To top it off there’s about 100 features they added as experimental, messed around with for a while, and left there unfinished. Including but not limited to real time texturing, the new hair groom which somehow apparently they called production ready, sub surf scattering has needed a .usf fix for about 3 official releases (over half a year)… etc. Could pile on issues I have either dealt with or have to live with for a full day.

I’m not sure there’s any hope of getting any official support for real time terrains or any feature request at all.
So, study. Make your own.

If you can pick, I think an octree implementation will outperform most voxel plugins avaliable. At least. My own experiments are rather promising.

Overall the performance drops for other reasons like the engine wanting to load 100% of a mesh that is 10% on screen… when dealing with the default landscape this is particularly demanding and I would say the base cause of poor performance. According to what has been shown in the ue5 preview this won’t be an issue eventually.

It’s starting to sound like maybe jumping to Unreal maybe isn’t the best idea.

Sadly no. it should have been added long time ago since in game map editors are all the fuss now a days.

the work around is using runtime mesh component and making your own terrain system that is editable at run time, that is a lot of work to make it look and feel good that is why I have requested this feature many many times but always get a reply like you Epic don’t allow engine code in packaged products etc.