{"id":39,"date":"2008-05-12T14:41:34","date_gmt":"2008-05-12T21:41:34","guid":{"rendered":"http:\/\/www.narby.net\/?page_id=39"},"modified":"2008-05-12T14:57:03","modified_gmt":"2008-05-12T21:57:03","slug":"cryengine-2-sandbox-creating-your-first-level","status":"publish","type":"page","link":"https:\/\/www.narby.net\/?page_id=39","title":{"rendered":"CryEngine 2 Sandbox &#8211; Creating your first level"},"content":{"rendered":"<p>Creating a level with CryEngine 2 \u00e2\u20ac\u201c SP Demo Release<\/p>\n<p>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<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t1.jpg\" alt=\"\" width=\"514\" height=\"302\" \/><\/p>\n<p>Not very exciting, the view is black because your camera is under the water and at position 0,0,0 in the level.<\/p>\n<p>Let\u00e2\u20ac\u2122s change this, click on file and goto \u00e2\u20ac\u0153Generate Surface texture\u00e2\u20ac\u009d. This will setup the relevant files in the level.pak and allow us to see what\u00e2\u20ac\u2122s going on.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t2.jpg\" alt=\"\" \/><\/p>\n<p>Leave the settings as they are and click ok.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t3.jpg\" alt=\"\" width=\"496\" height=\"288\" \/><\/p>\n<p>After a second or two, the level should look bluer and brighter. You\u00e2\u20ac\u2122re currently underwater, so fly up and take a look at the ocean below you.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t4.jpg\" alt=\"\" width=\"503\" height=\"293\" \/><\/p>\n<p>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 don\u00e2\u20ac\u2122t want to start making a level at the edge or you\u00e2\u20ac\u2122ll run out of space.<\/p>\n<p>A good trick to finding the center of the map is to goto Terrain -&gt; Edit Terrain on the top tool bar.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t5.jpg\" alt=\"\" width=\"504\" height=\"324\" \/><\/p>\n<p>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.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t6.jpg\" alt=\"\" width=\"505\" height=\"293\" \/><\/p>\n<p>Close the Terrain map and find the hill it created, fly over to it. This is the center point of your map.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t7.jpg\" alt=\"\" width=\"513\" height=\"301\" \/><\/p>\n<p>Next up, create some terrain using the terrain edit tool. For now, something simple like a small island. I\u00e2\u20ac\u2122m not going to go into detail with the terrain tool at this stage, there are other tutorial that will cover this in more detail.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t8.jpg\" alt=\"\" width=\"507\" height=\"296\" \/><\/p>\n<p>Here\u00e2\u20ac\u2122s where things get a little more interesting. You\u00e2\u20ac\u2122ll 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.<\/p>\n<p>Pay particular attention to the Filter section, the To Layer button, the 1 button and the Color Browser (the white square).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t9.jpg\" alt=\"\" width=\"503\" height=\"524\" \/><\/p>\n<p>These buttons control the terrain texture painter color settings. It\u00e2\u20ac\u2122s 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.<\/p>\n<p>Right now we only have one terrain layer, called Default. Default is the layer you can see in the picture above, rather dull. Let\u00e2\u20ac\u2122s turn it into some grass.<br \/>\nClick 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.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t10.jpg\" alt=\"\" \/><\/p>\n<p>IMPORTANT: The color you have selected will only be saved IF you click the \u00e2\u20ac\u0153To Layer\u00e2\u20ac\u009d button. If you do not do this, the color will return to white.<\/p>\n<p>You can adjust the brightness of the color you have picked with the slider below the word \u00e2\u20ac\u0153filter\u00e2\u20ac\u009d. If you want to return the brightness to default, click on the \u00e2\u20ac\u01531\u00e2\u20ac\u009d button.<\/p>\n<p>So, now we have a simple color setup, let\u00e2\u20ac\u2122s paint the terrain with it. Increase the radius of the painter and paint your island.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t11.jpg\" alt=\"\" width=\"499\" height=\"250\" \/><\/p>\n<p>We now have a rather ugly green island. The terrain texture doesn\u00e2\u20ac\u2122t have any detail and is completely toneless. Let\u00e2\u20ac\u2122s fix that<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t13.jpg\" alt=\"\" width=\"510\" height=\"300\" \/><\/p>\n<p>Our next task is assign a detail texture. Detail textures are what give the ground layer it\u00e2\u20ac\u2122s natural appearance. They contain all of the things you see when you look down at the ground such as grass, leaves, concrete, cliffs etc.<\/p>\n<p>To assign them, goto the Terrain Texture menu.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t14.jpg\" alt=\"\" \/><\/p>\n<p>This is the Terrain Layers Editor. Initially it will seem pretty complicated but it\u00e2\u20ac\u2122s actually very versatile. Notice the \u00e2\u20ac\u0153Default\u00e2\u20ac\u009d Layer, this is the layer you painted earlier. We\u00e2\u20ac\u2122re going to assign a detail texture and a distance texture to this layer.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t15.jpg\" alt=\"\" \/><\/p>\n<p>Let me explain these a little more<\/p>\n<p>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.<\/p>\n<p>In a CryEngine 2 level, when you look down you\u00e2\u20ac\u2122re seeing the detail texture at your feet which has been colored using the layer painter. The distance texture provides a neutral \u00e2\u20ac\u0153tone\u00e2\u20ac\u009d to the terrain in the distance. This texture is tiled over the terrain to give slight differences and variation in the distance so you don\u00e2\u20ac\u2122t see a solid color on the hills in the distance. Generally, these textures are very neutral, often greyscale.<\/p>\n<p>You can see the distance texture in the image below. It\u00e2\u20ac\u2122s tiled over the terrain throughout the level.<\/p>\n<p>The slight changes in brightness you see below on the ground are being created by the distance texture, there is no detail texture visible.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t21.jpg\" alt=\"\" width=\"489\" height=\"284\" \/><\/p>\n<p>The first thing we\u00e2\u20ac\u2122re 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.<\/p>\n<p>Click on Load Texture<\/p>\n<p>In the Crysis SP demo, there are two textures available for the distance texture. Select beach_white_sand.dds and click open. It\u00e2\u20ac\u2122s important to note that theoretically you can build and entire level using only ONE distance texture.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t16.jpg\" alt=\"\" width=\"510\" height=\"388\" \/><\/p>\n<p>Now that we\u00e2\u20ac\u2122ve assigned a distance texture, it\u00e2\u20ac\u2122s time to give the ground some life and detail. This is where we make the grass actually look like grass.<\/p>\n<p>Click on Edit Surface Types in the Terrain Layers Editor<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t17.jpg\" alt=\"\" \/><\/p>\n<p>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 isn\u00e2\u20ac\u2122t part of the SP demo and for this reason, doesn\u00e2\u20ac\u2122t appear in your level. We need to assign something else.<\/p>\n<p>Click on Material Editor<\/p>\n<p>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.<\/p>\n<p>You\u00e2\u20ac\u2122ll 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 Diffuse in 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.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t18.jpg\" alt=\"\" width=\"507\" height=\"378\" \/><\/p>\n<p>Close the material editor with plains_grass_green_and_dry selected.<\/p>\n<p>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.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t19.jpg\" alt=\"\" \/><\/p>\n<p>Close the Surface Type window and the Terrain Layers Editor.<\/p>\n<p>The terrain should now look something like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t20.jpg\" alt=\"\" width=\"510\" height=\"297\" \/><\/p>\n<p>You should now recompile the Surface Textures (file -&gt; Generate Surface Textures) and Export to Engine (file -&gt; Export to Engine).<\/p>\n<p>Note: Export to engine is essentially writing your level data to a format CryEngine 2 can understand. The .cry file is NOT loaded by the engine. The level data must be saved into the level.pak first. Everytime you make a change you will need to export to engine for that change to appear in game.<\/p>\n<p>Our island is fairly dull right now, we can brighten it up by importing a pre-made time of day setting.<\/p>\n<p>Goto View -&gt; Open view pane -&gt; Time of day<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t22.jpg\" alt=\"\" width=\"503\" height=\"380\" \/><\/p>\n<p>When the time of day editor opens, click on Import from File and browse the SP Demo\/Editor folder. You\u00e2\u20ac\u2122ll see default_time_of_day and default_time_of_day_MP. Pick either one and click ok.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t23.jpg\" alt=\"\" width=\"506\" height=\"383\" \/><\/p>\n<p>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.<\/p>\n<p>Close the Time of day editor.<\/p>\n<p>Your level should look much more lifelike now, brighter and crisper.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.narby.net\/img\/ce2_tutorial\/t24.jpg\" alt=\"\" width=\"514\" height=\"344\" \/><\/p>\n<p><a href=\"http:\/\/www.narby.net\/?page_id=40\">Continue to page 2 >><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating a level with CryEngine 2 \u00e2\u20ac\u201c SP Demo Release 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<a class=\"read-more\" href=\"https:\/\/www.narby.net\/?page_id=39\">Continue reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":35,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"class_list":["post-39","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.narby.net\/index.php?rest_route=\/wp\/v2\/pages\/39","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.narby.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.narby.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.narby.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.narby.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=39"}],"version-history":[{"count":0,"href":"https:\/\/www.narby.net\/index.php?rest_route=\/wp\/v2\/pages\/39\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.narby.net\/index.php?rest_route=\/wp\/v2\/pages\/35"}],"wp:attachment":[{"href":"https:\/\/www.narby.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=39"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}