𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

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

⬇  Acquire This Volume

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
Exercise
Solution
C++ STL Vector
Summary
Chapter 10: Inventory System and Pickup Items
Declaring the backpack
Forward declaration
Importing assets
Attaching an action mapping to a key
The PickupItem base class
The root component
Getting the avatar
Getting the player controller
Getting the HUD
Drawing the player inventory
Using HUD::DrawTexture()
Exercise
Detecting inventory item clicks
Dragging elements
Exercises
Putting things together
Summary
Chapter 11: Monsters
Landscape
Sculpting the landscape
Creating Monsters
Basic monster intelligence
Moving the monster – steering behavior
The discrete nature of monster motion
Monster SightSphere
Monster attacks on the player
Melee attacks
Defining a melee weapon
Coding for a melee weapon in C++
Downloading a sword
Creating a blueprint for your melee weapon
Sockets
Creating a skeletal mesh socket in the monster's hand
Attaching the sword to the model
Code to equip the player with a sword
Triggering the attack animation
Blueprint basics
Modifying the animation blueprint for Mixamo Adam
Code to swing the sword
Projectile or ranged attacks
Bullet physics
Adding bullets to the monster class
Player knockback
Summary
Chapter 12: Building Smarter Monsters with Advanced AI
Navigation – pathfinding and the NavMesh
What is pathfinding?
What is A*?
Using a NavMesh
Creating an AIController class
Behavior Tree
Setting up the Behavior Tree
Setting up Blackboard values
Setting up a BTTask
Setting Up the Behavior Tree itself
Updating the MonsterAIController
Updating the Monster class
Environment Query Systems
Flocking
Introduction to machine learning and neural networks
Genetic algorithms
Summary
Chapter 13: Spell Book
What is a spell?
Setting up particle systems
Changing particle properties
Settings for the blizzard spell
Spell class actor
Blueprinting our spells
Picking up spells
Creating blueprints for PickupItems that Cast Spells
Attaching right mouse click to CastSpell
Writing the avatar's CastSpell function
Instantiating the spell – GetWorld()->SpawnActor()
if(spell)
spell->SetCaster(this)
Writing AMyHUD::MouseRightClicked()
Activating right mouse button clicks
Creating other spells
The fire spell
Exercises
Summary
Chapter 14: Improving UI Feedback with UMG and Audio
What is UMG?
Updating the inventory window
The WidgetBase class
The InventoryWidget class
Setting up the widget blueprint
AMyHUD changes
AAvatar changes
A note on OnClicked
Laying out your UI
Updating your HUD and adding health bars
Creating a HUD class
Adding health bars
Playing audio
Summary
Chapter 15: Virtual Reality and Beyond
Getting ready for VR
Using VR Preview and VR Mode
Controls in VR
Tips on VR development
AR
Procedural programming
Extending functionality with plugins and add-ons
Mobile, console, and other platforms
Summary
Other Books You May Enjoy
Index


πŸ“œ SIMILAR VOLUMES


Learning C++ by Building Games with Unre
✍ Sharan Volin πŸ“‚ Library πŸ“… 2018 πŸ› Packt Publishing 🌐 English

<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 Unre
✍ Volin, Sharan πŸ“‚ Library πŸ“… 2018 πŸ› Packt Publishing Ltd 🌐 English

<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

Learning C# by Developing Games with Uni
✍ Terry Norton πŸ“‚ Library πŸ“… 2013 πŸ› Packt Publishing 🌐 English

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

Game Development Projects with Unreal En
✍ Hammad Fozi; GonΓ§alo Marques; David Pereira; Devin Sherry πŸ“‚ Library πŸ“… 2020 πŸ› Packt Publishing Ltd 🌐 English

<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

Learning C++ by Creating Games with UE4
✍ William Sherif πŸ“‚ Library πŸ“… 2015 πŸ› Packt Publishing - ebooks Account 🌐 English

<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

Learning C++ by creating games with UE4
✍ William Sherif πŸ“‚ Library πŸ“… 2015 πŸ› Packt Publishing 🌐 English

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