CryENGINE 3 Cookbook - Dan Tracy - E-Book

CryENGINE 3 Cookbook E-Book

Dan Tracy

0,0
39,59 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

With every successive console generation, the cost, time, and complexity of developing games has grown. Meet CryENGINE3, a middleware engine that is the perfect fit for most developers allowing users to exceed current generation quality standards while using less people and time than ever thought possible.The CryENGINE3 CookBook is packed full of recipes for junior and senior developers alike. It covers everything from creating photo realistic architectural visualizations to implementing advanced physics such as ragdoll and tornado effects. Topics covered include the sandbox, level layout, environment creation, AI, character creation, creating vehicles, and game logic. Every recipe is designed to add AAA quality to your games. The CryENGINE3 SDK has many tools immediately available to developers of all disciplines. For designers the book has recipes for building up your own levels and populating your levels with intelligent AI and photo realistic assets. For artists we have recipes for practical workflow tools and techniques used when working with the advanced CryENGINE shaders and materials. For animators we have recipes that will bring your creations to life using skinned characters and advanced animation systems like locomotion groups. Finally for programmers we have recipes that show how to employ the core mechanics behind entities such as vehicles and weapons while also utilizing the strengths of the physics engine to create a unique and exciting game.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 374

Veröffentlichungsjahr: 2011

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

CryENGINE 3 Cookbook
Credits
About the Authors
www.PacktPub.com
Support files, eBooks, discount offers and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code and colored graphics for this book
Errata
Piracy
Questions
1. CryENGINE 3: Getting Started
Introduction
Opening a level in the CryENGINE 3 Sandbox
Getting ready
How to do it...
How it works...
There's more...
What is a .cry file?
Using a level.cfg
See also
Navigating a level with the Sandbox Camera
Getting ready
How to do it...
How it works...
There's more...
Viewport movement speed control
Under Views you can adjust the viewport to view different aspects of your level
Splitting the main viewport to several subviewports
See also
Setting up a personalized toolset layout
Getting ready
How to do it...
How it works...
The Status Bar
The Console
The Toolbox
See also
How to customize toolbars and menus
Getting ready
How to do it...
How it works...
There's more...
The Options tab
Personalized menus and toolbars
Using the Rollup Bar
Getting ready
How to do it...
How it works...
There's more...
The AI section
The Area section
The Entities section
The Misc Objects section
The Solids section
The Archetype entity section
The Geom entity section
The Prefabs section
The Sound section
See also
Selecting and browsing level objects
Getting ready
How to do it...
How it works...
There's more...
Browsing frozen and hidden objects
List types
Display as a Tree
See also
Restoring the CryENGINE 3 default settings
Getting ready
How to do it...
How it works...
There's more...
Deleting your user folder
See also
2. Sandbox Basics
Introduction
Creating a new level
Getting ready
How to do it...
How it works...
Using the Terrain option
Heightmap resolution
Meters per unit
Terrain size
There's more...
See also
Generating a procedural terrain
Getting ready
How to do it...
How it works...
There's more...
Terrain generation settings
See also
Terrain sculpting
Getting ready
How to do it...
How it works...
There's more...
Noise settings
Reposition objects and vegetation
See also
Setting up the terrain texture
Getting ready
How to do it...
How it works...
There's more...
See also
Placing the objects in the world
Getting ready
How to do it...
How it works...
There's more...
See also
Refining the object placement
Getting ready
How to do it...
There's more...
Local position and rotation
Grid and angle snaps
Ctrl + Shift + Click
See also
Utilizing the layers for multiple developer collaboration
Getting ready
How to do it...
How it works...
There's more...
External layer limitations
See also
Switching to game mode
Getting ready
How to do it...
See also
Saving your level
Getting ready
How to do it...
How it works...
There's more...
Exporting to an engine
Getting ready
How to do it...
How it works...
There's more...
Opening .pak files
Corrupted .pak files should be deleted and re-exported
Essential game objects
Getting ready
How to do it...
How it works...
See also
Running a map from the Launcher
Getting ready
How to do it...
See also
3. Basic Level Layout
Introduction
Making basic shapes with the Solids tool
Getting ready
How to do it...
How it works...
There's more...
Other shapes—cone, sphere, cylinder
Number of sides—only for cone, sphere, cylinder
See also
Editing and merging solids
Getting ready
How to do it...
There's more...
Exporting the selected geometry to .OBJ
Resetting the XForm
See also
Grouping the objects
Getting ready
How to do it...
How it works...
There's more...
See also
Utilizing the Geom entities instead of brushes
Getting ready
How to do it...
How it works...
See also
Road construction
Getting ready
How to do it...
How it works...
There's more...
Road parameters
Shape editing
Align Height Map
See also
Painting vegetation
Getting ready
How to do it...
How it works...
There's more...
Vegetation parameters
See also
Breaking up tiling with Decals
Getting ready
How to do it...
How it works...
There's more...
Decal parameters
Decals can have their unique position, rotation, and scale
See also
Making caves with Voxels
Getting ready
How to do it...
How it works...
There's more...
Soft Create
Material
Copy Terrain
Creating Prefabs to store in external libraries
Getting ready
How to do it...
How it works...
There's more...
Extract Object and Extract All
Open/Close
Pick and Attach/Remove Object and Update Prefab
See also
4. Environment Creation
Introduction
Creating your first time of day using the basic parameters
Getting ready
How to do it...
How it works...
There's more...
Forcing sky update to true
Record icon
Play icon
See also
Adjusting the terrain lighting
Getting ready
How to do it...
How it works...
There's more...
Terrain ambient occlusion
Transition shading from the sun to the moon
SSAO (screen-space-ambient occlusion)
See also
Using the real-time Global Illumination
Getting ready
How to do it...
How it works...
There's more...
Advanced GI Cvars
See also
Editing HDR lighting and the effects for flares
Getting ready
How to do it...
How it works...
There's more...
Lights with flare effects
Glow texture effect produces bloom and flares
See also
Creating a global volumetric fog
Getting ready
How to do it...
How it works...
There's more...
Density offset
Enabling or disabling fog in the Render Settings
See also
Creating a night scene with time of day parameters
Getting ready
How to do it...
There's more...
SSAO contrast and amount
HDRSetup parameters at night
Moon and corona color and scale
See also
Color grading your level
Getting ready
How to do it...
How it works...
There's more...
_CCH naming convention
Capturing TGA images as reference images
Debugging visual glitches
See also
Creating a photo realistic ocean
Getting ready
How to do it...
How it works...
There's more...
Animating water parameters
Caustics
Free form transformation FFT water
Improving your sky with clouds
Getting ready
How to do it...
How it works...
There's more...
Cloud shadows
See also
Making it rain in your level
Getting ready
How to do it...
How it works...
There's more...
Lightning entity
Wind
Fog volumes
5. Basic Artificial Intelligence
Introduction
Placing the enemy AI
Getting ready
How to do it...
How it works...
There's more...
See also
Generating the AI navigation
Getting ready
How to do it...
How it works...
There's more...
Generating AI triangulation
See also
Forbidden boundaries
Getting ready
How to do it...
How it works...
See also
Forbidden areas
Getting ready
How to do it...
How it works...
See also
Setting up the interior navigation
Getting ready
How to do it...
How it works...
There's more...
Auto-Dynamic Points versus Designer Controlled Points
See also
Debugging the AI triangulation
Getting ready
How to do it...
How it works...
See also
Narrowing the AI's FOV to allow attacks from behind
Getting ready
How to do it...
How it works...
There's more...
See also
Respawning AI
Getting ready
How to do it...
How it works...
There's more...
AI territory FlowGraph node properties
AI wave FlowGraph node properties
6. Asset Creation
Introduction
Installing the CryENGINE 3 plugin for 3D Studio Max
Getting ready
How to do it...
How it works...
There's more...
3ds Max CryTools Maxscripts
Installing the 3ds Max CryTools Maxscripts
Uninstalling the 3ds Max CryTools Maxscripts
See also
Creating textures using CryTIF
Getting ready
How to do it...
How it works...
There's more...
Editing the CryTif plugin root path
Adjusting the default presets in the CryTIF dialog
Manually generating the .DDS output
See also
Setting up units to match CryENGINE in 3ds
Getting ready
How to do it...
How it works...
There's more...
Grid and Snap settings
Measurement reference
See also
Basic material setup in 3ds
Getting ready
How to do it...
How it works...
There's more...
Assigning textures in 3ds Max to materials
Physicalize
See also
Creating and exporting static objects
Getting ready
How to do it...
How it works...
There's more...
Physics proxy
Occlusion geometry
User defined properties
See also
Creating and exporting destroyable objects
Getting ready
How to do it...
How it works...
There's more...
Two-dimensional breakable assets
Jointed breakables
User defined properties
See also
Using advanced material editor parameters to create animation
Getting ready
How to do it...
How it works...
There's more...
Animated textures
Vertex deformation
See also
Creating new material effects
Getting ready
How to do it...
How it works...
There's more...
Creating new surface types
Physics block parameters
Ammo surface types
See also
Creating image-based lighting
Getting ready
How to do it...
How it works...
There's more...
Generating all Cubemaps
Creating a CubeMap with Material Editor
See also
7. Characters and Animation
Introduction
Creating skinned characters for the CryENGINE
Getting ready
How to do it...
How it works...
Materials and characters
LOD (Level of Detail)
Bone Attachments
See also
Ragdoll and physics for characters
Getting ready
How to do it...
How it works...
There's more...
IK limits
ParentFrames
Dead body entity settings
See also
Creating animation for your character
Getting ready
How to do it...
How it works...
There's more...
Changing the animations compression
.chrparams file Wildcard Mapping
Animobject entity
See also
Previewing animations and characters for Sandbox
Getting ready
How to do it...
How it works...
There's more...
Animation driven motion
Searching and filtering animations
Types of animation assets
See also
Creating upper body only animations
Getting ready
How to do it...
How it works...
There's more...
Additive animations
Using additives
See also
Creating locomotion animations
Getting ready
How to do it...
How it works...
There's more...
Swimming and vehicle transitions
Locomotion loops
Idle to move and 180 degree rotational assets
See also
Animating rigid body geometry data
Getting ready
How to do it...
How it works...
There's more...
Pre-baked physics with .CGA objects
Anim object and pre-baked .CGA
See also
8. Creating Vehicles
Introduction
Creating a new car mesh (CGA)
Getting ready
How to do it...
How it works...
There's more...
Dummy helpers for modification of the parts
Parts for vehicles and their limitless possibilities
See also
Creating a new car XML
Getting ready
How to do it...
How it works...
There's more...
See also
Giving more speed to the car
Getting ready
How to do it...
How it works...
There's more...
See also
Increasing the mass to push objects with the car
Getting ready
How to do it...
How it works...
There's more...
See also
Defining a sitting location
Getting ready
How to do it...
How it works...
There's more...
See also
Setting up multiple cameras for the car
Getting ready
How to do it...
How it works...
There's more...
See also
Need for a machine gun
Getting ready
How to do it...
How it works...
See also
Giving the car a weak spot
Getting ready
How to do it...
How it works...
There's more...
See also
9. Game Logic
Introduction
How to beam the player to a tag point from a trigger
Getting ready
How to do it...
How it works...
See also
Making the AI go to a location when the player enters a proximity trigger
Getting ready
How to do it...
How it works...
There's more...
AIGotoEx
See also
Debugging the Flow Graph
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a kill counter
Getting ready
How to do it...
How it works...
See also
Rewarding the player for reaching a kill goal
Getting ready
How to do it...
How it works...
See also
Displaying the player's health through a Flow Graph
Getting ready
How to do it...
How it works...
Changing the player camera through key input
Getting ready
How to do it...
How it works...
There's more...
Creating a countdown timer
How to do it...
How it works...
There's more...
10. Track View and Cut-Scenes
Introduction
Creating a new Track View sequence
How to do it...
How it works...
There's more...
Available tracks in the director node
Sequence properties
See also
Animating a camera in the Track View
Getting ready
How to do it...
How it works...
There's more...
FOV
Playback speed
Curve editor
See also
Triggering a sequence using the Flow Graph
Getting ready
How to do it...
How it works...
There's more...
Useful debugging trigger
Start time property
Break on stop property
See also
Animating entities in the Track View
Getting ready
How to do it...
How it works...
There's more...
Entity visibility track
Animating scale
Entities and their tracks
See also
Playing animations on entities in the Track View
Getting ready
How to do it...
How it works...
There's more...
Loop animation
Start time
Time scale
See also
Using console variables (CVars) in the Track View
Getting ready
How to do it...
How it works...
There's more...
Animating the CVar values
T_scale cvar in Track View
See also
Using track events
Getting ready
How to do it...
How it works...
There's more...
Removing events from the sequence
Triggering image nodes for track sequences
See also
11. Fun Physics
Introduction
Low gravity
Getting ready
How to do it...
How it works...
There's more...
Uniform property
Gravity sphere
Hangman on a rope
Getting ready
How to do it...
How it works...
See also
Tornadoes
Getting ready
How to do it...
How it works...
There's more...
Constraints
Getting ready
How to do it...
How it works...
There's more...
Constraint properties
Wrecking ball
Getting ready
How to do it...
How it works...
See also
Rock slide
Getting ready
How to do it...
How it works...
There's more...
Physics properties
Simulation properties
See also
12. Profiling and Improving Performance
Introduction
Profiling performance in the Sandbox
Getting ready
How to do it...
How it works...
There's more...
Draw Calls
Triangle count
Budgets
See also
Saving level statics
Getting ready
How to do it...
How it works...
There's more...
Textures tab and render targets
Physics tris and physics size
Detailed dependencies tab
See also
Enabling the debug draw modes
Getting ready
How to do it...
How it works...
There's more...
Overdraw pixel cost scale
R_stats 15
Profiles
See also
Optimizing the levels with VisAreas and portals
Getting ready
How to do it...
How it works...
There's more...
Ambient color of VisAreas and portals
Blind spots
Using VisAreas and portals vertically
See also
Using light boxes and light areas
Getting ready
How to do it...
How it works...
There's more...
Using a concave light shape
Linking to multiple light shapes
See also
Activating and deactivating the layers
Getting ready
How to do it...
How it works...
There's more...
Limits of layer switching
Cinematics
See also
Index

CryENGINE 3 Cookbook

CryENGINE 3 Cookbook

Copyright © 2011 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: June 2011

Production Reference: 1170611

Published by Packt Publishing Ltd.

32 Lincoln Road

Olton

Birmingham, B27 6PA, UK.

ISBN 978-1-849691-06-2

www.packtpub.com

Cover Image by Sean Tracy (<[email protected]>)

Credits

Authors

Sean Tracy

Dan Tracy

Acquisition Editor

Steven Wilding

Development Editor

Alina Lewis

Technical Editor

Aditi Suvarna

Copy Editor

Laxmi Subramanian

Indexer

Rekha Nair

Project Coordinator

Zainab Bagasrawala

Proofreader

Aaron Nash

Graphics

Geetanjali Sawant

Production Coordinator

Shantanu Zagade

Cover Work

Shantanu Zagade

About the Authors

Sean Tracy is Crytek's Senior Field Application Engineer for the award-wining CryENGINE. He is responsible for adapting the engine and its features to individual licensees, as well as developing full technical and vertical slice demos for prospective and existing clients. Describing himself as a generalizing specialist, he also gives support directly to CryENGINE licensees, while designing and maintaining their workflows, pipelines, and development techniques.

Sean was recruited by Crytek in 2008 after working as an electronics technician for the Canadian Military. He was recruited due to his role in founding and leading the development on the award winning total conversion project MechWarrior: Living Legends. Since then, he has been featured in numerous gaming magazines and has been invited to speak at many game related trade shows and seminars. He is an avid gamer with extensive modding experience on titles including Never Winter Nights, the Battlefield engine Frostbite, Doom, and Quake.

I would like to thank my wife for her understanding and support throughout the process of writing this book and for her ongoing support in allowing me to do what I truly enjoy for a living. I would also like to thank my brother for co-authoring the book with me as it's a pleasure to be able to work with someone with the same love for the technology as I have. Finally, I'd like to thank Crytek and Packt for their support in allowing me to write this book and for making one of the best game engines in the market.

Dan Tracy is Crytek's Technical Level Designer for the award-winning CryENGINE and Crysis 2. He is responsible for the creation and maintenance of numerous technical features and external applications used for telemetry and optimization. Viewed as more than a level designer, Dan prides himself on pushing the envelope when it comes to improving both technical and game related designs across multiple production disciplines.

Dan was recruited by Crytek in 2009 after previously working as a Quality Assurance Technician for BioWare. He was recruited due to his pivotal role in co-founding and leading development on the award winning total conversion project MechWarrior: Living Legends. Since then, he has been featured in numerous gaming magazines and has been interviewed by multiple media outlets. Dan is a passionate gamer, but an even more passionate modder and game designer, with vast knowledge and experience with multiple engines and titles including Never Winter Nights' Aurora, Battlefield's engine Frostbite, Unreal 3, and CryENGINE. This is Dan's first book.

I would like to thank my friends and family for giving me their support during the crunch time of the Crysis 2 production, which also paralleled the creation of this book. If it wasn't for them, this wouldn't have been possible. I would also like to thank my brother for co-authoring the book with me as well as Crytek for providing me with this amazing opportunity to share my knowledge of CryENGINE with the world. Finally, I'd like to thank Packt for their support and setting this whole project in motion and publishing my first ever book.

www.PacktPub.com

Support files, eBooks, discount offers and more

You might want to visit www.PacktPub.com for support files and downloads related to your book.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and, as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.

http://PacktLib.PacktPub.com

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read, and search across Packt's entire library of books. 

Why subscribe?

Fully searchable across every book published by PacktCopy and paste, print, and bookmark contentOn demand and accessible via web browser

Free access for Packt account holders

If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.

Preface

With the overall complexity involved in creating games becoming exceedingly difficult and expensive with every successive console generation, many game developers have turned to middleware engines, such as the CryENGINE, that offer a complete pipeline for the game development process. CryENGINE is a perfect fit for most developers as it allows users to create their content quickly and easily and thus, allow games to meet and exceed current generation quality standards and still be created by fewer and fewer people.

As CryENGINE 3 is globally recognized as one of the world's most powerful real-time middleware development platforms, with this book we will deliver the best of what the engine has to offer. Through the use of CryENGINE's intuitive and powerful toolset, named Sandbox, designers, artists, animators, and even programmers will be treated to real-time creation and iteration tools for bringing their visions to life.

What this book covers

Chapter 1, Getting Started, helps you set up the entire CryENGINE 3 Software Development Kit, which can be a difficult task. This chapter will guide you through the stages in setting up the required folder structure and how to set up your layout for the Sandbox Editor.

Chapter 2, Sandbox Basics, helps you to learn the basic and most commonly used features provided by Sandbox.

Chapter 3, Basic Level Layout, helps you create your first Level Layout within the Sandbox Editor and learn some of the more advanced techniques used by designers for object placement and manipulation.

Chapter 4, Environment Creation, utilizes the CryENGINE 3 rendering tools to create photorealistic environments.

Chapter 5, Basic Artificial Intelligence, helps you learn the basics of how to the use AI to navigate in your levels.

Chapter 6, Asset Creation, helps you learn the pipeline of asset creation and export your 3D models to the CryENGINE format.

Chapter 7, Characters and Animation, describes how to create new characters to be used in the engine along with your own custom animations.

Chapter 8, Creating Vehicles, describes how to create a new vehicle from scratch and set up the entity code required so your players can drive.

Chapter 9, Game Logic, helps you to get started with the highly versatile Flow Graph Editor and create many useful scripts used in the level.

Chapter 10, Track View and Cut-Scenes, helps you to learn how to create your own cinematic cut-scenes within CryENGINE.

Chapter 11, Fun Physics, describes how to set up some enjoyable physics contraptions using CryENGINE 3's physics system.

Chapter 12, Profiling and Improving Performance, helps you to learn the tools behind profiling your levels and discover the best methods for improving performance.

What you need for this book

The Software Development Kit version of the CryENGINE is used for all examples in this book, thus, the reader should have a version of the development kit to be able to follow the recipes contained in this book.

Who this book is for

This book is written with the casual and professional developer in mind. With that said, it is important that the readers have some fundamental knowledge of some Digital Content Creation Tools, such as Photoshop and 3d Studio Max. Though not a fundamental requirement, having some basic knowledge of real-time graphics software and, consequently, the terminology used will make the goal of these recipes more clear.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "The level must also be inside of your Build folder."

A block of code is set as follows:

<DamageMultipliers> <DamageMultiplier damageType="bullet" multiplier="0.125"/> <DamageMultiplier damageType="collision" multiplier="1"/> </DamageMultipliers>

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

<DamageMultipliers> <DamageMultiplier damageType="bullet" multiplier="0.125"/> <DamageMultiplier damageType="collision" multiplier="1"/> </DamageMultipliers>

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "To open an existing level, we need to access the File menu."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title via the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail <[email protected]>.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code and colored graphics for this book

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at <[email protected]> with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.

Chapter 1. CryENGINE 3: Getting Started

In this chapter, we will cover:

Opening a level using the CryENGINE 3 SandboxNavigating a level with the Sandbox CameraSetting up a personalized toolset layoutHow to customize toolbars and menusUsing the Rollup BarSelecting and browsing level objectsRestoring the CryENGINE 3 default settings

Introduction

The main focus of this particular chapter will be in getting the CryENGINE 3 Software Development Kit installed and having you up and editing a level in the Sandbox editor right away! One of the key things to keep in mind when learning a game compositing tool such as Sandbox is to remember to experiment and have fun! It is important not to forget that most of us (game developers) are trying to make things fun and not dreary and dull.

With such a powerful toolset waiting for you to dive in, let's get right to it!

Opening a level in the CryENGINE 3 Sandbox

As most people involved in the game's development process should be familiar with opening levels, this section will take you through the relatively straightforward task of opening a level within the CryENGINE 3 Sandbox editing tool.

Getting ready

Having already located the Editor.exe in either your bin32 or bin64 folders, it will now be started in this section.

Note

If a level is not already loaded, the editor's subsystems can still access assets and resources from your game. Keep this in mind as some tasks don't require the loading of a level.

How to do it...

Let's get to opening a level:

Launch the Editor.exe located in either the Bin32 or Bin64 folder. You will be presented with an interface, as shown in the following screenshot:As there are already example levels installed with the SDK, we can open them.To open an existing level, we need to access the File menu.The File menu includes commands related to the handling of level files such as opening, saving, showing log files, and a list of recently-loaded levels.As we want to open a pre-existing level, choose the Open option.You will then be presented with a browser window defaulting to the CryENGINE3/game/levels folder.Browse to Forest and open the folder.Within the folder there is a Forest.cry file that contains raw level data for editing.Open the Forest.cry file.

The editor will now start to load this level for you to start exploring!

How it works...

The editor reads the .cryfiles and can also access the subfolder layers within the level folder.

As the level loads, it reads the information present in the .cry file.

There's more...

You may want to know what the .cry file is composed of or even how to apply console command changes to individual levels.

What is a .cry file?

A .cry file is the principle level editing format for all levels built in the CryENGINE. It is actually an archive comprised of binary and XML data that is used only by the editor. You can open .cry files in the editor, or you can open them with an appropriate archiving program such as WinRAR.

Using a level.cfg

Similar to the system.cfg, the level.cfg is a file that is executed upon the loading of a level. The level.cfg can simply be stored in the level's directory. You may add console variables or level-specific configurations to this file.

See also

Having launched the Sandbox, you can continue to the Navigating a level with the Sandbox Camera recipe in this chapterTo get right to modifying a level, go to the Selecting and Browsing level objects recipe later in this chapter

Navigating a level with the Sandbox Camera

The ability to intuitively navigate levels is a basic skill that all developers should be familiar with. Thankfully, this interface is quite intuitive to anyone who is already familiar with the WASD control scheme popular in most First Person Shooters Games developed on the PC.

Getting ready

You should have already opened a level from the CryENGINE 3 Software Development Kit content and seen a perspective viewport displaying the level.

The window where you can see the level is called the Perspective Viewport window. It is used as the main window to view and navigate your level. This is where a large majority of your level will be created and common tasks such as object placement, terrain editing, and in-editor play testing will be performed.

How to do it...

The first step to interacting with the loaded level is to practice moving in the Perspective Viewport window.

Note

Sandbox is designed to be ergonomic for both left and right-handed users. In this example, we use the WASD control scheme, but the arrow keys are also supported for movement of the camera.

Press W to move forwards.Then press S to move backwards.A is pressed to move or strafe left.Finally, D is pressed to move or strafe right.Now you have learned to move the camera on its main axes, it's time to adjust the rotation of the camera.When the viewport is the active window, hold down the right mouse button on your mouse and move the mouse pointer to turn the view.You can also hold down the middle mouse button and move the mouse pointer to pan the view.Roll the middle mouse button wheel to move the view forward or backward.Finally, you can hold down Shift to double the speed of the viewport movements.

How it works...

The Viewport allows for a huge diversity of views and layouts for you to view your level; the perspective view is just one of many. The perspective view is commonly used as it displays the output of the render engine. It also presents you a view of your level using the standard camera perspective, showing all level geometry, lighting, and effects.

To experiment further with the viewport, note that it can also render subsystems and their toolsets such as flow graph, or character editor.

There's more...

You will likely want to adjust the movement speed and how to customize the viewport toyour individual use. You can also split the viewport in multiple different views, which is discussed further.

Viewport movement speed control

The Speed input is used to increase or decrease the movement speed of all the movements you make in the main Perspective Viewport.

The three buttons to the right of the Speed: inputs are quick links to the .1, 1, and 10 speeds.

Under Views you can adjust the viewport to view different aspects of your level

Top View, Front, and Left views will show their respective aspects of your level, consisting of bounding boxes and line-based helpers. It should be noted that geometry is not drawn.

Map view shows an overhead map of your level with helper, terrain, and texture information pertaining to your level.

Splitting the main viewport to several subviewports

Individual users can customize the layout and set viewing options specific to their needs using the viewport menu accessed by right-clicking on the viewports header.

The Layout Configuration window can be opened from the viewport header under Configure Layout. Once selected, you will be able to select one of the preset configurations to arrange the windows of the Sandbox editor into multiple viewport configurations. It should be recognized that in multiple viewport configurations some rendering effects may be disabled or performance may be reduced.

See also

To start building your own objects immediately, go to the Making basic shapes with the Solids Tool recipe in Chapter 3, Basic Level LayoutTo modify the terrain of the current level, go to the Terrain Sculpting recipe in Chapter 2, Sandbox Basics

Setting up a personalized toolset layout

It would suffice to say that every user of Sandbox will have different preferences to how different views and toolsets should be distributed on screen. The CryENGINE 3 Sandbox allows for this kind of user-based customization and this recipe will take you through the use of some of the built-in tools for customizing your interface.

Getting ready

Before starting, it's important to introduce the view menu. The view menus allow you to turn various windows, toolbars, and subsystems on or off as well as open the various Sandbox extended editors and tool dialogs.

While experimenting with views, be aware that if you close a window and want to open it again, this can be done easily using the View | Open View Pane menu.

Another important toolset that you will likely want on your layout is the Rollup Bar.

The Rollup Bar is similar to the 3ds Command Panels for those already familiar with 3ds. It is a quick menu bar for the majority of the functions available to the editor exposed to the developer in an easily accessible format.

The final important tool you will likely want is the Console.

The Console is a direct command-line editor to the CryENGINE 3. This essentially allows access to various advanced functions within the Sandbox editor, including various debug and test profiles.

To start this tutorial, you should have Sandbox Editor.exe started.

How to do it...

The first step of customization will be to learn how to scale and move the various windows in Sandbox around:

Let's first open a new window.Click VIEW | Open Viewpan>e | Asset Browser.This will open up a window containing the asset browser in the centre of your screen.Ignore the contents for now as the asset browser will be explained later on in this recipe; let's resize the window.Move the mouse pointer to the edge of the window, so that it turns into a double-ended black arrow. Click and drag the mouse pointer to scale the window.Now that we have resized the window to our liking, let's use the docking toolbars to anchor the asset browser into the layout.You can see the docking helpers whenever you drag a window over another window, or the Sandbox editor itself.Click and drag the window from the title bar and move it over various docking helpers shown around the main view window.Notice that once you release the mouse button, the window will dock itself into that location.

Now that the window is docked, we should learn how to undock it:

Similar to when we docked the window, drag the title bar again and move the selected window away.Notice that the window maintains its original size and shape. You may thus want to resize the window once you have undocked it.Another important interface to master is the ability to dock a window within other windows.Go back to the View menu and open another window.For this example, open the Flow Graph window.Now, drag the Asset Browser window to the Flow Graph window.You will observe the docking buttons being displayed again.Use the lower, central button to dock the selected window in the lower half of the Flow Graph window.

You can also dock windows at the top and sides of other windows using the other docking buttons:

To do this drag the title bar of the Asset Browser out of the Flow Graph window and away to another docking helper within the flow graph window to move it.The final tool that is available to you in customization is Docking a Window as a Tab in Another Window.For people using only one monitor, this is almost essential!You may have noticed previously that when you move a window to another window, a new central, circular button is displayed.This anchor will allow you to place the currently selected window as a tab within another window.Drag the Asset Browser to the Flow Graph window, and on to the central dock as the tab button. You will notice that there are now two tabs at the bottom of the window, Flow Graph and the Asset Browser.You can now select each window by clicking on its corresponding tab.Keep in mind that you can undock a window by dragging its tab to another part of the screen.Once you are happy with your layout you can save this layout for easy loading later.To do this, we will access the Layout Configuration window on the Display menu under Configure Layout.Select Save Layout from the Configure Layout dialog.You will then be presented with an opportunity to name this layout. Type the name of the configuration in this window and click OK.

How it works...

The docking helpers work very similar to windows office applications, so any users of those applications may be familiar with this system.

The save layout process creates a folder under the CryENGINE3/editor directory called layouts.

In this folder, it then saves a .layout file that is essentially an .xml file. This means that it could be edited by hand if required but can also be version controlled, which means multiple presets can be shared across large teams.

The Status Bar

The Status Bar contains translation/rotation/scaling information for selected objects, editor interaction shortcuts, and camera controls.

The Console

The Console in the Sandbox editor is used to input variables. It can be visually toggled on or off by going to the View Menu and selecting View Console or by pressing the caret key (^) while the Perspective Viewport is selected.

In the editor, a full list of console variables can be accessed by double-clicking the input field on the Console to open the Console Variables window.

Search for variables with partial or complete commands. Information on individual variables can be shown by hovering the mouse over a Console Variable for a couple of seconds in the Console Variable window; text will then be displayed as a tool-tip.

The Toolbox

The Toolbox is a set of user-defined tools that contains some example shortcuts to useful editor command lines and different functionality. It can also be added to with user-specific shortcuts and/or console variables.

See also

To get right to using some of the interfaces, go to the Using the Rollup Bar recipe later in this chapterTo learn how to customize toolbars and menus, go to the next recipe

How to customize toolbars and menus

This section will now introduce you to the various toolbars and menus available in the Sandbox. With these toolbars, users can very quickly access many of the features of the Sandbox editor by using simple icons and groups of icons at the top of the interface. These toolbars can be configured to fit the preferences and needs of individual users.

Getting ready

Before adjusting the toolbars, it is important that we explore a brief summary of the default toolbars that are available in Sandbox.

The Standard ToolBar contains open, save, hold, and fetch options.

The EditMode ToolBar contains various tools for level editing. These tools include undo and redo, link and unlink, select all, object movement/scaling, axes and terrain options, as well as object selection, saving, and loading.

The Object ToolBar contains tools for object alignment. The icons are go to selected object, align selection, align object to grid, set object(s) height, align object to the surface normal, and fix and unfix selected objects.

With the Mission ToolBar, you can select the current mission, duplicate a mission, delete a mission, and reload and edit mission scripts.

The Terrain ToolBar contains shortcuts to tools within the Terrain Editor, the Terrain Texture Layer editor, and Terrain Lighting dialog.

The Dialogs ToolBar contains icons used to access extender editor such as the Materials Editor, the Character Editor, the DataBase View, and the Flow Graph Editor.

The Console ToolBarhas options specific to console game development. The buttons include sync data to console, automatically sync data to console, sync camera, options, load current level on console, and launch current level on console.

How to do it...

Now that we know about the default toolbars, let's go ahead and set up our layout:

To do this, we will need to access the ToolBar settings menu.To access it, right-click anywhere on the Icon Bar.This will display the ToolBar settings menu.Selecting a toolbar from the list will display it or hide it on the main header.

Note

Toolbars can be arranged horizontally at the top of the editor, vertically on the edges, or completely undocked from the editor.

To customize these toolbars and to create new ones simply click on the Customize option at the bottom of the ToolBar settings menu.The Customize dialog box allows users to customize preset toolbars, as well as create custom user toolbars.The Newbutton allows you to create a new custom toolbar. On pressing the button, a prompt will appear requesting a name for the new toolbar.The Rename button allows you to rename any of the custom toolbars you have created.The Delete button allows you to delete any of the custom toolbars you have created.The Reset button returns any changes made to the toolbars back to default.Click on New