Elevation limits and z scale, what is the definitive answer?

As in title. The only statement I have been able to find is that the limits are +/- 256m at “z scale = 100.” Can someone give a definitive statement as to what the elevation limits in UE4 are, and how the z scale setting affects imported height maps?

Thanks!

You should be able to go much higher and lower than that. You should be able to get close to the world grid boundaries which are 20km on a side. So in theory you can go around 40x that range before running into serious problems. That said, I am not sure of anybody who has tested this yet so there may be unforseen issues. Please report back if so.

You will lose a slight amount of heightmap precision if you use the entire scale but probably not enough to be a big deal. The heightmap can only represent 65k unique positions.

At the default 512m range, that means the smallest level of movement is 0.78cm. If you use the entire range of ~20km, the smallest level of movement is ~30cm (almost exactly 1 foot).

Thanks a lot for the reply, Ryan.

I’m confused by this. I have read in a couple of places that the world is a cube of 512k units per side. If a uu == 1 cm then that should be 5km x 5km shouldn’t it? Are you saying the limits are more like 2m units per side?

Understood, it’s 16 bit, and I don’t have any intentions of coming anywhere near those limits. I’m just trying to figure out how the world coordinate system and scaling work so I can make good decisions and save myself some pain.

I’m afraid I went right off the rails here. What is the “default 512m range?” Are we talking about the z axis here? Having a hard time seeing where these numbers come from.

Thanks again for the reply yesterday, Ryan. I’ve been trying to understand better how all this works, and so today I made a test map and tried a few things as sort of control experiments. I used L3DT to create a 2048 x 2048 height map and then added a few features to it with known heights using a resolution of 1m, but leaving the majority of it flat. I exported the map as .r16 resizing it to 2017 x 2017 in the process, and then imported this heightmap into a new project in UE4 using the default component setup and leaving the coordinate scale at the default of 100 for all three axes.

First, as a quick side note, I explored your statements about the world size, and was able to position actors at +/- 1000000 uu with no problems. I found that interesting as I have read various figures. Some of that is probably based on older versions. However at the moment I am interested in terrain and the landscape system, and specifically how it treats vertical scale, so I did not explore this any further.

In this image I am displaying the imported landscape in wireframe mode. The highlighted box brush (1m cube) has been positioned centered on the base landscape level and then scaled x 2016 in the x direction. It exactly matches the dimension of the landscape, which pegs it at 2016 meters, which is what I would expect. However the base landscape level, which was set at 0m in L3DT, has been imported at z = -21834 in UE4.

The feature you can see in this image was created with 1m layers in L3DT. The highlighted box brush is a 1m cube that has been scaled in the z direction until it more or less matched the height of the first terrace. As you can see that resulted in a z scale factor of 45 for the brush. So the height of terrain features when the landscape actor has a z scale of 100 appears to be 45x the scale of the same features in L3DT. I placed another 1m cube next to the scaled up brush for reference to show what the height of the feature should be if the same scale was in use in both programs.

Lastly, as another test I set the z scale factor of the landscape actor to 0. At this scale factor the landscape base level is located at roughly z = -218, which makes a sort of mathematical sense in that it is 1/100 of the location at z scale = 100 (-21834 as mentioned above). In the image I have a brush that is 10m in the z direction located inside a feature that should be 10 meters in the L3DT scale, but with the landscape actor z scale factor set to 0 it now appears to be approximately 5m in height. This is also near enough to 1/100 the value at z scale factor == 100.

So I guess I have two main questions:

  1. In the editor, for landscape actors, how is the z coordinate scaling factor applied to a height map on import? Is the height map value multiplied by the scaling factor (and assuming my setting it to 0 defaulted it to 1 internally)?

  2. When a height map is imported what is the uu value of a unit increment in a height value? In L3DT for example I am working with a scale of 1 unit of height == 1m. I know in UE4 one uu == 1 cm. However it doesn’t appear to be that simple with landscape height.

Thanks again for your help.

I will get back to this and reply in detail later. Wanted to address at least this part:

>>I’m confused by this. I have read in a couple of places that the world is a cube of 512k units per side. If a uu == 1 cm then that should be 5km x 5km shouldn’t it? Are you saying the limits are more like 2m units per side?

The world used to be 512k on a side. For 4.8 (or maybe 4.7?) the size was increased to 2,000,000 units which is 20km or around a 4x increase. I forgot to mention that this changed sometime in the last few months. For me the change happend back in september so I forgot it used to be smaller. This shouldn’t really affect the Z thing but I haven’t tested to be sure. It might be impossible to get the camera to focus on stuff in the smaller world.

Ah thanks, Ryan. That clears up the confusion over the world size. I’ll look forward to reading anything else you have time to post on this subject.

With regards to the landscape tool. At the default scale of 100% on the z axis, it allows for a maximum elevation of 512meters total. 256+/-. So if you set the scale to 200% it would be 1024meters or 512+/-.

I’ve found that anything above 500% on the z axis starts to show stepping due to precision. For my maps I generally use 400% which is still pretty **** big. 2km elevation is fine for most cases.

That’s interesting, but it’s still hard to make sense of what I saw in my test map. If the z-scale at 100% is scaling everything into a +/- 25600 coordinate range, and presumably L3DT assumes a +/- 32767 range, then wouldn’t I expect my L3DT features to get squashed down? Instead they appear around 45x taller at z-scale == 100.

The main thing I’m still completely in the dark on is what units UE4 is assuming the height map to be in. I’m creating it in L3DT at 1m vertical resolution, but clearly UE4 is assuming a different unit on import. The default guess would be uu, but it doesn’t appear to be quite that simple, as all the features are not divided by 100. I think knowing this, and exactly how the z scale is applied would probably answer everything, because you could convert back and forth.

Bumping this thread, I also have the same question about the z-axis, hoping the developers will respond.