Zum Hauptinhalt springen
Nicht aus der Schweiz? Besuchen Sie lehmanns.de

Practical C++ Game Programming with Data Structures and Algorithms (eBook)

Write high-performance code and solve game development challenges with expert-led C++ solutions
eBook Download: EPUB
2025
426 Seiten
Packt Publishing (Verlag)
978-1-83588-987-9 (ISBN)

Lese- und Medienproben

Practical C++ Game Programming with Data Structures and Algorithms - ZHENYU GEORGE LI, Charles Shih-I Yeh
Systemvoraussetzungen
35,99 inkl. MwSt
(CHF 35,15)
Der eBook-Verkauf erfolgt durch die Lehmanns Media GmbH (Berlin) zum Preis in Euro inkl. MwSt.
  • Download sofort lieferbar
  • Zahlungsarten anzeigen

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.


Learn C++ game programming through real-world demos of AI systems, animation, and rendering to build scalable, high-performance games using patterns you can reuse across any game engineKey FeaturesBuild real-time 2D and 3D games using C++ with practical, executable examplesGain proficiency in game programming domains like AI pathfinding, camera systems, animation, and rendering effectsBoost runtime efficiency with practical techniques like object pooling, LOD patterns, and terrain partitioning to create smoother, more responsive gameplay systemsBook DescriptionCreating 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.What you will learnUse C++ data structures and algorithms to build core gameplay featuresImplement 2D/3D rendering with shaders, particle effects, and terrain systemsDesign camera systems like third-person, top-down, and split-screen viewsOptimize performance using object pooling and LODAnimate characters using skeletal rigging, interpolation, and inverse kinematicsBuild game AI with FSMs, behavior trees, pathfinding, and steeringApply neural network concepts in a turret defense projectWho this book is forThis 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.]]>

Contents


  1. Preface
    1. Who this book is for
    2. Understanding the code samples in this book
    3. What this book covers
    4. To get the most out of this book
    5. Acknowledgment of art and content contributions
    6. Get in touch
    7. Download a Free PDF Copy of This Book
  2. Part 1: Data Structure and Algorithm Fundamentals
  3. Gearing Up: C++ for Game Development
    1. Technical requirements
    2. Why learn algorithms for game development?
    3. Why is C++ used in this book?
    4. Understanding the structure for introducing algorithms in this book
    5. Setting up your development environment
      1. Install Visual Studio 2022
      2. Downloading the Knight solution from GitHub
    6. Utilizing the raylib graphics library
    7. Introducing Knight
      1. What’s new in Knight?
      2. Introducing the game flow structure
      3. Introducing Scene, SceneObject, and Components
    8. Investigating Demo1.cpp
      1. Implementing the main() function
      2. Overriding the Knight::Start() function
      3. Overriding the Knight::Update() function
    9. Summary
  4. Data Structures in Action: Building Game Functionality
    1. Technical requirements
    2. Data structures and algorithms in games
    3. Deciphering the secrets of game screenshots
      1. Common entities found in video games
      2. Defining the Entity C++ class
    4. Evaluating data structure and algorithm
      1. Measuring the efficiency of data structures
        1. Measuring of complexity
        2. Measuring scalability
      2. Big O: Measuring the efficiency of data structures and algorithms
    5. Basic data structure for collections
      1. Array
        1. Common operations on arrays
        2. Inserting/deleting versus enabling/disabling
      2. Standard C++ implementation of dynamic array
        1. Common operations on std::array
      3. List
        1. Accessing a specific element
        2. Enumerating elements in the list
        3. Inserting and deleting an element
        4. Sort
    6. The order matters – LIFO and FIFO
      1. Stack
        1. Common operations on the stack
      2. Queue
        1. The sample project
    7. Summary
  5. Algorithms Commonly Utilized in Game Development
    1. Technical requirements
    2. Exploring randomization
      1. Understanding the algorithm
      2. Implementing the code in C++
    3. Selection algorithms
      1. Random selection
      2. Weighted random selection
        1. Demo3a: Random and weighted-random selections in action
      3. Exclusive selection
        1. Demo3b: Exclusive random selection
    4. Shuffling for randomization
      1. Demo3c: Fisher-Yates shuffling
    5. Sorting algorithms
      1. Demo3d: Sorting cards
    6. Procedural generation
      1. Demo3e: Maze generation
    7. Object pooling
      1. Outlining the pooling algorithm
      2. Applying ObjectPool
    8. Summary
  6. Part 2: Graphics Algorithms in Practice
  7. 2D Rendering and Effects
    1. Technical requirements
    2. Understanding 2D graphics operations behind the scenes
      1. Loading and rendering a texture as an image
      2. Choosing an appropriate texture format
      3. Using the cache to avoid loading the same texture repeatedly
        1. Implementing an LRU texture cache
    3. Working with 2D texture rendering
      1. Rendering part of a region from the source texture
      2. Rotating the texture image
      3. Color blending
      4. Alpha blending
        1. Advanced color and/or alpha blending modes
        2. Combining both color and alpha blending
      5. N-patch texture
    4. Using screen scrolling
      1. Parallax scrolling
        1. How parallax scrolling works
    5. Rendering isometric maps
      1. How isometric projection works
    6. Summary
  8. The Camera and Camera Controls
    1. Technical requirements
    2. Camera – how players see the game world
      1. Common uses of cameras in video games
        1. First-person camera
        2. Third-person camera
        3. Top-down camera
        4. Rail camera
        5. Fly-through camera
        6. Other variations
    3. Defining the camera for rendering a scene
      1. Basic properties of a camera system
      2. Projecting a 3D world onto a 2D screen
        1. Perspective projection
        2. Orthographic projection
    4. Working with the built-in camera system
      1. Using the first-person-view camera
      2. Using the orthogonal camera
      3. Overriding the default control for built-in cameras
    5. Building a third-person follow-up camera
    6. Building a rail camera system
    7. Building a top-down camera for RTS
    8. Rendering multiple split-screen cameras
      1. Customizing the rendering operation
      2. Working with RenderTexture
    9. Summary
  9. 3D Graphics Rendering
    1. Technical requirements
    2. Programming with modern GPUs
      1. Understanding different coordinated spaces
        1. Model space
        2. World space
        3. View space (camera space/eye space)
        4. Clip space
        5. Normalized device coordinates space (NDC)
        6. Screen space
      2. Introducing the 3D graphics rendering pipeline ...

Erscheint lt. Verlag 30.6.2025
Vorwort Dr. E. Wyn Roberts
Sprache englisch
Themenwelt Mathematik / Informatik Informatik Programmiersprachen / -werkzeuge
Informatik Software Entwicklung Spieleprogrammierung
Informatik Theorie / Studium Algorithmen
ISBN-10 1-83588-987-5 / 1835889875
ISBN-13 978-1-83588-987-9 / 9781835889879
Informationen gemäß Produktsicherheitsverordnung (GPSR)
Haben Sie eine Frage zum Produkt?
EPUBEPUB (Ohne DRM)

Digital Rights Management: ohne DRM
Dieses eBook enthält kein DRM oder Kopier­schutz. Eine Weiter­gabe an Dritte ist jedoch rechtlich nicht zulässig, weil Sie beim Kauf nur die Rechte an der persön­lichen Nutzung erwerben.

Dateiformat: EPUB (Electronic Publication)
EPUB ist ein offener Standard für eBooks und eignet sich besonders zur Darstellung von Belle­tristik und Sach­büchern. Der Fließ­text wird dynamisch an die Display- und Schrift­größe ange­passt. Auch für mobile Lese­geräte ist EPUB daher gut geeignet.

Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen dafür die kostenlose Software Adobe Digital Editions.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen dafür eine kostenlose App.
Geräteliste und zusätzliche Hinweise

Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.

Mehr entdecken
aus dem Bereich