O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mastering C++ Game Development

Book Description

High-end game development with advanced C++ 17 programming techniques

About This Book

  • Make the best use of object-oriented capabilities of C++ to develop high-end games
  • Create reusable C++ libraries and editor tools for your game
  • Series of example projects demonstrating advanced techniques to build games of any genre

Who This Book Is For

This book is intended for aspiring game developers who are proficient in C++ 17 programming and are interested in developing professional games with C++.17

What You Will Learn

  • Work and communicate effectively in the modern games industry
  • Develop simple and advanced gameplay systems
  • How to leverage the standard core C++ libraries
  • Use modern real-time rendering techniques to achieve immersive 3D visuals
  • Achieve a narrative-driven game experience using a variety of data management techniques
  • Implement scripting using LUA
  • Learn AI algorithms and concepts for handling motion, behavior, and decision making
  • Implementation of the OpenGL, Bullet Physics, GLM, SteamVR and other common libraries

In Detail

Although many languages are now being used to develop games, C++ remains the standard for professional development. The majority of professional libraries and toolchains are still built using C++. The primary goal of this book is to teach you how to harness the power of the language and provide you with the ability to build high-quality games.

To begin, you will be presented with, an overview of popular development methodologies, and a short guide to updated features of the C++ 17 standard. You will learn how to leverage existing libraries such as OpenGL and the STL (standard library) to build complex systems. Throughout the journey, you will also build a set of C++ 17 compatible libraries that can be reused in your own development projects. In the last half of the book, you will work with demos designed to introduce you to advanced rendering techniques, interactive physics, advanced AI techniques, and even multiplayer game concerns with modern networks.

Style and approach

This guide is packed with game demos offering powerful techniques to create high-end games with C++ 17

Table of Contents

  1. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  2. C++ for Game Development
    1. The conventions used in the book
    2. An overview of advanced C++ concepts
      1. Working with namespaces
    3. Inheritance and polymorphism
    4. Pointers and referencing
      1. unique_ptr and shared_ptr
    5. const correctness
    6. Memory management
    7. Dealing with errors
    8. Working with types and containers
      1. STL generic containers
      2. Vector
      3. List
      4. Map
    9. Templating
      1. Class templates
      2. Function templates
      3. Variable templates
    10. Type inference and when to use it
    11. Game programming patterns
      1. Working with loops
      2. State machines
      3. Event listeners
    12. Summary
  3. Understanding Libraries
    1. Why do we use libraries?
    2. Library build types
      1. Statically linked libraries
        1. On Windows
        2. On macOS X
      2. Dynamically linked libraries
        1. Compiling and linking dynamic libraries on Windows
        2. Compiling and linking dynamic libraries On macOS X
    3. Header only or source libraries
    4. Building a custom shareable library
      1. Setup and structure
        1. Creating a new project on Windows
        2. Creating a new project on macOS X
        3. Creating source files on Windows
        4. Creating source files on macOS X
    5. Building a custom library
      1. On Windows
      2. On macOS X
    6. Building dynamic library on Windows using .def file
      1. Using only .def file
      2. Setting linker options
    7. Sharing and consuming libraries
    8. Summary
  4. Building a Strong Foundation
    1. Building helper classes
    2. Encapsulation with managers
    3. Creating interfaces
    4. Summary
  5. Building the Asset Pipeline
    1. What is an asset pipeline?
    2. Handling audio
    3. Working with textures
      1. Resource manager
      2. Texture and TextureCache
    4. The ImageLoader class
    5. Importing models – meshes
    6. Summary
  6. Building Gameplay Systems
    1. Understanding states
      1. Working with cameras
    2. Working with physics
      1. Point in AABB
        1. AABB to AABB
      2. Sphere to sphere
      3. Implementing the Bullet physics library.
    3. Summary
  7. Creating a Graphical User Interface
    1. Coordinate systems and positioning
    2. Adding control logic
    3. Rendering the GUI
    4. Summary
  8. Advanced Rendering
    1. Introduction to shaders
      1. Shader languages
      2. Building a shader program infrastructure
      3. Working with shader data
    2. Lighting effects
      1. Per-vertex diffuse
      2. Per-vertex ambient, diffuse, and specular
    3. Per-fragment Phong interpolation
    4. Using Shaders to create effects
      1. Discarding fragments
      2. Generating particles
    5. Summary
  9. Advanced Gameplay Systems
    1. Implementing a scripting language
      1. Why a scripting language
    2. Introducing LUA
    3. Implementing LUA
    4. Building a dialog system
    5. Constructing the C++ infrastructure
    6. Creating a dialog tree script
    7. Scripting quests
      1. In engine support
      2. Engine/script bridge
      3. Script-based system
    8. Summary
  10. Artificial Intelligence
    1. What is game AI?
      1. Defining game AI
      2. Conversations
      3. Competitive opponents
      4. Motion and pathfinding
      5. What game AI is not
    2. Making decisions
      1. AI state machines
      2. Decision trees
      3. Feedback loops
    3. Motion and pathfinding techniques
      1. Motion algorithms and techniques
        1. Steering behaviors
        2. Seek
        3. Flee
        4. Pursuit
        5. Evasion
        6. Wandering
      2. Search algorithms and pathfinding techniques
        1. Breadth first
        2. Dijkstra's algorithm
        3. A*
    4. Summary
  11. Multiplayer
    1. Introduction to multiplayer in games
      1. Local multiplayer
      2. Single-screen multiplayer
      3. Local area network
      4. Online multiplayer
    2. Network design and protocol development
      1. Network topology
        1. Peer-to-peer
        2. Client/server
      2. Understanding the protocols
        1. TCP/IP model
        2. UDP – User Datagram Protocol
        3. TCP – Transmission Control Protocol
      3. Introducing sockets
        1. Stream sockets
        2. Datagram sockets
    3. Creating a simple TCP server
      1. Windows
      2. macOS
    4. Summary
  12. Virtual Reality
    1. Quick VR overview
    2. Current VR hardware
      1. Oculus Rift CV1
      2. HTC Vive
      3. Open Source Virtual Reality (OSVR) development kit
      4. Sony PlayStation VR
      5. Windows Mixed Reality headsets
    3. VR rendering concepts
      1. Working with frusta
      2. Increasing rendering performance
    4. Headset SDKs
    5. Implementing VR support
      1. Verifying HMD
      2. Rendering
    6. Summary
  13. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think