Unable to connect origin shifted heightmaps in UE5


I was hoping to use world machine to help me quickly build out a large world in UE5 but am having issues lining up the UE5 landscapes imported from WM.

I created the height output files in WM by shifting the origin in project settings.

In WM this appears to work fine. However upon importing into UE5 and shifting the landscape to where it should be positioned the landscapes do not connect.

There seems to be a 1 meter shift in the x axis which I presume is from some sort of padding pixel which I have seen references to but haven’t figured out how to disable. But the main issue is that the heightmaps just don’t fit together, even if I reduce the translation to 100800 (or 1.008km) there is a significant difference in the height of the layers.

I was hoping to use this method along with the greater resolutions and tiles in the professional version to quickly build very large maps but have been unable to get a prototype working on the trial version.

Is this even possible?

I’m not sure if I’m going wrong in UE or WM so apologies if this is the wrong forum.

Any help would be appreciated!

What I’ve tried so far:

  • I am 100% certain the layers are oriented so that they should connect
  • Set project elevation quick scale to 2.048km (apparently UE likes max Z multiples of 512)

Hey! You’re on the right forum, and I think I know what’s going wrong.

This indeed sounds like a pixel padding issue, and with the fixed translation, does it work? If this problem persists, you could always create one large heightmap in World Machine itself, or a program like Photoshop.

This is where stuff starts to get tricky. The reason this behaviour pops up has to do with the concept of “a lack of context”. When you create one big piece of terrain, and decide to slice it up in smaller chunks, and rendering out each chunk, World Machine no longer knows of the stuff around that chunk. This doesn’t matter for most generator devices, but it ruins your day as soon as you start to use the cool features like the Erosion device.
This is because the Erosion device’s behaviour depends on its surroundings. For example, I have made this “grid” terrain, and in this example, the highlighted chunk (blue) is the chunk we’d be exporting. Do note, the distance between the chunks does not exist using your or the Tiled Build method, this is just to illustrate.

As you can see, we have quite some elevation going on in this chunk, and in the corner labelled with A, the Erosion device would probably think “okay, that is the lowest point of the world, we will put all of the sediment in this spot”. But what the device doesn’t know, is that the elevation still drops quite some more outside of that chunk. So instead of properly “moving” the sediment all the way down, as you’d expect and would see in the render of the entire terrain, you’d now have corner A suddenly become elevated a lot more, as all the sediment accumulates there.
And that is probably what is happening with your exports as well. The devices that are (somewhat) incompatible with Tiled Builds, will change the edges in an unpredictable way, causing those mismatches.

Okay, that sucks, how can I fix it, you probably wonder.

Well… Not really. But we can get pretty close to the perfect solution, and that has again to do with the concept of “context”. Something the Tiled Build can do automatically, is “add” a bit of margin to each render. So it will enlarge each chunk, to incorporate some terrain from adjacent chunks (read: it creates a context), highlighted as the purple area.

If we were to render it now, the Erosion device would know that corner A is not the lowest point and that the sediment should not accumulate there, but further to the border instead. Then, when done rendering, the Tiled Build removes that purple margin, and only exports the blue part. This method will still be a feasible method for lower powered machines, whilst retaining a lot more context.

So, what I can suggest for you is: Export your worlds with a 25% margin (1513×1513 px), then remove that margin (252px on each side) either in World Machine (in a new world) or in something like Photoshop. Or, render the world in its entirety, but I assume you are on the basic version?

I hope this helps, and if you have any more questions, be sure to ask them!

1 Like

Thanks so much for the quick reply HYLK and very detailed explanation of how engine works. I ran a very quick test of just removing erosion and the result is now practically pixel perfect.

I’ll definitely implement your suggestions regarding context when I get around to building the larger world, thanks for your help!

1 Like