|
This tutorial is written for Raven Shield map
makers who want to create terrain from start to finish using
only the UnrealED terrain editor. If you have experience
creating terrain for other Unreal games, and are comfortable
creating gray alpha bitmaps in PhotoShop, you might want to
read Amon's "Crash Free Terrain Tutorial" first.
Note: The terrain editor
can be extremely unstable during the first few steps of
creating new terrain. There are two known causes of the
terrain editor crashing: First, moving your mouse outside the
terrain editor window after first creating your heightmap.
Second, using terrain dimensions which are not in base 2.
(These are both discussed in more detail below.) Follow my
instructions carefully and you may be able to avoid crashes
completely. If you crash while following this tutorial, don't
panic. Just reload the map and retry the steps again from your
last save (and yes, save your map frequently).
This tutorial assumes
that you are already familiar with UnrealED and know how to
load a simple custom map into Raven Shield. If this is not the
case, take a look at my earlier tutorial, Building
Your First Raven Shield Map, and then come back to this
one. I'm not going to spend much time in this tutorial dealing
with basic brush geometry or insertion points. I'll assume you
know what you're doing and can improvise these as you go
along.
Creating the
HeightMap
Let's get started. Select any
light-colored floor or ceiling texture and subtract a cube
sized Height=4096,Width=4096,Breadth=4096. Open the Actor
Classes browser, expand "Info" and select "ZoneInfo". Right
click in the subtracted area and choose "Add ZoneInfo Here".
Reposition the icon near the center of the area, if necessary.
Double click on the ZoneInfo icon to open the properties
window. Expand "ZoneInfo" and set bTerrainZone to "True".
Expand "ZoneLight" and set AmbientBrightness to "128".
Normally, you would setup a skybox for this outdoor area, but
we're not going to take the time to do that here.
Click the "Terrain Editing" button (represented by
mountain peaks) on the left toolbar. Click the "New..." button
at the bottom of the Terrain Editing window. Set Package to
"MyLevel", Group to "Terrain", and Name to "HeightMap1". (You
may note that in other tutorials I recommend against using the
MyLevel package; this is one of the exceptions to that rule).
Set XSize to "64" and YSize to "64". (Since the default scale
is set to 64, you should always set XSize to your total area
Breadth (in this case, 4096) divided by 64 and set YSize to
your total area Width divided by 64.) XSize and YSize dimensions must both be set to base 2
numbers (2 raised to any whole power: 16, 32, 64, 128, 256,
512 etc.) or the editor will crash during a later step. This
constraint means that your terrain will rarely be a perfect
fit for your map. There is no harm if your terrain stretches
beyond the borders of your subtracted world, so simply use
terrain dimensions that are slightly larger than needed. Leave Height set to "32768". Click the "OK" button.
Save your map.
Creating Alpha Layers
Select "TerrainInfo0" which has now appeared in the
"Terrain Infos" list. At this point do
not (I repeat DO NOT) move your mouse cursor over the top down
2d view! I know it sounds crazy, but if you do so the editor
will crash, guarenteed. Now that I've made
you paranoid, carefully select the "Layers" tab. Leaving the
Terrain Editing window open (and while being careful where you
move your mouse), open up the Texture browser, open the
"Training_T.utx" file, select the "Terrain" group, and select
the "Dirt" texture. Return to the Terrain Editor, Select the
first "Undefined" layer, and click the "New..." button. Set
Package to "MyLevel", Group to "Terrain", and Name to
"Layer1". Set AlphaHeight and AlphaWidth to "64". Leave
AlphaFill set to "0" because we want this base layer to be
completely visible. Set UScale to "8" and VScale to "8". (This
scales the texture as is normally done in the surface
properties window, but in this case you won't have a chance to
adjust the scale without deleting and recreating the layer.)
Click the "OK" button. Save your map (but stay away from that
top down 2d view).
Switch to the Texture browser
again, browse to "Training_T.Terrain" and select the
"DirtMoss" texture. Return to the Terrain Editor, Select the
next "Undefined" layer, and click the "New..." button. Set
Package to "MyLevel", Group to "Terrain", and Name to
"Layer2". Set AlphaHeight and AlphaWidth to "64". This time,
set AlphaFill to "256" because we want this layer to be
invisible initially. Click the "OK" button. Repeat this
process to add two more layers: use the
"Training_T.Terrain.Grass" texture for Layer3 and the
"Training_T.Terrain.Dirt2" texture for Layer 4. Use an
AlphaFill of "256" for both layers. When all four layers have
been created, save your map.
Building our
Terrain Zone
Click the "Camera Movement" button on
the left toolbar to close the Terrain Editor. Locate the
TerrainInfo icon which has been created, and reposition it so
that is perfectly centered between the four walls, and about
512 units above the floor. Rebuild the map. Position your
camera above the TerrainInfo icon and you should see a flat
terrain surface stretching all the way across our outdoor
area. If you setup the layers properly, the terrain will
display the dirt texture we assigned to the bottom layer
(Layer1), since we set the other layers' AlphaFills to "256"
making them completely transparent (If one of the other
textures is displaying instead, don't worry. We'll be playing
with the layered textures later).
If the terrain is
not positioned properly to fill the area, you can move the
TerrainIcon and rebuild the map; the terrain will always
center around that icon. It is also worth noting that while in
this tutorial we are building terrain that perfectly fits our
area, there is no harm if your terrain stretches beyond the
borders of your subtracted world; the overlap simply will not
be visible in-game. Save your map. If you've gotten this far,
you may have experienced a few UnrealED crashes, but the worst
is over. Move your mouse over the top down 2d view once just
to reassure yourself that the editor is your friend once
again.
Sculpting the Landscape
Open the
Terrain Editor, and Select "Painting" from the "Tools" list.
Under "Options", set Inner Radius to around "254", Outer
Radius to around "558", and Strength to around "25". Select
the "Terrains" tab, select "TerrainInfo0", and then select the
gray Heightmap under "Heightmap Info" (It will turn
greenish-gray to indicate it is selected). Now the fun begins.
In the 3d
perspective view, hold the [Ctrl] key, left click, and drag in
short movements to raise the terrain, creating hills. Then,
hold the [Ctrl] key, right click, and drag to lower the
terrain, creating valleys. By adjusting the Inner Radius and
Strength settings, you can "paint" the height of your terrain
in large bold strokes or with minute fine touches. It is a
very powerful tool. Note that the Undo button will not work
when modifying terrain, so be careful once you get your
terrain the way you like it. After playing with the terrain a
bit, click the "Camera Movement" button to close the Terrain
Editor, and place an insertion zone and node point just above
a flat area of your landscape. Double click on the TerrainInfo
icon to open it's properties. Expand "R6Planning" and set
m_blsWalkable to "True". Set m_iPlanningFloor_0 and
m_iPlanningFloor_1 to "100". Now our entire terrain will work
in the planning stage and in-game map. Rebuild the map. If
your insertion zone or path node are not on a suitably flat
plane, the editor will let you know.
Save the map,
load it as a practice mission, and walk around a bit. Notice
that your operatives can climb gradual inclines but cannot
climb slopes that are too steep. Also notice that the terrain
automatically inherits the hit effects of the assigned texture
(in this case, dirt kicks up when our dirt texture is hit by
bullets). At this point, our terrain geometry looks pretty
realistic, but the fact that everything is painted with a
single texture is pretty unrealistic. Let's get back to the
editor.
Painting the
Earth
Open the Terrain Editor, and Select
"Painting" from the "Tools" list. Set InnerRadius to around
"102" and OuterRadius to around "203". Select "TerrainInfo0"
under "Terrain Infos", then select the "Layers" tab. Select
"Layer2", which is a dirtmoss texture we placed just above our
bottom layer of dirt. Since we now have a layer selected, the
painting tool is going to affect textures rather than heights.
In the 3d perspective view, hold the [Ctrl] key, left click,
and drag in short movements to paint dirt moss on top of the
dirt. Next, hold the [Ctrl] key, right click, and drag to
erase dirt moss, displaying the dirt underneath. Select
"Layer4", and paint a rock face on one of your higher hills.
Then, select "Layer2" again and try to paint dirt moss over
the rock face. It doesn't work, does it? Actually, it is
painting the dirt moss, but underneath the rock. (Select
"Layer4" and erase part of it in the same spot to see what I
mean.) The order of the layers is very important because you
can never paint a lower layer texture over a higher layer
texture.
Remember how we set our base layer Alpha Fill
to "0" and the other Alpha Fills to 256? Believe it or not,
you can even set higher layers to partial transparency,
allowing the lower texture to show through right off the bat.
(However, to do this we would need to delete and recreate the
texture, which we're not going to take the time to do now.)
You might notice that the grass texture we loaded is magnified
a bit more than it should be. If we wanted to, We could fix
this by deleting and recreating the layer with lower UScale
and VScale settings. Experiment some more with painting
layers. With a good mix of logical texture placement and pure
randomness you'll be amazed at how realistic you can make your
terrain appear. Make sure you mix things up enough that the
repeating pattern of a single texture is never noticeable.
Terrain Editing
Tools
Let's take a look at a few other tools in
the Terrain Editor. Since we'll be modifying terrain geometry
again, select the "Terrains" tab, select "TerrainInfo0", and
select the gray Heightmap (make sure it turns greenish-gray).
Select the "Noise" tool. In the 3d perspective view, hold the
[Ctrl] key, left click, and drag to add random roughness to
the land. This tool is useful for creating a realistic sense
of erosion in undeveloped land. The Strength setting controls
the extent of the erosion.
Next, select the "Flatten"
tool. In the 3d perspective view, hold the [Ctrl] key, left
click, and drag over any area of the map to effectively
bulldoze that land. This tool is useful for establishing
civilized, developed areas. (Note that brushes and static
meshes do not HAVE to be placed on perfectly flat surfaces...)
The Flatten tool is also useful for creating cliffs by
painting into the edge of a tall hill or mountain. But, the
flattened area probably looks a bit unrealistic now; let's
correct that.
Select "Smoothing" from the "Tools"
list. In the 3d perspective view, hold the [Ctrl] key, left
click, and drag over the edges of your flattened area to
create a more gradual slope.
Static Meshes in
Terrain
As I briefly mentioned before, you can
place brushes and static meshes pretty much anywhere you'd
like along your terrain. In many cases, you'll want to use a
combination of terrain cliff faces and static mesh
walls/fences to mark the edge of the map. Note that one sure
way to upset players on your map is to allow them to walk up
to border terrain which is just steep enough to prevent
climbing, yet allows the player to think they might be able to
climb it. Also note that while some static meshes will provide
logical collision automatically, others (pine trees for
example) will require that you place invisible collision hulls
or blocking volumes to keep the player from accidentally
stumbling passed the border.
You can also provide some
neat effects by embedding certain static meshes into the
terrain itself. Using the heightmap painting technique, carve
out a small valley somewhere on your map. Then, click the
"Camera Movement" button to close the Terrain Editor. Open the
Static Mesh browser, open "Training_SM.usx", choose the
"Water" group, and select "PondWater". Right click in your
valley and choose "Add StaticMesh:
'Training_SM.Water.PondWater'". Reposition the static mesh so
that it fills the bottom of the valley without any corners
sticking out of the terrain elseware. If the static mesh is
too large or too small for your valley, open the PondWater's
"Display" properties and change the DrawScale value, or go
back into the Terrain Editor and resculpt the valley to fit
perfectly around your new pond. Note that normally you would
only want to place this pond in an off-limits area, since the
player will walk right over it as if it is fiberglass rather
than water. If you'd like, experiment with placing brushes and
other static meshes in various areas on your terrain.
Assigning
Terrain to Planning Floors
If we wanted to, we
could easily assign the entire terrain to a single planning
floor. But I doubt your terrain is all of a similar elevation,
plus we wouldn't want the far edges of the terrain to appear
walkable in the planning map. So I'll show you how to assign
different parts of your terrain to different planning floors.
Thanks to Amon from the Dev team for sharing how to pull this
off.
First, open the "View" menu in the editor and
choose "Level Properties". Expand "R6Planning". We're going to
divide our terrain into three floors, so set
R6PlanningMinLevel to "100" and R6PlanningMaxLevel to "102".
Close the level properties window. Locate the TerrainInfo icon
and double click it to open it's properties. Expand
"R6Planning" and set m_blsWalkable to "True". Set both
m_iPlanningFloor_0 and m_iPlanningFloor_1 to one floor lower
than the lowest floor on your map, in this case "99". Now,
type the following into the command line text box along the
bottom of the editor: "pp c=1". Press the [Enter] key. Click
once in the 3d perspective view and your terrain should all
turn red.
Open the Terrain Editor. Select the
"Planning paint" tool (the last option in the Tools list). Set
"Floor offset" (a small textbox on the right side of the
Terrain Editor window) to "1". This will allow us to "paint"
the areas of the map that we want to assign to the lowest
floor (which in this case happens to be floor 100). In the 3d
perspective view, hold the [Ctrl] key, left click, and
carefully drag over only the lowest areas (the valleys) of
your terrain. Areas you assign will change to a different
shade of red. Try to avoid rough edges as much as possible.
Now, change "Floor offset" to "2". This will assign terrain to
the next floor up (in this example, floor 101). In the 3d
perspective view, hold the [Ctrl] key, left click, and
carefully drag over only the medium elevation areas of your
terrain, avoiding the highest elevation terrain while painting
right up against the edges of the low elevation terrain you
just assigned. Also note that if there are areas of your
terrain which you do not wish to be walkable (for example, the
map edge) simply do not paint it. If you make any mistakes,
you can set "Floor offset" to "0" and then paint over the
mistake to erase it. Finally, change "Floor offset" to "3" and
paint the highest elevation areas.
Click the "Camera
Movement" button to close the Terrain Editor. Type the
following into the command line text box: "pp c=0". Press the
[Enter] key. Click once in the 3d perspective view to turn the
look of your terrain back to normal. Rebuild and save your
map. Load the game and experiment with it in the Planning
Stage. Notice that when one floor is active, everything one
floor above or below displays in a faded color, reminiscent of
the original Rainbow 6, and if you click on a different floor
the map will automatically switch to that floor just like a
stairway or ladder. Note that if you haven't carefully placed
path nodes on the map, you'll need to keep your waypoints
close together.
Conclusion
That should
give you a good introduction to the Terrain Editor. Note that
there are several ways to utilize terrain in your map, as
evidenced by three of the campaign maps.
In "Peaks",
most all of the terrain is walkable, and the heightmap is
quite dynamic: the terrain itself provides the majority of the
geometry and the gameplay rests on the shape of the landscape.
In "Training", most of the terrain is also walkable however
the majority of it is low and flat with buildings on top: the
terrain is used mainly to provide an outside border and
contribute atmosphere to the map. In "Alpine", the terrain is
only utilized for atmosphere: all walkable surfaces are
geometry brushes placed on top of the terrain.
I hope you found this
tutorial helpful. If there's anything I've gotten wrong,
please let me know and I'll correct the information. Email me
if you have any questions or mapping issues you'd like to
discuss. -Beckett
|