Mastering C++ Game Development
Create professional and realistic 3D games using C++ 17
Mickey MacDonald
BIRMINGHAM - MUMBAI
Mastering C++ Game Development
Copyright 2018 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Commissioning Editor: Amarabhab Banerjee
Acquisition Editors: Meeta Rajani
Content Development Editor: Devika Battike
Technical Editor: Mohd Riyan Khan
Copy Editor: Safis Editing, Dipti Mankame
Project Coordinator: Judie Jose
Proofreader: Safis Editing
Indexer: Pratik Shirodkar
Graphics: Tania Dutta
Production Coordinator: Nilesh Mohite
First published: January 2018
Production reference: 1240118
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78862-922-5
www.packtpub.com
mapt.io
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Why subscribe?
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
PacktPub.com
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@packtpub.com for more details.
At www.PacktPub.com , you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Contributors
About the author
Mickey MacDonald is a professional game designer and developer who has experience in developing both AAA and indie titles for a variety of gaming platforms and devices. Growing up, he always enjoyed playing video games, which inspired him to start creating his own. He is also a technical evangelist at Microsoft with focus on game development. As part of his role, a lot of his time is spent talking to other game developers and sharing the lessons he has learned in his development experiences. In his spare time, he enjoys researching video games and collecting vintage game consoles and computer systems.
To my family and friends, who have always helped and supported me,
and to my grandfather, who taught me the joy of pursuing knowledge.
A big thanks to the Packt Publishing team, who have worked tirelessly to bring this book to life. Thank you for the support, patience, and hard work!
About the reviewer
Bryan Griffiths is a software engineer who has worked in the gaming industry for more than 15 years and shipped multiple AAA, AR, VR, indie, mobile, and web games. In his career, he has worked on projects for most of the major publishers, including Microsoft, Apple, Sega, and Activision-Blizzard.
Most days, he can be found instructing the next generation of game developers from triOS College's Kitchener campus. Other days, he's out helping companies iterate on their game prototypes, expanding their teams with qualified individuals, or hunting down the last few bugs in a project before release.
I'd like to thank my parents for setting me on this path by constantly providing the tech and experiences that challenged me and broadened my mind throughout my childhood as well as Krystal and Kaizen for holding down the fort during crunch time.
Packt is searching for authors like you
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Preface
Although many languages are now being used to develop games, C++ remains the standard for professional development. The vast majority of libraries, engines, and toolchains are still being developed strictly in C++. Known for its performance and reliability, C++ continues to be the best option for true cross-platform compatibility.
By picking up this book, you are beginning your journey to mastering this powerful language. Although the journey will be long, it will be filled with discovery! Even after the countless hours I have spent working with C++, I still find myself filled with joy at finding new techniques and approaches. In this book, I want to give you the tools and understanding that will prepare you for continuing this learning journey. While new and flashy tools and engines will arise and potentially fall, having a strong understanding of how games, their tools, and engines are developed at a low level will provide you with valuable knowledge you can always lean on.
Who this book is for
This book is intended for intermediate to advanced C++ game developers who are looking to take their skills to the next level and learn the deep concepts of 3D game development. The reader will learn the key concepts used in the development of AAA-level games. Advanced topics, such as library creation, artificial intelligence, shader techniques, advanced effects and lighting, tool creation, physics, networking, and other critical game systems, will be covered throughout the journey.
What this book covers
, C++ for Game Development , covers some of the more advanced C++ topics used in modern game development. We will look at inheritance and polymorphism, pointers, referencing, and the common STL generic containers. The concept of templating and building generic code with class, function, and variable templates. Type inference and the new language keywords auto and decltype and their uses in combination with the new return value syntax. Finally, we will close out the chapter by looking at some core game patterns used today.
Next page