CryENGINE 3 Game Development Beginner''''s Guide - Pdf 10


CryENGINE 3 Game Development
Beginner's Guide
Discover how to use the CryENGINE 3 free SDK, the
next-generaon, real-me game development tool
Sean Tracy
Paul Reindell
BIRMINGHAM - MUMBAI
CryENGINE 3 Game Development Beginner's Guide
Copyright © 2012 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system,
or transmied in any form or by any means, without the prior wrien permission of the
publisher, except in the case of brief quotaons embedded in crical arcles or reviews.
Every eort has been made in the preparaon of this book to ensure the accuracy of the
informaon presented. However, the informaon 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 informaon about all of the
companies and products menoned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this informaon.
First published: September 2012
Producon Reference: 1140912
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-84969-200-7
www.packtpub.com
Cover Image by Hazel Denise Karunungan ()
Credits

Valenna D'silva
Adi Gajjar
Producon Coordinators
Nitesh Thakur
Manu Joseph
Cover Work
Nitesh Thakur
About the Authors
Sean Tracy is Crytek's Senior Field Applicaon Engineer for the award-winning
CryENGINE. He is responsible for adapng the engine and its features to individual
licensees, as well as developing full technical and "vercal slice" demos for prospecve
and exisng clients. Describing himself as a "generalizing specialist", he also gives support
directly to CryENGINE licensees while designing and maintaining their workows, pipelines,
and development techniques.
Sean was recruited by Crytek in 2008 aer working as an electronics technician for the
Canadian military. He was recruited due to his role in 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 invited to speak at many
game-related trade shows, conferences, and seminars. He is an avid gamer with extensive
modding experience on tles, including Never Winter Nights, Baleeld, Doom, and Quake.
This is Sean's second book.
I would rst like to thank my beauful wife, Kristy, for her love and support
throughout the process of wring this book and for her ongoing support
allowing me to do what I truly enjoy for a living. I also want to thank her
for giving us a gorgeous baby girl who is the light of my life. I would also
like to thank my colleagues for taking the me to review the book with
me, as it's a pleasure to work with people with the same love for real-me
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 on the market.

parcipang in sessions relang to game producon, design, and markeng.
Michelle is the author of Corona SDK Mobile Game Development: Beginner's Guide,
which was published by Packt Publishing. She has also wrien an arcle called How
to Create a Mini-Game in Corona SDK for Game Coder Magazine. You can also view
her personal website at .
Dr Christos Gatzidis is a Senior Lecturer in Creave Technology at Bournemouth
University, UK at the School of Design, Engineering, and Compung. He has a PhD
from City University London, UK and an MSc in Computer Animaon from Teesside
University, UK; he has also previously published work in a number of academically
edited books, conferences, and journals. He is also the framework leader for the
Creave Technology collecon of degrees at Bournemouth University (which includes
the BSc in Games Technology and the MSc in Computer Games Technology courses).
Christos teaches a variety of units on these courses and uses game engines (such as
Epic's Unreal Development Kit) across all years of the undergraduate course, to cover
topics ranging from basic-level design fundamentals to more advanced scripng.
I would like to thank the authors of this book and also the great people
at Packt for producing this excellent guide in one of the most engaging
game development tools around today.
Sascha Hoba is an Engine Programmer for Crytek's award-winning CryENGINE. He is
responsible for implemenng new features, improving exisng ones, and keeping the
engine up-to-date with improvements made across all Crytek teams to increase the
overall quality of the engine. He also gives direct support to CryENGINE licensees
around the world, guiding them on how to use CryENGINE from a programmer's
perspecve and trying to nd possible soluons for special requests made by licensees.
Sascha was recruited by Crytek back in 2010 aer studying IT—Informaon
Technology—at university. He was recruited due to his experience in working with all the
revisions of CryENGINE since CryENGINE 1, back in 2004. He gained his experience as an
acve member of the FarCry and Crysis modding communies, where he always tried to
push the engine to its limits and solve individual problems on how to implement certain
features with the available CryENGINE SDK.

to your book.
Did you know that Packt oers eBook versions of every book published, with PDF and ePub
les available? You can upgrade to the eBook version at
www.PacktPub.com and as a print
book customer, you are entled to a discount on the eBook copy. Get in touch with us at
for more details.
At
www.PacktPub.com, you can also read a collecon of free technical arcles, sign up
for a range of free newsleers and receive exclusive discounts and oers on Packt books
and eBooks.

Do you need instant soluons to your IT quesons? PacktLib is Packts online digital book
library. Here, you can access, read and search across Packt's enre library of books.
Why Subscribe?
 Fully searchable across every book published by Packt
 Copy and paste, print and bookmark content
 On 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 enrely free books. Simply use your login credenals for
immediate access.

Table of Contents
Preface 1
Chapter 1: Introducing the CryENGINE 3 Free SDK 7
What is the CryENGINE? 8
Applying your vision 8
Far Cry by Crytek – rst-person shooter 9
Aion by NCso – massively online role-playing game 10
Crysis by Crytek – rst-person shooter 11

Scaling your level with Meters Per Unit 39
Calculang the real-world size of the terrain 40
Using or not using terrain 40
Time for acon - creang your own heightmap 41
Using alternave ways for creang terrain 47
Generang procedural terrain 47
Imporng a pre-made heightmap 48
Creang terrain textures 49
Time for acon - creang some basic terrain texture layers 50
Adding altude and slope 56
Adjusng the le resoluon 56
Creang vegetaon 57
Time for acon - creang some ora for your level 58
Time for acon - seng up me of day and its basic parameters 62
Adding Atmosphere 69
Summary 69
Chapter 3: Playable Levels in No Time 71
Building levels with enes and objects 71
Starng a level 72
Creang a spawn point 72
Time for acon - creang a spawn point 72
Landmarks to guide the player 74
Using roads in levels 74
Time for acon - creang a road object 74
Ulizing layers to organize level objects 79
Time for acon - creang and managing layers 79
Adding objects using the asset browser 81
Time for acon - adding brushes to the level 82
White boxing 84
White boxing using Construcve Solid Geometry (CSG) 84

Starng CryENGINE 3 with Visual Studio 122
Time for acon - starng CryENGINE with the debugger aached 122
Breakpoints, watches, and co 125
Time for acon - seng up your rst breakpoint 126
Create a new Lua enty and call C++ code to interact with it 129
Time for acon - creang a new enty 129
Time for acon - placing your enty into your level 132
How to interact with enes via Lua script 134
Time for acon - making the teleporter usable 134
Time for some real code 136
Time for acon - wring a new scriptbind funcon in C++ 136
Call the new C++ funcon from your Lua script 140
Time for acon - changing the teleporter enty to execute the C++ code 141
CryENGINE specic data types 143
Summary 145
Table of Contents
[ iv ]
Chapter 6: User Interface and HUD Creaon with Flash 147
Adobe Flash as a very powerful UI design tool 148
Time for acon – creang a new Flash asset with Adobe Flash 148
Bringing your Flash asset into CryENGINE 3 158
Time for acon – bringing your Flash asset into CryENGINE 3 158
Time for acon – making funcons, variables, and movieclips accessible in
CryENGINE 3 159
Dierent alignment modes for UI elements 162
Dynamic alignment 163
Fixed and fullscreen alignment 164
Using the UI Emulator to display and test your asset 164
Time for acon – starng Sandbox and tesng your UIElement 164
Creang a new UI Acon for the new HUD 167

Creang destrucble objects 205
Time for acon - making your object destrucble 205
Specifying physics and render dynamics with user dened properes 210
Breaking two-dimensional assets 210
Designing breakables with constraints 211
Using character assets 213
Following the character creaon pipeline 213
Creang your own characters 213
Time for acon - creang your own skinned character 214
Creang a character LOD (Level of Detail) 221
Bone aachments 222
Creang animaons for your character 223
Time for acon - creang animaon for a skinned character 223
.chrparams wildcard mapping 227
Creang animaon for rigid body assets 228
Time for acon - creang animaon using rigid body data 229
Summary 232
Chapter 8: Creang Real-me Cutscenes and Cinemac Events 233
Discovering the Track View editor 234
Creang a new Track View sequence 234
Time for acon – creang a new sequence 235
Adding tracks to the director node 238
Adjusng Sequence Properes 238
Animang a camera in Track View 238
Time for acon – animang a camera 239
FOV 243
Playback speed 243
Curve Editor 243
Triggering a sequence using Flow Graph 243
Time for acon – triggering a sequence 244

Geng your rst sound into the CryENGINE 266
Time for acon - creang an ambient sound event 266
Leveraging advanced parameters of ambient sounds 273
Time for acon - nesng ambient sounds and using other parameters
for sound events 273
Randomizing sounds 276
Time for acon - creang random sounds 277
Reverb volumes 279
Time for acon - create your own reverb preset 280
Adding sounds to parcle eects 283
Time for acon - add a sound to a parcle eect 283
Using the three dierent sound control overme funcons 285
Sound events and weapons 286
Time for acon - add sound to a weapon 286
Weapon sound workow ps 289
Summary 290
Chapter 10: Preparing to Share Your Content 291
Proling performance in Sandbox 292
Proling with display info 292
Time for acon – enabling and reading display info 292
Understanding draw calls 294
Visualizing triangle count 295
Table of Contents
[ vii ]
Seng budgets 295
Saving a level's stascs 295
Time for acon – Save Level Stascs 296
Viewing textures and render targets in the Textures tab 300
Viewing physical triangle count and physics memory footprints 300
Reading the Detailed Dependencies tab 300

hobbyist developers alike have turned to middleware game engines, such as the CryENGINE,
to save them me, money, and frustraon, while manifesng their ideas into releasable games.
The CryENGINE is a comfortable t for most developers, because it allows users to create
their content quickly, iterate on that content, and to nalize it without leaving the comfort
of the CryENGINE's Sandbox Editor. I oen refer to the CryENGINE as a force mulplier,
since its tools make it possible for smaller teams to accomplish what used to take an
enre development studio, full of people. This book is an introducon to the CryENGINE
technology, and is comprised of achievable, small-scale examples, which can be applied
in almost any game genre. This book is not designed to cover exhausvely every feature
and funcon in the CryENGINE, but rather is designed to give you the knowledge and tools
needed to get you of to a smooth and painless start when making your own games with the
CryENGINE 3.
What this book covers
Chapter 1, Introducing the CryENGINE 3 Free SDK, covers the beginning to developing
your own games of any scale by learning to harness the power of the award-winning
CryENGINE® 3 game engine. In this chapter, you will learn to navigate and interface
within the CryENGINE® 3 Sandbox, the tool used to create AAA games, such as Crysis
1 and 2, as well as the soon to be released Crysis 3.
Preface
[ 2 ]
Chapter 2, Breaking Ground with Sandbox, covers building your game worlds in real me
with CryENGINE® 3 Sandbox, as we share insights into some of the tools and features
useable right out of the box. In this chapter, you will learn how to create your own worlds
by following straighorward examples that use some of the important fundamental features
available to developers of the CryENGINE®. This includes tools and techniques related to
sculpng, molding the terrain, and placing vegetaon.
Chapter 3, Playable Levels in No Time, covers more advanced level design tools, which
are discussed in the chapter, as well as simple modeling techniques using the integrated
CryENGINE solids system.
Chapter 4, I'm a Scripter, Not a Coder, covers learning the method of visual scripng used

which include Photoshop and 3D Studio Max. Though not a fundamental requirement,
having some basic knowledge of real-me graphics soware and, consequently, the
terminology used, will make the goal of these tutorials more clear. The freely available
version of the CryENGINE® 3 has been used for all the examples in this book, and Chapter
1, Introducing the CryENGINE 3 Free SDK will guide the reader to download and install the
CryENGINE® 3 Free SDK.
Conventions
In this book, you will nd several headings appearing frequently.
To give clear instrucons of how to complete a procedure or task, we use:
Time for action – heading
1. Acon 1
2. Acon 2
3. Acon 3
Instrucons oen need some extra explanaon so that they make sense, so they are
followed with:
What just happened?
This heading explains the working of tasks or instrucons that you have just completed.
You will also nd some other learning aids in the book, including:
Preface
[ 4 ]
Pop quiz – heading
These are short mulple choice quesons intended to help you test your own understanding
Have a go hero – heading
These set praccal challenges and give you ideas for experimenng with what you have
learned.
You will also nd a number of styles of text that disnguish between dierent kinds of
informaon. Here are some examples of these styles, and an explanaon of their meaning.
Code words in text are shown as follows: " If you now navigate to the level directory using
Windows Explorer, you will noce a new folder called
Layers. Inside that folder, you will

e-mailed directly to you.
Downloading the color images of this book
We also provide you a PDF le that has color images of the screenshots/diagrams used
in this book. The color images will help you beer understand the changes in the output.
You can download this le from
/>downloads/2007_graphics.pdf
.
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do
happen. If you nd 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 frustraon and help us improve subsequent versions of this book.
If you nd any errata, please report them by vising />support
, selecng your book, clicking on the errata submission form link, and entering
the details of your errata. Once your errata are veried, your submission will be accepted
and the errata will be uploaded to our website, or added to any list of exisng errata, under
the Errata secon of that tle.
Preface
[ 6 ]
Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt,
we take the protecon 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 locaon
address or website name immediately so that we can pursue a remedy.
Please contact us at
with a link to the suspected pirated material.
We appreciate your help in protecng our authors, and our ability to bring you
valuable content.
Questions
You can contact us at if you are having a problem with any


Nhờ tải bản gốc
Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status