Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Practical C++ Game Programming with Data Structures and Algorithms

You're reading from   Practical C++ Game Programming with Data Structures and Algorithms Write high-performance code and solve game development challenges with expert-led C++ solutions

Arrow left icon
Product type Paperback
Published in Jun 2025
Publisher Packt
ISBN-13 9781835889862
Length 408 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Authors (2):
Arrow left icon
Zhenyu George Li Zhenyu George Li
Author Profile Icon Zhenyu George Li
Zhenyu George Li
Charles Shih-I Yeh Charles Shih-I Yeh
Author Profile Icon Charles Shih-I Yeh
Charles Shih-I Yeh
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Part 1: Data Structure and Algorithm Fundamentals
2. Gearing Up: C++ for Game Development FREE CHAPTER 3. Data Structures in Action: Building Game Functionality 4. Algorithms Commonly Utilized in Game Development 5. Part 2: Graphics Algorithms in Practice
6. 2D Rendering and Effects 7. The Camera and Camera Controls 8. 3D Graphics Rendering 9. Rendering a 3D Game World 10. Part 3: Breathing Life into Your Games
11. Animating Your Characters 12. Building AI Opponents 13. Machine Learning Algorithms for Game AI 14. Part 4: Reflecting and Moving Forward
15. Continuing Your Learning Journey 16. Other Books You May Enjoy
17. Index

To get the most out of this book

To get the most out of this book, you should have a solid foundation in C++ programming, including an understanding of Object-Oriented Programming (OOP) and data structures. Familiarity with game-related concepts and knowledge, such as rendering, animation, physics, and frame rate management, will also be beneficial in understanding the practical applications of the algorithms introduced. While this book avoids overly complex modern C++ features, a basic grasp of C++ syntax and programming logic is essential for following along with the examples.

The following table outlines the software and hardware requirements for this book:

Software/hardware covered in the book

Operating system requirements

Microsoft Visual Studio 2002 with the C++ compiler

Microsoft Windows 10 and up

If you run the samples on systems other than Windows, such as macOS, you will need to manually set up the project and copy the source code into the project.

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Note that the authors acknowledge the use of cutting-edge AI, such as ChatGPT, with the sole aim of enhancing the language and clarity within the book, thereby ensuring a smooth reading experience for readers. It’s important to note that the content itself has been crafted by the authors and edited by a professional publishing team.

Download the example code files

The code bundle for the book is hosted on GitHub at https://github.com/PacktPublishing/Practical-C-Game-Programming-with-Data-Structures-and-Algorithms. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://packt.link/gbp/9781835889862.

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. For example: “ However, when we assign CameraMode as CAMERA_FIRST_PERSON and add it to the scene, Knight will activate first-person mode and enable input control for first-person mode.”

A block of code is set as follows:

OrthogonalCamera* OrthCam = NULL;
OrthCam = _Scene->CreateSceneObject<OrthogonalCamera>("Orthogonal Camera");
OrthCam->SetUp(Vector3{ 0.0f, 15.0f, 15.0f }, Vector3{ 0.0f, 0.0f, 0.0f }, 20.0f);

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

//Push the sample data into the dataset
sampleData.clear();
sampleData.push_back(inputs[0]);
sampleData.push_back(inputs[1]);
sampleData.push_back(targets[0]);
sampleData.push_back(targets[1]);
dataset.push_back(sampleData);

Bold: Indicates a new term, an important word, or words that you see on the screen. For instance, words in menus or dialog boxes appear in the text like this. For example: “ When installing VS2022, make sure to enable the Desktop development with C++ module to install the C++ compiler together with the IDE.”

Warnings or important notes appear like this.

Tips and tricks appear like this.

Further, to maintain consistency and minimize confusion, the C++ sample code in this book primarily follows the Visual Studio C++ coding preferences. For detailed guidelines, you can refer to the official documentation at https://learn.microsoft.com/en-us/cpp/ide/how-to-set-preferences?view=msvc-170.

Additionally, some special coding conventions used in the sample code are inspired by OpenStack’s C++ Coding Standards. You can find more details in their documentation at https://wiki.openstack.org/wiki/CppCodingStandards#:~:text=Private%20member%20data%20variables%20should,all%20lowercase%20with%20underscore%20separation.

In certain cases, exceptions may be made for compact expressions that enhance readability and fit within the page layout constraints, ensuring clarity without compromising comprehension.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime