Now let’s populate our game work with some terrain, trees, water and more. We will start by creating a terrain object. In the Create panel select the Terrain icon.
You can accomplish the same thing by right-clicking the viewport or selecting the root of the scene in the SceneGraph explorer and select Insert->Create terrain.
This will display a Create Terrain dialog window:
There are several different things you can control here, decorations will result in grass and trees being populated in your game world. Side Length determines the size of your terrain along each axis, while Tile Size determines the density of the generated terrain. Textures enable you to specify the texture used at ground level, mid-level, and at high points of the terrain, but we will stick with the defaults for now. Under Topology, you can determine what the highest point in your created terrain while Topology describes how the three different options, hills, deserts, and flat options. Click OK and your terrain object will be created.
Notice the Terrain Editing window? This contains the options available for editing your newly created terrain object. We will go through each of them shortly. Notice in the SceneView that in addition to a terrain object, several tree meshes were also created:
You can select each individual tree, deleting, or moving them as you see fit. Notice how the trees appear below the Terrain in the list? This is because they are children of the Terrain. This is handy because if you move the parent, all of the children will move as well.
Now let’s take a look at the different editing options. The first one is selection, that should be obvious enough. The next icon:
Is for painting textures. With this selected, choose a texture from the texture window, the selected tile will be tinted:
Now you can paint textures in the viewport.
Now left-click and it will replace the texture in the selected area.
The next icon:
Can be used to raise and lower the terrain below the brush.
Click and drag left to lower, drag right to raise.
You can go one step further tweaking high elevation(which will also change the texture between Ground, Middle, and High as it goes up and down) using the Mountain/Valley tool
This works almost identically to the Raise/Lower tool:
Left-click to change elevation, move the mouse up and down instead of left and right. Up to increase height to a hill, down to create a valley.
Next is the smooth tool.
This simply smooths out edges and can be used to make less sharp edges.
This one is pretty straight forward, left-click over a surface and it will be smoothed out over time.
Next up we have the flatten tool
This tool works like smooth, but instead of rounding down edges, this one just straight out pushes the surface down evenly, attempting to flatten the surface.
Next up is the noise tool:
This can be thought of as a way to randomize the surface.
Finally we have the grass tool.
This one can be used to draw grass sprites on the terrain:
You can control the size of the painted grass using these two boxes:
You can also hold down the shift key while painting to erase the grass under the brush on the terrain.
Using this combination of tools you can create just about any kind of terrain for your game. One thing that is noticeably lacking is water.
So, let’s look at how you can add some water to your game level. In the Create panel, select a water object:
Or right click and select Insert->Create A Water Surface. You will then be shown the following dialog:
This controls the size of the created water while tile count determines the mesh density. Size similar to the terrain object, or simply chose the defaults. Now simply position your water above your terrain so some surfaces are above water and some are below, like so:
There are a number of different properties you can set for water such as how high waves should be, the color and transparency effect when the camera is below water, the direction water should flow, etc.