We continue with CryEngine 3 SDK tutorials. If you are just starting to learn and use CryEngine 3 SDK, start here.
In this tutorial we cover how to generate and create new terrain.
- Creating New Map
- Defining Heightmap Resolution and Meters Per Unit
- Generating and creating terrain (procedural)
- Generate terrain options
- Modifying terrain options
- Resizing terrain
Make sure to check this page for all the tutorials on CryEngine 3 SDK.
Creating a new map is very simple.
Go to File --> New Map
Name your level and define Heightmap Resolution and Meters Per Unit.
Heightmap Resolution is the amount of pixels you want your heightmap to be
Meters Per Unit is how many meters for every pixel of your heightmap do you want
Larger your Meters Per Unit value and Heightmap Resolution will give you a large terrain size.
You can see the Terrain Size values in meters above ok/cancel buttons.
If you set Meters Per Unit to a larger number, the more blockier and rougher your terrain will be. Low number will give you more detail and smooth terrain but more there will be more triangles per every meter/pixel.
Basically you have to find the balance between the size and performance. In order to know this you will have to create a few terrains.
I would recommend to create a few throw away test maps playing around with different Heightmap Resolutions and Meters Per Unit. You can also resize your terrain after you went through New Level creation. So you don't have to create a new map everytime you want a new terrain size. I cover that later down the page.
Once you set terrain size, click OK.
You now have a world and a flat terrain below sea level.
Lets generate our first terrain using procedural method. This means that CryEngine will give us a random heightmap and create a terrain for us.
Go up to Terrain --> Edit Terrain
Terrain Editor window will open.
In Terrain Editor window still open go to Tools --> Generate Terrain
Terrain Generation window will open. Here you can modify few values to get various random results for your terrain.
I only modify Feature Size, which sets the variation of the terrain. Lower number, less heights and peaks you get and more normal terrain looks.
Play around with all the values to see what they do. You can generate this terrain as many times as you want for variety of results.
Click OK when ready.
Modify Options inside the Terrain Editor are extremely useful. These are used to give the entire terrain some modification. Most of these are self-explanatory.
I use the following when I create procedural terrain:
- Make Isle: rounds out your entire terrain, creating more of an island shape
- Remove Water: removes water from your map. Sets water level to -10,000
- Set Water Level: set a water level. Default is 10 meters.
- Set Max Height: sets the maximum height of your terrain. Set this before you Generate terrain to see the results
- Flatten (Light/Heavy)
- Smooth: smoothes entire terrain
- Smooth Slope
- Reduce Range (Light/Heavy)
Watch the video to see what each one of them does. But the best way is to go through and experiment each one on your terrain.
For procedural terrain generation I have used most of these to get the terrain to look how I want it.
You can always resize the terrain after you went through New Level creation.
In the Terrain Editor window click on the Resize tool or go to Modify --> Resize.
Input new Heightmap Resolution and Meters Per Unit. Any terrain you currently have will be gone.