Creating Terrain with L3DT and YATT

From ALFA
Revision as of 19:47, 1 August 2014 by Foambats4all (talk | contribs) (Creation with YATT)
Jump to: navigation, search
L3DTwYATT Example.jpg

One of the most taxing tasks of creating a new exterior area is the manual manipulation of terrain. Using the popular program Large 3D Terrain (L3DT) Generator and a toolset plugin, we can create realistic terrain with minimal effort. An example terrain as seen in the Toolset can be seen to the right.

This document will help guide builders to use these tools for Neverwinter Nights 2.


Prerequisites

If you have not already done so, follow the steps for setting up an ALFA Build Module, including enabling third party toolset plugins.

Large 3D Terrain Generator

Download L3DT Standard Edition. Preferably get the latest beta, but if you encounter issues using it, try switching to the stable release. Install it using the on-screen instructions.

Yet Another Terrain Tool

Download Yet Another Terrain Tool. Once it is finished, open the archive and extract the file to <NWN2 Install Directory>/NWN2Toolset/Plugins.


Generation with L3DT

For a more complete introduction to L3DT, see L3DT User Tutorials

In this example we will be making a very simple terrain using L3DT. To get started, open L3DT and create a new project using File > New project.

Project Type

L3DTwYATT 001.jpg

Our first window in L3DT lets us determine what sort of project we're making. Typically, you will want either a Designable Map or a Blank Designable Map. A blank map will let you detail the world by hand, while the first option will generate the map for you based on various parameters. In this tutorial, we will be using Designable Map. Make sure this is selected, then click Next >>.

Summary:

  1. Select Designable Map
  2. Click Next >>


Heightfield Size

L3DTwYATT 002.jpg

Next, we want to specify the size of our heightfield. A heightfield is the image used that provides vertical depth, or height, to a terrain. The YATT website provides minimum resolutions to use for these heightmaps, copied below. In this example, we will be making a 24x24 external area. By using the chart, we see that our minimum size for a 24x24 area is 241px by 241px. However, we want to always round up to the next multiple of 16 for the next step, so we will be putting in a value of 256 for both. In Neverwinter Nights 2, 1 map unit is 1 meter, so we will use a Horizontal Scale of 1.

Area Width Heightmap Size Area Width Heightmap Size
4 128 20 224
8 160 24 256
12 176 28 272
16 208 32 304

Summary:

  1. Set both Width and Height to 256.
  2. Set Horizontal Scale to 1.
  3. Click Next >>


Design Map Size

L3DTwYATT 003.jpg

The design map lets us place or tweak features, and and thus determines general terrain detail. This is mostly important if we want to tweak our map, or are generating one by hand. For this example, we're going to err on the side of detail, and select a value of 16.

Summary:

  1. Select 16 from the drop down box.
  2. Click Next >>


Design Map Parameters

L3DTwYATT 004.jpg

While most of the screens are fairly simple, this is where you actually have the most input on how your terrain will come out. Play with these dials, experiment, and see what you like best. With this you can make rolling plains, frosty crags, or islands.

Summary:

  1. Play around! Don't be afraid to try new things, you can always make a new map.
  2. Click Next >>


Calculation Queue

L3DTwYATT 005.jpg

In this next step, we define just what we want to create. For our purposes, we will check everything except for Water map.

Summary:

  1. Check everything except for Water map.
  2. Click Next >>


Light Mapping (Part 1)

L3DTwYATT 006.jpg

This is another window we will simply click through. Should you wish to get advanced, here you can control the angle of our lighting, which we will use later to make specular maps. These maps will translate to color maps for our terrain, which will provide far nicer details.

Summary:

  1. Click Next >>


Light Mapping (Part 2)

L3DTwYATT 007.jpg

Yet another simple page. Here, we are specifying the details for generating what we described above. Since we are not generating water in this example, be sure to uncheck Water effects.

Summary:

  1. Uncheck Water effects
  2. Click Next >>


Texture Settings

L3DTwYATT 008.jpg

Our final bit of generation in L3DT prior to exporting will be the creation of our textures. For now, the default settings work out just fine.

Summary:

  1. Click Next >>


Finalizing Generation

L3DTwYATT 009.jpg

After L3DT generates everything for you, take a look around. This is your chance to make sure what you made is something worth creating. Due to the random nature of L3DT's generation, not everything will be suitable for a NWN2 area. You will want to keep in mind that the center of your map is where the players will be, so you will want to make sure everything looks manageable.

You can click the View map in 3D button on the toolbar to take a look around. Control your camera using W, A, S, and D to move around. Use R to lower the camera, and E to raise it.

Do not worry too much about texture quality, as we will not be using L3DT's textures directly. When you are happy with what you have, progress to the next step.



Exporting Maps

Now that we've generated our fancy terrain, we need to cut out the parts that the toolset can use. These exports, maps, are image files that represent details on the terrain. A heightmap may be a grayscale image, where lighter shades represent higher altitudes, while darker shades represent depth. You can see some of these maps by clicking the tabs.

Creating Alpha Texture Maps

L3DTwYATT 010.jpg

First, we need to generate alpha texture maps. These maps tell YATT where and at what pressures there are textures. You will get one map for each texture used. To get started, navigate to Operations > Alpha maps > Generate maps... Here you will want to note down the order and textures used. In this example, we've have layers 1 and 2 being grasses, with 3 and 4 being cliff textures. Note these down for later, then click Next >>.

Summary:

  1. Navigate to Operations > Alpha maps > Generate maps...
  2. Note down the relationship between the numbers and what kind of texture it relates to. E.g., 1 goes to grass, 4 goes to cliffs.
  3. Click Next >>


Exporting Alpha Texture Maps

L3DTwYATT 011.jpg

On the next page, you will want to check Export alpha maps now and save the .xml file where you will be exporting your maps. If you went through more detailed textures, you may want to change some settings here.

Summary:

  1. Check Export alpha maps now.
  2. Save the .xml file into a folder to use later.
  3. Click Next >>


Exporting Heightmap

L3DTwYATT 012.jpg

Next we want to export our heightfield, which will define our terrain's shape. To start, select the Heightfield tab, then navigate to Layers > Export layer... or use the Ctrl+E shortcut. We want to export our images as bitmap or BMP files. Select this from the drop down menu, and use the ... button to specify the location of your map. You want to save this to the same directory as your alpha maps. When you are done, progress by clicking Next >>.

Summary:

  1. Select the Heightfield tab.
  2. Navigate to Layers > Export layer...
  3. Select BMP as the export File format.
  4. Click on ... on the File name field, and save the .bmp file in the same folder as your alpha maps.
  5. Click Next >>


Exporting Specular Light Map

L3DTwYATT 013.jpg

Now that we have our heightfield/heightmap, we're basically going to do the same thing for our specular light map. Follow the same steps, but for the Specular light map tab.

Summary:

  1. Select the Specular light map tab.
  2. Navigate to Layers > Export layer...
  3. Select BMP as the export File format.
  4. Click on ... on the File name field, and save the .bmp file in the same folder as your alpha maps.
  5. Click Next >>

Tweaking Specular Lights

By default the specular light map is rather dramatic. Open it in your favorite image editing program, such as GIMP and add a white layer above it, at 75% or so opacity. You may want to come back to this file later to tweak it.



Creation with YATT

At this point we are done with L3DT. Close it, and open up the toolset.

Getting Started

L3DTwYATT 014.jpg

Make sure that you have 3rd party plugins enabled, and that you have YATT properly installed. If you do, you should be able to navigate to Plugins > YATT. Do so, then navigate to File > Define Input Images.

Summary:

  1. Start the toolset.
  2. Enable 3rd party plugins.
  3. Navigate to Plugins > YATT
  4. Navigate to File > Define Input Images


Define Heightfield

L3DTwYATT 015.jpg

We're going to start off with our heightmap. Again, this will tell YATT the shape of your area, where hills and valleys are, and so on. Click on the ... button in the Heightmap field, then add our map by clicking the Add button on the new window. Our first step here is to use the ... button in our Heightmap File field to the heightfield we exported earlier.

The heightmap image itself uses shades between white and black, where white is the highest elevation, and black is the lowest. However, we need to define just how large this scale is. By using Minimum Height and Maximum Height we can specify that. For our cliffs, we're going to use a value of -10 and 80. In L3DT, you can view the elevation and try to see just how much of a range you want.

Finally, we want to tell YATT the size of our area. In this example, we are making a 24 by 24 area. In Map To Area Width and Map To Area Height select a value of TwentyFour. Click OK when you are done.

Summary:

  1. Click on ... in the Heightmap field.
  2. Click the Add button.
  3. Set Heightmap File to the heightfield we exported earlier.
  4. Set Minimum Height to -10 and Maximum Height to 80.
  5. Set Map To Area Width and Map To Area Height to TwentyFour.
  6. Click OK.


Define Colourmap

L3DTwYATT 016.jpg

In NWN2, it is common to use a black color to faintly define terrain. We will be doing this by using L3DT's specular light map as a color map. Open the colourmap collection, click Add, and point Colourmap File to our specular light map from earlier. Again, we will need to tell YATT the size of our area. In Map To Area Width and Map To Area Height select a value of TwentyFour. Click OK when you are done.

Summary:

  1. Click on ... in the Colourmap field.
  2. Click the Add button.
  3. Set Colourmap File to the specular light map we exported earlier.
  4. Set Map To Area Width and Map To Area Height to TwentyFour.
  5. Click OK.


Define Texturmaps

L3DTwYATT 017.jpg

Much like with heightmaps and the colourmap, we are going to specify our texturemaps. Here, however, we need to keep in mind which map relates to which textures. If you did not note them down from earlier, go back to that step to see which file corresponds to which texture, or open and explore your alpha map .xml file.

Repeat the following steps for each alpha texture map that L3DT exported.

  1. Click Add.
  2. Point Texturemap File to the alpha map.
  3. Set Texture to a related texture. Keep in mind you can always swap out textures in the toolset after generation.
  4. Set Map To Area Width and Map To Area Height to TwentyFour.

When you are done, click OK.


Generating the Area

And that's it! You're ready to generate your area. If what you get is not desirable, you can use the brush tool to replace textures. You may want to go back and edit your specular light map to make the black colors less defined.

To create your area, click OK on the settings browser, and navigate to Area > Build Area from Image(s). Wait for YATT to complete its process, then open your area. From there, you still need to place down details, but one of the hardest parts is done for you.


Touching up Details

Coming soon!