Use some of the functions and entities that the CryENGINE 3 SDK gives to us straight out of the box.
Posted by filter-coffee on Oct 30th, 2012
Basic Mapping/Technical.
You may now be asking yourself, "I've downloaded the CryENGINE 3 SDK. Now how do I start making games with it?" Such a question has far-reaching implications and is awfully difficult to answer! So in my attempt to answer this question, let's create our own game together, in a short amount of time, using some of the functions and entities that the CryENGINE 3 SDK gives to us straight out of the box.
In this article by Sean Tracy and Paul Reindell, authors ofCryENGINE 3 Game Development: Beginner's Guide, we will be:
Good practice when creating prototypes and smaller scale games, especially if you lack the expertise in creating certain assets and code, is to reduce, reuse, and recycle. To break down what I mean:
Developing out of the boxAs mentioned earlier, the CryENGINE 3 SDK has a huge amount of out-of-the-box features for creating games.Let's begin by following a few simple steps to make our first game world.Before proceeding with this example, it's important to understand the features it is displaying; the level we will have created by the end of this article will not be a full, playable game, but rather a unique creation of yours, which will be constructed using the first major features we will need in our game. It will provide an environment in to which we can design gameplay.With the ultimate goal of this article being to create our own level with the core features immediately available to us, we must keep in mind that these examples are orientated to compliment a first-person shooter and not other genres. The first-person shooter genre is quite well defined as new games come out every year within this genre. So, it should be fairly easy for any developer to follow these examples.In my career, I have seen that you can indeed accomplish a good cross section of different games with the CryENGINE 3 SDK. However, the third- and first-person genres are significantly easier to create, immediately with the example content and features available right out of the box.For the designers:
This article is truly a must-have for designers working with the engine. Though, I would highly recommend that all users of sandbox know how to use these features, as they are the principal features typically used within most levels of the different types of games in the CryENGINE.
Let's follow a few simple steps to create our own level:

(Move the mouse over the image to enlarge.)Congratulations! You now have an empty level to mold and modify at your will.Before moving on, let's talk a little about the properties that we just set, as they are fundamental properties of the levels within CryENGINE. It is important to understand these, as depending on the type of game you are creating, you may need bigger or smaller maps, or you may not even need terrain at all.
When we created the New Level, we chose a Heightmap Resolution of 1024x1024. To explain this further, each pixel on the heightmap has a certain grey level. This pixel then gets applied to the terrain polygons, and depending on the level of grey, will move the polygon on the terrain to a certain height. This is called displacement. Heightmaps always have varying values from full white to full black, where full white is maximum displacement and full black is minimum or no displacement.The higher the resolution of the heightmap, the more the pixels that are available to represent different features on said heightmap. You can thus achieve more definition and a more accurate geometrical representation of your heightmap using higher resolutions. The settings can range from the smallest resolution of 128x128, all the way to the largest supported resolution of 8192x8192 . The following screenshot shows the difference between high resolution and low resolution heightmaps:
If the Heightmap Resolution parameter is examined in terms of pixel size, then this dialog box can be viewed also as the Meters Per Pixel parameter . This means that each pixel of the heightmap will be represented by so many meters.For example, if a heightmap's resolution has 4 Meters Per Unit, then each pixel on the generated heightmap will measure to be 4 meters in length and width on the level.Even though Meters Per Unit can be used to increase the size of your level, it will decrease the fidelity of the heightmap. You will notice that attempting to smoothen out the terrain may be difficult, since there will be a wider, minimum triangle size set by this value.Keep in mind that you can adjust the unit size even after the map has been created. This is done through the terrain editor, which we will discuss shortly.
The expected size of the terrain can easily be calculated before making the map, because the equation is not so complicated. The real-world size of the terrain can be calculated as:(Heightmap Resolution) x Meters Per Unit = Final Terrain Dimensions.For example:
In most cases, levels in CryENGINE will use some amount of the terrain. The terrain itself is a highly optimized system that has levels of dynamic tessellation, which adjusts the density of polygons depending on the distance from the camera to the player. Dynamic tessellation is used to make the more defined areas of the terrain closer to the camera and the less defined ones further away, as the amount of terrain polygons on the screen will have a significant impact on the performance of the level.In some cases, however, the terrain can be expensive in terms of performance, and if the game is made in an environment like space or interior corridors and rooms, then it might make sense to disable the terrain. Disabling the terrain in these cases will save an immense amount of memory, and speed up level loading and runtime performance.In this particular example, we will use the terrain, but should you wish to disable it, simply go to the second tab in the RollupBar (usually called the environment tab) and set the ShowTerrainSurfaceparameter to false , as shown in the following screenshot:
You must have created a new map to follow this example.Having sufficiently beaten the terrain system to death through explanation, let's get on with what we are most interested in, which is creating our own heightmap to use for our game:
(Move the mouse over the image to enlarge.)
Using a second monitor:
This is a good time to take advantage of a second monitor should you have one, as you can leave the perspective view on your primary monitor and view the changes made in theTerrain Editor on your second monitor, in real time.
NOTE: You can sample the terrain height in the Terrain Editor or the view port using the shortcut Control when the flatten brush is selected.
(Move the mouse over the image to enlarge.)Note that, by default, the water is set to a height of 16 meters. Since we flattened our terrain to a height of 20 meters, we have a 4-meter difference from the terrain to the water in the center of the map. In the perspective viewport, this will look like a steep cliff going into the water.I find it significantly easier to gauge the effects of the smooth brush in the perspective viewport.
(Move the mouse over the image to enlarge.)
(Move the mouse over the image to enlarge.)A good technique is to use the Rise/Lower brush and only click a few times, and then use Shift to switch to the smooth brush and do this multiple times on the same area. This will give you some nice terrain variation, which will serve us nicely when we go to texture it.
Don't forget the player's perspective:
Remember to switch to game mode periodically to inspect your terrain from the players level. It is often the case that we get caught up in the appearance of a map by looking at it from our point of view while building it, rather than from the point of view of the player, which is paramount for our game to be enjoyable to anyone playing it.
In this particular example, we used one of the three different techniques to create height maps within the CryENGINE sandbox:
You now have a level with some terrain that looks somewhat like a beach, a flat land area, and some mountains. This is a great place to start for any outdoor map as it allows us to use some powerful out of the box engine features like the water and the terrain. Having the mountains surrounding the map also encourages the illusion of having more terrain behind it.
With the settings we just explored, try to add some more terrain variation into the map to customize it further, as per your game's needs. Try using different settings for the brushes we explored previously. You could try adding some islands out in the water off the coast of your beach or some hills on the flat portion of the map.Use the Inside Radius and Outside Radius, which have a falloff of the brushes settings from the inner area having the strongest effect and the outer having the least.To create steeper hills or mountains, set the Inside Radius and Outside Radius to be relatively similar in size. To get a shallower and smoother hill set the Inside Radius and Outside Radius further apart.Finally, try using the Hardness, which acts like the pressure applied to a brush by a painter on canvas. A good way to explain this is that if the Hardness is set to 1, then within one click you will have the desired height. If set to 0.01, then it will take 100 clicks to achieve an identical result.You can save these variations into different .cry files should you wish to do so.
Use the Tools menu in the Terrain Editor and click on Generate Terrain ; you can modify many parameters when generating new terrain procedurally like this:
(Move the mouse over the image to enlarge.)
Try adjusting some of the automatic generation parameters like:
You may already have a heightmap prepared, or you may even have exported one from the CryENGINE.To import/export your own grayscale heightmaps use File | Import/Export Heightmap.The resolution of the heightmap must match the resolution of the terrain.The supported formats are:
For maps requiring high detail close to the player, it makes sense to set the resolution as high as possible but keep the meters per unit of the terrain low. In this way, the terrain polygons will be small enough to represent accurate terrain displacement sufficiently at short distances.
Up until now we've been using the default terrain texture, and since real life doesn't look like a checker or grid pattern, it is imperative that we paint some textures onto this terrain. We can do this with sandbox relatively easily, and it allows us to leverage the power of the advanced shading features of the CryENGINE3 quickly.Terrain textures are split up into multiple layers and are painted manually, directly in the viewport onto the terrain. Each Terrain layer consists of a Surface texture and a Detail material. The various components of the Terrian layer are shown in the figure below:
The Surface texture will be the surface the player can see from a long range. It is also blended together, when viewed close up, with the Detail material. This is done to provide a higher quality of shading and realism around the player where needed. As seen in the preceding figure, it is made up of a Diffuse color and a Diffuse texture.The Detail material is what a player will see when they are close. It is similar to other materials in CryENGINE as it is comprised of a particular Shader , Surface type, and textures. The Surface type of the material defines how the layer reacts to physics and other systems such as sound and particles.
Applying a good set of terrain layers depends heavily on the environment in which you wish to create your map. In this particular example, we will use a somewhat straightforward setup of rocks, forest, grass, mud, sand, and underwater.

(Move the mouse over the image to enlarge.)
(Move the mouse over the image to enlarge.)
(Move the mouse over the image to enlarge.)Having loaded a base set of texture layers into our level, we can now get to the fun part of painting them!
Generating surface texture at a high quality
A higher resolution will result in better, overall quality. The optional high quality setting creates an additional way over the textures to bake in further detail while keeping the same memory footprint.
It should be noted that once the terraintexture.pak is generated, it will appear on all .cry files stored within that directory, should it contain the corresponding, terrain texture layers.
Congratulations! You are well on your way to becoming a terrain painting master. Now, our level is starting to take shape. It's so colorful now!Let's further explain some of the layers that this example uses:
This gives us a ton of possibilities for various types of terrain.
As we saw, these parameters can be set per layer, allowing you to paint that layer within the altitude measured in meters or the slope measured in degrees. This is especially useful for cliff-like layers (for example, 55 degrees to 90 degrees).
A tile's resolution affects how many terrain tiles there are in each terrain sector. The higher the resolution, the higher the amount of tiles used, which leads to better layer blending, as well as softer transitions in the high detail textures. It can be set from as low as 64x64 to as high as 2048x2048; this tiling resolution is an important factor when it comes to optimization, as well as high quality terrain. A good technique is to utilize only higher resolution tiles within the gameplay area of a level, and to use lower resolution tiles on the surrounding terrain for performance and memory considerations.
The vegetation system in CryENGINE is powerful, you can utilize a small amount of assets and use procedural placement to make their placement look quite natural.The interface for vegetation painter is similar to painting terrain textures. They are both based on a brush-like interface where you can click-and-drag directly on the terrain as if you were painting. Both the terrain painter and the vegetation painter support the same altitude and angle properties, and can be used together to achieve very realistic results.It is important to understand though, that quite differently than painting terrain textures, painting vegetation is a placement of geometry. This geometry is then instanced, a technique used to increase performance, since the objects that are being drawn are already in memory for the entire map.Placing geometry as vegetation allows us to use the vegetation system to its full potential, as applying the vegetation shader to these geometry objects allows for realistic physics such as touch bending simulation (where the player can physically bend branches) and also wind bending.
Without further ado, let's bring some life to the map we have been working on.
Before we can paint the vegetation, we first must add in some objects that we want to use. The first vegetation we will place will be some trees.

You can hold Control and click on multiple objects in a category at once.
You will now have two categories one of trees and one of detail objects detail objects with some preset parameters with which to work, as seen in the following screenshot:
You can immediately start to paint these categories and experiment with the parameters at the bottom of the rollup bar while the vegetation tool is active.Changing the vegetation properties after they've been placed
The properties of a vegetation object are only applied while painting, so if you want to change the properties after the vegetation has been placed, you will need to repaint it. Some properties such as random rotation use terrain color, and properties such as wind bending will update to the currently placed vegetation objects.
You will notice a number beside each object within the vegetation category, which is meant to be a quick reference to the number of instances, which a current object has, within the level.


Remember that you can quickly switch between painting and erasing by using the control key. We can also customize these landscapes using the individual selection mode available.
Note that in one of the vegetation groups, a stone is used. Not usually considered vegetation, it is a good example of demonstrating that you can use any sort of model as vegetation, but it should be noted that they will be typically restricted to terrain. Another good use of the vegetation system could be small, rubble pieces, twigs, and so on.
Congratulations! You have just become accustomed with one of the most powerful tools the CryENGINE has to offer for creating realistic forests and environments containing massive amounts of vegetation.
In this example, we used the vegetation painter and some of its parameters to create and sculpt the flora for our level.
Now, the time has come to adjust the overall lighting of our level. The fastest and easiest way to achieve a huge variety of atmospheres and settings is by using the Time of day feature in CryENGINE.The sun in CryENGINE is approximated by a colored, directional light without distance attenuation. This is important to understand as its properties are similar to that of a regular light, and properties such as color and specular level can be adjusted. There is an important distinction, however, to the sun and other lights in CryENGINE, as the sun uses a technology called cascaded shadow maps.
(Move the mouse over the image to enlarge.)Note that when you highlight any of the basic parameters in the time of day dialog, there are key frames set already represented by the small, yellow squares on the timeline in the preceding screenshot.This timeline is represented by a 24-hour slider at the top of the Time Of Day interface.Since the best way to learn to manipulate the Time Of Day editor is to create your own. So, let's reset all the values before starting.
(Move the mouse over the image to enlarge.)This will effectively remove all the key frames outside of the default values of 0000 and 2400.
The first setting we will adjust, will be the Sun color.Monitor settings and calibration
After clicking on OK, you will see that new key frames have now been created on the timeline. You can see the interpolation of the values from 0000 to 2400, which will be used in the case where you have an animated time of day. The next parameter we will adjust will be the multiplier for the Sun color we previously set.

Having now set some of the basic Time Of Day settings, we have added some important aspects to our level. Not so much in terms of gameplay, but rather in theme and atmosphere.
Our level now has some Fog , a good Sun color , some contrast on the ground between shadows and light, as well as a fairly intense sun with sunrays.
An important point to realize is that there is truly no single, correct or perfect setting for the time of day; this will depend greatly upon your taste and your overall needs for different environments. Be sure to experiment with the values, and try to create some dramatically different atmospheres. When using the Time Of Day feature, it is recommended to not have the sun perfectly at the highest position. The Time Of Day dialog box has a huge variety of settings for simulating realistic and surrealistic lighting effects. Having completed setting up the basic parameters will make it substantially easier to adjust the advanced effects that time of day allows you to adjust, to achieve photorealistic-looking, outdoor lighting.
For truly precise lighting, you can supplement the time of day using the Lighting tool.
(Move the mouse over the image to enlarge.)North is assumed to be on the Y positive axis (y+) in the CryENGINE.
Do not point the sun straight down on your level
It is good to have some rotation on the sun so that the shadows are not aligned with the world direction and thus objects that may be aligned. This is all done to make man-made buildings and other level objects look better because they are often world aligned and built straight up.
As with film and television, atmospheric effects play an essential role in a level's environmental design. As you saw in the previous examples, adding atmospheric effects using the time of day tool can change the look and feel of your level drastically. An old building can look perfectly harmless in the bright sunshine, but in the fog it can take on a sinister appearance, which hints at underlying drama yet to unfold!SummaryIn this article, we've found out that gameplay needs an environment in order to take place, and so the creation and design of a level's environment is a critical factor in developing top-quality games. The level's environment is just as important as character design and presents several unique challenges to designers.
Designing levels breaks down into two distinct parts. The first of which is the look and feel of the level's environment, which we've gone over in a good amount of detail in this article. The whole purpose to this article was to provide the space and ambience to host the various challenges of AI enemies, puzzles, and trials within our game. Having made an interesting environment, let's fill it with some gameplay, using entities and objects essential to making our first game example!
Great read.
Could you please add it to CryENGINE 3 Developers group Moddb.com
Thanks in advance.
This comment is currently awaiting admin approval, join now to view.
this is amazing..... this is exaclty what i was looking for......THANK YOU!!!!