Book Image

CryENGINE Game Programming with C++, C#, and Lua

Book Image

CryENGINE Game Programming with C++, C#, and Lua

Overview of this book

CryENGINE is a complete 3D game development solution that can run on multiple platforms. It is orientated around giving intuitive tools to the developer. A variety of interactive video games can be created using CryENGINE. CryENGINE is one of the most beginner-friendly engines out there to learn. If you are interested in diving into the various systems and understanding their workings in a way that is easily understood, then this book is for you. This book provides you with the knowledge to tame the powerful but hard-to-master CryENGINE. CryENGINE Game Programming with C++, C#, and Lua dives into the various systems and explains their workings in a way that can be easily understood by developers of all levels. It provides knowledge on the engine along with step-by-step exercises and detailed information on the backend implementation of the subsystems, giving you an excellent foundation to build upon when developing your own CryENGINE games. Written by developers with years of CryENGINE experience, this book breaks down the common confusion that encompasses the CryENGINE engine code, guiding you through a series of chapters aimed towards giving you the ability to create your own games in a rapid yet productive fashion. You will learn everything you need to know in order to create your own CryENGINE-powered games as well as detailed information on how to use the engine to your advantage. By teaching systems such as audio, particle effects, rendering, AI, networking, and more, we'll be exposing the most inner parts of CryENGINE that commonly confuse programmers. If you want to quickly gain the knowledge required to create your own CryENGINE game title, then this book is for you.
Table of Contents (19 chapters)
CryENGINE Game Programming with C++, C#, and Lua
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

The process of developing and maintaining games has changed very rapidly in the last few years. It has become more and more common for game developers to license third-party game engines, such as CryENGINE, in order to focus fully on the game itself.

As the first game engine to ship with a pure What You See Is What You Play (WYSIWYP) philosophy in mind, CryENGINE focuses on productivity and iteration by allowing developers to jump directly into their games, previewing changes as they happen, and not waiting for levels and assets to build.

For a programmer, CryENGINE is the ideal toolset. Development can be done in C++ using the generous API, allowing developers to jump straight into the code and write high-performing code that is not limited to obscure scripting languages. Got an idea? Fire up Visual Studio and get right to work.

What this book covers

Chapter 1, Introduction and Setup, covers getting up to speed with a brief overview of the engine, detailing its strengths, the possibilities it provides, and a step-by-step guide to set up your environment.

Chapter 2, Visual Scripting with Flowgraph, introduces you to the visual scripting tool, giving an easy passage to create game logic in an accessible visual manner.

Chapter 3, Creating and Utilizing Custom Entities, covers the entity system and how to use it to your advantage. Populate your game world with entities that range from simple physicalized objects to complex weather simulation managers.

Chapter 4, Game Rules, provides you with an in-depth look into the game rules system, giving you a standardized template for overarching game and session logic. It also teaches how to implement your own custom game modes in a variety of languages.

Chapter 5, Creating Custom Actors, details the creation of custom actor classes for both player-controlled entities and the basis of artificial intelligence.

Chapter 6, Artificial Intelligence, covers the process of creating a living and breathing world by using the built-in artificial intelligence solution.

Chapter 7, The User Interface, details the process of using Flash and Autodesk Scaleform to spice up your interface with everything from simple on-screen bitmaps to rendering interactive flash elements in the game world.

Chapter 8, Multiplayer and Networking, covers the work behind taking the engine online, and learning how to synchronize the game world across the network.

Chapter 9, Physics Programming, covers the inner workings of the physics system, and the process of creating physical interactions for everything from the largest of vehicles to the smallest particle effect.

Chapter 10, Rendering Programming, helps you to learn how the rendering system works, and how to use it to create and expand everything from render nodes to multiple viewports.

Chapter 11, Effects and Sound, details the workings of the FMod sound engine in use by CryENGINE, allowing you to implement convincing sound for your project.

Chapter 12, Debugging and Profiling, covers common ways of debugging your game, and the basics of using the console.

What you need for this book

  • CryENGINE 3 Free SDK v3.5.4

  • CryMono v0.7 for CryENGINE 3.5.4

  • Visual Studio Express 2012

  • Notepad++

  • FMod

Who this book is for

This book has been written for developers with a basic working knowledge of using CryENGINE and its Editor, and in some cases will assume the reader knows about very basic features such as loading a level in the Editor, and placing an entity. If you have never worked with CryENGINE before, we recommend either playing around with the CryENGINE Free SDK on your own, or purchasing CryENGINE 3 Game Development: Beginner's Guide, by Sean Tracy and Paul Reindell.

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 GFx element determines which Flash file should be loaded for the element."

A block of code is set as follows:

<events>
  <event name="OnBigButton" fscommand="onBigButton" desc="Triggered when a big button is pressed">    
    <param name="id" desc="Id of the button" type="string" />
  </event>
</events>
}

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: "Once started, the UI graph with the specified name will be activated, assuming it contains a UI:Action:Start node as shown:"

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 , and mention the book title via the subject of your message.

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.

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/submit-errata, 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 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 if you are having a problem with any aspect of the book, and we will do our best to address it.