This video features an interview with Michael Dunsky, author of "Mastering C++ Game Animation Programming." Dunsky discusses his new book, a follow-up to "C++ Game Animation Programming," aimed at experienced C++ developers looking to delve into advanced game animation techniques. The interview covers the book's structure, key topics like using the Open Asset Import Library for 3D model loading, GPU-accelerated animation via compute shaders, visual selection and UI creation with ImGui, advanced camera handling, robust configuration management, collision detection (quadtree, bounding spheres), inverse kinematics, behavior trees, and A* navigation. Dunsky emphasizes the use of modern C++ (C++17 and newer), cross-platform development (Windows, Linux, OpenGL, Vulkan), and demonstrates a live game-engine-like application developed throughout the book, showcasing features like dynamic collision detection, visual model manipulation, pathfinding, and a node-based behavior editor. The author also shares his background, insights on C++ best practices, and details about the availability of a demo and discount for the book.
Mastering C++ Game Animation: An Interview with Michael Dunsky
0:00 Introduction: Jens Weller interviews Michael Dunsky, author of "Mastering C++ Game Animation Programming." Dunsky introduces himself as an electronics engineer turned game developer and console porting programmer, with over 20 years of experience.
1:18 Book Overview: This is Dunsky's second book, intended as an advanced continuation of his first, "C++ Game Animation Programming." While the first book starts from scratch (empty window, basic renderer), the new book builds upon existing knowledge, starting with loading a glTF model and diving into complex animation.
2:33 Open Asset Import Library (Assimp): The book heavily utilizes Assimp to simplify the loading of various 3D model formats, freeing developers from handling specific file structures.
3:27 GPU-Accelerated Animations: A core concept is offloading animation calculations from the CPU to the GPU using compute shaders. Dunsky highlights using the GPU as storage for pre-calculated animations to achieve faster lookups, emphasizing the GPU as a "friend" for parallel tasks.
4:46 Visual Selection and UI: The book details how to implement visual selection of 3D models in the scene, allowing direct manipulation (move, rotate, scale) via mouse input, rather than relying solely on UI buttons. ImGui is used for the user interface.
6:28 Technology Stack & Portability: The code uses GLFW for window management, SDL for audio (in later chapters), and GLM for mathematical operations. It is designed for cross-platform compatibility, running on Linux and Windows, and supports both OpenGL and Vulkan APIs, along with MSVC, Clang, and GCC compilers.
7:24 Animation Editor Features: The book guides the reader in transforming a basic model viewer into a full animation editor, incorporating essential features like a comprehensive undo/redo system and separate edit/simulation modes for better workflow and visualization.
9:46 Configuration Management: Emphasizes the importance of saving and loading the scene's configuration, enabling users to persist their work, close the program, and resume building their virtual worlds piece by piece.
10:54 Camera Systems: Covers the implementation of various camera types, including free-look, third-person, and first-person cameras, with the latter able to be attached to specific model bones for realistic shaking effects.
12:05 Advanced Animation Techniques: Explores optimizing animations using GPU lookup tables by pre-calculating and storing animation data on the GPU, balancing speed and memory usage in modern GPUs.
12:57 Collision Detection: Provides a detailed explanation of a two-tiered collision detection system: a 2D quadtree for broad-phase detection (Axis-Aligned Bounding Boxes - AABBs) and bounding spheres for narrow-phase detection on individual model bones. The video shows visual debugging of collisions.
14:39 Character Realism: Discusses techniques for enhancing character realism through advanced animation blending, head and face animations (e.g., smiling, anger), and behavior controls.
15:35 Modern C++ Practices: Dunsky highlights the use of modern C++ (C++17 or newer, tested up to C++26), advocating for STL functions (e.g., std::copy, std::find_if) and avoiding older, less robust practices like macros and defines for cleaner, future-proof code.
16:04 Level Interaction and Navigation: The book covers loading real game maps, implementing inverse kinematics to ensure characters' feet correctly interact with terrain (e.g., on slopes), and utilizing the A* algorithm for pathfinding in complex environments.
17:32 Creating Immersive Worlds: The book touches on adding immersive elements like sound (music, footsteps) and dynamic visual effects (time of day changes, fog) to enhance the virtual world experience.
19:50 Target Audience & Learning: The book is aimed at experienced C++ developers, game programmers, and character animators who have basic animation knowledge and are curious about advanced techniques. It serves as a "playground" with practical sessions for hands-on learning and code extension.
23:30 Author's Background: Michael Dunsky's primary role is a gameplay programmer, currently working with Unreal Engine, and C++ has been his "tool of choice" and a hobby since 1998.
24:51 Known Errors: Dunsky reports only two minor UI corrections and a potential minor issue with animation blending, noting the code is generally stable.
25:59 Improving C++ Code: The book serves as a practical example of writing better C++ code by demonstrating the use of modern features like smart pointers and platform-independent coding, leveraging CMake for build management.
28:01 Live Demo Begins: Michael Dunsky presents a live demonstration of the game-engine-like application developed in the book, showcasing:
28:21 Dynamic Collision Visualization: Visualizing AABB bounding boxes and bounding spheres for characters, showing red indicators upon collision.
29:11 Visual Model Manipulation: Directly selecting, moving, rotating, and scaling instances with the mouse, including an undo (Ctrl+Z) feature.
30:02 Octree & Debug Views: Demonstrating the octree structure for level geometry and various debug views (wireframe, normals).
31:46 Instance Cloning: Quickly creating multiple copies of characters.
32:04 Performance & IK: Discussing the system's ability to run hundreds of animated instances at 60-75 FPS, and showcasing inverse kinematics for realistic foot placement.
33:42 ImGui Performance Timers: Using ImGui to display real-time performance metrics for different systems, identifying potential bottlenecks.
34:10 Not a Level Editor: Clarifying that the application loads existing levels rather than being a full-fledged level editor.
35:09 Scope and Future Books: Dunsky explains that topics like physics, rigging, and model creation were omitted from the book due to page limits, suggesting they could be subjects for future books.
43:33 Node-Based Behavior Editor: Demonstrates a visual, node-based editor (built using ImNodes) for defining complex character behaviors with random values and weights, and showcases additive animations like head movements (nodding, smiling, angry).
45:30 Pathfinding Demo (Continued): Shows characters following dynamically recalculated A* paths to movable targets, with the path drawn visually.
47:27 Demo Availability & Portability: An executable demo of the final chapter's code is available for download on the Packt website. The code is highly portable, running on Windows and Linux (including Raspberry Pi 400 with Vulkan) across various compilers.
48:00 Discount Code: Mentions that discount codes for purchasing the book are available.