Terrains and Landscapes in Un real Engine 451
TABLE 7.24: Spline Segments
Landscape Spline Segment
Connections: Settings specific to the two control points this seg-
ment is attached to. The Connections sub- properties are as fol-
lows:
Tang ent Len: Scale of the tangent at this point, controls how
curved the segment is. Negative tangents cause the segment
to connect to the back of the control point.
Socket Name: So c ket on the control point this se gment end is
connected to.
Layer Name: Name of the blend mask layer to paint to when the
spline is applied to the Landsca pe.
Raise Terrain: Raises the Landscape to m a tc h spline when the
spline is applied to the Landscape. Good for roads on embank-
ments.
Lower Terrain: Lowers the Landscape to match spline when th e
spline is applied to the Landsca pe. Good for rivers and ditches.
Landscape Spline Meshes
Spline Meshes: The meshes to apply to the spline. Multiple meshes
will be applied in random order controlled by the random seed.
The items below are the Spline Meshes sub-properties (on a per
mesh basis):
Mesh: The Static Mesh to use.
Material O verrides: Overrides the Static Mesh’s assigned Ma-
terial w ith a different Material for the spline.
Center H: Whether to horizontally center the mesh on the
spline or use the mesh’s origin.
Offset: Offsets the mesh from the spline (units in unscaled
mesh-space).
Scale to Width: Whether to scale the mesh to fit the spline
width or to use the mesh unchanged.
Scale: Multiplier to the size of the mesh. If Scale to Width is
enabled, the Scale specified here is relative to th e spline
width; otherwise, it is relative to the mesh’s natural size.
Forward Axis: Chooses the Forward axis of the Sp line Mesh.
Up Axis: Chooses the Up axis of th e Spline M esh.
Random Seed: Controls the order multipl e spline meshes are ap-
plied.
Enable Collision: Enables collision on spline meshes.
Cast Shadow: Ena b les the casting of s h a d ows by the mesh.
Manipulating Control Points/ Segments: The following list presents an overview
452 Game Development and Simulation with Unreal Technology
of control-point m anipulation sh ortcuts [31]:
TABLE 7.25: Manipulating Segments/Control Points
Left-Click: Selects a control point or segment.
Shift + Left-Click: Selec ts multiple c ontrol points or segments.
Control+A: Selects all c ontrol points connected to the cu rrently selected
point and/or all segments connected to the currently selected seg-
ment.
Control + Left-Click: On landscape, a d d s a new control point, connected
to any selected control point.
Control + Left-Click: With a control point selected, wil l create a seg-
ment joining any selected control p oints to the new control point.
Control + Left-Click: With a segment selected, s p lits the segment at
that point a n d inserts a new control point.
Del: Deletes the selected control points or segments.
R: Automatically calculates rotation for selected spline control po ints.
T: Automatically flips the tangents for se lected control points or seg-
ments.
F: Flips selected splin e segments (only affects meshes on the spl ine).
End: Snaps the selected contro l po int to the landscape below.
FIND ON THE WEBSITE
To find updates to this tutorial and upda te d instructions about its implementa-
tion on othe r UE4 versions, p le ase visit the books companion Website at:
http://www.RVRLAB.com/UE4Book/
TUTORIAL 7.7 Creating Landsca pe Splines: A Cobblestone Walkway
With our land scape built a nd painted , it is time for us to p opulate it with meshes
and objects. Let us imagine the level we have b een building so far is to be a part
of a mountain range with a shrine nestled somewhere high up. It would be great
to be able to place a walkway for our visitors to walk up to reach the shrine.
This scenario brings us to a place where we can see the power of a unique and
newly introduced tool in UE4 the Landscape Splines.
If you have not completed Tutorial 7.1, go to pag e 386 to create a Landscape.
We w ill ne ed this landscape to complete our work below.
It would be great if you also have finished one of the Tutorials 7.3, 7.4, 7.6. In
Terrains and Landscapes in Un real Engine 453
these Tutorials you set up materials and layers for your landscapes so that your
work would look like the figures shown in this Tutorial.
CREATING TH E WALKWAY MESH AND MATERIAL
Before we get to play with UE’ 4 Landscape Splines, let us first set up a mesh
which w e will later use as a walkway. I wanted the walkway to be made of so me
cobblestone pathways. As such, I will go ahead and re-use a box mesh and cob-
blestone mater ia ls alre ady provided in the starter contents. We will mo dify these
items to suit our use and then jump into working with Landscape Splines.
Let us first create a folder to organize our meshes:
(a) (b)
FIGURE 7.40: (a) Moving the Walkway Mesh to Our Meshes Folder. (b) Copying the Cob-
blestone Materials.
1. Right-click in the Content Browser to create a new folder in your main Game
Folder.
2. Rename this folder Meshes.
3. Again in the Content Browser, find the St arter Content folder and
Double-click on the Archite cture f older to open it up.
4. In th e Architecture fo lder, find a mesh called Floor_400×400.
5. Right-click on Floor_ 400×400 and choose Duplicate. This will make a
copy of this mesh in the Architecture folder of the Starter Content.
6. Rename the du plicated mesh to Walkway_400×400.
7. Drag the Walkway_40 0×400 mesh into your newly created folder M eshes and
choose the Move Here option (see Figure 7.40(a)).
8. Again in the Content Browser, find the Materials f older and
Double-click on the Materia ls folder to open it up.
9. In th e Materials fold er, find a material called M_CobbleStone_Rough.
10. Drag the M_Cobbl eStone_Rough material into your materials folder you created
earlier and then choose th e Copy Here option (see Figure 7 .40(b)).
11. Go to you r materials folder and rename the copy of th e material to
M_Walkway_CobbleStone.
454 Game Development and Simulation with Unreal Technology
12. The final step here is to apply the M_Walkway _CobbleStone material to our
Walkway_400×400 mesh. To do so, Double-click on the Walkway_400×40 0
mesh to open it up in the UE4’s Static Mesh Editor.
13. Drag the M_Walkway_CobbleStone material to the Element 0 section of the
Walkway_400×400 mesh in its LOD0 section in the Deta ils rollout of the Static
Mesh Editor (see Figure 7.41).
FIGURE 7.41: Assigning the Cobblestone Material to Walkway Mesh.
14. Save your Walkwa y_400×400 mesh and close the Static Mesh Editor.
CREATING TH E LANDSCAPE SPLINE
Now that our mesh and its material are set u p and ready, let us go ahead and
create our first landscape spline.
15. In the main editor Modes Panel, go to the Landscape Tool (Shift+3).
16. Click on the Manage mode.
17. In the Manage mode, click on the Selection To ol icon under the Landscape
Editor section and from the drop-down menu choose Edit Splines tool. Note: If
these tools are not activated, you do not have a spline actor in the level. Go to
Tutorial 7.1 on page 386 to create one.
18. Hold the Cont rol key on your keyboard and Left-click somewhere on the
landscape to create your splines’ first Control Point.
19. While still holding the Control key on your keyboard, click on another loca tion
on your la ndscape to create the second Control Point.
20. After your second Control Poin t is created, you should see the two p oints a nd
the segment connec ting them on your landscape (see Figure 7.42).
21. Keep a dding more Control Points to your spline by Control+Left-clicking
on your la ndscape.
22. After you have added some Contro l Points, click on the Contro l Points but-
ton in the Landscape Spline sectio n of the Details rollout of the editor (see
Figure 7.43(a)). This will select all of your control points. We will make some
modifications to them next.
Terrains and Landscapes in Un real Engine 455
FIGURE 7.42: The Spline’s First Two Control Points.
(a) (b)
FIGURE 7.43: (a) Selecting All of Spline’s Control Points. ( b) Adjusting Control Points
Properties.
23. With all of the Control Points selected, find the Landsc ape Spline Control
Point section of the Details rollout.
24. Make the following changes to the Control Points properties (see Fig-
ure 7.43(b)):
Width: 300
Side Falloff: 300
End Falloff: 300
25. Left-click on the All Splines button in the Tool Settings of the Manage
mode of the Landscape Tool a few times (see Figure 7.44).
26. This will deform and paint your landscape to conform to the shape of your spline.
27. We will next a pply our mesh to this spline.
APPLYING STATIC MESHES TO SPLIN ES
Now that our spline is placed in the level, and fits snugly on top o f the landscape,
we can go ahead and apply the brick walkway mesh to it to customize its lo ok.
28. If you have switched from the Manage mode to another mode in the Landscape
Editor, go back to the Manage mode.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.35.185