Torque Game EngineTorque Game Engine Documentation
Version 1.3.x

Terrain Editor

Starting The Terrain Editor

  1. Start the Mission Editor by pressing F11.
  2. Start the Terrain Editor by pressing F6.

The Terrain Editor Window

When you start the Terrain Editor, you will see a shot like the one above. This looks very much like the view in the Manipulator, for the fact that there are no windows obscuring your view. However, if you look closely, you'll notice some odd squares following your cursor around while you move your mouse. These squares are yet another Torque user interface device, the purpose of which is to give you feedback on what terrain area will be affected when you choose to manipulate it and to some degree how it will be affected. Before we jump right into learning how to edit the terrain, let us look at the other two devices on the screen.

The Over Vertex Brush Scale

I'm sure someone will correct my naming, but for now I'll refer to the text beside the label (Mouse Brush) as the Over Vertex Brush Scale. The purpose of this scale is two-fold:

  1. It shows how many vertices are currently under the brush. In the image above, we have 69 blocks under the brush.
  2. It shows the average elevation of the vertices under the brush.

The Normal Brush Selection Scale

Again, I'm sure someone will tell me my naming choice is incorrect, but for now I'll refer to the text beside the label (Selection) as the Selected Brush Scale. The purpose of this scale is two-fold:

  1. It shows how many vertices are currently selected. (We'll learn about selecting below.)
  2. It shows the average elevation of these selected vertices.

Editing

There are two basic modes for editing via the Terrain Editor:

  1. Brush Mode - The default mode, which I like to think of as Brush Mode, is a free floating 9x9 vertex brush. You can adjust the shape and hardness of the brush as well as change its size of by rough increments. In addition, this mode provides several operations.
  2. Selection Mode - The second mode, which I use less frequently, but which can do things that you cannot do in Brush Mode, is what I like to think of as Selection Mode. In this mode, you select arbitrary blocks of terrain. Then, you can perform a single operation upon them, which is to modify their height via mouse movement.

Editing in Brush Mode

I think it is fair to say that most of your editing is going to be in Brush Mode, and because it is the default mode, I'll discuss it first. As mentioned previously, you can modify the brush shape, hardness, and size. The illustration below describes the details, which are modifiable in the Brush Menu.

OK, now that we know about basic brush manipulation, what about the operations? Let us take a look at the action menu on the next page.

Basic Brush Editing Actions

Table 4.22. 

Table 4.23. 

OperationMeaning
Add Dirt

lowers terrain under brush.

Excavate

raises terrain under brush.

Adjust Height

temporarily selects vertices under brush.

Mouse Up - raises

Mouse Down - lowers vertices.

Flatten

sets all vertices to brush to average height of vertices under brush.

Hint: Look at the Over Vertex Brush Scale.

Smooth

does a nearest neighbor elevation average on vertices under brush.

Set Height

sets all vertices to pre-selected height. (see Terrain Editor settings below for setting this value.)

Set Empty

This removes the terrain between the outer edges of the brush.

Clear Empty

Puts terrain back in spots where it was previously removed.

Paint Material

paints vertex with currently selected texture. (See: Terrain Texture Painter chapter)

Selection in Brush Mode

Alright, so what about this other mode, Selection? There isn't really much to it. To get into Selection Mode, just open the action menu and click Select. Now, you can select terrain as follows:

OK, now that we know about basic brush manipulation, what about the operations? Let us take a look at the action menu on the next page.

Table 4.24. 

ActionResult

Previously Unselected Vertex

Selects vertex.

Previously Selected Vertex

May increase strength of action (see discussion of brush hardness below) if the selection cursor has a stronger value than currently selected vertex's action strength.

CTRL +

Previously Selected Vertex

De-selects vertex.

Having selected the terrain blocks that we wish to modify, we can open the action menu and click Adjust Selection. Now, we can right-click and drag up-down to raise-lower the elevation of the selected blocks.

To leave selection mode, select any other operation in the action menu. Also, once selected, vertices stay selected, regardless of mode. If you wish to de-select all selected vertices press CTRL + N or click Select None in the Edit menu.

Brush Hardness

Brush hardness has been mentioned several times but not completely explained. When the brush hardness is set to Soft, the action strength along the diameter of the brush can be modified. In simple terms, if the strength of action is set low, then the value change for that part of the brush is also low. Vice versa, if the strength of action is set high, the value change for that part of the brush will be high. This attenuation is in relation to the movement of the mouse. The brush gives strength of action feedback through coloration. Brush coloration is a continuous scale from RED to GREEN. You can manipulate this hardness in the Terrain Editor Settings dialog found under the Edit Menu.

Table 4.25. 

ColorRelative Hardness (Strength of Action)

RED

Hardest (100%)

ORANGE

Hard (more than 50%)

YELLOW

Soft (less than 50%)

GREEN

Softest (Almost 0%)

For example, the brush below is hard in the middle progressing to soft on the edges.

Terrain Editor Settings

Earlier, I deferred a discussion of these settings. Now is the time to understand them. In addition to being able to adjust brush shape, hardness, and size, the Terrain Editor Settings Dialog, found under the Edit menu, gives us some additional control.

Selection and Radius

I had a bit of difficulty understanding Radius when I was learning about the engine. So, instead attempting to explain it with words, I'll give a pictorial example that should clear it up. In the following sequence, I have changed to Selection-Mode and am using a 1x1 brush. I then selected a single vertex and then opened the Terrain Editor Settings dialog.

Table 4.26. 

Radius = 1

APPLY

Radius = 8

APPLY

Radius = 12

APPLY

Radius = 16

APPLY