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

CryENGINE Game Programming with C++, C#, and Lua
eBook: $26.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print + free eBook + free PacktLib access to the book: $71.98    Print cover: $44.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • Dive into the various CryENGINE subsystems to quickly learn how to master the engine
  • Create your very own game using C++, C#, or Lua in CryENGINE
  • Understand the structure and design of the engine

Book Details

Language : English
Paperback : 276 pages [ 235mm x 191mm ]
Release Date : November 2013
ISBN : 1849695903
ISBN 13 : 9781849695909
Author(s) : Filip Lundgren, Ruan Pearce-Authers
Topics and Technologies : All Books, Other

Table of Contents

Chapter 1: Introduction and Setup
Chapter 2: Visual Scripting with Flowgraph
Chapter 3: Creating and Utilizing Custom Entities
Chapter 4: Game Rules
Chapter 5: Creating Custom Actors
Chapter 6: Artificial Intelligence
Chapter 7: The User Interface
Chapter 8: Multiplayer and Networking
Chapter 9: Physics Programming
Chapter 10: Rendering Programming
Chapter 11: Effects and Sound
Chapter 12: Debugging and Profiling
  • Chapter 1: Introduction and Setup
    • Installing Visual Studio Express 2012
    • Choosing your CryENGINE installation type
    • Downloading the book's CryENGINE sample installation
      • What just happened?
      • Verifying that the build is functional
      • Integrating CryMono (C# support)
        • Compiling the CryMono project
        • Loading and initializing CryMono via the CryGame.dll library
    • Registering your CryDev account
      • What just happened?
    • Running the sample application
      • Editor
        • Starting the Editor
      • Launcher
        • Starting the Launcher
      • Dedicated server
    • Compiling the CryGame project (C++)
      • What just happened?
      • The CE Game Programming Sample solution breakdown
        • CryGame
        • CryAction
        • CryCommon
    • The CryENGINE folder structure
      • PAK files
        • File query priority
        • Attaching the debugger
      • What just happened?
    • Summary
    • Chapter 2: Visual Scripting with Flowgraph
      • Concept of flowgraphs
      • Opening the Flowgraph Editor
      • A tour of the Flowgraph Editor
        • Components
          • Terminology
          • Component categories
        • Flowgraph types
          • AI Actions
          • UI Actions
          • Material FX
          • FG Modules
          • Entities
          • Prefabs
      • Creating a flowgraph
        • The flowgraph entity
          • Spawning FlowgraphEntity
        • Attaching a new flowgraph
        • Adding nodes into flowgraphs
        • Input and output ports
          • Port types
        • Target entities
        • Linking flownodes
        • Testing our flowgraph
      • The stock flownode overview
        • Building a clock
        • Listening for player input
        • Executing on a loop
      • Flowgraph modules
        • Creating a module
        • Calling a module
        • Module parameters/ports
      • Custom flownodes
      • Creating a custom node in C++
        • Organizing nodes
        • Creating a new node file
          • Breaking down of code
        • The node functions overview
        • Implementing GetConfiguration
          • Creating ports
          • Assigning arrays to the node configuration
        • Implementing ProcessEvent
      • Creating a custom node in C#
        • Adding inputs
        • Adding outputs
        • Implementing Activate
        • Target entities
      • Summary
      • Chapter 3: Creating and Utilizing Custom Entities
        • Introducing the entity system
          • Entity classes
          • Entities
            • entityId
            • EntityGUID
          • Game objects
          • The entity pool system
        • Creating a custom entity
          • Creating an entity using Lua
            • Common Lua entity callbacks
          • Creating an entity in C#
            • Adding Editor properties
          • Creating an entity in C++
            • Creating a custom entity class
        • Entity flownodes
          • Creating an entity flownode in Lua
          • Creating an entity flownode using C#
          • Creating an entity flownode in C++
            • Registering the entity node
            • The final code
        • Game objects
          • Game object extensions
            • Creating a game object extension in C++
            • Activating our extension
        • Summary
        • Chapter 4: Game Rules
          • Introduction to game rules
            • IGameRules interface – game rules
            • Scripting – game modes
            • Loading a level
          • Implementing the game rules interface
            • Registering the game object extension
            • Creating custom game modes
          • Scripting
            • Lua scripting
              • Invoking methods
              • Invoking methods with parameters
              • Getting values returned from Lua
              • Getting table values
            • CryMono scripting
              • Calling methods
              • Return values
              • Properties
              • Fields
          • Creating a basic game mode in C#
            • Defining our intention
            • Creating the actor
            • Spawning the actor
            • Handling disconnections
            • Assigning the player to a team
            • Implementing Headquarters
              • Adding the end game event
              • Creating the Headquarters entity
            • Populating the level
          • Summary
          • Chapter 5: Creating Custom Actors
            • Introducing the actor system
              • Channel identifiers
              • Actor spawning
                • Removing actors
              • The view system
                • Linking views to game objects
            • Creating custom actors
              • Creating actors in C#
                • The CryMono class hierarchy
                • Using native and CryMono actors alongside each other
              • Creating actors in C++
                • Registering actors
            • Camera handling
              • Implementing IGameObjectView
              • Creating a top-down camera
                • View rotation
            • Player inputs
              • The hardware mouse
              • Action maps
                • Listening for action map events
                • Enabling action map sections
            • Animated characters
              • Movement requests
              • Adding a movement request
            • The Mannequin animation system
              • The Mannequin Editor
                • Preview setup
                • Creating contexts
                • Creating fragments
                • Creating and using tags
                • Saving
              • Starting fragments
                • Acquiring the fragment identifier
                • Queuing the fragment
              • Setting tags
                • Forcing actions into requerying options
              • Debugging Mannequin
              • Setting up Mannequin for a custom entity
                • Initializing Mannequin
                • Loading the controller definition
                • Setting the active context
            • Summary
            • Chapter 6: Artificial Intelligence
              • The Artificial Intelligence (AI) system
                • Scripting
                • AI actors
                • Goal pipes
                  • Creating custom pipes
                  • Selecting pipes
                • Signals
                • AI behaviors
                  • Sample
                • IAIObject
              • Creating custom AI
                • Registering an AI actor implementation
                  • In C#
                  • In C++
                • Creating the AI entity definition
                • AI behaviors and characters
                  • Understanding and using behavior selection trees
                  • Character
                  • NavigationType
                • Creating custom behaviors
                  • Listening to signals
              • AI base definition breakdown
                • The AISample_x table
                  • The Properties table
                  • The AIMovementAbility table
                • The CreateAI function
                • The RegisterAI function
              • Summary
              • Chapter 7: The User Interface
                • Flash movie clips and UI graphs
                  • Elements
                    • XML Breakdown
                  • Actions
                • Creating a main menu
                  • Creating menu elements
                  • Exposing ActionScript assets
                    • Functions
                    • Events
                    • Variables
                    • Arrays
                  • Exposing MovieClip instances to flowgraph
                  • Creating the UI actions
                    • Creating the state control graph
                    • Creating the MainMenu action
                    • Adding buttons
                  • End result
                • Engine ActionScript callbacks
                • Creating UI game event systems
                  • Implementing IUIGameEventSystem
                  • Receiving events
                  • Dispatching events
                    • Dispatching the event
                • Summary
                • Chapter 8: Multiplayer and Networking
                  • The networking system
                    • Network identifiers
                    • Net channels
                      • Net nubs
                  • Setting up a multiplayer game
                    • Starting the server
                      • Dedicated server
                      • Launcher
                    • Connecting to a server via the console
                    • Debugging networked games
                  • Networking using game object extensions
                    • Remote Method Invocation (RMI)
                      • RMI structure
                      • RMI example
                    • Network aspect serialization
                      • Aspects
                    • Compression policies
                      • Creating a new compression policy
                  • Exposing Lua entities to the network
                    • Net.Expose
                      • Function implementation
                      • Invoking RMIs
                    • Binding our entity to the network
                  • Summary
                  • Chapter 9: Physics Programming
                    • CryPhysics
                      • Physicalized entity types
                      • Introducing physical entity identifiers
                        • Drawing entity proxies
                    • Physical entity actions, parameters, and status
                      • Parameters
                      • Actions
                      • Status
                    • Physicalized entity type details
                      • Common parameters
                      • Common actions
                      • Common statuses
                    • Static
                    • Rigid
                    • Wheeled vehicle
                      • Unique parameters
                      • Unique statuses
                      • Unique actions
                    • Living
                      • Unique parameters
                      • Unique statuses
                      • Unique actions
                    • Particle
                      • Unique parameters
                    • Articulated
                      • Unique parameters
                    • Rope
                      • Unique parameters
                    • Soft
                      • Unique parameters
                      • Unique actions
                  • Ray world intersections
                    • The ray_hit struct
                      • Commonly used member variables
                    • Origin and direction
                    • Object types and ray flags
                      • Object types
                      • Ray flags
                    • Allowing multiple ray hits
                  • Creating a physicalized entity
                    • In C++
                    • In C#
                  • Simulating explosions
                  • Summary
                    • Chapter 10: Rendering Programming
                      • The renderer details
                        • Shaders
                          • Shader permutations
                          • Shader cache
                      • Render nodes
                      • Rendering breakdown
                        • Pre update
                        • Post update
                      • Rendering new viewports using render contexts
                        • Rendering
                          • Using the I3DEngine::RenderWorld function
                      • Shaders
                        • The shader description
                        • Texture slots
                        • Shader flags
                          • Material flags
                          • Engine flags
                          • Runtime flags
                        • Samplers
                          • Using texture slots with samplers
                        • Obtaining a texture
                      • Manipulating static objects at runtime
                      • Modifying materials at runtime
                        • Cloning a material
                        • Material parameters
                        • Shader parameters
                        • Example – Dynamic alpha-test for vegetation
                      • Summary
                      • Chapter 11: Effects and Sound
                        • Introducing effects
                          • Material effects
                            • Surface types
                          • Particle effects
                          • Sound effects
                            • FMOD Designer
                        • Creating and triggering material effects
                          • Automated playback based on physical interactions
                            • Adding new surface types
                            • Effect definitions
                          • Triggering custom events
                        • Animation-based events and effects
                        • Spawning particle emitters
                        • Exporting sounds by using FMod
                          • Adding sounds to the project
                        • Playing sounds
                          • Using SoundSpots
                          • Programmatically playing sound
                            • Sound flags
                            • Sound semantics
                        • Summary
                        • Chapter 12: Debugging and Profiling
                          • Debugging the game logic
                            • Logging to the console and files
                              • Log verbosity
                              • Global log functions
                            • The persistent debug
                              • C++
                              • C#
                            • CryAssert
                          • Profiling
                            • Profile usages
                            • Profiling in C++
                            • Profiling in C#
                          • The console
                            • Console variables
                              • Registering a CVar
                              • Flags
                              • Console variable groups
                            • Console commands
                              • Registering a console command in C#
                              • Creating a Console Command in C++
                          • Summary

                          Filip Lundgren

                          Filip Lundgren is a Technical Director at Poppermost Production AB where he works on SNOW, the first free-to-play open-world skiing title. Filip has been working with CryENGINE since 2007 with the release of Crysis 1 SDK, and has developed community tools such as CryMono and the CryENGINE toolbox.

                          Ruan Pearce-Authers

                          Ruan Pearce-Authers is a game programmer currently working for Crytek GmbH. In 2009, he began managing Crytek's development community, and providing technical support for CryENGINE users. Prior to this, he was active in the Crysis modding community himself, and followed this up by producing sample projects and additional tools for the Free SDK. He co-developed the CryMono engine extension to bring support for .NET to the CryENGINE, and the Tanks game sample written exclusively in C#. At present, Ruan works as part of the development team for Crytek's award-winning entrance, into the free-to-play market, Warface, in Frankfurt.

                          Submit Errata

                          Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.

                          Sample chapters

                          You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                          Frequently bought together

                          CryENGINE Game Programming with C++, C#, and Lua +    Oracle SOA Suite 11g R1 Developer's Guide =
                          50% Off
                          the second eBook
                          Price for both: $44.10

                          Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                          What you will learn from this book

                          • Make and modify Flowgraph nodes to give your visual scripting a clear advantage
                          • Utilize custom entities, from simple physicalized objects to complex weather simulation managers
                          • Control the flow of the game in real-time by creating game rules and modes
                          • Create custom actors, in order to create unique elements controllable by human players
                          • Use the Artificial Intelligence system to your advantage with custom AI units
                          • Design custom User Interfaces to give your player a way to navigate the game’s menus and HUDs
                          • Implement multiplayer and networking elements for your game, allowing several players to share the experience with each other
                          • Master game physics and how to create your own physicalized objects that can interact with the game world
                          • Understand the process of using and manipulating the CryENGINE renderer to your advantage, including custom shader authoring
                          • Bring your game to life by introducing effects such as particles and sound
                          • Debug and profile your game code to get the most out of the computers running your game
                          • Implement stock GameDll systems such as vehicles and weapons

                          In Detail

                          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.


                          This book provides you with step-by-step exercises covering the various systems of CryENGINE and comprehensively explains their workings in a way that can be easily understood by readers of any skill level to help you develop your very own CryENGINE games.

                          Who this book is for

                          This book is intended for developers looking to harness the power of CryENGINE, providing a good grounding in how to use the engine to its full potential. The book assumes basic knowledge of the engine and its editor in non-programming areas.

                          Code Download and Errata
                          Packt Anytime, Anywhere
                          Register Books
                          Print Upgrades
                          eBook Downloads
                          Video Support
                          Contact Us
                          Awards Voting Nominations Previous Winners
                          Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                          Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software