Skip to content

PacktPublishing/Mastering-Cpp-Game-Animation-Programming

Repository files navigation

Mastering C++ Game Animation Programming, First Edition

This is the code repository for Mastering C++ Game Animation Programming, First Edition, published by Packt.

Enhance your skills with advanced game animation techniques in C++, OpenGL, and Vulkan

      Free PDF       Graphic Bundle       Amazon      

About the book

Mastering C++ Game Animation Programming, First Edition

With two decades of programming experience across multiple languages and platforms, expert game developer and console porting programmer Michael Dunsky guides you through the intricacies of character animation programming. This book tackles the common challenges developers face in creating sophisticated, efficient, and visually appealing character animations. You’ll learn how to leverage the Open Asset Import Library for easy 3D model loading and optimize your 3D engine by offloading computations from the CPU to the GPU. The book covers visual selection, extended camera handling, and separating your application into edit and simulation modes. You’ll also master configuration storage to progressively build your virtual world piece by piece. As you develop your engine-like application, you’ll implement collision detection, inverse kinematics, and expert techniques to bring your characters to life with realistic visuals and fluid movement. For more advanced animation and character behavior controls, you’ll design truly immersive and responsive NPCs, load real game maps, and use navigation algorithms, enabling the instances to roam freely in complex environments. By the end of this book, you’ll be skilled at designing interactive virtual worlds inhabited by lifelike NPCs that exhibit natural, context-aware behaviors.

Key Learnings

  • Master the basics of the Open Asset Import Library
  • Animate thousands of game characters
  • Extend ImGui with more advanced control types
  • Implement simple configuration file handling
  • Explore collision detection between 3D models and world objects
  • Combine inverse kinematics and collision detection
  • Work with state machines, behavior trees, and interactive NPC behaviors
  • Implement navigation for NPC movement in unknown terrains

Chapters

Unity Cookbook, Fifth Edition

  1. Working with Open Asset Import Library
  2. Moving Animation Calculations from CPU to GPU
  3. Adding a Visual Selection
  4. Enhancing Application Handling
  5. Saving and Loading the Configuration
  6. Extending Camera Handling
  7. Enhancing Animation Controls
  8. An Introduction to Collision Detection
  9. Adding Behavior and Interaction
  10. Advanced Animation Blending
  11. Loading a Game Map
  12. Advanced Collision Detection
  13. Adding Simple Navigation
  14. Creating Immersive Interactive Worlds

Instructions and Navigations

All of the code is organized into folders.

Software and Hardware List

Chapter Software required OS required
1-14 Visual Studio 2022 or Eclipse 2023-06 (or newer) Windows 10 (or newer), or Linux (i.e. Ubuntu 22.04, Debian 12, or newer)

Get to know the Author

Michael Dunsky is an electronics engineer, console porting programmer, and game developer with more than 20 years of programming experience. He started with BASIC at the young age of 14 and expanded his portfolio over the years to include assembly language, C, C++, Java, Python, VHDL, OpenGL, GLSL, and Vulkan. During his career, he also gained extensive knowledge of Linux, virtual machines, server operation, and infra-structure automation. Michael holds a Master of Science degree in Computer Sci-ence from the FernUniversität in Hagen with a focus on computer graphics, parallel programming, and software systems.

Other Related Books

Author Notes & Recent Fixes

The following section contains updates within the text of the book.

Chapter 1

'Open Asset Importer Library' Git version fix

Unfortinately, the master branch of the Assimmp GitHub Repository includes now changes that require an installed DirecX 9 SDK, even for the initial CMake configuration run. Switching off the tools by adjusting ASSIMP_BUILD_ASSIMP_TOOLS to OFF in the new file CMakePresets.json solves the SDK error, but configuring CMake via UI is no longer possible with the new file in place.

To fix the problem, checking out a tagged/relesed version is required. As a 'special hurdle', checking out a tag can NOT be done via a menu in Visual Studio 2022, one has to use the command line:

  • Right-click the assimp project in the Solution Explorer - Folder View window
  • Select Open in Terminal to open a 'Developer PowerShell'
  • In the PowerShell window, checkout the latest release (as of today):
git checkout v6.0.2

Then, right-click CMakeLists.txt, select Delete Cache and Reconfigure to re-run CMake.

If the cache deletion option is not available, you have to close Visual Studio and remove the following files and folders from the assimp project folder on disk if they exists (use right-click on project, then Open Folder in File Explorer to open an Explorer window):

  • .cmake
  • .vs
  • out
  • build.ninja
  • VSInheritedEnvironments.txt

After restarting Visual Studio, the initial CMake run should succeed and you can continue configuring the asset importer library.

Building all Examples at once

Building the code by using the top-level CMakeLists.txt file will fail for the code in Chapter 14 if the two libraries SDL and SDL_mixer are not installed. Please follow the instructions in section Installing SDL and SDL_mixer on Windows on page 459 and/or Installing SDL and SDL_mixer on Linux on page 460 before building the code for all chapters.

About

Mastering C++ Game Animation Programming by Packt Publishing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •