Terrain tutorial - Part 3
Tutorials in this series:
- Terrain tutorial: Creating a heightmap, modifying brush patterns and shapes, using terrain limiters, using the level tool to create ramps and mesas
- Terrain tutorial - Part 2: Colorizing terrain, importing unique brush patterns
- Terrain tutorial - Part 3: Creating multiple heightmaps at once, dealing with overlaps
- Terrain tutorial - Part 4: Modifying terrain with textures, adding dynamic details
- Terrain tutorial - Part 5: Erasing and Cloning terrain details, exporting terrain for modeling reference, texture tweaking
Creating multiple heightmaps
When you've been clicking on the standard button, it creates a 32 x 32 heightmap. In this section of the tutorial, we will go into more depth on what that 32 x 32 means, and how to create heightmaps of different sizes, or multiple heightmaps at once.
Structure of a heightmap
Heightmaps are defined by the number of vertices along the edge (note that this is vertices between polygons, not the polygons themselves).
Heightmaps can be created in any size from 2 vertices on a side up to 128 vertices on a side, though the most common sizes are:
- 32 x 32
- 64 x 64
- 96 x 96
- 128 x 128
Heightmaps can also be created in other smaller or irregular sizes, anywhere from 2 x 2 to 128 x 128, such as 10 x 15, or 125 x 50, or anything else, depending on your needs.
The Grid Menu
If you would like to create an irregularly shaped heightmap, or multiple heightmaps at once, this is done with the Grid button on the Terrain Panel, which opens the Create Heightmap Grid menu. With this menu, you can create anything from a tiny 2x2 vertex heightmap, to an area that uses multiple nodes and thousands of vertices.
This menu will also advise you on how many heightmap nodes are needed, if you want to make a very large area.
- On the Terrain panel, click the grid button next to the "Create Heightmap" button, to get the Create Heightmap Grid menu.
- In the "miles" column of the menu, enter width and depth of 1 x 1 mile
- Note that when you do this, the menu automatically fills in the number of vertices that a 1-mile-square heightmap would require (805) and how big that would be in meters (1609).
- In the "Preferred size" column of the menu, choose the option of 64 x 64.
- On the righthand side of the menu, it will inform you that you would need 13x13 heightmap nodes of size 64x64 to achieve this.
- Choose a preferred size of 32 x 32, and the number of nodes increases to 26x26.
- Choose a preferred size of 128 x 128, and the number of nodes decreases to 7x7
- Next, enter in the size of a default heightmap (what you get when you just click the "Create Heightmap" button)
- Choose a preferred size of 32 x 32
- In the Vertices column, it currently says 2x2, which is the smallest possible heightmap, not what we want.
- In the Vertices column, enter width and depth of 32 x 32
- The rest of the menu will tell you that this is equivalent to an area about 62 meters on a side, or .04 miles, and that it requires one (1x1) heightmap node.
Create the smallest possible heightmap
Next, we will create a very small heightmap node, to better view how this works.
For best results, cancel out of the grid menu first, and maneuver your viewpoint so that you're looking out into a void somewhere, with no current heightmaps visible in the viewport. This will make it easier to observe the new heightmap node without interference from other nodes.
- Open the heightmap grid menu
- In the "vertices" column, keep the minimum value, of 2 x 2
- The "preferred size" won't matter at this point, because we're only making something very small, so it won't require more than one node.
- Click "OK" to create the heightmap node.
- The node will have appeared at your viewpoint, so press the back button on the mouse, or CTRL-G, to center the new node in your viewport.
Next, we'll look at the polygons of this new node. There are multiple ways to do this, but probably the easiest is to hover a Terrain Tool over the node and get the polygons to highlight that way.
- Select one of the Terrain Tools, such as Level.
- Use a Solid brush shape
- Create a large brush size with the mouse wheel.
- Hover the mouse over the heightmap, to highlight the polygons. Since this is the smallest possible heightmap, you will see only two triangles, connecting the two vertices on each side of the heightmap.
- Create the smallest possible brush with the mouse wheel
- Hover the mouse over each of the four vertices, and observe how you can highlight the vertices individually.
Create an irregularly shaped heightmap
- Again, maneuver your viewpoint to an empty space in your area.
- Open the Grid menu, and create a heightmap that is 2 x 5 vertices
- Click OK
- Center your view on the new heightmap, by pressing CTRL-G, or the back button on your mouse.
- See also: vertex-coloring
- Choose the Colorize tool
- Select a bright color, such as red (click on the righthand side of the triangle in the Color subpanel)
- Create a very small terrain brush
- Move your viewpoint very close to the heightmap, highlight one and only one of the vertices, and click once to watch how the color appears. It's a subtle point, but worth noting that color is applied to a heightmap with vertex-based coloring, not per polygon.
- Choose a different color, such as blue
- Move the brush to another vertex near where you painted red, and click once
- Note how the colors of red and blue blend, in between the vertices
- Try painting other vertices with different colors, to observe how they blend.
- Hold down the CTRL key to get a "sample" icon, and move over the colors and note how the pointer changes colors. When you sample a color, you're sampling the base color at the nearest vertex, and not the blended color in between vertices.
Create a large area
Next, we'll create an area that takes more than one heightmap node.
- Maneuver your viewpoint to an open area.
- Open the Grid Menu
- In the meters column, set a size of 100x100 meters. Note how this requires 51x51 vertices.
- Under "Preferred size", choose 32x32.
- Note how it says that this will require 2x2 nodes (two nodes wide, and two nodes deep).
- Click "OK".
- Center your view on the new set of heightmap nodes.
- Note how there's only one 32x32 node, and three other partial nodes to bring things up to the proper size.
- For future reference, the small partial or "sliver" nodes should still be thought of as individual heightmaps, so that un-seen ones can be "culled" by HeroEngine to improve framerate.
- Select two of the created heightmaps, and using the Select & Translate Tool , move them back and forth. This demonstrates that the multiple nodes are not connected together in any way, they are still separate.
- Move two of the heightmaps so they overlap part of the other heightmaps (about 25-50% overlap)
- Next, using the green axis of movement, move the heightmaps apart in altitude, either up or down. Red lines should appear, to show that the heightmaps have a gap between them.
- Note that these lines only appear when the Select & Translate Tool is active, and not with other tools.
- The gap can be "stitched" together (see below), but leaving the heightmaps separate can also be helpful in making elevation differences. However, be careful when modifying overlapping heightmaps, because the terrain tool modifies everything underneath it.
- Select the Edit Height tool and try to modify the heightmaps in the area of the overlap. Note how the tool affects both layers.
- To edit only one layer, use one of the Terrain limiters.
- De-select the limiter checkbox to continue.
Stitching heightmaps together
At this point you should have overlapping heightmaps, with some bumpy terrain on each
- To "heal" the gap between the overlapping heightmaps, choose the Stitch tool
- Hover the mouse over the rift between the two heightmaps, and click and drag to heal the rift
- Note: the stitch tool will only work if the circle is blue. If the circle is orange, it means the tool is not properly positioned over the heightmap
- If the tool disappears for some reason, click on one of the heightmaps to re-select it.
- Choose the Select & Translate Tool again, to doublecheck if there are still any red lines.
Creating a cave roof
Overlapping heightmaps might also be used for a cave system.
- Move your viewpoint below a heightmap, and note that from below, it is not visible.
- To invert a heightmap:
- Select the upper heightmap
- Open the Properties panel
- Change the Inverted property to TRUE
- The heightmap should now be visible from below, and can still be modified.
Note: For a good cave though, it is usually better to use a heightmap node for the floor, and static assets for the top.
Splitting a heightmap
If it's desired to split one heightmap into multiple nodes, this can be done with the Split Tool. This can sometimes be useful for Rooming, splitting heightmaps and assets between rooms.
- Select a heightmap.
- Choose the Split Tool
- Use the mousewheel to change the direction of the slicer.
- Click to slice the heightmap.