Download

World Machine & UE4 - Massive Tiled Worlds & Landscape Materials

Hey everyone, first post on the forums. Recently with the launch of 4.8, I’ve decided to attempt a rather ambitious project regarding massive open world terrains. Using World Machine, I’ve created a 50x50 km landscape. Now originally, I used very few tiles as shown in other tutorials here on the forums (4x4 tiles, so 16 total). However, I found that with this size of a landscape, using so few tiles would cover far too vast of an area of the landscape, and I assumed that this would cause performance issues for the player. In addition, the amount of resources necessary to output tiles that large with the resolution and 1:1 m/p ratio was too much.

So I’ve gone to a sort of extreme, and I suppose I’m doing a sanity check. I figured that if I’m creating a 50x50km world, and I want a fairly high resolution terrain, and I want decent performance, then when I needed to do was determine what a “reasonable” chunk of terrain would be for the player to render through level streaming. I estimated that about 500x500 meters was a decent size for a single tile of terrain, and what this results in is 100 x 100 tiles in world machine, so 10,000 total tiles. This is a methodology I found in this post.

Now I don’t know if this is the best way to go about this. I’m not sure how I would go about creating a landscape material for this, as instead of a single splatmap, normal map, or weight map, I’ll have one for each tile of terrain (so again, 10,000 of each file). This was intuitive enough to work with when I created other large worlds, but with few tiles (only 16) and low resolution, but I’m questioning its practicality with large worlds such as this.

Is there a better way to create an open world of this size, with a high resolution, and effectively divide the world into manageable chunks for the player? If this is a valid method, what sort of workflow should I use in order to create a landscape material if I’m using many different image maps, or does it matter?

tl;dr: How do I make a 50x50 km world in World Machine, divide it into small manageable pieces for performance, and maintain a decent terrain resolution so I don’t lose important details (rivers, erosion etc)

I’d really appreciate some feedback/advice.

Pic related, early version of the map.

Still looking for help on this. Does anyone have any advice/experiences on creating similarly sized landscapes?

Hi!

You need activate Enable World Composition in World Settings and import your tiled maps from World Machine into World Composition tools. It will create sublevels with streaming mode.

You can see it in this lesson:
https://youtube.com/watch?v=4aidYFu0GTQ
This video tutorial in Russian, but I think it does not matter.

This might be of help:

Thanks! So this will work properly, even with the extreme amount of tiles I’m using? I’ve gotten world composition working on smaller maps before.

In theory, world composition can handle any amount of times you can throw at it. Main bottleneck would be the usual things like draw calls and streaming performance.

Draw calls depend on how many landscape components you’ll show at any given time, and the LOD system you’re going to use. If you use a single mesh for a distance LOD, it could work provided you have low view distance. If you want to use the World Composition LOD system though, anything higher than few thousand tiles will give you a slide show. Bigger is better in this case

Streaming performance depends on the landscape component amounts, and the complexity of the actors inside a map. Smaller isn’t really better, less is better, but that doesn’t necessarily mean things have to be small. If you have 16 components per 500x500 landscape tile, and you constantly stream them in and out, you may end up doing more work than loading a 64 component 2kx2k landscape tile.

There is also a workflow issue with UE4 and massive amounts of tiles. If you want to add meshes to a certain tile, you have to activate the level of that tile first. If you accidentally place meshes on top of another tile, you’ll need to manually move them to the relevant level. Not really an issue for small amount of tiles, but it might end up being nightmarish with 10k tiles. I think Epic is considering a workflow improvement on this, but afaik currently it sits on the backlog/wishlist.

I would recommend 2kx2k tiles with 64 components. Maybe 1k tiles on areas with dense foliage and some larger ones on large open spaces. I’ve tried 32km x 32km map before, it had 256 2kx2k tiles. Performance or streaming wasn’t an issue and tile number was adequately low for the terrain size.

Edit: World Machine build time would be more concerning for me to be honest. Unless you have a render PC with 32+ cores, or the terrain doesn’t have erosion, 50km x 50km 1:1 terrain would take more than a week to build, possibly 2 weeks if your CPU isn’t the latest and greatest.

Well before you jump in to such a huge process I would recommend to make some test, because at the moment I wasn’t able to export the WM to look the same in UE4.

So consider the following math to set up your WM:
Decide you approximate terrain length in one side, eg ~30km, then go and check UE4 recommended landscape sizes, these are like 505, 1009, 2017, 4033 and 8129.
No make a quick calculation 30000m / 2017 = 14.87… Once you have this float value, round it up to 15 better 16, then take the recommended UE4 size you used, 2017 x 16 (your rounded value) = 32272 m, this value will be your WM width and height.
So go to in WM to World Extends and Resolution, set to width 32.272 km, then hit TAB, no in the same window, go to Resolution and type in 2017.
Next in the Tab of Tile Build Options, set your Tile Resolution to 2017 (from your earlier calculation), and for Tiles Per Side set 16 (earlier calculation), Blending percentage set to 100%.

Now the fun part comes, the in the next Tab, General setup, set you max elevation baring in mind that you always use a height of 256 multiplier, so eg. 256x8 = 2048 m should be fine for you max elevation. NOW: if you use Base elevation then enter the same value with negative: -2048, in this case when you import your terrain in UE4 always set the Z to the half of your WM Max elevation, in this case 1024. If you use 0 as Base elevation you dived you WM Max Elevation with 4, so 512!

THE BAD NEWS: after all 5 hours of waiting 3h in WM and 2h in UE to import your terrain, then Load it in, you will never receive the terrain you wanted, since it will be flipped in X and also Y axes.
Solution… None that I know of…
To see what is happening, just create a smaller terrain, eg. 4km, so you have your math 4000/505 = 7.92, round it up to 8, then 8x505=4.40km, then import in to UE, you’ll see that nothing is matching, it’s like mirrored…

If you find a solution, let me know!

The good news is that I found solutions for two of my major problems.

The first is how to re-scale the Z from UE, because you don’t like the resulted height after you Load your tiles:

  • Select you LandscapeProxies from the World Outliner, all of them! Go to Modes->Landscape. Without doing anything further here, check your Details window, because under Transform all your Settings became available, even though your Landscape Proxies which you selected earlier became deselected. Do not try to select them again, just simply set your Z value to another. It is imperative to have all your Proxies selected first, otherwise you will mess up your Z applying it just to some…

The second and biggest issue, the fact that your imported landscape is flipped on X.

  • Select again ALL your Landscape Proxies, then right click, select Transform->Mirror X. Depending on the terrain size, you will wait a while, but it will solve your problem

Hope this helps…

Thanks for the information guys. It looks like I’m just going to experiment a bit with this and see how it performs. Currently I’m having issues importing the tiled landscape. It simply doesn’t respond when I select my heightmap tiles. I can easily import only a few of the tiles though. UE4 doesn’t lock up, it just acts as if I didn’t select anything.

Edit: Usually for using splatmaps and normal maps, I’d simply use the image as a texture within the material. However when exporting a tiled landscape, instead of one splatmap I have one for each tile. How would I go about using a splatmap to establish a base texturing on a tiled landscape?

About your import problem, you should check if in the import window detects the tiles resolution, if not this means your WM sizes are not correct, just follow my guide.
Also always remove your imported tile levels from the Content Browser before you re-importing the same tiles! Otherwise you’ll have a mess.

Regarding the tiled flow map I’m afraid I don’t know the correct answer. I’m just two steps ahead of you. But this a good one.

By the way, if you export your tiles in WM in steps and you want to import it progressively into UE, at the moment I’m havving the issue that the new tiles Z is shifted with almost 2000 cm! This is a mystery!

In World Machine, making your maximum elevation is a multiple of 512 makes calculating the math of your landscapes z axis much easier.
The default maximum elevation of a landscape in UE4 is 512meters, and it is created 100 cm up

As for the X and Y. Since you are using 505x505 tiles, that’s 505meters x 100 = 50500 or 50.5km.
Then on your tiled build options page, select the tile resolution 505 as you said already.
50 tiles per side
100% blending
Share edge vertices should be ticked
DON’T FLIP ON THE Y AXIS.

Flipping your terrain on the Y axis does literally that and is completely useless. Yes, it will import your landscape in one piece, but it will be flipped. No amount of flipping nodes will correct this. You use flip nodes and flipping on Y axis option and you are back to square one. A landscape imported that doesn’t line up.

I don’t know if you are using the pro version but I assume you are, I also assume you are doing a tiled build :stuck_out_tongue:

**The problem with importing to unreal is that it reads the file names wrong. In particular the Y coordinates in the file name. So they need to be reversed.
Say you have 4 tiles across, you would have.
Exterior_x00_y00
Exterior_x00_y01
Exterior_x00_y02
Exterior_x00_y03

The Y coords need reversing, like so.
Exterior_x00_y00 - Exterior_x00_y03
Exterior_x00_y01 - Exterior_x00_y02
Exterior_x00_y02 - Exterior_x00_y01
Exterior_x00_y03 - Exterior_x00_y00

This needs to be done for your height files as well as your texture height/weight maps.**

Then when importing, you have world composition ON. Then in the levels panel using “Import Tiled Landscape”
Like so http://i.imgur.com/mafCvKz.png

Then on the “Import Tiled Landscape” Dialogue. http://i.imgur.com/nKQ4rAC.png
Set your tile coordinates offset to half of the total cells across in each direction. So in your case it would be minus 50 in both directions. This will shift all the landscape tiles in that direction so your world will be created centred in the world composition tool.

Make sure to set your scale and preferably a material instance on your main landscape material here.

Thorax, thank you for the solution!

One question though, why the player stops when reaches the World Bounds (seen as a yellow square in the Tile Browser), if the map is larger then 20km?
Based on the docs it should Reshift the Coords, should it? Is there a setting for this or I have to stick with 20 km.

Thanks!

For your question regarding the textures, and flow map, you will get the answer here https://wiki.unrealengine.com/World_Machine_to_UE4_using_World_Composition

World Settings >> World >> Show Advanced >> “Enable World Origin Rebasing”

Hi,

In 4.9 tiled landscape import will have an option (enabled by default) to reverse tile Y coordinate.
When exporting from World Machine:

Right now, unfortunately you will need to do it manually as Thorax said.

Thank you for both!

Hi,

I’m writing this post because of some PM’s.

I haven’t progressed too much in my terrain because of time issues, but I really experimented a lot with World Machine and I finally managed a 32x32 km terrain. Basically you can go infinite with the size but only with World Composition. The side effect of this is that the levels are streamed dynamically, so far distance is not possible by default, also no Multiplayer.
To answer the question of far distance visibility:
The trick is to export your terrain tiles into Max or Maya and create a low res version of your entire terrain and place it on the Base Level so it will be always loaded. The low res terrain should be placed slightly under your high res terrain so when this will be streamed, will overlap the low one.
Then you need to be tricky with you terrain texture too, first you need to create your grass, then based on the grass general ambient color, you will have to tweak your terrain texture to blend with the real grass seamlessly as possible.
This way your low res terrain will look as it would be your hires terrain and you’ll have your long range view.

My problem here is that the grass for some reason in a spherical area around the camera is darker then the rest of the grass. If anybody can help out with this issue would be great.

I also have to mention to those who are experimenting with very large terrains, that at the current state UE has some strange import behaviors with the tiles, in my experience the tiles MUST be imported at once and not any other way around, otherwise your tiles for some unknown reason will not match.
Also very important to not for those who are using WM, is that the tile export MUST also be done at once for the entire terrain, otherwise the tiles will not be blended correctly. This will take very long time for a terrain such as mine 16 tiles per side of 2017x2017 per tile = 32,272 km x 32,272 km.
Sadly I also have to mention that even if you are following both criteria’s I mentioned before, it could likely happen that your tiles will not match, having a gap between… In this case, create a brand new project and try again and again until you will have one proper import. If you have that scene, save it down!!!

If I can help with additional info, let me know. I think I could create a go trough video of the process how I created the terrain in WM, the settings I’ve used, the export, how to get the height maps for grass, trees, rock in WM, even the Material I have.
Let me know.

I’m getting ready , to need this myself (if the thread is too old pls let me know).

I’m deciding how large, and I know I am limited by my current hardware of course, but still I’m wondering about some current issues I have.

I grabbed some srtm data from srtm grabber ( bing it don’t have url atm) , the resolution of the png is 1261x1261 yet is for a 2500 sq mile area, which I know is large but I"ve seen huge worlds being done here before so its not that unusual.

I used microdem to place dots representing ares of interest, then took into PS and made sure it was 16 bit greyscale and loaded into ue4 editor,but its horrible stair stepped.

What step did I do that was causing this, & is ‘merged’ srtm resolution the main culprit,- if so what is the best way to avolid it and not lose the slope data I need ?

thx

is that right that are the maximum 260.123km? in UE4

because 8129 x 32 = 260,123km

max vertices = 8129
max Components = 1024 (32x32 tiles)

Can you please tell me how to add a static mesh on map with streaming options and make sure that mesh stays on same location when user spawn to map? Coz always when i spawn user all static meshes siple move out of the map, i guess rebasing is the cause but not sure… ahh btw with dedicated server on…