Practical C++ Game Programming with Data Structures and Algorithms

Write high-performance code and solve game development challenges with expert-led C++ solutions
Regular price
£27.00
Sale price
£27.00
Regular price
£27.00
Tax included.
Creating responsive, intelligent games takes more than just following engine tutorials. It requires solving real development challenges with practical, efficient code. This book bridges theory and practice with proven algorithms and techniques grounded in real-world production needs, emphasizing clean, portable C++ implementations. Starting with raylib and the custom Knight engine layer, you’ll be introduced to a simple object-oriented scene and game object system. From there, you'll build responsive gameplay systems using essential data structures and algorithms, progressing through 2D rendering, collision detection, effects, and camera control before advancing to 3D graphics environments built using shaders, lighting, quad-tree terrain, and dynamic camera setups. You’ll animate characters using skeletal rigs, interpolation, and inverse kinematics for fluid movement and then develop game AI using FSMs, behavior trees, A* pathfinding, and steering behaviors. The book also covers neural networks, exploring their underlying theories, training processes, and tools. Throughout, the code is written in legacy-compatible C++ to ensure broad support across platforms and compilers. By the end, you’ll have gained the skills to build game systems that not only work but also scale, perform, and adapt like professional-grade code.
Format: eBook
ISBN: 9781835889879
Length: 426 pages
Edition: 1
Published: June 30, 2025
Author: Zhenyu George Li and Charles Shih-I Yeh
  • Preface
  • Part I: Data Structure and Algorithm Fundamentals
  • Gearing Up: C++ for Game Development
  • Data Structures in Action: Building Game Functionality
  • Algorithms Commonly Utilized in Game Development
  • Part II: Graphics Algorithms in Practice
  • 2D Rendering and Effects
  • The Camera and Camera Controls
  • 3D Graphics Rendering
  • Rendering a 3D Game World
  • Part III: Breathing Life into Your Games
  • Animating Your Characters
  • Building AI Opponents
  • Machine Learning Algorithms for Game AI
  • Part IV: Reflecting and Moving Forward
  • Continuing Your Learning Journey
  • Other Books You May Enjoy
  • Index

Build high-performance game systems using C++ and DS&A.

Key Benefits

  • Build real-time 2D and 3D games using C++ with practical, executable examples
  • Gain proficiency in game programming domains like AI pathfinding, camera systems, animation, and rendering effects
  • Boost runtime efficiency with practical techniques like object pooling, LOD patterns, and terrain partitioning to create smoother, more responsive gameplay systems

What You'll Learn

  • Use C++ data structures and algorithms to build core gameplay features
  • Implement 2D/3D rendering with shaders, particle effects, and terrain systems
  • Design camera systems like third-person, top-down, and split-screen views
  • Optimize performance using object pooling and LOD
  • Animate characters using skeletal rigging, interpolation, and inverse kinematics
  • Build game AI with FSMs, behavior trees, pathfinding, and steering
  • Apply neural network concepts in a turret defense project

Audience

This book is for junior game developers, hobbyists, and computer science students entering game development, as well as C++ programmers looking to strengthen their skills. While some familiarity with C++ is helpful, the examples are explained step by step to remain approachable. Whether you're starting out or reinforcing your skills before diving into game engines down the road, this book offers a clear and practical foundation to make you a more effective developer, regardless of which tools you choose later.

Develop the hands-on skills to overcome common game dev hurdles and deliver polished, high-performance results.

Struggling to manage hundreds of visual elements at once?

This book teaches you how to use scene graph architecture to structure your visuals intelligently. Keep your render loop clean and your UI layers organized, no matter how complex your scene becomes.

Want your game to shimmer with magic, fire, snow, or explosions?

Learn how to harness particle systems to produce spectacular effects that scale beautifully, perform well, and bring your game to life.

Struggling with 3D surfaces that look flat and lifeless? 

Discover how normal mapping can add depth, texture, and realism to your models without increasing polygon counts. Learn the technique used in top-tier games to deliver visual fidelity efficiently.

Large terrains hurting your frame rate?

You’ll learn how to apply quad-tree structures to render only what the camera sees, improving performance without sacrificing scale.

Tired of inefficient or clunky shuffle logic?

Discover a shuffling algorithm designed to minimize memory usage and keep operations fast — ideal for games with inventory systems, loot drops, or procedural content.

Meet the Authors

Zhen Yu George Li

Zhen Yu George Li is a seasoned video game developer and senior development consultant at Unity with over 20 years of industry experience. Since discovering his passion for game development in college, he has built strong technical foundations in Visual Basic, C/C++, DirectX, OpenGL, and Windows GUI, which paved the way for a successful career contributing to major commercial titles such as Halo Infinite, Magic Arena, Stela, Dead Rising 2, and The Bigs 2. His expertise spans programming, gameplay and AI, graphics, animation, multiplayer systems, physics, frontend development, and multiplatform production, with hands-on experience using both Unreal and Unity engines in real-world projects. In addition to his development work, George has eight years of college-level teaching experience, having lectured at Vancouver Film School, the College of Interactive Arts, and Hefei Union University, where he taught subjects including Unreal Engine development.

Charles Shih-I Yeh

Charles Shih-I Yeh is a Senior Game Development Engineer at Unity Technology, with over 20 years of expertise in game programming across mobile, console, and MMORPG platforms. He holds a Master's in Computer Science from USC and specializes in building custom game engines, digital content creation (DCC) tools, and multiplayer services. Charles is also a part-time lecturer at esteemed universities and the author of two books on game design.
Editorial Review

Dr. E. Wyn Roberts, M.A. Ph.D (Cantab.), Emeritus Professor of Linguistics, Simon Fraser University, Burnaby, Canada

“This book is designed for independent developers, company training, and post-secondary reference use. The knowledge presented herein is most intelligently, clearly, and effectively presented so as to be as efficiently applicable and pedagogically effective as possible on any device or platform, producing high-quality games, accessories, and edits.

This volume will certainly stand the test of time and fulfill the majority of the needs of those working in the field of gaming. However, I am certain that George and Charles, working together, will make further, very crucial contributions to this topic.

Until then, this volume will serve you excellently, helping you enjoy and prosper with your future activities and products.”

recommended

Related Titles

Based on your interests, we’ve picked a few things we think you’ll love.

FAQs

On completion of order you'll receive an option to download the eBook in PDF or EPUB

Yes, all our content is DRM free

You can purchase a print book directly from Packt