CryENGINE®3 is the first PC, Playstation®3, and Xbox 360™ all-in-one game development solution that is Next-Gen ready with scalable computation and graphics technologies. Using the CryENGINE®3, you can start the development of your next generation games today. CryENGINE®3 is the only game engine that provides multi-award winning graphics, state-of-the art lighting, physics and AI, out of the box. The famous CryENGINE®3 Sandbox™ editor is a production proven, third-generation real-time tool suite designed and built by AAA developers. CryENGINE®’s powerful real-time renderer is now even better! DirectX 11 (DX11) support significantly enhances the capabilities of the renderer within CryENGINE®3, allowing for some of the best visuals ever seen.
This article will deal with the majority of the tools you will use on a regular basis as well as the essentials for creating new and exciting levels for your project. It will also include the use of one of CryENGINE's greatest features of What you see is what you play by demonstrating how you may be able to play the level that you have created on demand.
Posted by INtense! on Aug 2nd, 2011
Intermediate Level Design/Theory.
In this article by Dan Tracy, author of CryENGINE 3 Cookbook, we will cover:
Placing objects is a simple task; however, basic terrain snapping is not explained to most new developers. It is common to ask why, when dragging and dropping an object into the world, they cannot see the object. This section will teach you the easiest ways to place an object into your map by using the Follow Terrain method.
First select the Follow Terrain button. Then open the Objects tab within the Rollup Bar. Now from the Brushes browser, select any object you wish to place down (for example, defaults/box).
You may either double-click the object, or drag-and-drop it onto the Perspective View. Move your mouse anywhere where there is visible terrain and then click once more to confirm the position you wish to place it in.
The Follow Terrain tool is a simple tool that allows the pivot of the object to match the exact height of the terrain in that location. This is best seen on objects that have a pivot point close to or near the bottom of them.
You can also follow terrain and snap to objects. This method is very similar to the Follow Terrain method, except that this also includes objects when placing or moving your selected object.
This method does not work on non-physicalized objects.
Refining the object placement
After placing the objects in the world with just the Follow Terrain or Snapping to Objects, you might find that you will need to adjust the position, rotation, or scale of the object. In this recipe, we will show you the basics of how you might be able to do so along with a few hotkey shortcuts to make this process a little faster. This works with any object that is placed in your level, from Entities to Solids.
In this recipe, we will call your object (the one whose location you wish to refine) Box for ease of reference.
To move the Box in the world space and change its position, proceed with the following steps:
You may move objects either on a single axis, or two at once by clicking and dragging on the plane that is adjacent to any two axes: X + Y, X + Z, or Y + Z. To rotate an object, do the following:
You cannot rotate an object along multiple axes. To scale an object, do the following:
It is possible to scale on just one axis or two axes; however, this is highly discouraged as Non-Uniform Scaling will result in broken physical meshes for that object. If you require an object to be scaled up, we recommend you only scale uniformly on all three axes!
Here are some additional ways to manipulate objects within the world.
To make position or rotation refinement a bit easier, you might want to try changing how the widget will position or rotate your object by changing it to align itself relative to the object's pivot. To do this, there is a drop-down menu in the EditMode ToolBar that will have the option to select Local. This is called Local Direction. This setup might help to position your object after you have rotated it.
To aid in positioning of non-organic objects, such as buildings or roads, you may wish to turn on the Snap to Grid option. Turning this feature on will allow you to move the object on a grid (currently relative to its location). To change the grid spacing, click the drop-down arrow next to the number to change the spacing (grid spacing is in meters). Angle Snaps is found immediately to the right of the Grid Snaps. Turning this feature on will allow you to rotate an object by every five degrees.
Even though it is a Hotkey, to many developers this hotkey is extremely handy for initial placement of objects. It allows you to move the object quickly to any point on any physical surface relative to your Perspective View.
Utilizing the layers for multiple developer collaboration
A common question that is usually asked about the CryENGINE is how does one developer work on the same level as another at the same time. The answer is—Layers. In this recipe, we will show you how you may be able to utilize the layer system for not only your own organization, but to set up external layers for other developers to work on in parallel.
Now in your build folder, go to the following location: -... \Game\Levels\My_Level. From here you will notice a new folder called Layers. Inside that folder, you will see ActionBubble_01.lyr.
This layer shall be the layer that your other developers will work on. In order for them to be able to do so, you must first commit My_Level.cry and the Layers folder to your repository (it is easiest to commit the entire folder).
After doing so, you may now have your other developer make changes to that layer by moving Box1 to another location. Then have them save the map.
Have them commit only the ActionBubble_01.lyr to the repository. Once you have retrieved it from the updated repository, you will notice that Box1 will have moved after you have re-opened My_Level.cry in the Editor with the latest layer.
External layers are the key to this whole process. Once a .cry file has been saved to reference an external layer, it will access the data inside of those layers upon loading the level in Sandbox.
It is good practice to assign a Map owner who will take care of the .cry file. As this is the master file, only one person should be in charge of maintaining it by creating new layers if necessary.
Here is a list of limitations of what external layers cannot hold.
Even though any entity/object you place in your level can be placed into external layers, it is important to note that there are some items that cannot be placed inside of these layers. Here is a list of the common items that are solely owned by the .cry file:
Switching to game mode
CryENGINE prides itself on the saying What you see is what you play, and the switching to game mode is a testament to this.
It goes without saying that testing your work often is the key to a successful project, and the quick easy use of switching to Game Mode within the Editor allows you to test at will without the need to close Sandbox.
Even though the Editor is built with this feature to allow Developers to check their work, this is still only an emulation. This means that there are several special editor rules and debug options available in this mode, which isn't fully representative of what the Player might see in the Pure Game. Even though it is an excellent idea to test often by switching to Game Mode, it is also important to do any final testing in the Launcher on your target platform to have a proper Pure Game experience.
In this recipe, we will cover the simple, but highly important use of switching to game mode. This function allows you to jump into your level instantly, and allows you to test what the player will see, hear, and feel within the location you are at with your Perspective Camera.
Have My_Level open inside of Sandbox. Review the Navigating a level with the Sandbox Camera to get familiar with the Perspective View.
In the Sandbox main toolbar, find Game | Switch to Game or click on Ctrl + G. It's that simple.
Game Logic can change the player's initial spawning location. If this logic is enabled, then you will be forced to spawn at this location as well when entering game mode.
Saving your level
On the surface, saving your level seems like a simple process; however, there are a few important functionalities that you should be aware of when saving your level. This recipe will show you how to do a basic saving, copying/moving your level (do not use Save As), and auto backups.
Have any level open inside Sandbox. Open Windows Explorer to the following location: ...\CryENGINE_Build\Game\Levels.
To save a level, go to File | Save.
Ctrl + S does not work by default. You will need to set up a shortcut key yourself for that.
When copying/moving levels:
We recommend that you never perform a Save As for your level. Unfortunately, there are several dependencies (Level.pak, TerrainTexture.pak, Layers, Minimap images, and so on) that do not get moved or relink themselves when a Save As is performed. They are all dependent on the folder in which they are placed. If you do this, you will see several anomalies within your level (broken textures, bugs in game logic, missing assets).
When creating a backup, remember that by default, Sandbox creates My_Level.bak files after the second/third time your level is saved. These .bak files are essentially the previous saves of your .cry file.
If, for whatever reason, you need to revert back to a previous save of your level, you may delete your My_Level.cry file and rename My_Level.bak# to My_Level.cry and reopen your level inside of Sandbox.
Also, by default, Sandbox creates up to two previous revisions (My_Level.bak and My_Level.bak2).
By default, all levels are saved in their own folder inside of ...\Game\Levels by their level name. For example, My_Level will have its own folder with the level's folder. Once saved, each level will also contain a *.cry file, with the * being the name of the level as well. Each of these .cry files hold all the relevant information that is required to make up your level (much like a blueprint for your level).
Depending on your work style, you might want to enable the Auto Backup system. This will automatically save your work every X minute interval with the name of your choice (Autobackup by default) into your level's folder. These Auto Backups will save continuously as long as your editor is open or you turn this feature off.
To access this feature, open Sandbox | Tools | Preferences | General/Files | Auto Backup.
Exporting to an engine
Even though saving your level will create a .cry file for you, it is extremely important to note that a .cry alone will not work in the Launcher. For that you will need to perform this recipe, which will create the required files to run in Pure Gamemode.
Have My_Level open inside Sandbox.
Go to File | Export to Engine or click on Ctrl + E.
This crucial step is required to convert all the blueprint's setup in your .cry file in to a level.pak inside of the My_Level folder to be used in Pure Gamemode. This level.pak is basically a cache of data for the game to use, which houses all the baked information about Game Logic, AI Markup, Particle list, Brush list, and so on.
Here is some useful information that you should know about .pak files.
It is possible to open these .pak files and see the information stored inside them by using third-party compression software, such as WinZIP and WinRAR. However, we do not recommend doing this unless you are familiar with handling the files you may wish to manually change. If you do change the files that are inside of these .pak files, you run the risk of damaging the .pak file and breaking your level for the Launcher.
There is no need to panic if, for whatever reason, any of your .pak files become corrupted and unusable in Pure Gamemode. You can always delete them and generate a new one from your My_Level.cry by repeating this recipe.
Essential game objects
Even though we covered how to export your level to be used in Pure Gamemode, you may find that when you launch your level, you are not in the correct location in the map. This quick recipe will show you how to create a Spawn point for Pure Gamemode and also remind you the importance of having a physical surface to spawn on.
Unless your game supports some sort of Player flying mechanic, we recommend you choose a location where the Player can stand when he initially spawns within your level. Any physical surface (Floor, Roof, Terrain, Rock, and so on) will do.
To place a Spawn Point follow these steps:
This initial spawn point will automatically work as the main spawn point for your map in Pure Gamemode (as long as you keep to the default SinglePlayer.lua gamerules). If you jump into your map from the Launcher now, you will be spawned at this location.
Any additional spawn points will not function unless there is some game logic hooked into their functionality.
Running a map from the Launcher
The final recipe in this article will cover how you may access the Pure Gamemode version of My_Level from the Launcher.
You must have a map with a working spawn point (otherwise you will spawn at 0,0,0), that has been exported from the engine with a functional level.pak.
The level must also be inside your Build folder.
This will load the map as well as spawn you in the spawn point that was provided.
Over 90 recipes written by Crytek developers for creating third-generation real-ti