Sp Demo Level Creation

Embed Size (px)

Citation preview

  • 8/8/2019 Sp Demo Level Creation

    1/22

    CryEngine 2 TutorialCreating a level (SP Demo Release)

    A u t h o r: C h r i s " n a r b y " A u t y L e a d M u l t i p l a y e r D e si g n e r, C r y t e k (2 9.10.2 0 0 7)

    (PDF-Version: James-Ryan)

  • 8/8/2019 Sp Demo Level Creation

    2/22

    SIMPLE LEVEL CREATION

    Load up the CryEngine editor and create a new map, name accordingly and click ok. You should be

    greeted with something that looks like this:

    Not very exciting, the view is black because your camera is under the water and at position (0,0,0)

    in the level.

    Lets change this, click on file and goto Generate Surface texture. This will setup the relevant

    files in the level.pakand allow us to see whats going on.

    -1-

  • 8/8/2019 Sp Demo Level Creation

    3/22

    Leave the settings as they are and click ok.

    After a second or two, the level should look bluer and brighter. Youre currently underwater, so fly

    up and take a look at the ocean below you.

    As you can see, the white square is the terrain. We now want to setup the terrain texture and start

    creating a level. The first thing to do is find the center of the map. You dont want to start making a

    level at the edge or youll run out of space.-2-

  • 8/8/2019 Sp Demo Level Creation

    4/22

    A good trick to finding the center of the map is to goto Terrain -> Edit Terrain on the top tool bar.

    When the terrain overhead appears, simply click in the middle of the water a couple of times. This

    will reveal a hill of terrain that you can use to find the center of the level.

    Close the Terrain map and find the hill it created, fly over to it. This is the center point of your map.

    -3-

  • 8/8/2019 Sp Demo Level Creation

    5/22

    Next up, create some terrain using the terrain edit tool. For now, something simple like a small

    island. Im not going to go into detail with the terrain tool at this stage, there are other tutorial that

    will cover this in more detail.

    Heres where things get a little more interesting. Youll notice on the roll up bar on the right side of

    the editor is the Layer Painter button. Click this and take a look at the settings.

    -4-

  • 8/8/2019 Sp Demo Level Creation

    6/22

    Pay particular attention to the Filter section, the To Layer button, the 1 button and the Color

    Browser (the white square).

    These buttons control the terrain texture painter color settings. Its this section that will allow you to

    control what color the terrain will be and give you infinite possibilities as to the color of the ground

    texture in your level.

    -5-

  • 8/8/2019 Sp Demo Level Creation

    7/22

    Right now we only have one terrain layer, called Default. Default is the layer you can see in the

    picture above, rather dull. Lets turn it into some grass.

    Click on the white square. Here is where we pick a color for the terrain. Select something Grassy,

    not too saturated is best, then click ok.

    IMPORTANT: The color you have selected will only be saved IF you click the To Layer button.

    If you do not do this, the color will return to white.

    You can adjust the brightness of the color you have picked with the slider below the word filter.If you want to return the brightness to default, click on the 1 button.

    So, now we have a simple color setup, lets paint the terrain with it. Increase the radius of the

    painter and paint your island.

    -6-

  • 8/8/2019 Sp Demo Level Creation

    8/22

    We now have a rather ugly green island. The terrain texture doesnt have any detail and is

    completely toneless. Lets fix that:

    -7-

  • 8/8/2019 Sp Demo Level Creation

    9/22

    Our next task is assign a detail texture. Detail textures are what give the ground layer its natural

    appearance. They contain all of the things you see when you look down at the ground such as grass,

    leaves, concrete, cliffs etc.

    To assign them, goto the Terrain->Texture menu.

    This is the Terrain Layers Editor. Initially it will seem pretty complicated but its actually veryversatile. Notice the Default Layer, this is the layer you painted earlier. Were going to assign a

    detail texture and a distance texture to this layer.

    -8-

  • 8/8/2019 Sp Demo Level Creation

    10/22

    Let me explain these a little more:

    There are three components that make up a terrain layer. The detail texture, the distance texture and

    terrain color. The first two are defined in the menu above, the third is defined in the terrain layer

    painter that we previously covered.

    In a CryEngine level, when you look down youre seeing the detail texture at your feet which hasbeen colored using the layer painter. The distance texture provides a neutral tone to the terrain in

    the distance. This texture is tiled over the terrain to give slight differences and variation in the

    distance so you dont see a solid color on the hills in the distance. Generally, these textures are very

    neutral, often greyscale.

    You can see the distance texture in the image below. Its tiled over the terrain throughout the level.

    The slight changes in brightness you see below on the ground are being created by the distance

    texture, there is no detail texture visible.

    The first thing were going to do, is assign the distance texture. We do this by clicking on the black

    square in the Terrain Layer Editor, or by clicking on Load Texture.

    Click on Load Texture

    In the Crysis SP demo, there are two textures available for the distance texture. Select

    beach_white_sand.dds and click open. Its important to note that theoretically you can build and

    entire level using only ONE distance texture.

    -9-

  • 8/8/2019 Sp Demo Level Creation

    11/22

    Now that weve assigned a distance texture, its time to give the ground some life and detail. This iswhere we make the grass actually look like grass.

    Click on Edit Surface Types in the Terrain Layers Editor:

    -10-

  • 8/8/2019 Sp Demo Level Creation

    12/22

    This is the Surface Type detail layers editor. Here we can assign a detail texture. Select the layer

    you wish to assign (in this case Default) and notice the material name currently assigned. This

    material isnt part of the SP demo and for this reason, doesnt appear in your level. We need to

    assign something else.

    Click on Material Editor.

    This is the material editor. I could write an entire guide on this alone, but for now scroll down and

    find a material called plains_grass_green_and_dry.

    Youll notice most of the materials in this list are not usable, this is because they are not included in

    the SP demo. You can see which are included, by moving your mouse cursor over the word Diffusein the material properties. This will bring up a preview of the texture. If it appears (like in the

    picture) it can be used in the demo version of the editor.

    Close the material editor with plains_grass_green_and_dry selected.

    Click on Pick Selected, then Ok. You may want to adjust the X and Y scale mapping at the bottom

    to adjust the tiling of the material. 0.5 is a pretty good value.

    -11-

  • 8/8/2019 Sp Demo Level Creation

    13/22

    Close the Surface Type window and the Terrain Layers Editor.

    The terrain should now look something like this:

    -12-

  • 8/8/2019 Sp Demo Level Creation

    14/22

    You should now recompile the Surface Textures (file -> Generate Surface Textures) and Export

    to Engine (file -> Export to Engine).

    Note: Export to engine is essentially writing your level data to a format CryEngine can understand.

    The .cry file is NOT loaded by the engine. The level data must be saved into the level.pakfirst.

    Everytime you make a change you will need to export to engine for that change to appear in game.

    Our island is fairly dull right now, we can brighten it up by importing a pre-made time of day

    setting.

    Goto View -> Open view pane -> Time of day

    When the time of day editor opens, click on Import from File and browse the SP Demo/Editorfolder. Youll see default_time_of_day and default_time_of_day_MP. Pick either one and click

    ok.

    -13-

  • 8/8/2019 Sp Demo Level Creation

    15/22

    Once open, move the time of day slider to 10am or 2pm. This make sure shadows are not cast

    straight down, which will look odd.

    Close the Time of day editor.

    -14-

  • 8/8/2019 Sp Demo Level Creation

    16/22

    Your level should look much more lifelike now, brighter and crisper.

    -15-

  • 8/8/2019 Sp Demo Level Creation

    17/22

    Simple Vegetation

    Ok lets place some vegetation, a jungle isnt a jungle without it.

    First thing to do is load some vegetation groups that we can use to place in the level.

    On the rollup bar, go to the vegetation button. This is where well be placing trees and plants from.

    First thing however, is to load up some vegetation types. To do this, simply click on the little tree

    icon on the left side of vegetation browser.

    You can load anything you want, but for the sake of argument lets load some palm trees, some

    bushier river trees and some grass.

    -16-

  • 8/8/2019 Sp Demo Level Creation

    18/22

    In the tutorial Im using

    -Objects/natural/ground_plants/grass/bigpatch_medium.cgf

    -Objects/natural/trees/river_tree/

    -Objects/natural/trees/palm_trees/

    You can see the tree types I loaded in the screenshot

    Ok now that we have some trees loaded into the vegetation browser, its time to set them up. Before

    we place anything, we need to change the properties of the objects. Click on the grass listed in the

    vegetation browser.

    We want to change the following properties for all the vegetation loaded:

    -Size var should be changed to 0.1 or 0.25 to give a variation to the vegetation

    -Random rotation should be checked

    -Align to terrain should be checked

    -Use terrain color should be checked-Cast shadow should be checked

    -Use sprites should be unchecked (for grass only!)

    -17-

  • 8/8/2019 Sp Demo Level Creation

    19/22

    Now we can start placing them:

    Make sure Snap to Terrain is selected on the top toolbar. This will make adjusting the position of

    the vegetation much simpler. Snap to terrain is the little green thing with the wavy line over it.

    Now, select one of your trees. While HOLDING shift, left click on the terrain. You selected

    vegetation should appear. By left clicking and holding LMB at the base of the tree you can drag it

    around (as long as snap to terrain is on!). You can hold shift and place as many as you like.

    By holding CTRL and ALT you can rotate the tree to make it appear more random.

    -18-

  • 8/8/2019 Sp Demo Level Creation

    20/22

    Lets place a few:

    Now lets add some grass, do this in the same way as you placed the trees. Try not to overlap these

    patches too much, theyre quite large. They can often be a little tricky to select too, you have makesure youre clicking in the middle of the patch.

    -19-

  • 8/8/2019 Sp Demo Level Creation

    21/22

    Thats basically it for simple vegetation placement. Later on Ill try to cover vegetation painting,

    and auto-placement of vegetation through the detail texture layer.

    One final thing to do, File -> Generate surface textures, but this time were going to change the

    settings.

    Click on high-quality and Calculate Terrain Sky Accessibility. Essentially these will darken the

    ground around the trees and add some nice additional depth to the scene.

    Be warned, it might take a few minutes to calculate.

    -20-

  • 8/8/2019 Sp Demo Level Creation

    22/22

    You can see the effects below:

    -21-