[Tutorial] Using Terragen and Dispgen to map

Discussion in 'Mapping' started by BumGravy, Aug 4, 2008.

  1. BumGravy

    BumGravy Member

    Messages:
    663
    Likes Received:
    1
    Trophy Points:
    0
    I've noticed a few people recently saying they would like to learn how to make nice looking displacements to create environments suitable for Empires. I have just finished the first beta of a map using the technique of creating a heightmap in Terragen and then using DispGen to convert the heightmap to displacements to use in Hammer.

    I have found this technique to be a LOT faster than manually editing displacements into an environment in Hammer - and the end results certainly look a lot smoother and more organic than you would get if you tried to create them manually.

    There are already tutorials for using Terragen and Dispgen out there, but this one will hopefully tell you how best to use these programs for making an Empires map specifically.

    Programs needed:
    Terragen
    Dispgen
    Image editing software (I use Paint.NET
    Hammer

    PART 1 - GENERATING THE HEIGHTMAP IN TERRAGEN

    1) Open Terragen. We are going to use this to create our greyscale heightmap image. In the landscape window, press the Generate Terrain (A) button. We can start with the default values in this window, so just hit the Generate terrain button (B). This will generate a random heightmap in the Landscape window. If you don't like it, hit the generate terrain button until you get something you like the look of, but don't worry about it too much at this stage. My random image looks like this:
    [​IMG]
    Note - If you are lazy/impateint and want fast results, you can skip to step 5 and use this image to generate your displacements. The next few step will tell you how to edit this image to give you more control over how your displacements are going to turn out.

    2) Close the Terrain Genesis dialogue. We can now edit the terrain as we please in the Landscape window by pressing View/Sculpt... Hit this and then make sure the Basic Sculpting button is selected (A) and also Display Heights is set to Greys. Also at the top you will see the tool size and tool effect buttons. We can change these to change the amount the tool effects the image. Bear in mind Black parts of the image are Lower, and White parts of the image are higher.

    *A solid black area next to a solid white area will translate as a step or a steep incline.
    *A gradually gradiated grey area will translate to a smooth slope.
    *A large are of one tone will result in a large flat area. Remember, these areas are important for where you want the commander to be able to build a base.


    Use the tool on the image and change it as you desire, with left mouse button to make areas lighter (higher), and right mouse button to make areas darker (lower). Notice if you go too low, the you can see blue water. As we will be using a greyscale image for a later step we will want to raise these areas back up so that they return to greyscale. Make sure no water is showing. After messing about with my image it now looks like this:

    [​IMG]

    Close the View/Sculpt window when you are happy with what you have got, but again don't worry too much about it. You will notice in my image I have raised more of the hills around the edges - this is so that it will be better to seal off the outside of my level to the player.

    3) As well as being able to manually edit the height as I have just shown, we can also use Terragens Terrain Modification window to edit the contours. Press the Modify button in the landscape window (A) to bring this dialogue up. IMPORTANT - make sure you do not accidentally press the Clear/Flatten button or you will lose your unsaved work, as Terragen does not seem to have an undo function. If you want your terrain to look like it has been naturally eroded by glaciers, press the Glaciate button (B). If you want it to look more like canyons, press the Canyonize button (C). I am going to press both of these just for the hell of it, and then set my bottom level to zero by changing the height "from" value and then hitting Set Height Range (D). I am not sure if this is absolutely necessary but I like to know that my bottom level is at zero so it will be completely black. You can see my resulting image:

    [​IMG]

    4) When you are happy with the results close the Terrain Modification window and hit View/Sculpt again (step 2) to get a better look at your image. If you like you can repeat steps 2 and 3 until you have something you like the look of, but don't stress over it too much for now.

    We can now take a look at a 3D rendered preview of our image. Press the Rendering Control window in Terragen and hit the render preview (A). Because of where my camera is placed I can't see very much, so I have moved it by clicking as directed in the bottom right of this window (B).

    [​IMG]


    Move your camera around and press render preview to get an idea of what your map might look like. If you want to get a better look, hit the Render Image button (C), and you can also play with Terragens settings to make a nice looking render. Below you will see my render so far.

    [​IMG]

    Notice that my greyscale has quite a lot of contrast - very dark and very light areas. As you can see this translates as flat areas(black) with high, sharp peaks (white). If you don't like the height of your mountainous areas don't worry - this can be adjusted easily.

    5) So now we have previewed our image, we are happy with it, and can now get it into a format that we can use in Dispgen to turn the heightmap into usable displacements. First of all save your terrain in case you wan to modify it again later by pressing Save.. back in the Landscape window.

    Terragen doesn't actually export any kind of file that we can directly use in Dispgen but we can cheat. In Landscape, press the View/Sculpt button (step 2) to view your greyscale heightmap. Now press the PrintScreen button on your keyboard (usually beside Scroll Lock, Pause Break and all those other buttons you never use) to copy the screen image to the clipboard. You may have software such as Fraps for this kind of thing but there is no advantage or disadvantage from using PrintScreen.

    Open your image editing software (I like Paint.Net, it is free and easy to use and a small download too.) and hit Paste. This will paste your screenshot into the image editor. Crop the image down to just the greyscale, and then resize it to 512x512 pixels. So you should have something that looks like this:

    [​IMG]

    6) We are now going to adjust the contrast to expand the black areas slightly, so there are more flat areas and therefore more areas for the commanders to easily build on. You may want to skip this step depending on how your image is looking, but I feel my image could do with a bit more flatness so I am going to play with the brightness/contrast settings until I get something like this:

    [​IMG]

    Save this image as any kind of common image file, but do not use any compression, as it is the heightmap we are going to use for the next part - it is now time to load up Dispgen.
     
    Last edited: Aug 4, 2008
  2. BumGravy

    BumGravy Member

    Messages:
    663
    Likes Received:
    1
    Trophy Points:
    0
    PART 2 - DISPLACEMENTS

    1) Load up Dispgen. You can run the .exe straight from the Zip file if you have just downloaded it, no install necessary. We are now going to turn our lovely new heightmap into a VMF file contaiing displacements. For these settings, you can use my example for now and if you don't like the result come back into DispGen, change the values and create a new VMF.

    First we have to set the Brush Generation Parameters. To get a reasonable amount of detail into the displacements, you want to raise the X and Y triangle values. I have set mine to 64 each, which will create 16 brushes, which is a reasonable amount if you want to create a full-scale Empires map. Put 32 into the Height (units) box as this will make it easier to scale our displacements vertically.

    Check the Displacement adjustments and Run Smoothing boxes, these will help to generate much nicer displacements that will look better when textured. Where it says Heightmap File, browse to the Heightmap you created in the first stage. You do not need to worry about the material name or Alpha mapping, as you can easily do this in Hammer. Enter a name for your VMF utput file, but don't worry about creating a Skybox or Nodraw brushes at this stage. Your Dispgen window should look something like this:

    [​IMG]

    So hit Generate!

    2) Load up Hammer and open the VMF you have created. Your displacements will look quite flat because of the height setting we used in Dispgen, but don't worry - select your displacements, and in one of the side views stretch the displacement vertically. Your rolling hills and valleys will expand up the way like a pop-up book! As you can see it is now very easy to set the exact height you want your hills to be, regardless of how high your hills appeared when you were using Terragen. You should have something that looks like this (I am using a dev texture to show off the curves better):

    [​IMG]


    3)Now at this stage you will probably want to tweak your displacements in hammer - in the above picture notice I have one peak that seems strangley pointed and looks out of place. If you look at my Heightmap image you might be able to work out the region this relates to - a very white area next to a very dark area. As this is only a small area I can do this in Hammer, but alternatively I could go back and edit my Heightmap in my image editor to smooth that area out (Part 1, step 6), but if my Heightmap had a lot of these areas I would probably go back to Terragen and either create a fresh heightmap or edit the terrain file that I saved already. As it stand I can just smooth out this bump and see what it looks like in game.

    I won't take you through Alpha painting or displacement editing or the whole "how to make a map", but after a small tweak and a quick compile, here is what my map loks like when compile and rendered in-game:

    [​IMG]

    OK it looks crap because of my low game settings and Ive stretched the texture, but you get the idea :)

    Please leave any comments or suggestions on how to improve this tutorial, or if you found my rambling annoying or helpful.
     
    Last edited: Aug 4, 2008
  3. -Mayama-

    -Mayama- MANLY MAN BITCH

    Messages:
    6,487
    Likes Received:
    0
    Trophy Points:
    0
    Thx for the terragen part :)
     
  4. w00kie

    w00kie Mustachioed Mexican

    Messages:
    3,863
    Likes Received:
    13
    Trophy Points:
    0
    thx, I worked with Terragen years ago, creating heighmaps for BF42.

    btw: How do I load up a VMF into hammer? :D

    Seriously


    EDIT: Okay, got it :D never done something in Hammer before :)
     
    Last edited: Aug 4, 2008
  5. bitchslap

    bitchslap Member

    Messages:
    1,217
    Likes Received:
    0
    Trophy Points:
    0
    ty for doing this, i hope more ppl try to make command maps, we need some fresh attack zones.
     
  6. ScardyBob

    ScardyBob Member

    Messages:
    3,457
    Likes Received:
    30
    Trophy Points:
    0
    Also, you don't need terragen to create a heightmap. The concept is just a 2D picture with light/dark areas corresponding to relative heights (lighter = higher, darker = lower). You can do this in pretty much any paint program, though Terragen makes realistic terrain pretty quickly :)
     
  7. Gnar

    Gnar Member

    Messages:
    61
    Likes Received:
    0
    Trophy Points:
    0
    >_<

    snip
    ~Kylegar


    i got a question, which do i open in hammer, HL2:ep1 hl2dm? or hl2ep1 hl2? to map for empires? i been looking for a tutorial in the forums, one does not exist that i know of...

    and geez. this tutorial is brilliant for the people who dont have TIME. jobs, school, girlfriends, all really take the most time out of soemeones life. a fast disp that looks decent is great. i relaly dont want to make my own displacements, i dont have TIME. Thank you OP for posting this. i now have confidence to map for this mod.
     
    Last edited by a moderator: Aug 20, 2008
  8. BumGravy

    BumGravy Member

    Messages:
    663
    Likes Received:
    1
    Trophy Points:
    0
    Another happy customer, thanks for the comments :)

    Once you set up your Hammer options for empires, you will have an empires config to choose when you load sourcesdk. It seems weird that theres not a tutorial on how to set it up in here, Ill write one tomorrow.
     
  9. Kylegar

    Kylegar Specstax Rule

    Messages:
    2,170
    Likes Received:
    0
    Trophy Points:
    0
    I cleaned this thread.

    Be respectful of eachother, a method is a method.
     
  10. bitchslap

    bitchslap Member

    Messages:
    1,217
    Likes Received:
    0
    Trophy Points:
    0
  11. Jephir

    Jephir ALL GLORY TO THE JEPHIR

    Messages:
    1,409
    Likes Received:
    6
    Trophy Points:
    0
    Awesome tutorial!

    Thank you so much bumgravy! Now I don't have to use carve anymore!!!
     
  12. Cloud

    Cloud Member

    Messages:
    1,379
    Likes Received:
    0
    Trophy Points:
    0
    SAY WHAT?!
    i used to do a lotta stuff in terragen O_o
    Thanks for the tut.
     
  13. blizzerd

    blizzerd Member

    Messages:
    10,552
    Likes Received:
    60
    Trophy Points:
    0
    What? you used carve? for what?
     
  14. Private Sandbag

    Private Sandbag Member

    Messages:
    7,491
    Likes Received:
    0
    Trophy Points:
    0
    this is going to sound really silly, i realise, but could someone do a tutorial on making emp_canyon style cliffs? i realise that they're displacements, but i've tried several displacement or brush techniques, and they're all really slow and unreliable. what's the fastest way to set up a bunch of cliffs?

    edit: news just in... simon is awesome.
     
    Last edited: Aug 31, 2008
  15. Emp_Recruit

    Emp_Recruit Member

    Messages:
    4,244
    Likes Received:
    0
    Trophy Points:
    0
  16. willvette

    willvette Member

    Messages:
    107
    Likes Received:
    0
    Trophy Points:
    0
    hay, tool called World Machine can also make heightmap images and it gives you more tools to use to make it, but it also miens that it is more complex.
    http://www.world-machine.com/
     
  17. Caelo

    Caelo Member

    Messages:
    2,371
    Likes Received:
    5
    Trophy Points:
    0
    dispgen can make sure your textures don't go haywire unlike world-machine... and that alone should be enough reason to pick dispgen instead of WM
     
  18. arklansman

    arklansman Member

    Messages:
    5,365
    Likes Received:
    0
    Trophy Points:
    0
    World machine is for making heightmaps, dispgen is for making heightmaps into displacements.
     
  19. Empty

    Empty Member

    Messages:
    14,912
    Likes Received:
    11
    Trophy Points:
    0
    dispgen is down, anyone have a mirror
     
  20. Starcitsura

    Starcitsura Member

    Messages:
    417
    Likes Received:
    0
    Trophy Points:
    0

Share This Page