<p><b>Create your own games using Unreal Engine 4 while learning the fundamentals of C++ programming</b></p><h4>Key Features</h4><ul><li>Gain foundational knowledge of C++ language and syntax when creating games with UE4</li><li>Build 2D and 3D games featuring interactive UIs, game physics, and arti
Learning C++ by Building Games with Unreal Engine 4: A beginner's guide to learning 3D game development with C++ and UE4, 2nd Edition
β Scribed by Sharan Volin
- Publisher
- Packt Publishing
- Year
- 2018
- Tongue
- English
- Leaves
- 456
- Edition
- 2
- Category
- Library
No coin nor oath required. For personal study only.
β¦ Synopsis
Learning C++ by Building Games with Unreal Engine 4
β¦ Table of Contents
Cover
Title Page
Copyright and Credits
www.PacktPub.com
Contributors
Table of Contents
Preface
Chapter 1: Getting Started with C++17
Setting up our project
Using Microsoft Visual Studio on Windows
Downloading and Installing Visual Studio
Starting a New Project in Visual Studio
Using Xcode on a Mac
Downloading and installing Xcode
Starting a new project in Xcode
Creating your first C++ program
Semicolons
Handling errors
Warnings in C++
What is building and compiling?
Example output
Exercise - ASCII art
Summary
Chapter 2: Variables and Memory
Variables
Declaring variables β touching the silicon
Reading and writing to your reserved spot in memory
Numbers and math
Numbers are everything
More on variables
Math in C++
Exercises
Generalized variable syntax
Primitive types
Advanced variable topics
Automatically detecting type
Enums
const variables
Building more complex types
Object types β struct
Exercise β player
Solution
Pointers
What can pointers do?
Address of operator (&)
Using nullptr
Smart pointers
Input and output
The cin and cout objects
The printf() function
Exercise
Solution
Namespaces
Summary
Chapter 3: If, Else, and Switch
Branching
Controlling the flow of your program
The == operator
Coding if statements
Coding else statements
Testing for inequalities using other comparison operators (>, >=, <, <=, and !=)
Using logical operators
The not (!) operator
Exercises
Solutions
The and (&&) operator
The or (||) operator
Exercise
Solution
Branching code in more than two ways
The else if statement
Exercise
Solution
The switch statement
The switch statement versus the if statement
Exercise
Solution
Bit-shifted enums
Our first example with Unreal Engine
Summary
Chapter 4: Looping
The while loop
Infinite loops
Exercises
Solutions
The do/while loop
The for loop
Exercises
Solutions
Looping with Unreal Engine
Summary
Chapter 5: Functions and Macros
Functions
An example of a library function β sqrt()
Writing our own functions
A sample program trace
Exercise
Solution
Functions with arguments
Functions that return values
Exercises
Solutions
Initializer lists
Variables revisited
Global variables
Local variables
The scope of a variable
Static local variables
Const variables
Const and functions
Function prototypes
.h and .cpp files
prototypes.h
funcs.cpp
main.cpp
extern variables
Macros
Macros with arguments
Constexpr
Summary
Chapter 6: Objects, Classes, and Inheritance
What is an object?
The struct object
Member functions
The this keyword
Are strings objects?
Invoking a member function
Exercises
Solutions
Privates and encapsulation
Some people like it public
The class keyword versus struct
Getters and setters
Getters
Setters
But what's the point of get/set operations?
Constructors and destructors
Class inheritance
Derived classes
Syntax of inheritance
What does inheritance do?
The is-a relationship
Protected variables
Virtual functions
Purely virtual functionsΒ
Multiple inheritance
Private inheritance
Putting your classes into headers
Using .h and .cpp files
Exercise
Object-oriented programming design patterns
Singletons
Factories
Object pools
Static members
Callable objects and invoke
Summary
Chapter 7: Dynamic Memory Allocation
Constructors and destructors revisited
Dynamic memory allocation
The delete keyword
Memory leaks
Regular arrays
The array syntax
Exercise
Solution
C++ style dynamic size arrays (new[] and delete[])
Dynamic C-style arrays
Vectors
Summary
Chapter 8: Actors and Pawns
Actors versus pawns
Creating a world to put your actors in
The UE4 editor
Editor controls
Play mode controls
Adding objects to the scene
Starting a new level
Adding light sources
Collision volumes
Adding collision volumes
Adding the player to the scene
Inheriting from UE4 GameFramework classes
Associating a model with the Avatar class
Downloading free models
Loading the mesh
Creating a blueprint from our C++ class
Writing C++ code that controls the game's character
Making the player an instance of the Avatar class
Setting up controller input
Exercise
Solution
Yaw and pitch
Creating non-player character entities
Displaying a quote from each NPC dialog box
Displaying messages on the HUD
Exercise
Using TArray
Exercise
Triggering an event when the player is near an NPC
Making the NPC display something to the HUD when the player is nearby
Exercises
Solutions
Summary
Chapter 9: Templates and Commonly-Used Containers
Debugging the output in UE4
Templates and containers
Your first template
UE4's TArray
An example that uses TArray
Iterating a TArray
The vanilla-for-loop-and-square-brackets notation
Iterators
Determining whether an element is in the TArray
TSet
Iterating a TSet
Intersecting TSet arrays
Unioning TSet arrays
Finding in TSet arrays
TMap
A list of items for the player's inventory
Iterating a TMap
TLinkedList/TDoubleLinkedList
C++ STL versions of commonly-used containers
The C++ STL set
Finding an element in a
Exercise
Solution
The C++ STL map
Finding an element in a
π SIMILAR VOLUMES
<p><b>Learn the fundamentals of C++ programming with a fun-filled, practical guide and create your own games using Unreal Engine 4.</b><p><b>Key Features</b><p><li>Gain foundational knowledge of C++ language and syntax while creating games with UE4<li>Build 2D and 3D games having compelling user int
Youve actually been creating scripts in your mind your whole life, you just didnt realize it. Apply this logical ability to write Unity C# scripts<br>Learn how to use the two primary building blocks for writing scripts: the variable and the method. Theyre not mysterious or intimidating, just a simpl
<p><b>Learn the tools and techniques of game design using a project-based approach with Unreal Engine 4 and C++</b></p>Key Features<ul><li>Kickstart your career or dive into a new hobby by exploring game design with UE4 and C++</li><li>Learn the techniques needed to prototype and develop your own id
<p><b>Learn C++ programming with a fun, real-world application that allows you to create your own games!</b></p> <h2>About This Book</h2><ul><li>Be a top programmer by being able to visualize programming concepts; how data is saved in computer memory, and how a program flows</li><li>Keep track of pl
Unreal Engine 4 is used to create top notch, exciting games by AAA studios, and learning to program in C++ needs some serious motivation.<br>Learning C++ by Creating Games With UE4 will start with the basics of C++: installing a code editor so you can begin to write C++ code. You will then learn how