L3DT users' community
Large 3D terrain generator

Choosing the right horizontal scale

Got a problem or need advice?

Choosing the right horizontal scale

Postby Aaron » Fri Aug 29, 2008 2:22 pm

Hi All,

I've written a brief guide to choosing the right horizontal scale, which is intended to help new users decide what horizontal scale they should use for their heightmap, considering such factors as genre, geographic area, and disk size.

If you have any questions, or dispute the assertions of the page linked above, please reply to this thread.

Cheerio,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby hikmayan13 » Sun Jan 31, 2010 5:29 am

Aaron,thanks for the guide and example screens. Well,my question is regardless of "Horiz. scale" adjustments final exported terrain still extremely too high. If you can create a tutorial demonstrating the process from L3DT to UDK...that will be a plus.
If you think you 've seen the best of anything in creation...think again!.Know that the creator is Might.
hikmayan13
Member
 
Posts: 16
Joined: Sat Jan 16, 2010 11:12 pm
Location: USA

Re: Choosing the right horizontal scale

Postby Oktyabr » Thu Feb 17, 2011 6:52 pm

Hi,

I've noticed something similar. I'm mostly interested in using L3DT's terrain generation processes for creating "fantasy" geography, primarily island(s) surrounded by sea. I've learned a few tricks to focus my work on a centrally placed island but have noticed that the larger the horizontal scale the steeper the changes in elevation become too as if setting horizontal scale also applies the same dimension to vertical scale? Is there something I'm overlooking here?

It would be nice to be able to set a maximum sea floor depth, say -100m, and a maximum altitude above sea level, say 200m, independent of the horizontal scale.
-------------------------------------------------------------------------------------------
"Free time" is only free if your time has absolutely no value.
Oktyabr
New member
 
Posts: 3
Joined: Thu Feb 17, 2011 6:45 pm

Re: Choosing the right horizontal scale

Postby Telarus » Thu Feb 17, 2011 8:44 pm

hikmayan13,

You're talking about once you've imported it into UDK, right? Then it's not Aaron's issue, let me explain.

( Just checking, which version of the UDK are you using? My school has a project team working on a game that uses the Sept '10 version, so we're waiting to upgrade until their project is done. As that's the case, the following uses the old "Terrain" system... I'm not sure if the new "Landscape" system has rolled out yet. With that in mind..... )

If that is the case, you probably are importing the Terrain as a 16bit G16 bitmap (if you didn't know, L3DT _can_ export these, and can even resize to the correct [power-of-2-#]+1 size on export).

Once you have the terrain mesh in UDK set correctly (# of Patches X/Y should equal the [power-of-2-#] you used), and displaced correctly, you have to set the 3D.Scale attributes.

Now here's the key:

L3DT _cannot_ include horizontal scale or vertical range in a G16 file, so you have to enter these yourself.

Go to Display > Draw Scale 3D

The default settings are DrawScale.X = 256, DrawScale.Y = 256, DrawScale.Z = 256.

These are the numbers we're going to have to change, but we'll have to do a little math first, and DrawScale.Z _will_ be different from DrawScale.X/Y.... I'm going to assume the terrain is square as that's easiest to work with.

Lets assume a Horizontal.Scale (from L3DT) of 5m, and a vertical range of 300m (-100 to +200).
Let's say your UDK terrain has 128 Patches.X/Y....

To get the correct slope in UDK you would do this (conversion from Unreal Units to meters is 50uu = 1m):

5m * 50 = 250uu

This is how big one 'Patch' will be, so set your 3DScale.X and Y to this Number.

OK! Now, we have to figure out the 3dScale.Z number. This is when it gets weird, and I had to experiment A LOT to figure out how the UDK designers setup this terrain system. This is what I have.

Set 3dScale.Z to:

0.5*(vert-range)*50uu / 256

Not sure why they went with that, as G16 files are supposedly 16 bit, but there you have it. So in our test case:

0.5*300*50 / 256 = 29.296875 (I'll round to 29.3)

Now that has gives us the correct Vertical-Scale, but it has probably left our terrain's "sea level" NOT at 0uu (Z-axis). If your terrain has a "sea level" that you like to reset to be at 0uu (Z-axis), we need to do some more funky math that I had to experiment to discover.

0.5 * (Max-Height - |Min-Height| ) * 50uu = Offset.

So in our example:

0.5 * 100 * 50uu = 2500uu

We then set this in the Terrain's Movement > Location > Z property.

Here is a few screenshots of my test terrain in L3DT (untextured, basic height-scale/water display) and UDK (wireframe) and the UDK properties:

Image

Image

An aside for Aaron: How hard would it be to export a mosaic of G16 images of [power_of_2] +1 ?
Telarus
Doyen
 
Posts: 112
Joined: Mon Jun 01, 2009 12:34 am

Re: Choosing the right horizontal scale

Postby demi » Sat Mar 05, 2011 1:57 am

Hi Aaron,

I want to bring this to your attention since it greatly effects the outcome on some game engines. Game engines like Esenthel and BigWorlds do not use a programmable scale and they are fixed scale.

Esenthel is fixed at .5, 1 or 2 meters per division so no matter what scale you use in L3DT your end product is fixed by the detail level of the engine. The higher the detail mesh the more pixels you use per meter. In Esenthel you need to scale the world according to the resolution or calculate the block sizes before importing the terrain. This is all fine and dandy for Esenthel because you have to hand paint the terrain.

In BigWorlds the calculations are a bit more complex because they use 32,64,128 and 256 pixels = one block and 10 blocks = 1 KM. it again is based on the detail mesh you create at design time. The biggest issues I faced in BigWorlds was getting the pixel division correct so the alpha masks were exactly pixel for pixel matching the terrain. If I had to many or not enough the terrain was blotched in areas and missing textures in other areas. I could not simply make extra blocks and let the painting begin. It had to be pixel for pixel exact match.

I tested several terrains in both engines and Esenthel was very easy to work with because of the hand painting however I made a .1 meter world and put it in the game engine it was so large it looked ugly. If the divisions were to large then the terrain was jagged and the height had to be reduced. The best method I found was to make a world at 4 to 8 meters per division in L3DT and divide the heightmap by 4 or 8 when I imported. This gave a scale of the world and it looks really nice.

In BigWorlds I set down and calculated it based on a 128 pixel block size the divisions were 1.28 meters to get 1.28 meters in the DM is not possible so I had to fudge it by making a 10 meter per division map and calculating the actual resolution was 7.8125 based on the 1.28 meters per division so my HF had to be divided by 7.8125 to be exact match. See the video I just put up.
demi
Oracle
 
Posts: 227
Joined: Thu Nov 24, 2005 4:56 am

Re: Choosing the right horizontal scale

Postby kutigi » Tue May 31, 2011 6:53 pm

Telarus:
This is "hikmayan13";I couldn't log in no matter what I try to do.So,it's a whole new fresh start. :o
I appreciate the efforts trying to resolve some of the "HM" export issues to UDK. Regardless of UDK version, the results are fairly same especially the texture layers resolution issues. I am assuming texture resolution might be handled somehow within UDK Matrial editor by tweaking mathematically.That right there is a lot of work;by the way I never say it's Aaron's issue, just pointing out difficulties using his product...I have earned that right by being one of the registered L3DT PRO users. It's the right thing to do and may be just may be,he might come up with a solution. At this point I am using "May beta release with Lanscape Editor" and here:
http://img43.imageshack.us/img43/2406/5 ... 4026pm.jpg

I hope all these issues can be resolved soon enough.
kutigi
New member
 
Posts: 2
Joined: Tue May 31, 2011 6:08 pm

Re: Choosing the right horizontal scale

Postby Aaron » Wed Jun 01, 2011 12:25 pm

Hi Hikmayan,

I've reset your original account, so you should have an activation e-mail in your yahoo account now. Please let me know if there are any problems in re-activating that account.

Best regards,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Re: Choosing the right horizontal scale

Postby h4voc » Thu Apr 23, 2015 7:41 am

Hey Aaron,

great tutorial.
While reading it came to my mind that there is another important factor for game developers.
I hope that i got it right, but if you choose small a horizontal scale that would mean that the terrain mesh will have much more tris/polys. This will be very important for game devs and the hardware requirements for that game.
After my first tests when importing generated heightmaps to Unity3D game engine my terrains mesh had a count of 150k+ tris. People should Keep in mind that they want to add trees, houses, other environment objects and mobile units to game. This will increase the the tris count even more.
This is why people should think about a lower detailed terrain mesh tris-wise. There are other options to enhance the look of a terrain(shaders, textures etc)

Somewhere in there thread you mentioned that current game engines (state 2008) cannot handle this terrain sizes (350km²), which is right if try to load the terrain as a whole. This is where T3DT really shines with the option to use mosaic maps. With some work gameengines are able to handles big terrains. They go the mosaic/tiled way and it works fine.

regards,
h4voc
User avatar
h4voc
Member
 
Posts: 22
Joined: Thu Apr 09, 2015 1:50 pm


Return to Help and support

Who is online

Users browsing this forum: No registered users and 4 guests