Procedural World Generation UE 4.27

I am trying to find a way to generate a procedural landscape in UE 4.27. I don’t want to use UE 5, because my laptop specs do not meet the minimum requirements of it.

I have found several tutorials about this subject online, however, they are not really helpful at all. The best ones I found were using height maps to create an extensive landscape accordingly. Though there’s a caveat for using height maps, which is not being able to generate caves or more complex shapes on the landscape, a height map to me feels 2 dimensional. And I can’t really find other ways even to try to test things with.

Is there someone who can point me in the right direction so I can try improvising and getting started somewhere? I’d prefer using only Unreal native tools, if possible, and if necessary free third-party plugins would be my best choice.

Hey there @OkanSens! Welcome back to the community! So when working with UE4, most would recommend rolling your own system if you need fully procedural terrain, as you’ve noticed the landscape system is more meant for predetermined landscapes.

Although depending on if you love or hate voxels and marching cubes, I have a solid recommendation that isn’t to build one from scratch using Octrees.

Voxel plugin allows you to create fully procedural and editable at runtime terrain (Example: space engineers) However, with voxels you have to try a great deal more to get “realistic” style of visuals, as voxels can’t be but so small. This does have a paid version that’s much better. Since you mentioned performance might be a problem I’d recommend stress testing before trying to build a game around it.

1 Like

Thanks a lot for the reply! I’ve seen this plugin before too, I might give the free version a try. Space Engineers’ worlds are spherical if I’m not mistaken. They do not have caves but I should just wiggle and see if I can do it.

On the other hand, can I not generate a world within Unreal using landscape tool. Or is it not worth the trouble and should I just use a prebuilt plugin such as Voxel?

The landscape tool is more meant for authored content ready for compile time. It would be a pretty substantial endeavor to try and make realtime generation for it. While not “technically” impossible, it would take some massive engineering time and skill, plus you’d be working with the engine source and it’s complex even for industrial scale applications to say the least. Forcing a square into the triangle slot to say the least.

The voxels themselves can be handled in almost any way you see fit, there’s games in their showcase that do spherical worlds, most just use the plugin in authored worlds however you can use it for procedural generation with the perk that realtime editing of the terrain is built in. I’ve worked with the pro version myself and it’s quite nice, I’m not entirely sure if the free version is lacking anywhere however.

A video to get you started (however you’ll need to definitely do a bit of custom work for your use case, but this might get you rolling, expect a long dip in the documentation):

Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.

1 Like

You’re awesome, thanks so much! Turns out I’ve even saved the video to a playlist beforehand while doing my research about this subject.

I’ll give it a go. It seems like a really great, versatile, and useful plugin and I think I needed to hear someone credible about it. I remember assuming the free version was so limited compared to the full version, and that was why I did not try it out. If it works out I’ll even try to save up for the full version.

Thanks for your time and help!

Absolutely! Give it a shot, see how it fits for your use case, I was pleasantly surprised how nice the implementation was. They are also working on a better version that’s more performant as well in the meantime, so if everything is fine but it’s performance won’t work for your use case, I’d check to see where their 2.0 release is at. If you have any questions about the product, they direct people to their discord. Good luck!

1 Like

Hi again! I’ve tried using the free version but I should say it is pretty limited compared to the pro version. I respect that however, I cannot buy the pro version as it’s pretty expensive, especially with current rates in my country. For instance, I’d need a voxel generator graph to customize the world I’m building, but it is not supported in the free version. Some pre built graphs are provided by the developers, but they are really dull and are shared as simple examples. So I couldn’t delve into the custom world generation part that much.

I’ve checked out a bit more, and only found out UE5 has this Procedural Content Generation (PCG). Would you recommend upgrading to UE5 for this? My PC specs aren’t that great, and I will not be able to use Lumen or Nanite, but would I be able to run and develop a low/semi-high poly game with 16GB ram and a GTX 1650? Apologies if asking too much btw, but I do not have many people to ask these questions :')

Understandable! An alternative would be to run your own, however this is significantly more complex. I can get you some information on some basics, however depending on your technical background it may be a long journey!

PCG is quite powerful though is more suited to populating landscapes and can’t really generate them in the way you’d need. Any landscape you’d create to work with PCG will also have the same issue as the landscape system in that it won’t be runtime editable (besides the PCG elements) and caves would have to be separate meshes as the landscape system is limited at base. 5+ are also a bit heavier engine wise so 4.27 is fine to stick with if you don’t need any of the updates.

1 Like

I have learned from Voxel Plugin Discord server that while using the free version, I can use C++ classes to manipulate the terrain. However, I’m still not sure how flexible it would be, as I know that foliage and other stuff will are pro content.

If it will not be so much trouble for you, could you at least show me some pointers to do some research about creating my own landscape system? At least I’ll be able to control all the variables that way.

I’ve got a computer science and engineering background, while not boasting that I’ll figure out everything, I think I’ll have some chances :smiley:

EDIT: And as an extra question, would using a program such as GAEA or some heightmap generator result in a good landscape? Could you add another layer of terrain in it too, such as caves and ravines?

Caves are usually separate levels.
Even if it’s possible to rotate a landscape on its ■■■ and turn it into a cave ceiling in a pinch.

The cost of unreal landscapes (cpu, ram, rendering) make them next to useless, so it is much preferable to just just about anything else (static mesh, voxel plugins, procedural mesh, etc).

Just learn to use blender.
Make meshes.
Split the level up in chunks of around 500mx500m.

There is of course, absolutely nothing procedural about any of it.
The unreal landscape system doesnt support it anyway (on top of costing too much resources).

You cannot manipulate the landacape at runtime mainly because its collision will not update along (so the end result would be visual only, which is useless).

Re gea or any other terrain editor.
You can use just about whatever to get a heightmap to use as the basis of something. You could even randomly generate the heightmap.

The peobelm remains, you cannot offset the terrain at runtime with that map.

Imho there is absolutely nothing out there which will get unreal to generate a “good map” if utilizing the landscape system.
Any other engine is eons away in terms of what features their landscape provides paired to functionality.
Unreal is stuck in the 1990s when it comes to it.
Literally DarkBasic was capable of generating random terrains out of randomized matricies (look up cave run).
To do that in ue4, use the procedural mesh component. Not the landscape.

Basically speaking, your engineering backround is kinda useless since the “landscape” is really more of an art thing.
Particularly Game art, which is well, probably in the realm of your degree but a speciality that I havent seen too many people even do properly.

If you really want to research away at things either way:
Octree, the (arguably?) Best way to load stuff in.
Mesh streaming (bascially, only show the tris you need so the rest is not rendered/loaded/computed).
Quadratic based edge collapse - what gets you from LOD1 to LOD6 without having a cylinder turn into a rectangle.
Voxels ofc, which is a basic concept more than a plugin.

That should be some bits to get you started at least. Far from all youll end up learning should you make your own landacape system.

Oh, while at it, probably pick up and learn any GIS program and terminology.

Understandable! I’d recommend leaning into expanding on the free version of VP since you already have the voxels implemented, it may take a bit to get to grips with their source, but once you do you’ll skip a ton of work implementing them.

Alternatively if you want to work from scratch, I agree with MH that Octrees are a good place to start but you will be putting together all of it. While unreal has a basic implementation, you’ll be handling these by scratch.

Gaea is great for realistic terrains, however as MH mentioned the landscape system is really just not built for caves, so when adding them you’d be making a hole in the terrain and implementing the caves as separate meshes and there’d be no realtime mesh editing possible. GIS is also a good path if you want real world data and not procedurally generated.

1 Like

I’ve read somewhere that caves can be achieved with heightmaps using multiple passes on the terrain, but I’ll look further into it.

I can see caves being separate levels, however, the generated terrain being a separate level already and not being huge (it’s just a map created for a round of the game), I wouldn’t want caves to be loaded, or break the flow of the game by teleporting the players to somewhere else.

So I’ll ditch UE landscapes I got that so far.

I already am proficient with Blender. I’ve seen some procedural maps using pre built content to create a better environment such as some basic shapes of mountains, cave rooms etc…

Hmm, I see the problem with heightmap now, that’s a thing to research for me now too then.

Octree, heard of it, will check it out.

I’ll check the others out too.
Have you guys heard of the game Deep Rock Galactic? It was made in Unreal and it generates very great looking levels, and the whole levels are caves. I couldn’t find a solid answer for it but I’ve seen people talk about CSG (Constructive Solid Geometry) was used to generate the levels.

What purpose would any GIS tool serve me at this point? If I can’t control the constraints of the terrain I import from there it’s still problematic. Customization is key for me here.

As you have suggested, I’ll check the VP a bit more. I’ll check Octrees and see what comes out of it.

Yes, this works quite well with a heightmesh too, for those longing for the days if landscape-tessellation.

Coupled with landscape/RVT blending, for walls, etc, decently complex cave-systems could be assembled.

But yes, otherwise, I would largely agree with what you said about landscapes. There is good potential, IMHO, but it’s cumbersome to have to convolute your logic, project, etc to the vagaries of landscapes in Unreal.

To the OP, if you are going to use them, use them for something basic, like dirt, grassland, nothing super complex or crowded. Think the latest Zelda-games if you want something decently performant.

IF you want something large and open, you can use a landscape, but since it will eat up a large portion of your screen, be very careful on the material-cost. Part of it isn’t the features/lack-of but mechanical, in terms of screen% and sheer overall-cost. You want to make it all gussy, but you are going to pay for it…

From this discussion topic, I’ve already decided not to use Landscapes. The levels aren’t going to be huge, but there will be some exploration to be done by the players in each round using vehicles.

I’m also reconsidering my thoughts about runtime edits. Maybe I’ll just let the game generate the level and make it uneditable by the players. many games do not have this anyways.

I’m also thinking of using premade/modeled assets which can be connected differently to create a better looking environement. One example I know of this is Warframe. At least this way, they have much more control over the levels they’re generating, especially the style.

Just checked out the latest Zelda gameplay and I can say the environment looks really great. I’m not aiming to get a photorealistic and a very crowded terrain with lots of foliage. Simple is nice. That goes for any method that anyone uses imo.

FWIW, I’ve played with the heightmesh. It’s promising, still beta, but performance and tessellation-density can be quite good.

As well, it CAN be dynamically updated insofar as height, at a cost. Can be used with a capture/render-target on your player for depthmask to create footprints in mud/snow, paths in same, etc, etc. No collision, true, that is still driven by the underlying landscape, but it’s an option one can play with so be aware.

Dynamic updates don’t seem to be my concern for the project. At least for now. Those footprints are really nice touches.

Here’s another idea, this requires more modeling and planning though. Modeling pieces of mountains, hills, cave pieces, and connector pieces for them, and also add in more models like building pieces; doorways, entries, hallways…

I think this way has a lot more control over the terrain or level than any other solution for small scale content. In Unreal you can create as many Blueprints from these assets, and connect them procedurally during level generation depending on which tileset you require. And then populate the “rooms” with other assets like crates/events/POIs.

Seeing how limited procedural generation is currently in Unreal I might go with this way to get a better looking result in a more controlled environment.

Here to give an update about my issue in case anyone’s interested :smiley: or to help someone out if anybody needs it.

Copied from my post from another thread:

I’ve kind of solved the problem. What I needed was simple. The game would spawn a Start Piece on the world (selected from an array of Start Pieces) and then loop through its connection points, in this case I made them Capsule Colliders, and spawn random Connector Pieces (again from an array randomly).

Now I’m trying to match the connection points angles face each other. Once it is solved it’ll give me a huge flexibility to use different angles with different heights too. I’ll just need to model and create Blueprints that can be placed next to each other looking seamlessly!

EDIT: Here’s an ss to show the small step!

The z coordinates are different that’s not a big deal, I’ll just need to reposition and rerotate them to look seamless. However, this is the big step for me! This might look horrible but it’s working :smiley: And it also generates new shapes with each playthrough.

Thanks for all the ideas and help people!

1 Like

Great work! These are premade pieces right? Sometimes going the simpler route is the best route for your use case!

1 Like

Exactly, these are just test models I rapidly used for testing. I create any Blueprint Actor and create any “piece” I want, and add Capsule Colliders to act as connection points(I learned that you could get a BP’s components). By using this method I can create a whole bunch of different levels that don’t even feel like a dungeon but a generated landscape! And as you have mentioned it is a lot easier to implement and change.

Thanks so much for your help too btw, you got me find my own answer as well as learn a lot of new stuff :slight_smile:

1 Like