UE3 - UT3 Creating Realistic terrain Part 1

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

skyhave

New Member
Jul 24, 2008
8
0
0
Australia Melbourne
Creating Realistic terrain
Part 1 Importing custom heightmaps


Terrain creation is one of the things I haven’t found much in the way of tutorials for ... so here goes.

By following this tutorial you can create some very realistic and detailed terrain heightmaps in a very short amount of time. I’m going to show you just one of the many ways in which you can go about doing this.

You will need terragen a realistic terrain generation software which I have used for this tutorial. There are other terrain generation tools that you could use that may even do a better job. However I like to use terragen because it is quick and dirty.

You can download it here http://www.planetside.co.uk/terragen/download.shtml

You will also need G16ed conversion tool for exporting your height map to a 16bit bitmap image that Unreal uses for heightmaps.

You can download it here http://homepage.ntlworld.com/martingbell/ut2003/

Terragen allows you to export your heightmap out as a 16 bit raw which can be imported straight into G16ed and saved directly to 16bitmap and your almost done. However I have added a few extra steps for creating larger and more detailed terrain.

Basically I want to create an expansive realistic mountain range for my level. My first problem is the free version of terragen only lets you create heightmaps with a maximum resolution of 512. Obviously not enough for my purposes. In order to combat this I generate 4 separate 512 heightmaps all with terrain of epic proportions. I later join all four of these maps together into a 1024x1024 map. This gives me 4 a heightmap with 4 times more detail.

Here is a basic overview of the steps that I take in this tutorial

Step 1
Generate 4 realistic terrain heightmaps using terrain generation software

Step 2
Export and open heightmaps in image editor (GIMP, Photoshop)

Step 3
Join the 4 hightmaps into one larger one

Step 4
Save out completed heightmap and convert to G16 bmp

Step 5
Import you heightmap into your level and scale your terrain to the proper proportions

Step 1
Now you may be happy just randomly generating terrain until you get something you like. But I am not. I want to have as much control over the general shape of my terrain as possible.

I open tearragen and my first step is to go to “size” and click on 513. Then go click on “view/sculpt” and I start painting a rough heightmap. I check “Cols” which makes my height map appear psychedelic. And the rest you can figure out yourself.

viewsculpt.jpg


Once I’m happy with what I’ve painted I click on the 3D preview button and find that my terrain has some very tall lumpiness.

talllumpyness.jpg


Next I go to “modify” and change “scale vertical” from 200% to 75% (you set the value you want then you click “scale vertically” button). I return back to the 3D preview window and find that my terrain now more closely resembles rolling hills. You may be inclined to go back to modify a few times and change the vertical scale until you get the proportions exactly how you want them.

Terrainstepmodification.jpg


rollinghills.jpg


Now I have created the general shape of my terrain I just need generate some realism onto it.

Now is a good time to save your terrain because there is no undo command for the next step which you may want to try a few times till you get the right results

I now go to “generate terrain”

Under Action check “generate features on existing terrain”

Under settings make sure “size of features” slider is on low setting if the feature size is too big it will distort your terrain into something completely different. If you do this and you don’t like the result you will need to close your map without saving and load it again from where you saved it before in order to restore you terrain back to how it was before so you can try again.

generator.jpg


generatedrealism.jpg


You will probably get some rows of irregular peaks along two edges of your terrain but we will worry about those later.

irregularpeaks.jpg


Now that I’ve covered the basics of using terragen I will now move on to creating the terrain for my level. As I mentioned before 512x512 heightmap isn’t detailed enough for my purposes. For the sake of demonstration I have created 4 randomly generated 513 heightmaps. I export them all out as 8bit Raw files as I know I can open these in Photoshop.

Step 2
Now I have always used Photoshop so I know little of the capabilities and limitations of its freeware equivalents such as GIMP. So assuming you can open and save a 8bit raw with GIMP You can basically do the same as I do using Photoshop. In this case I will mostly be using the “stamp tool” and if your using GIMP I believe you would use the “clone tool” to do the same.

Note: when opening the raw files in Photoshop leave them as 513x513 I found that if you changed it to 512x512 it would stretch the image to 512x1024 for some reason.

Step 3
I place my 4 raw hightmaps in the best arrangement on a 1024x1024 canvas and flatten the layers. I save the image as a 16bit tiff while I work on it. I then use the stamp tool to blend the edges of the 4 original heightmaps into the one. The smudge and blur tools are also good for this but I would steer away from using them as they will cause you to loose rockiness and give you smooth and curvier terrain.

joining.jpg


Note: With the example terrain heightmap I created earlier I had those irregular peaks along the edges we can fix this now by either cropping the image leaving out the edges with the irregularities. Then resize the image back to its original resolution. Or you could paint them out using the stamp, dodge and burn tools.

fixpeaks.jpg


Once you’re done cleaning up the joining edges save the final hightmap out as a raw.

Step 4
Now open G16ed and import your heightmap raw and save it as a G16 bmp

Step 5
In your level in the unreal editor switch to terrain editing mode

Note: when importing a heightmap there is no need to go to Tools->New Terrain...

Note: the “import/export” section of the terrain editor check “Heightmap only” and leave the class on G16BMPT3D

Then import your G16 bmp

terraineditor.jpg


Now your terrain heightmap will appear very much out of proportion. Don’t panic at this point.

I have just imported a 1024 heightmap which gives me a ridiculously huge 256 scale terrain. A heightmap of 512x512 will give you a terrain a scale of 128x128 in unreal. This is about as large as you will want to go. For anything larger I would suggest figuring out how to do level streaming. Or maybe Crysis would be better suited for you to make levels in.

unproportional.jpg


With the terrain selected go down to the “draw scale” fields at the bottom right hand corner of the editor and change the X,Y scales from 256 to 128 and the Z scale to 25. You can always tweak the Z scale till your terrain appears to have the right proportions.

You should really add some kind of material other than the default, to your terrain.

proportional.jpg


Note: It is important that you make sure your lighting is set up exactly how you want it be for you build lighting for the terrain as it takes a very long time to bake. You are looking at up to 2 hours for a full quality build of just the terrain its self. And you will end up with a map file of at least 110mb.

Now all that remains is to texture and vegitate your map but I will leave that for another tutorial.