View Full Version : CryEngine 2 Sandbox 2 advanced tips

12-29-2009, 01:55 AM
source for the following: http://www.crymod.com/thread.php?postid=76662#post76662

Multiple people working on the same map:

Almost everything in Sandbox can be exported/imported; object layers, vegetation, terrain blocks, height map, time of day settings. So different people can work on different things at the same time.

Divide you level into layers from the beginning. Look at the Crysis levels for a good way to do this. Make sure that all objects are in the correct layers, there should be nothing remaining in the Main layer. Then make all layers external (RollUpBar --> Layer Settings tab --> Right click layer --> Settings --> Tick External)

The biggest challenge is making sure that only one person works on something at a time. Communication between team members is key! It is good to have an owner of the level that imports the changes from other people.

Some examples of good work flow:
-Person 1 works on distant mountains and vegetation, person 2 tweaks time of day settings (person 2 exports new time of day settings and person 1 imports them).
-Person 1 paints surface texture around beginning of level, person 2 works on AI encounter at the end of the level (person 2 sends all layers that were changed to person 1 who overwrites his old layers).

what does the sync player button mean at the bottom? Can you have two people work on the map at the same time and see the changes the other person makes. i.e. over a network and two computer with the sandbox?
The sync player button just means whether or not the actual player follows the camera around in the editor.

There is no networked editing I'm afraid. Would be cool though.

how to divide a map into different layers ?

RollUpBar --> Layer Settings tab. Here you can create new layers, delete layers, rename, change settings etc.

When you have an object selected you can change what layer it is on with this button:

tips on layers, I started out with a separate layer for each area of my map that I have planned out in my story, even if there isn't anything in that layer yet.

See this older screenshot of my layers here:

Then as I worked on each area, one at a time, I made more and more layers.
For example if an area such as a mine has voxels I made those on a separate layer then the actual objects inside the mine. That way I don't accidentally delete a voxel, or move it. I then do VisAreas and portals on another, roads, AI, etc... until my entire area is complete. (None are yet)

I use the main layer ONLY for a scratch pad, such as building new objects, or ripping apart multiplayer Prefabs.

I have found it invaluable for keeping your sanity as the map grows.

12-29-2009, 02:09 AM
Adding custom Materials

The material editor is integrated into our source control application. Since you guys don't have this it might function a bit weird.

To work around this, the best is to extract all materials from GameData.pak. Here is how:
-Open GameData.pak with WinRar.
-Drag the Materials folder into you Game folder so it sits next to other folders like Levels, config, Localized etc.
-Right click the materials folder and choose Properties.
-Un-tick Read Only.
-Click OK.
-Restart your editor.

As you can see the materials no longer have the little lock symbol on them. This means that they can be edited. You should be able to duplicate and add new ones as well.

Question: ever had any problems with saving materials?
Do This:
Tools > Preferences > Source Control
Untick 'Enabled'.
cool.. but doesnt work for multi submaterials (requires sdk -> proper 3dmax exporter )
you shouldn't be modifying the PAK files in the first place.
All the materials you create are stored outside of the PAK's.

12-29-2009, 02:12 AM
Running Sandbox 2 smoothly... memory consumption:

Keep an eye on memory consumption in the lower right corner of Sandbox. When the icon turns red, you are in the danger zone. Restart the editor.

If you copy and paste very large flow graphs sandbox will start to crawl as well.

A few tips to keep memory consumption lower:
-Work in LowSpec. This will load less textures and less complex geometry which will decrease memory consumption.
-In preferences try setting number of undo levels to a lower number. Default is 50 which is more than most people really need. The problem is that this needs to be set every time you run the editor which is really awful

12-29-2009, 02:18 AM
Texturing Buildings and other static objects:

A few things to keep in mind.

It is always wise to keep the number of materials low as possible, so you will have less "Draw Calls" in your engine.
For MWLL we made statics with 10 or more materials but after testing some levels in the engine we decided to cut down the number of materials to 3 or 5, because the engine was getting slow because of the high number of draw calls.

So we combined the textures, made them tileable in one direction and added some more edges in the buildings where we had to. I figured with newer cards some more polys won´t hurt the frame rate so much compared to a higher number of materials.

Although todays cards have 256 or 512 MB you still have to keep the texture memory small, because in the most cases you have more textures for one material(diffuse map, specular map, normal map and maybe some RGB multiply shaders.

So you could live with 1024 or 512 Textures on unique objects, and I understand maybe when you have a wide, open terrain level with woods, mountains, houses, props, characters and so on that it will be a better quality.

But you could use the sheeting technique where you clamp coordinates and still use tiling. My approach for architecture is to pick textures that only have to tile on one axis, usually x, and stack them on the other axis. That'd give you, say, 3 512s and a bunch of trims in one 512*2048.

Hey , I just have a couple of questions about creating buildings for better performance.

1. Should I build the buildings in many peices? For instance have all the ledges on a window a seperate model, because i figure this engine would probably do instancing for the same model referenced many times. Meaning it would only load 1 ledge into memory... and u can place the ledge on many window frames.

I would recommend checking out the buildings in the multiplayer map that comes with the SP demo. Select the prototype factory prefab for example and open it. You will see that it is made out of different parts.

2. How does crysis work for not rendering what u dont see.. for instance if i built a sky scraper... i dont want every floor rendered... just the room your in or the outside of the building if your outside. Pretty much same thing there... Would i build each part of the building as a seperate model? Would each peice still be rendered if im outside and they are being obstucted by other geometry?

Again, have a look at the prototype factory. You will notice that the individual rooms have VisArea shapes around them and Portals in the doorways. This will make sure that anything inside the VisAreas will be culled EXCEPT if you are looking through a portal into the VisArea.

12-29-2009, 02:22 AM
Video Capture: Single Frames
I saw a few options in SB2 regarding AVIs. You can set the framerate and codec code for the AVI, but I'm unable to initialize it. Is there a way to output frame-by-frame movies out of Crysis in SB2 mode? It would be cool to set everything maxed and output the most impresive scenes to a high-resolution AVI file. I would say Crytek used the same procedure for creating their promo movies.

Anyway, if someone knows how to configure this feature and get it working, I would appreciate it a lot! I just hope this feature isn't only in the full version of the editor.

We use a technique where the engine outputs screen shots that are then composited into a video with a fixed frame rate. Note: This will not give you any sound!

The console command capture_frames 1 will make the engine start outputting individual frames as screen shots to a CaptureOutput folder in your Crysis root directory. The screen shots can then be composited into a video in Premiere or with a shareware program like Jpg2Avi. The video will probably look like the game is running on steroids, because the capture process can't keep up with the game (a video made at 30 FPS from frames captured at ~10 FPS).

This is where the console variable fixed_time_step 0.03333 comes in. It will lock the update rate of the game at 30 FPS. Enter this console command before starting the capture process and set it to 0 when finished.
But... is there any way to manualy set the JPEG compression? I'm not satisfied with the picture quality. Is there some console command for that?
I recorded the sound with CoolEdit while re-running the same capturing scene, so this is not a problem at all.

Start the game in devmode and do it there
Just for info, if someone wants highest picture quality when capturing with "capture_frames 1" console command, then using "capture_file format = bmp" will capture in bitmap format.

Windows Movie Maker is on every XP/Vista machine an imports image files that are batch numbered and creates videos from them, be it avi or wmv. So you have one already.

12-29-2009, 02:31 AM
Hiding hud/interface/helpers/stats:

Since most people seem to have missed or forgotten this one:

typing into console 'cl_hud=0' removes hud, 'cl_hud=1' brings it back.

Shift+Space hides/shows helpers (all the colourful lines and icons shown by the editor by default).

You can hide solids (the invisible walls for level boundaries that are displayed as red transparent boxes) by going into fourth tab in RollupBar (little screen icon on the toolbar on the right side of the screen) and checking 'Solids' in 'Hide by Category' group.

To hide performance stats, go into Tools->User Commands->displayInfo. This way you can make clean screenshots without even going into game mode.

12-29-2009, 02:34 AM
Advanced Screen Shots:


f12 =
C:\Documents and Settings\USERNAME\My Documents\my games\crysis_sp_demo\ScreenShots

you can also use this for making very large screenshots. this feature can be buggy (picture quality wise).
e_screenshot_quality 100 (100 is a bit better, but perhaps not always)
e_screenshot_width 1600
e_screenshot_height 1200
e_screenshot 1

e_screenshot_height 1200
e_screenshot_width 2800
e_screenshot_quality 100
^ the quality is from 0 to 100, 100 being the best
e_screenshot 1
it will save in the game folder/screenshots/hi-res/ as a tga file, convert it using photoshop/gimp/paint.net ect
don't take a screen in game by adjusting the resolution, it won't be nearly as good quality, take it in the Editor using the above commands

I always get the best results when I set the quality to 100.

And you don't need to convert to .jpg using other software. There's a console command e_screenshot_file_format=jpg

And a good solution for taking huge screenshots and saving some post-process effects (such as Terrain AO) is to set r_height and r_width (in game) to about 2 to 4 times bigger than your resolution, and just capture the normal screenshot using r_GetScreenShot=2 or F12.
Then just down-scale the big image and you should have a nice anti-aliased image.
(I have yet to try this method myself, but it should work)

12-29-2009, 02:36 AM
Terrain colors: Google Maps:

You can manipulate the terrain color in an external program. I used this to overlay a satelite image from google earth onto my terrain for reference.

Go to Terrain - Export/Import Texture Map

Select the portion of the terrain map (this is actually the far-away-lod-texture of the default texture layer) you wan't to replace by clicking the corresponding tile in the overview on the left. You can also select more than one tile by click-dragging over some of them.

Then click either import or export, the will both do an export when you use the dialog for the first time. If you had selected a file prior to this, you have to click export.
A image file of your terrain texture is created, according to the resolution(s) of the tile(s) you selected. Feel free to modify this image in an external tool or replace it completely with another image.

Then go back to the import/export dialog, again select the tiles you want to replace and, with the filename still displayed in the textbox, click import. The texture is replaced by the contents of the file, the view is updated when you close the dialog.

You can replace any tile(s) with the selected file, not only the one(s) you used to export. Just make sure to select those tile(s) that make up the exact same resolution as the image. You can even alter the resolution in your external tool and then import to another tile or more tiles, as long as resolutions match. You can do more than one modify-in-external-tool/import cycle without having to do the whole export thing first, as long as the filename stays the same.

The resolution of the tiles can by changed (one by one) with the 'change tile resolution' button at the bottom of the 'layer painter' rollout.

When exporting/Importing textures from a map Such as "Island" or any other Crytek map import/export only to the Surface Type Editor and not the base layers. If imported to base layers you will no longer be able to texture correctly.

For Example: you choose Beach_sand.dds as your base layer texture and you have forest_ground_leaves_brown and then tried to texture you will get a random texture like fern leaves or a mountain texture. This is caused by importing the base layers from crytek maps.

Height Maps
DEMs (or Digital Elevation Models) are topographic representations of a real-life geographical area. In game design, the most important thing to note is that they are NOT heightmaps in and of themselves. They must be converted as such. Here's how I do it.

1. Import the DEM into a program called Landserf. You can download it here. NOTE: DO NOT use Internet Explorer to download Landserf. I have no idea why, but by default, Internet Explorer converts .jar files to .zip archives, and renaming doesn't work, so this will pretty much destroy your installation file. There are other programs available that will convert DEMs, such as 3DEM, but I've never used them.

2. Export to a .RAW format.

3. Import the .RAW in Photoshop.

4. Convert to grayscale mode (Image/Mode/Grayscale.)

5. Convert to RGB Color. (Image/Mode/RGB Color)

6. Export as a 24-bit bitmap.

7. Import the bitmap into Sandbox.

The result won't be overly spectacular by itself, but it's a good starting point. There will be some jaggedness, but this can be corrected with a Modify/Smooth Slope in the terrain editor. Then, after some optimization with Sandbox's terrain modification tools, you will have a truly breathtaking terrain. It's not a good way to create islands, since most DEMs cover a wide area, but large landmasses will be no problem.

12-29-2009, 02:40 AM
Multiple Objects snap together:

This probably the tool that saves the most time of the all. It allows you to always have your objects aligned, no matter how you rotate them, they will always snap together!

To use align selection , select an object, press the align selection button, then click the destination object. All transforms (position, rotation, scale) will be copied from destination object to your initial selected object.

Also accessed by: Modify -> Goto Selection Modify -Y Align/Snap -> Align to Object

Fast Rotate:

This is a huge timesaver! Bind a key (R) to Modify/Fast Rotate/ Rotate Z Axis.

Then use the Modify/Fast Rotate/Rotate Angle to set a snap angle. I choosed 22.5.

Now I can move around and rotate entites without switching gizmos. You now also have two diffrent angle snaps, one for the gizmo and one for the fast rotate.

Just try it and you will love it! If have you used Radiant, you this was something that you probably missed in Sandbox 2.

"Show screentips on Toolbars".
In the menu Tools / Customize Keyboard/ Options / Other you can enable "Show screentips on Toolbars". This will allow you to hover the mouse over an icon in the editor, and if there is a hotkey for it, the hotkey will be displayed aswell. This option was not enabled by default for me.

Quick Snap: Ctrl+Shift+LMB

I've seen that alot of people have asked how to correctly place objects they'ev added to their level, and the answer they get is to use the follow /snap terrain option and then move the object around. There is another. better way and that is to select move and use ctrl + shift + left mouse button and then click anywhere (terrain or object) to snap the selected to where you click, instead of using the transform gizmo. This temporarly overrides the Axis locks. (This tip is in the manual, but maybe overlooked by it's readers?)


Select: 4


Select and Move: 1
Select and Rotate: 2
Select and Scale: 3

Axis lock:

X: Ctrl + 3
Y: Ctrl + 4
XY: Ctrl + 2
Follow Terrain: Ctrl + 1

Saving and Backup:

Hold and Fetch:

File / Hold = Ctrl + Alt + H
File / Fetch = Ctrl + Alt + F

These to commands will make (Hold) a backup of your level.cry in your Level folder, called Editorhold.cry. You can load this backup by using Fetch or File/Load . The editor will overwrite the Editorhold.cry everytime you select Hold, it will not save the level as a new file.