How do I procedurally generate landscape?

Hey,

I’m looking to create a landscape that randomly generates height map information on each play / level load, so everytime it looks like a new landscape. I was thinking there was some way of using a material to do this effect but come to a dead end as I can’t seem to affect the landscape height information within a material. Does anyone have any suggestions on how to make this work?

I’m thinking of creating my own static mesh plane and using displacement to create the same effect. The landscape doesn’t have to be highly detailed and will be very small, like a long 4 x 8 strip.

Thanks,
Chris

Hi Chris,

I’m afraid this isn’t possible at the moment. The editor builds collision data structures and tangent data as you import or paint it, and there isn’t an easy way to call that at runtime. We do have a feature request open to allow modification of the landscape at runtime.

Given the size of the effect you’re after, I think using a WorldPositionOffset input to a suitably-tessellated StaticMesh would probably work, but that wouldn’t have any collision.

Cheers

Ah ok thanks for the reply. Yea it would be good to have it implemented, it would only need to generate once on level load for example.

I started to play with the WorldPositionOffset last night but as you said it didn’t have collision so I’m going to look for a work around of sorts.

Cheers, Chris

Not sure if this help but this is using a Procedural Mesh Generation to create a voxel landscape

Aside from the voxels, AndrewJSch’s code linked from that thread is a good reference for how to add your own primitive component type. That is the correct way to add custom geometry types to UE4.

Yea I see that voxel procedure, it’s ideal if only there was a way to smooth out the landscape

would you be able to bake a height map to a basic plane and have it generate biom’s you made dynamically or stream a random level when you come to the endge of that bion