Unreal Engine C++ Developer: Learn C++ and Make Video Games
4.5 (33,195 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
175,125 students enrolled

Unreal Engine C++ Developer: Learn C++ and Make Video Games

Learn C++ from basics. Make your first 4 video games in Unreal engine, the engine behind Fortnite. Interactive tutorial.
4.5 (33,195 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
175,125 students enrolled
Last updated 4/2019
English, Indonesian [Auto-generated], 6 more
  • Italian [Auto-generated]
  • Japanese [Auto-generated]
  • Polish [Auto-generated]
  • Portuguese [Auto-generated]
  • Spanish [Auto-generated]
  • Turkish [Auto-generated]
Current price: $11.99 Original price: $194.99 Discount: 94% off
2 days left at this price!
30-Day Money-Back Guarantee
This course includes
  • 60 hours on-demand video
  • 15 articles
  • 12 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to Udemy's top 3,000+ courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • C++, the games industry standard language.
  • How to use the Unreal Engine 4 Editor.

  • Unreal Blueprint for designer friendly programming.

  • Git as a version control and backup system.
  • Object Oriented Programming and how to put it into practice.
  • Sound effects and audio to add depth to your games.
  • Game design principles.
  • Programming patterns and best practices.
  • Unreal's Terrain Editor to create epic landscapes.
  • Artificial Intelligence behaviour programming for enemies.
  • Strong and transferable problem solving skills.
  • Modern game development technologies and techniques.
  • A fundamental understanding of computers.
  • Write code that is clean and to understand.
  • Unreal Gameplay Framework to make games easily.
  • Advanced vehicle physics.
  • Blackboard and Behaviour Tree for customizable AI.
  • Animation Blueprint for custom character animation.
  • C++ template programming to reduce repetition.
  • Vector maths for game play and physics calculations.
Course content
Expand all 351 lectures 60:16:34
+ Introduction and Setup - 2019 Version
13 lectures 01:03:35

Ben Tristem explains how to get the most from this course.

(Unique Video Reference: 1_IS_UC2)

Preview 02:49

Ben Tristem explains why this section is important for beginners. We also define what a compiler is, and overview the section flow.

Know why you'll persevere through this course if it gets tough.

(Unique Video Reference: 2_IS_UC2)

Why Hello World Is Exciting
If you have slow / expensive internet, or are on Linux...

Ben Tristem explains the role of Visual Studio Code, Xcode or Visual Studio in developing Unreal Engine games.

Install Unreal Engine 4.21

(Unique Video Reference: 2b_IS_UC2)

Unreal Development Environment

Check out the partner to this course, which focuses on different games and Blueprint over C++.

Want to Focus on Blueprint?


Able to run the cl command in the Developer Command Prompt

(Unique Video Reference: 3_IS_UC2)

Install Windows 10 C++ Compiler

Ben Tristem gives you a simple way of getting a C++ compiler installed on MacOS.

Able to run g++ command in Mac Terminal.

(Unique Video Reference: 4_IS_UC2)

Install MacOS C++ Compiler

Ben Tristem shows you how simple it is to install the GCC compiler on Linux (accessed via g++)

Run g++ from Linux Terminal

(Unique Video Reference: 5_IS_UC2)

Install Linux C++ Compiler

Ben Tristem takes you step-by-step through building the Unreal Engine from source code.

You can build and run Unreal Engine on Linux

(Unique Video Reference: 6_IS_UC2)

Build Unreal Engine From Source (Linux)

Ben Tristem walks you through the basics of Visual Studio code.

You can install Visual Studio Code and the Microsoft C++ extension on your platform.

(Unique Video Reference: 7_IS_UC2)

Introducing Visual Studio Code

Ben Tristem shows you the extra setup required to run the Developer Command Prompt for Visual Studio from with VS Code.

Can use Developer Command Prompt environment in VS Code.

(Unique Video Reference: 8_IS_UC2)

Extra VS Code Setup For Windows

Ben Tristem walks you through the two most basic C++ programs, and shows you how to compile and run them from within VS Code on Mac, Windows and Linux.

Write the most basic C++ program that actually does something.

(Unique Video Reference: 9_IS_UC2)

The Simplest C++ Program
End of Section 1
+ Introduction and Setup (Original Version)
12 lectures 56:26
WARNING: Section Being Archived At End Of April
  • Use the latest versions of Unreal
  • They work well with the latest Visual Studio
  • Why the videos use older versions
  • What to do if something is different.

(Unique Video Reference: 2b_IS_URC)

A Note On Unreal Versions
Fully Remove Visual Studio If You Have Issues
  • Configure Visual Studio Community 2017.
  • If you’re on MacOS skip ahead 2 mins.

Software changes regularly. If your install options are different please post a screenshot in the Q&A so we can update the course. Thanks.

(Unique Video Reference: 3_IS_URC)

Setup Visual Studio or XCode
Avoiding Unreal 4.20
  • Start Unreal Engine Downloading too.
  • An overview of the Unreal install process.
  • What is an IDE and why you need it.

(Unique Video Reference: 4_IS_URC)

Preview 08:06
  • Get Visual Studio running.
  • Xcode is covered in the next video.
  • Write your first line of C++ code.
  • Check the code “compiles”.
  • Learn where to find the Output log.

(Unique Video Reference: 5_IS_URC)

Intro to Visual Studio 2015 on PC
  • Get Xcode running.
  • Write your first line of C++ code.
  • Check the code “compiles”.
  • Learn where to find the Output.

(Unique Video Reference: 6_IS_URC)

Intro to Xcode on MacOS
  • Expected vs Observed behaviour.
  • Creating a Minimal Viable Test case.
  • Useful information to include.
  • Explaining what has already been tried.
  • Sharing code the smart way.
  • Using Udemy Q&A effectively.

(Unique Video Reference: 6b_IS_URC)

How to Ask Good Questions
  • Create a new Basic C++ project.
  • Take a quick look around Unreal.
  • Learn about saving and scenes.
  • Customise the Unreal Editor interface.

(Unique Video Reference: 7_IS_URC)

Preview 09:46
  • Well done getting setup.
  • Introduce yourself in the discussions.
  • Start the next section NOW.
  • Going from C# to C++.

(Unique Video Reference: 8_IS_URC)

Section 1 Wrap-Up

Check your basic understanding of the Unreal ecosystem.

Section End QUIZ
10 questions
  • We answer your questions
  • Thanks for the intros.
  • Visual Studio on Mac?
  • Ben’s Momentum plugin.
  • And more.

Awkward paws...

(Unique Video Reference: 9_IS_URC)

Instructor Hangout
+ Bulls & Cows Word Console Game - Your First C++
43 lectures 05:51:30
  • Welcome to the first actual coding video.
  • Why we’re doing this in the IDE only.
  • What you’ll be building, see resources.
  • You’ll learn types, loops, routines, classes.
  • We’ll follow Unreal’s coding style, and re-use.
  • Notes and resources are attached.

(Unique Video Reference: 1_BC_URC)

Intro, Notes & Section 2 Assets
  • You will be getting comfortable with Visual Studio
  • You write your first C++
  • We’ll have a simple and fun console game
  • You’ll be ready to dive into Unreal.

(Unique Video Reference: 1b_BC_URC )

Bull Cow Game Overview
  • How much planning should we do?
  • Define the emotional problem the game solves*
  • Chose concept, rules & requirements.
  • Start to think about the architecture.
  • Copy as much as possible into the code!
  • Document now what may change later.

Useful Links + * McConnell, Steve. Code Complete. Microsoft Press 2004. Chapter 3.3

(Unique Video Reference: 2_BC_URC)

S02 Game Design Document (GDD)
A Note About Visual Studio 17
  • How projects and solutions relate.
  • Setting up a new command line project.
  • An overview of the structure of our solution.
  • (Adding main.cpp to our project).

(Unique Video Reference: 3_BC_URC)

How Solutions & Projects Relate
  • The difference between an engine and a library.
  • How this relates to this console application.
  • What is building / compiling code?
  • How the console knows where to find our code.
  • The syntax of a function in C++.
  • Write the minimal C++ program to remove error.
  • Testing our application runs without error.

(Unique Video Reference: 4_BC_URC)

C++ Function Syntax
  • # represents a “preprocessor directive”.
  • #include copies-and-pastes other code.
  • The idea of using library code.
  • Use <> for standard libraries.
  • Use “ “ for files you have created yourself.
  • Notice the namespace icon in autocomplete.
  • Import iostream library and use std namespace.

(Unique Video Reference: 5_BC_URC)

Using, #include and Namespaces
  • What a “magic number” is.
  • Why it’s a good idea to avoid them.
  • constexpr means “evaluated at compile time”.
  • Introduce coding standards*.
  • Use a constant for the word length.

Useful Links + * Unreal Engine - Coding Standard

(Unique Video Reference: 6_BC_URC)

Magic Numbers and Constants
  • The difference between \n and endl
  • Introducing pseudocode programming
  • Why we need to #import \
  • Getting input using cin
  • Discovering woes with our input buffer.

(Unique Video Reference: 7_BC_URC)

Variables and cin for Input
  • Re-cap the problem we have.
  • Why getline() is useful here.
  • Where to find C++ documentation.
  • A word on non-obvious solutions.

(Unique Video Reference: 8_BC_URC)

Using getline()
  • Programming is all about managing complexity.
  • We want to think about a few things at a time.
  • The idea of abstraction and encapsulation.
  • How functions help us simplify.
  • Write and call your first functions.
  • A warning about “side-effects” of functions.
  • Always use return at the end of your functions.

(Unique Video Reference: 9_BC_URC)

Simplifying With Functions
  • Why we need loops.
  • When to use for vs while.
  • The syntax of a for loop.
  • Think carefully about the first & last loop.
  • Write a for loop to repeat the game.

(Unique Video Reference: 10_BC_URC)

Iterating With For & While Loops

Consolodate your knowledge so far.

Mid Section Quiz
10 questions
  • More about levels of abstraction.
  • A word on being clever.
  • Using Visual Studio’s Extract “Extract Function”
  • What a header file (.h) is.
  • What’s refactoring, and why we do it.
  • Removing side-effects.
  • Where to find the course code on GitHub.

(Unique Video Reference: 11_BC_URC)

Clarity is Worth Fighting For
  • What a boolean is, and how to use it.
  • Only use when completely clear what you mean.
  • Use == for comparison.
  • Use && for logical AND.
  • Use || for logical OR.
  • Use [n] to access a string, starting at n=0.
  • Use ‘ ‘ for characters, and “ “ for strings.

(Unique Video Reference: 12_BC_URC)

Booleans and comparisons
  • What a do while loop is.
  • How it executes code one or more times.
  • Making our game play multiple times.

(Unique Video Reference: 13_BC_URC)

Using do and while in C++
  • Lookup the Turing machine.
  • A quick overview of the MVC pattern.
  • User defined types (classes).
  • About working at an interface level (black box).
  • An overview of class FBullCowGame

(Unique Video Reference: 14_BC_URC)

Preview 02:59
  • Introducing .h header files in C++.
  • Why the added complexity is worth it.
  • Defining the interface to our class.
  • Writing our first draft of FBullCowGame.h

(Unique Video Reference: 15_BC_URC)

Using Header Files as Contracts
  • NEVER use using namespace in a .h
  • In fact, why use it at all?
  • Create your .cpp files and #include
  • Don’t create chains of includes.

(Unique Video Reference: 16_BC_URC)

Including Our Own Header File
Frustrated With XCode?
  • Relax, they’re just user defined types!
  • string FirstName; creates a string object
  • FBullCowGame BCGame; works the same way
  • These instances are initialised by “constructors”
  • Instantiating means “creating an instance of”
  • So we’re simply creating a game instance.

(Unique Video Reference: 17_BC_URC)

Instantiating Your Class
  • What is a getter method
  • Why we never access variables directly
  • How to call a method using the dot operator
  • Pros and cons of initialising in at compile time
  • Using “Rebuild Project” to make VS behave!

(Unique Video Reference: 18_BC_URC)

Writing & Using Getter Methods
  • const’s meaning depends on context
  • Generally means “I promise not to change this”
  • What this is depends on exactly where it appears
  • At the end of a member function, for example int GetCurrentTry() const; it prevents the function from modifying any member variables
  • This is a good safety feature.

(Unique Video Reference: 19_BC_URC)

Introducing the Const Keyword
  • Default constructor called when object created
  • Initialize in constructor when decided at runtime
  • Initialize in declaration if known at compile time
  • Constructor syntax simply: ClassName();
  • Set the member variables in constructor
  • Test this has worked.

(Unique Video Reference: 20_BC_URC)

Constructors For Initialisation
  • More on Pseudocode Programming Practice (PPP)
  • Reviewing our code and architecture
  • Using // TODO as a comment prefix
  • Introducing Visual Studio’s Task List
  • Planning our next wave of coding.

(Unique Video Reference: 21_BC_URC)

Pseudocode Programming

Wow, has it been 10 lectures already? Let's consolodate your knowledge.

Mid Section Quiz
10 questions
  • We’re substituting types to be “Unreal ready”
  • The declaration is using \ = \;
  • For example using int32 = int;
  • Why Unreal uses int32 rather than int
  • FText is for output, FString is “mutable”
  • Where to use each type of string
  • Map FText and FString to std::string

(Unique Video Reference: 22_BC_URC)

Using using for Type Aliases
  • struct is almost identical to class

  • It’s member variables (data) is public by default

  • Ideal for simple value types like BullCowCount

  • Outline BullCowCount SubmitGuess(FString)

(Unique Video Reference: 23_BC_URC)

Using struct for Simple Types
  • Why we need conditionals (selection)
  • Use if when it reads better (e.g. few conditions)
  • Use switch for multiple, simple conditions
  • (for loads of statements consider a table lookup)
  • The syntax of an if statement
  • Using if to write count bulls and cows.

(Unique Video Reference: 24_BC_URC)

Using if Statements in C++
  • A very brief intro to Visual Studio’s debugger
  • Set a break-point by clicking in margin
  • Watch values by highlighting in debug mode
  • Use “Continue” to cycle back to breakpoint.

(Unique Video Reference: 25_BC_URC)

Debugging 101
  • Centralising the hidden word length
  • Making this a property of the game class
  • Writing a getter to access this value
  • Updating our intro to vary with word length.

(Unique Video Reference: 26_BC_URC)

A Place for Everything
  • An enumerated type consists of named values
  • Use instead of coded meaning
  • Makes the code more readable and meaningful
  • Only defined values can be used - more robust
  • A benefit of C++ 11’s strongly typed enums
  • Creating an enum class for error checking.

(Unique Video Reference: 27_BC_URC)

Introducing enumerations
  • Use else if for the first time
  • Outline or CheckGuessValidity() method
  • Write working code for checking guess length
  • Use the debugger to test the return values.

(Unique Video Reference: 28_BC_URC)

Writing Error Checking Code
  • Use our error values to communicate with user
  • All our user interaction is via GameManager.cpp
  • We’ll use FText in this file, as it’s UI text
  • We can “switch” what we say based on the error
  • The syntax of a switch statement
  • Remember your break keywords!

(Unique Video Reference: 29_BC_URC)

Using switch Statements
  • Don’t get comfortable with compiler warnings
  • Refactor GetValidGuess() to remove warning
  • Rename SubmitGuess() to SubmitValidGuess()
  • Improve readability of SubmitValidGuess()
  • Get a warm fuzzy feeling!

(Unique Video Reference: 30_BC_URC)

Warm Fuzzy Feelings
  • Change our PlayGame() loop to a while
  • Implement our IsGameWon() function

(Unique Video Reference: 31_BC_URC)

Handling Game Win Condition

Wahoo, 10 more lectures down... are you feeling clever yet?

Mid Section Quiz
10 questions

Write a method to print a game summary to the screen once the game is over.

(Unique Video Reference: 32_BC_URC)

Win or Lose "Screen"
  • Algorithm: the recipe for solving a problem
  • or: 45th US Vice President’s dance style
  • Introducing the complexity of algorithms
  • A quick introduction to “Big O” notation
  • Comparing three ways of checking for isograms.

(Unique Video Reference: 33_BC_URC)

Introducing Big O Notation
  • The importance of knowing your data types
  • Introducing the std::map data type
  • #define TMap std::map to keep it ‘Unreal’
  • How we’ll be using the map
  • TMap\ LetterSeen; to declare
  • Using LetterSeen[Letter] to access
  • Wiring-up and pseudocoding IsIsogram()

(Unique Video Reference: 34_BC_URC)

TMap and map Data Structures
  • Introducing containers and iterators
  • Using a range-based for loop in Unreal*
  • Gently introducing the auto keyword
  • Finishing our IsIsogram()

Useful Links

  • * Unreal Engine - Ranged Based For Loops

(Unique Video Reference: 35_BC_URC)

Range-based for Loop
  • Gain confidence with a multi-stage challenge
  • A word on implicit dependencies

(Unique Video Reference: 36_BC_URC)

Design a Helper Function
  • Having someone else play test your game is vital
  • Silently take notes, or record screen if possible
  • Immediately go away and fix obvious bugs
  • For improvements consider 2nd or 3rd opinion
  • Repeat until the bug / issue rate plateaus.

(Unique Video Reference: 37_BC_URC)

Playtesting Your Game
  • About the flow channel*
  • map word length to max tries
  • Play test to determine correct difficulty.

Useful Links

  • * Read more in Sylvester, T. Designing Games - O’Reilly

(Unique Video Reference: 38_BC_URC)

Difficulty & Play Tuning
  • First impressions count (think reviews)
  • Don’t ship a half-baked product, even if digital
  • Check through your code (polish)
  • Ship to your customers (package).

(Unique Video Reference: 39_BC_URC)

Polishing & Packaging

Congratulations on getting this far. Check your knowledge, watch the wrap-up video and start the next section right away!

End Of Section Quiz
7 questions
  • HUGE congratulations on your progress

  • Over 5 hours of pure C++ learning

  • Over 30 challenges you’ve completed

  • The journey has only just begun

  • Share your source code for others to play

  • Here are some suggested improvements

  • Next we take the game logic into Unreal :-)

(Unique Video Reference: xx_BC_URC)

Section 2 Wrap-Up
+ Building Escape - Your First Unreal C++ Game
48 lectures 07:54:23
  • Welcome to our first Unreal editor section.
  • You’ll learn simple level building.
  • We’ll be using meshes and materials.
  • C++ events accessed from Blueprint.
  • Calling C++ code from Blueprint.
  • And much more.

(Unique Video Reference: 1_BE_URC)

Intro, Notes & Section 3 Assets

The Concept, Rules and Requirements of our simple game.

(Unique Video Reference: 2_BE_URC)

S03 Game Design Document (GDD)
  • An overview of the finished project.

(Unique Video Reference: 1b_BE_URC)

Building Escape Overview
  • The what and why of Version Control Systems
  • Choosing your Version Control System (VCS)
  • What files to include / exclude
  • Commit = save a local snapshot
  • Reset = roll-back to a previous state
  • Branch, Push and Large File Support later.

(Unique Video Reference: 3_BE_URC)

Version Control 101
  • Derived files can be easily rebuilt
  • Other files (code, assets, level layout etc) can’t
  • Ignore most derived files for version control
  • Which folders to ignore in version control
  • Our starting .gitignore file for Unreal.

(Unique Video Reference: 4_BE_URC)

Ignoring Unreal Derived Files
  • Understand Unreal creates VS projects for us
  • How to re-generate VS project files
  • Writing our first .gitignore file
  • “Committing” our project for the first time.

(Unique Video Reference: 5_BE_URC)

Your First .gitignore for Unreal
  • Why changes to the starter scene aren’t tracked
  • Arranging a simple set of windows
  • Moving around in the 3D Viewport
  • Setting our start map, and committing

(Unique Video Reference: 6_BE_URC)

Preview 08:23
  • You’re about to meet pointers for the first time

  • The clue is when you see a * next to a type

  • Pointers are simply memory addresses

  • You have to “follow” the pointer to the object

  • Benefit: saves you from moving things in memory

  • Disadvantage: you can lose control of data.

(Unique Video Reference: 6b_BE_URC)

A Pointers Primer
  • Introducing the idea of inheritance
  • Unreal’s scarily powerful class system
  • Exploring using the Class Viewer
  • Inheritance for “is a” relationships
  • Components for “has a” relationships.

(Unique Video Reference: 7_BE_URC)

Unreal’s Class System
  • Cloning our project.
  • Checking out a lectures state.
  • How Unreal’s build system works.
  • Diagnosing build system issues.

(Unique Video Reference: 7b_BE_URC)

Cloning and Building Our Code
  • Using UE_LOG to print to the Output Console
  • Printing to the game screen

Useful Links + Epic Wiki - Logs, Printing Messages to Yourself During Runtime

(Unique Video Reference: 8_BE_URC)

Runtime Messages for Feedback
  • Use GetOwner() to find the component’s owner
  • *AActor is a pointer to an actor, a new concept
  • Use -> to access methods through pointers
  • Use GetName() to find the object’s name
  • Use %s as a format operator for strings
  • Use * to “dereference” pointers.

(Unique Video Reference: 9_BE_URC)

Accessing Object Names
  • Converting old projects to IWYU.
  • Order of headers with IWYU.
  • Removing monolithic headers.
  • How to find headers.

(Unique Video Reference: 9b_BE_URC)

Include What You Use For 4.17+
Mid Section Quiz
9 questions
  • Introducing FVector
  • Mixing . and -> to access methods
  • Using multiple format operators
  • Finishing our PositionReport component.

(Unique Video Reference: 10_BE_URC)

Getting Transforms in C++
  • A little more about the editor & temporary actors
  • How to eject yourself from the possessed pawn
  • Snapping objects to the floor (END key)
  • Using the FRotator struct to represent rotation
  • Use SetActorRotation() to rotate objects.

(Unique Video Reference: 11_BE_URC)

Moving Objects With C++
  • A brief intro of BSP “vs” Static Meshes
  • Use Q, W, E keys to translate, rotate, scale
  • Make good use of grid snapping and quad view
  • Hold ALT + drag translate to duplicate an object
  • Hold L and double-click for temporary work Light
  • This is fiddly, try letting go of L and trying again.

(Unique Video Reference: 12_BE_URC)

Laying Out Geometry
  • A material is comprised of texture(s) and shader(s)
  • Textures are image files, shaders are GPU code
  • Unreal ships with some impressive examples
  • Unreal has powerful material editing tools
  • Applying materials to our room interior.

(Unique Video Reference: 13_BE_URC)

Applying Materials
  • A macro is a programmed cut-and-paste
  • This happens before the code is compiled
  • Can unlock powerful functionality
  • We don’t get code complete as standard
  • Can also create really weird build errors
  • Expose ATriggerVolume* to the Details window

(Unique Video Reference: 14_BE_URC)

Macros Starting with UPROPERTY
  • A trigger volume is a very versatile tool
  • A 3D volume that detects things entering / leaving
  • We’re going to use one as a pressure plate
  • How we’re going to specify what can open doors
  • Use IsOverlappingActor() on ATriggerVolume
  • Polling vs using events.

(Unique Video Reference: 15_BE_URC)

Preview 10:14
  • We’ve used GetOwner() to search “bottom-up”
  • Now let’s use GetWorld() to search “top-down”
  • Game Mode specifies the Default Pawn Class
  • The Default Pawn is your “body”, is transient
  • The Player Controller is your “mind”, persist
  • PlayerController class has GetPawn()

(Unique Video Reference: 16_BE_URC)

Unreal’s PlayerController
  • Collisions volumes are also known as colliders
  • These tell the physics engine what hits what
  • A trigger volume just triggers code
  • A collider actually has physics simulated
  • Exploring how to add collision volumes
  • Prevent players from passing through the door!

(Unique Video Reference: 17_BE_URC)

Using Collision Volumes
  • Using GetWord()->GetTimeSeconds()
  • Making our game highly “play tunable”
  • Re-factoring our code for simplicity
  • Using a spotlight to provide “affordance”
  • Play-testing to ensure the game is annoying!

(Unique Video Reference: 18_BE_URC)

Using GetTimeSeconds()
  • We want to be able to lift the chair next
  • We’ll add a Grabber.cpp component to the player
  • The player is a temporary actor, appears on play
  • The Game Mode sets which Default Pawn to use
  • Create Default Pawn & Game Mode Blueprints
  • Specify our modified Default Pawn.

(Unique Video Reference: 19_BE_URC)

Grabbing System Overview
Mid Section Quiz
10 questions
  • Why Blueprint is helpful in this case
  • How to make a Blueprint from the Default Pawn
  • Note this Blueprint class inherits, an “is a” relation
  • A Blueprint is like a template
  • You make an “instance” in the scene
  • Explore “instantiating” from Blueprint & modifying.

(Unique Video Reference: 20_BE_URC)

Preview 07:28
  • “Hard coding” means assets written into code
  • The DefaultPawn_BP is an asset
  • We want to be able to track changes to its name
  • It is convenient to use Blueprint for this purpose
  • Extending our C++ Game Mode with Blueprint
  • Selecting the new DefaultPawn_BP

(Unique Video Reference: 21_BE_URC)

Preview 07:05
  • Know where the player is looking
  • Out-parameters can be confusing
  • A way of marking-up out parameters
  • Continuously logging player viewpoint.

(Unique Video Reference: 22_BE_URC)

Getting Player Viewpoint
  • How to add vectors
  • Calculating our line trace end point
  • Using debug functions for visualisation in Unreal
  • Use DrawDebugLine() to visualise the vectors.

(Unique Video Reference: 23_BE_URC)

Using DrawDebugLine
  • Line tracing (AKA ray casting) is a very useful tool
  • Imagine we shine a virtual laser into the world
  • We can use different view modes to visualise
  • Simulating physics sets the object channel.

(Unique Video Reference: 24_BE_URC)

Line Tracing AKA Ray-Casting
  • Meet references for the first time
  • LineTraceSingle may be deprecated
  • Build params inc. FCollisionQueryParams

(Unique Video Reference: 25_BE_URC)

  • How references and pointers compare
  • How to perform common operations in both
  • What the & and * symbols means in context
  • Challenge: Repoint and Rewrite
  • When to use references over pointers?

(Unique Video Reference: 26_BE_URC)

  • What to do if your Unreal solution keeps crashing
  • How to delete all temporary files
  • The order in which to reset things

(Unique Video Reference: 27_BE_URC)

Resetting Your Unreal Project
  • What FindComponentByClass() does
  • How to use it to find attached components
  • Introducing angle brackets <> for generics
  • Use nullptr to initialise your pointers
  • Log a useful error if the component isn’t attached.

(Unique Video Reference: 28_BE_URC)

Using FindComponentByClass()
  • Settings > Project Settings > Engine > Input
  • Action mappings are used for on / off actions
  • Axis mappings are used for analog values
  • You can give players a way or re-mapping
  • Many keys can bind to one action
  • How to call a function on a key press or release

(Unique Video Reference: 29_BE_URC)

Introducing Input Binding
  • How the arrow, dot and :: accessors work
  • Introducing virtual memory
  • Introducing permanent storage, stack & heap
  • Heap is also known as free store
  • How accessor operators relate to memory
  • Bind another input action

(Unique Video Reference: 30_BE_URC)

Accessors & Memory Layout
Mid Section Quiz
10 questions
  • A “hot loop” is code that get called often
  • TickComponent is a good example, every frame
  • Beware of code that you know will be called a lot
  • Make it clear what happens every tick
  • Refactor our code for speed...
  • ...and make it ready for for the physics handle.

(Unique Video Reference: 31_BE_URC)

Reducing Code in “Hot Loops”
  • Unreal provides a Physics Handle that’s ideal here
  • The Physics Handle component docs are scant*
  • Find an example of its use in the engine
  • Get the physics handle working.

Useful Links

  • Unreal Engine API Reference - UPhysicsHandleComponent

(Unique Video Reference: 32_BE_URC)

Using Physics Handles
  • Using multiple getters for multiple return values
  • Less lines of clear code is better (143 at start)
  • Naming is really important, take the time
  • Comment the “why”, don’t assume it’s obvious
  • The “what” should be obvious...
  • … but it can be helpful to add clarification

(Unique Video Reference: 33_BE_URC)

Refactoring Rules
  • A TArray is Unreal’s go-to container class
  • Use to contain many elements of same type
  • We’ll use to contain all actors on pressure plate
  • Give our Default Pawn an eye-height and mass
  • Making our pressure-plate based on total mass.

(Unique Video Reference: 34_BE_URC)

Introducing Unreal’s TArray
  • Using auto& as an auto reference type
  • Automatically iterating over a TArray
  • Pattern: for (const auto* Iterator : Array)
  • How to find an actor’s mass
  • Tweaking and testing our mass values.

(Unique Video Reference: 35_BE_URC)

Iterating over TArray with for
  • Are you using source control? If not start now
  • You can “binary search” commits quite fast
  • For example 1024 commits takes max 10 tries!
  • Think “what changed” and “possible side-effects”
  • Remember you can eject with F8 during play.

(Unique Video Reference: 36_BE_URC)

Debugging Game Issues
  • You may want to re-size objects (e.g. panels)
  • Doing so will stretch the texture
  • You can re-scale a few ways
  • One way is in the material blueprint
  • UV mapping because we ran out of letters!
  • Using the TexCoord node in the material editor.

(Unique Video Reference: 37_BE_URC)

Managing Texture Tiling
  • Horrible crashes when we follow a nullptr
  • We must always check pointers before use
  • When declaring always initialise to nullptr
  • Look for * in your .h files to help find pointers
  • Also check before every use and handle nullptr
  • Sometimes we may chose not to, e.g. Owner.

(Unique Video Reference: 38_BE_URC)

Pointer Protection Process
  • Sometimes Blueprint’s the better choice
  • For example defining our door swing as a curve
  • We can create an event called OnOpenRequest
  • Using UPROPERTY (BlueprintAssignable)

(Unique Video Reference: 39_BE_URC)

Exposing Events to Blueprint
Mid Section Quiz
10 questions
  • The Timeline node in Blueprint has a curve editor
  • This is ideal for defining our door movement
  • How to use Timeline curves in Blueprint
  • Setting rotation from a Timeline.

(Unique Video Reference: 40_BE_URC)

Using Blueprint Timeline
  • Using Blueprint has superseded some code
  • It’s important there’s only 1 place per parameter
  • Creating a 2nd event: OnClose

(Unique Video Reference: 41_BE_URC)

Everything in its Place
  • Not all doors have the same absolute rotation
  • We want to store the door’s rotation at the start
  • … then use this value to make a relative rotation
  • We can use Blueprint variables for this
  • Making doors that face any direction work.

(Unique Video Reference: 42_BE_URC)

Using Variables in Blueprint
  • We’re going to trigger a simple sound in Blueprint
  • Later in the course we’ll use C++ too
  • However we’ll always reference our assets via BP
  • How to trigger a 3D sound.

(Unique Video Reference: 43_BE_URC)

SFX & Audio Clips
Section End Quiz
5 questions
  • Congratulations on another complete section

  • You’ve learnt so much, look at the lecture titles

  • Please carry-on a little on your own and share

  • Attached are useful resources

  • Start the next section as soon as you’re finished.

(Unique Video Reference: xx_BE_URC)

Section 3 Wrap-Up
+ Battle Tank - A Fun Tank Battle with Mortars
122 lectures 22:13:27
  • Battle Tank is an open world tank fight
  • This will be a head to head battle
  • Other player can be human or simple AI
  • Heavy focus on control systems
  • Also learning terrains, UI, terrain sculpting & more
  • Dive right in and enjoy yourself!

(Unique Video Reference: 1_BT_URC)

Intro, Notes & Section 4 Assets
  • An overview of the finished Battle Tank project.

(Unique Video Reference: 1b_BT_URC)

Battle Tank Overview
  • The Concept, Rules and (initial) requirements
  • We’ll iterate around a loop while making this game
  • Constantly asking “what’s least fun”
  • Remember we’re not AAA studios
  • Let’s find the essence of fun of this game.

(Unique Video Reference: 2_BT_URC)

S04 Game Design Document (GDD)
  • Creating an online repository for your project
  • GitHub provides public hosting for free
  • We will use their default UnrealEngine .gitignore
  • We’ll then “clone” this repository to our machine
  • How to use a readme.md with markdown*

(Unique Video Reference: 3_BT_URC)

Setting Up a GitHub “Repo”
  • Creating an Unreal project in an existing “repo”
  • What’s good about Landscapes in Unreal Engine
  • How to add a Landscape in Unreal
  • How to delete a Landscape in Unreal.

(Unique Video Reference: 4_BT_URC)

Creating & Deleting Landscapes
  • You can change position & rotation later
  • Scale will impact terrain size, so set on creation
  • How to choose your “Section Size”
  • The effect of the “Number of Components”
  • Creating a landscape of a specific scale.

(Unique Video Reference: 5_BT_URC)

Landscape Setup & Scaling
  • Sculpt: hills, valleys & flat areas
  • Smooth, flatten & ramp: create useful features
  • Erosion & noise: make it more organic
  • Paint: use layered materials
  • Details: add details (foliage, trees, etc)

(Unique Video Reference: 6_BT_URC)

A Landscaping Process
  • Epic games launcher helps manage versions
  • Remember to commit your project first
  • You can then “Convert in-place”
  • Check your project runs OK in new version
  • Close everything and re-commit
  • How to tag a commit in GitHub.

(Unique Video Reference: 7_BT_URC)

Upgrading Engine Version
  • Create a material for your landscape
  • Set Usage > Used with Landscape
  • LandscapeLayerBlend node & Vector Parameters
  • Add at at least two layers & create LayerInfo
  • Paint the landscape from the Modes tab
  • Screenshot and share with us

(Unique Video Reference: 8_BT_URC)

Using Landscape Layers
  • Unreal’s tools are setup for photoreal landscapes
  • Once you set the bar high, the rest must match
  • An alternative is to opt for a low-poly look...
  • ...then you can focus on gameplay, story, sound
  • Can be a good choice for smaller teams
  • How to make low-poly, flat-shaded landscapes.

(Unique Video Reference: 9_BT_URC)

Flat Shading Low Poly Landscapes
  • How to make flat shading optional
  • Importing and exporting landscape heightmaps
  • Reducing the resolution of a landscape
  • Using a texture in a landscape material.

(Unique Video Reference: 10_BT_URC)

More Landscaping Tools
Mid Section Quiz
9 questions
  • Support keyboard, mouse & gamepad controller
  • Mapping player intentions to control inputs
  • Mapping control inputs to actor actuators
  • Introducing the concept of “fly by wire”.

(Unique Video Reference: 11_BT_URC)

Tank Control System
  • Import the tank in 4 static mesh parts
  • Assemble the parts using sockets
  • Create our Tank_BP and test.

(Unique Video Reference: 12_BT_URC)

Actors from Multiple Meshes
Improved Models
  • Add mass to the tank
  • Fine-tune track position
  • Replace root component in Tank_BP
  • Enable physics and assign a mass
  • Set the tank as the Default Pawn
  • Setup PlayerStart and debug start collisions.

(Unique Video Reference: 13_BT_URC)

Configuring a Tank
  • Horizontal Coordinate System
  • Setup a Camera Spring Arm
  • Why the Spring Arm alone isn’t enough
  • How rotations don’t “commute”
  • Binding mouse and gamepad to camera control.

(Unique Video Reference: 14_BT_URC)

3rd Person Camera Control
  • Use a Scene Root as azimuth gimbal
  • Use the Spring Arm for elevation control
  • Adjust the Spring Arm length
  • Set the camera rotation to 0 (down the arm)
  • Decide if you want the camera to roll or not.

(Unique Video Reference: 15_BT_URC)

Fixing 3rd Person Camera Rotation
  • Create a Widget Blueprint for the aim point
  • Decide the Player Controller with create the UI
  • Create widget and add to viewport in Blueprint
  • Override the Player Controller in the game mode.

(Unique Video Reference: 16_BT_URC)

User Interface (UI) in Unreal
  • Create a dedicated Scene for the Main Menu
  • Use the Level Blueprint to configure UI
  • Add a background image to get started.

(Unique Video Reference: 17_BT_URC)

Main Menu Screens
  • Show mouse cursor in Unreal UI
  • Use a Scale Box for background image scaling
  • Add a Start button
  • Customise fonts inside our UI Widget
  • Set anchors so UI scales to different aspect ratios.

(Unique Video Reference: 18_BT_URC)

UI Scale Box, Buttons & Mouse
  • Bind Start button event to Blueprint
  • Create custom WidgetReady event
  • Make Start menu button focused on play
  • Ensure we can quit from the game
  • Aim towards Steam “Full Controller Support”.

(Unique Video Reference: 19_BT_URC)

Controller Ready Navigation

Based on where you are in the course, we're going to assume you’re already familiar with the Blueprint tools for UMG (Unreal's UI framework). These are definitely the best way to go about designing your interfaces. Who wants to be doing that in C++!

But there are good reasons to be using C++ for the logic driving your UI: version-ability, performance or just preference. How can we seamlessly bind our clean, performant C++ to the beautiful UI design created by the editor? 

This post outlines the tips and tricks Sam has learnt, including...

  • Basic setup
  • Creating a Blueprint Widget from C++
  • Widget Setup
  • Getting to your Blueprint widgets
  • Binding callbacks
  • More cool UI stuff…

Read the full post: https://blog.gamedev.tv/creating-unreal-engine-ui-with-umg-and-c/


Ben & Sam

Creating Unreal Engine UI with UMG and C++
  • Creating a stand-alone game
  • Setting the first level that loads
  • Making sure the input mode works
  • Setting-up for “Full Controller Support”.

(Unique Video Reference: 20_BT_URC)

Trial Packaging Your Game
Mid Section Quiz
9 questions
  • How delegation can hide information
  • Creating a custom Player Controller class
  • Re-parenting Blueprint classes onto our C++

(Unique Video Reference: 21_BT_URC)

Delegating to Components
  • A virtual method can be overridden by children
  • The override keyword is a sanity check
  • Use Super:: to include parents’ functionality
  • Use this to add BeginPlay() to PlayerController.

(Unique Video Reference: 22_BT_URC)

Using virtual and override
  • What is polymorphism?
  • How to overload functions.
  • Using run-time polymorphism.

(Unique Video Reference: 22b_BT_URC)

Overloading and Polymorphism
  • How methods are called.
  • Why we need the virtual method.
  • How Vtables implement this.
  • See how the assembly changes.

(Unique Video Reference: 22c_BT_URC)

Virtual Functions and Vtables
  • How to create a AIController based C++ class
  • Assigning an AI Controller to a Pawn
  • Verifying which pawns are possessed
  • Logging possession to the console.

(Unique Video Reference: 23_BT_URC)

Creating an AI Controller Class
  • Getting the AI to find the player position
  • We won’t implement line-of-sight for simplicity
  • UGameplayStatics::GetPlayerController()
  • Or GetWorld()->GetFirstPlayerController()

(Unique Video Reference: 24_BT_URC)

Get the Player Controller with C++
  • Revise adding engine methods into new classes
  • Pseudocode our initial aiming logic
  • Learn about Visual Assist for Visual Studio.

(Unique Video Reference: 25_BT_URC)

Add Tick() to PlayerController
  • Out parameters smell a little but are used a lot
  • Allows you to return a bool and a FVector
  • Alternative architecture would be a struct or class
  • We’ll do it this way to get you more comfortable with creating your own methods using out parameters.

(Unique Video Reference: 26_BT_URC)

Creating an Out Parameter Method
  • Use FVector2D() to store pixel coordinates
  • This is two floats, pixels can be non-integer
  • Revising UPROPERTY(EditAnywhere) and more.

(Unique Video Reference: 27_BT_URC)

Finding Screen Pixel Coordinates
  • How to find the camera look direction
  • What the WorldLocation parameter does
  • WorldDirection returned is a unit vector.

(Unique Video Reference: 28_BT_URC)

Using DeprojectScreenToWorld
  • We want world position of anything visible
  • GetWorld()->LineTraceSingleByChannel()
  • Use the ECC_Visibility channel for what’s seen
  • Remember HitResult is a rich object
  • Use HitResult.Location for Location member.

(Unique Video Reference: 29_BT_URC)

Using LineTraceSingleByChannel()
  • AI and Player possessed tanks aim the same way
  • Later the tank will delegate aiming
  • But the AI/Player controllers don’t care
  • This provides nice abstraction
  • We also hide implementation details
  • … and make the game more fair.

(Unique Video Reference: 30_BT_URC)

Unify Player & AI Aiming
Mid Section Quiz
10 questions
  • You can add required components in C++
  • Our Tank Aiming Component is a good candidate
  • We will delegate all AimAt() requests…
  • … regardless of their source (AI or player).

(Unique Video Reference: 31_BT_URC)

Create Default Sub Objects in C++
  • Why StaticMeshComponet is prefixed with U
  • Creating a setter for the barrel reference
  • How to name parameters in setters
  • Using BlueprintCallable() to call C++ from BP
  • Finding the start position of or projectile.

(Unique Video Reference: 32_BT_URC)

  • How speed and velocity relate
  • The high and low projectile arc
  • Setting a launch speed on the tank
  • Introducing SuggestProjectileVelocity()

(Unique Video Reference: 33_BT_URC)

  • Use SuggestProjectileVelocity() in Unreal
  • Work out where a projectile will land.

(Unique Video Reference: 34_BT_URC)

Predict Projectile Landing Point
  • A FRotaor is a struct
  • It contains Roll, Pitch and Yaw as floats
  • Convert using .Rotation() method
  • Report aim direction as a rotator
  • Log result to the console in Unreal.

(Unique Video Reference: 35_BT_URC)

Using FRotators in Unreal
  • More about the Unreal Header Tool (UHT)
  • Pre-processing happens first, e.g. on macros
  • Then compilation produces .obj files
  • These .obj files are linked by the linker
  • How to #include strategically.

(Unique Video Reference: 35b_BT_URC)

The C++ Compilation Process
  • If we #include in a .h file we create a “chain”
  • Any .h file that includes us will in-turn include
  • This can be hard to keep track of
  • To simply use a type, we can “forward declare”
  • Simply put class ClassName; under the includes
  • You’ll still need to #include in the .cpp to use.

(Unique Video Reference: 36_BT_URC)

Using Forward Declarations
  • In actor blueprints you have custom components
  • Static mesh components don’t appear by default
  • Use BlueprintSpawnableComponent annotation
  • Using hidecategories = ("CategoryName")

(Unique Video Reference: 37_BT_URC)

  • How to disable or enable tick on various classes

  • GetWorld()->GetTimeSeconds() for logging

  • Documenting your execution flow for clarity

  • Change parameter names for clarity.

(Unique Video Reference: 40_BT_URC)

Review Our Execution Flow
  • If something’s weird break it down
  • Use logs or the debugger to follow each step
  • SuggestProjectileVelocity() has a bug*
  • … it MUST have an optional parameter!?
  • Moving to forward declarations.

Useful Links

  • * UE4 Answer Hub - SuggestProjectileVelocity() Behaving Badly

(Unique Video Reference: 41_BT_URC)

How to Report Bugs
Mid Section Quiz
10 questions
  • FMath::Clamp\(Input, Min, Max);

  • Very useful for restricting value ranges

  • Clamp our Barrel’s elevation

  • Wire it to the aiming component

  • Test barrel elevation works.

(Unique Video Reference: 42_BT_URC)

Using Clamp() to Limit Values

This mid-section challenge will help you integrate your knowledge and really cement what you’ve done in the past few lectures. It will also give you a great foundation of practical understanding on which to build. Please give it a good shot before watching my solution.

(Unique Video Reference: 43_BT_URC)

CHALLENGE - Turret Rotation

This is the 2nd part of the solution to this section’s longer challenge. We’ll be finishing off the turret rotation, giving us complete barrel aiming control by the end :-)

(Unique Video Reference: 44_BT_URC)

CHALLENGE - Turret Rotation Pt.2
  • Create a public Fire() method on our tank
  • Bind input via Blueprint
  • Call this new C++ method to test
  • Create a Projectile class, and Blueprint it.

(Unique Video Reference: 45_BT_URC)

Setting Up Projectiles
  • Multiple versions of the engine take up GB
  • Upgrade Building Escape and Battle Tank
  • Learn more about using source control
  • Using Stash in source control
  • Fixing issue with overlapping collision volumes.

(Unique Video Reference: 46_BT_URC)

Upgrading to Unreal 4.12
A Note About The Movement Bug
  • About AutoWeld compound objects
  • Working through self-collision issues
  • Disabling gravity on subobjects
  • A reminder Unreal is designed for humanoids.

(Unique Video Reference: 47_BT_URC)

Working Round Awkward Bugs
  • Using TSubclassOf\
  • More about forward declarations
  • How to use GetWorld()->SpawnActor()
  • How to spawn projectiles from a weapon.

(Unique Video Reference: 48_BT_URC)

Using SpawnActor<>() to Spawn
  • Recap use of CreateDefaultSubobject()
  • Use a ProjectileMovementComponent
  • Get our tank delegating launch to projectile.

(Unique Video Reference: 49_BT_URC)

Projectile Movement Components
  • Inline some code for readability
  • Inlining can also be called “defactoring”
  • Less lines of code is often better*
    • everything else being equal
  • FPlatformTime::Seconds() is an accurate timer
  • Make AI tanks fire on every frame.

(Unique Video Reference: 50_BT_URC)

Making AI Tanks Fire
  • EditAnywhere allows all instances to be edited
  • For example each AI tank could be different
  • EditDefaultsOnly allows “architype” editing
  • In other words, all tanks must be the same
  • Think which you want in future.

(Unique Video Reference: 51_BT_URC)

EditAnywhere vs EditDefaultsOnly
Mid Section Quiz
10 questions
  • Using primitive colliders in Unreal
  • Adding a quit button to our main menu.

(Unique Video Reference: 52_BT_URC)

Adding a Quit Button
  • Base Tank Tracks on UStaticMeshComponent
  • Create a BlueprintCallable throttle method
  • Bind input to track throttles
  • Discuss what Input Axis Scale does.

(Unique Video Reference: 53_BT_URC)

Setup Track Throttles
  • GetComponentLocation() does what it says!
  • Find root: GetOwner()->GetRootComponent());
  • Cast to UPrimitiveComponent so you can…
  • AddForceAtLocation();
  • Estimate sensible defaults for driving forces.

(Unique Video Reference: 54_BT_URC)

ApplyForceAtLocation() in Action
  • You can assign a physics material under collision
  • Friction is combined between two surfaces
  • The coefficient is the proportion of the contact force that can be exerted sideways before slip.
  • Adjust friction and driving forces to get movement.

(Unique Video Reference: 55_BT_URC)

Physics Materials & Friction
  • Fly-by-wire means translating control intention
  • How control intention maps to track throttles
  • Creating a TankMovementComponent C++ class
  • Why inherit from UNavMovementComponent

(Unique Video Reference: 56_BT_URC)

Fly-by-Wire Control System
  • Bind some input for forward and backward
  • Make the method BlueprintCallable
  • Make TankMovementComponent a default on tank
  • Make a protected tank variable to store pointer
  • Make this pointer BlueprintReadOnly pointer
  • Test that you get a log of +/-1.

(Unique Video Reference: 57_BT_URC)

Using BlueprintReadOnly
  • Actor components require instance references
  • We were passing these references from the tank
  • But we could equally keep them locally
  • Move to composing our actor in Blueprint
  • Create an initialise method for aiming
  • Test it works and hail the simpler code.

(Unique Video Reference: 58_BT_URC)

A Better Component Architecture
  • Add IntendTurnRight() method
  • Bind firing input to the “A button”
  • Test we can move manually with fly-by-wire.

(Unique Video Reference: 59_BT_URC)

Completing Manual Tank Movement
  • Pathfinding is finding the shortest possible path
  • This requires some (artificial) intelligence
  • All pathfinding must happen on a navmesh
  • Adding Nav Mesh Bounds to the level
  • An overview of how MoveToActor() and RequestDirectMove() work.

(Unique Video Reference: 60_BT_URC)

Introducing AI Pathfinding
  • We have access to Unreal’s source code
  • Let’s look into the UNavMovementComponent.h
  • We’re looking for RequestDirectMove()
  • We’ll override it without calling Super
  • We can then get the golden MoveVelocity vector
  • AI tanks can now use our fly-by-wire controls!

(Unique Video Reference: 61_BT_URC)

Dissecting RequestDirectMove()
Mid Section Quiz
10 questions
  • Focusing on controlling forward speed of AI
  • If target in front, move forward full speed
  • If target to side, don’t move forward
  • Vary smoothly in-between
  • This sounds like a cosine function to me!
  • Using FVector::DotProduct()

(Unique Video Reference: 62_BT_URC)

DotProduct() Vector Operator
  • Focusing on controlling turning of AI
  • If target in front or behind* don’t rotate
  • If target to side rotate at full speed
  • This is the behaviour of a sin function
  • Using FVector::CrossProduct()

(Unique Video Reference: 63_BT_URC)

CrossProduct() Vector Operator
  • Private, protected or public? Use the safest
  • UPROPERY / UFUNCTION needed? Use “”
  • #include and forward declarations required?

(Unique Video Reference: 64_BT_URC)

Finalising Your Class Code
  • Remember “what’s the least fun thing about this?”
  • One thing is not knowing if you can fire
  • How to change crosshair colour in blueprint…
  • … according to the aiming component state
  • States: Locked, Aiming, Reloading
  • Referencing actor component from player UI.

(Unique Video Reference: 65_BT_URC)

How to Use Blueprint Variables
  • We met enum class around lecture 35
  • In Unreal we must annotate with UENUM()
  • We must specify the storage type (uint8)
  • See Unreal’s coding standards in Resources
  • Remember we use enums to encode meaning.

(Unique Video Reference: 66_BT_URC)

Using Enum(erations) in UE4
  • Move away from CreateDefaultSubObject()
  • Make aiming a BlueprintSpawanableComponent
  • Get our code re-compiling as soon as possible
  • Experience hard crash and add pointer protection
  • Possibly get exasperated that we can’t find the suspected null-pointer causing the crash.

(Unique Video Reference: 67_BT_URC)

Refactoring our Aiming Component
  • Hard crashes can be difficult to diagnose
  • Attach your IDE’s debugger to the Unreal editor
  • Use it to discover the source (often null pointer)
  • We can also probe using Print in blueprint.

(Unique Video Reference: 68_BT_URC)

Attaching a Debugger to Unreal
  • Adding log entries to C++ and BP helps you to uncover the timing over events in the engine
  • We’re doing this to discover exactly when Construct and Begin Play gets called in both C++ and Blueprint
  • Note dropped actors are constructed in editor.

(Unique Video Reference: 69_BT_URC)

Constructor & Begin Play Timing
  • We don’t have a Aiming Component reference
  • It is hard to find a sensible time to set it
  • Also we don’t need the reference on the tank
  • We can Get Components by Class in Blueprint
  • Mock-up our C++ code in Blueprint.

(Unique Video Reference: 70_BT_URC)

Decoupling Your Architecture
  • We want to expose a C++ function to Blueprint
  • We also want to pass a parameter (aiming ref.)
  • Multicast delegates only work like this for actors
  • We’re using a component so we use…
  • UFUNCTION(BlueprintImplementableEvent)
  • You don’t need to define the function!

(Unique Video Reference: 71_BT_URC)

Mid Section Quiz
10 questions

(Unique Video Reference: 72_BT_URC)

Using the ensure Assertion
  • Code architecture can be hard to see
  • Dependency mapping shakes-out the structure
  • Go through your .cpp files and look at includes
  • Map these as dependencies on a diagram
  • If it looks like spaghetti, you need to refactor!

(Unique Video Reference: 73_BT_URC)

Dependency Mapping
  • Congratulations on getting this far
  • We’re not teaching sterile solutions here
  • We’re showing you how to recognise real issues
  • … and how to tackle them sensibly
  • It’s not the easy path, but it is the valuable one.

(Unique Video Reference: 74_BT_URC)

Talking Head - Real World Skills
  • You should probably only refactor working code
  • Red means your code’s not working
  • Green means it is, even if the code is messy
  • We commit at green, then start refactoring.

(Unique Video Reference: 75_BT_URC)

Starting From Green
  • There is no need to cast the Pawn to a Tank
  • Doing so creates a dependency we don’t want
  • Remember a Tank is a Pawn
  • We simplify our architecture here.

(Unique Video Reference: 76_BT_URC)

Aiming Without the Tank
  • Removing our final dependencies
  • If you override BeginPlay() in an actor you should call Super::BeginPlay()
  • If you don’t override it at all, there’s no need to, your Blueprint Begin Play will still run.

(Unique Video Reference: 77_BT_URC)

Finishing our Refactoring
  • Actor Components use TickComponent not Tick
  • You can find the signature in docs online
  • Or by copying from the engine code
  • Remember to use override at to check
  • Remember to set the boolean in the constructor
  • GetWorld()->GetTimeSeconds() alternative.

(Unique Video Reference: 78_BT_URC)

Adding TickComponent() Back
  • FVectors are just structs containing float
  • You must “define equal” when comparing floats
  • The FVector::Equals() method allows this
  • Specify a tolerance, see docs in resources.

(Unique Video Reference: 79_BT_URC)

Are Two Floats Equal?
  • We can apply a sideways correction force
  • Remember Force = Mass * Acceleration
  • … and Acceleration = Speed / Time
  • So we calculate the force using the slippage speed,the frame time, and the tank mass
  • A way to calculate is FVector::DotProduct()

(Unique Video Reference: 80_BT_URC)

Programmatic Sideways Friction
  • We could use OnComponentHit in Blueprint
  • But we’re grown-ups so we’re going to use C++
  • Signature of OnHit(...) has changed in 4.12
  • Remember you need to make it a UFUNCTION
  • Details on next slide.

(Unique Video Reference: 81_BT_URC)

OnComponentHit Event in 4.12
  • Boolean flags usually make answers old
  • Try and think of a way of avoiding them
  • Revise the use of FMath::Clamp()

(Unique Video Reference: 82_BT_URC)

Avoiding Boolean Flags
Mid Section Quiz
10 questions
  • Use a literal glass ceiling to help with testing!
  • Sometimes the barrel takes the long route
  • A simple if() statement can help here
  • Find and fix another bug in the code
  • You can use %i formatter to log booleans.

(Unique Video Reference: 83_BT_URC)

Improving Tank Aiming
  • Expose the Acceptance Radius to blueprint
  • Tweak that value as EditAnywhere
  • Change back to EditDefaultsOnly once found
  • Prevent AI tanks firing until aiming is locked.

(Unique Video Reference: 84_BT_URC)

Tweaking Tank AI
  • Add a 4th enum state for out of ammo
  • Work around bug of blueprint select nodes not updating when we add new enum values in C++
  • Add a display for rounds remaining
  • Bind the UI to a GetRounds() method.

(Unique Video Reference: 85_BT_URC)

Making an Ammo Display
  • The tank components were built for the tank
  • It turns-out we can re-use movement and aiming
  • This is the benefit of re-usable components
  • We’ll create a self-aiming mortar tower.

(Unique Video Reference: 86_BT_URC)

Making an AutoMortar
Improved Mortar Models
  • Currently we .gitignore the Starter Content
  • Therefore we can’t track changes
  • We want a consistent starting point for particles
  • So we’re going to delete Starter Content
  • Lots depends on it so we use a special tool
  • That special tool is the reference viewer.

(Unique Video Reference: 87_BT_URC)

Using the Reference Viewer
  • We will compose our projectile in C++
  • Use SetRootComponent()
  • Use AttachTo(RootComponent)
  • You can set default properties in C++
  • Use UPROPERTY(VisibleAnywhere)

(Unique Video Reference: 88_BT_URC)

Preparing for Particles
  • Setup a Starter Content project
  • Use it to migrate assets to Battle Tank
  • Explore particle systems
  • Use world space for smoke trails
  • Create and share your smoke trail.

(Unique Video Reference: 89_BT_URC)

Introducing Particle Systems
  • Our smoke disappeared when viewed from side
  • This is due to the fixed particle bounding boxes
  • We can fix it by making the boxes dynamic
  • BUT we need to remove GPU rendered particles
  • … and test the performance hit is acceptable.

(Unique Video Reference: 90_BT_URC)

Particle Bounding Boxes
  • Use Message Log to see warnings
  • AttachTo() has become AttachToComponent()
  • Now must provide FAttachmentTransformRules
  • We’ll use KeepRelativeTransform for now
  • Write code to de-active launch blast and
  • Activate impact blast on impact.

(Unique Video Reference: 91_BT_URC)

Using FAttachmentTransformRules
Mid Section Quiz
10 questions
  • If you don’t AttachToComponent() then…
  • It will look like you’re attached but…
  • The transform may be broken and…
  • You’ll get really weird effects and…
  • Unreal may cache the issue...
  • So, always AttachToComponent() :-)

(Unique Video Reference: 92_BT_URC)

Radial Forces & Caching
  • Currently we don’t destroy our projectiles
  • This will cause slow-down and memory leakage
  • You won’t pass console testing with a leak
  • Tidy up after ourselves
  • Discuss projectile schemes
  • Destroy our projectiles with a timer.

(Unique Video Reference: 93_BT_URC)

Using GetTimerManager()
  • Unreal has an actor damage system
  • We’ll apply radial damage from the projectile
  • Then the AActor::TakeDamage() method will be called on the tank (and all other actors in radius)
  • We’ll then finish our damage system off
  • Solve the int or float damage question.

(Unique Video Reference: 94_BT_URC)

Using TakeDamage() on Actors
  • Add a UI Widget component to our tank
  • Make a very simple health progress bar
  • Wire the bar to the tank.

(Unique Video Reference: 95_BT_URC)

BlueprintPure & Health Bars

(Unique Video Reference: 96_BT_URC)

The Observer Pattern
  • We’re nearing the end of the section
  • You have several challenges over to try
  • These include various fixes and improvements...
  • Use StartSpectatingOnly() in Player Controller
  • DetachFromControllerPendingDestroy() in AI
  • Fixing a bug with our starting health

(Unique Video Reference: 97_BT_URC)

Finishing Off - Part 1
  • You can use the noise function on landscapes
  • Gameobjects are automatically destroyed when they travel a long way from the play area
  • Reviewing Unreal’s coding standards.

(Unique Video Reference: 98_BT_URC)

Finishing Off - Part 2

In this section we covered... + Basic terrain landscaping + Using and modifying the AI pathfinding system + A deep-dive into control systems + User Interface for the first time + A whole tonne of C++ and architecture.

(Unique Video Reference: 99_BT_URC)

Section 4 Wrap-Up
  • Our player controller line traces to aim
  • This can hit the UI in some circumstances
  • Change our line trace channel to ECC::Camera
  • Add a 1st person camera
  • Use the Toggle Visibility Blueprint node
  • Bind input and enjoy simple camera swapping.

(Unique Video Reference: 100_BT_URC)

Bonus - Switching Cameras
Mid Section Quiz
7 questions

Finished Battle Tank? Then you’re ready to embark on learning multiplayer. 

Here's an article that Sam recently wrote for Epic’s Official Unreal Engine blog

In it he sets out a ‘Getting Started Guide’ to help you map out the territory and take your first steps towards creating a multiplayer game of your own. 



Ben & Sam

Get Started with Multiplayer
  • Why the suspension is broken.
  • How we will fix it with a suspension.
  • Overview of how suspension works.

(Unique Video Reference: 100b_BT_URC)

Fixing The Tank Suspension

In this video (objectives)…

  1. Update the project.
  2. Fix any build errors.
  3. Fix any bad log messages.

After watching (learning outcomes)…

Can upgrade your own projects to 4.19.

(Unique Video Reference: 101_BT_URC)

Upgrade to 4.19 And Bug Fixes

In this video (objectives)…

  1. Discuss why the tank pops.
  2. Identify why real world vehicles don't.
  3. Create a physics model for our tank.

After watching (learning outcomes)…

Explain how to model a vehicle in a physics engine.

(Unique Video Reference: 102_BT_URC)

Real-world Vehicle Physics

In this video (objectives)…

  1. Introduce the physics constraint component.
  2. Combine two components with a constraint.
  3. Tweak the limits of a constraint.

After watching (learning outcomes)…

Create a physics constraint between two components and set limits.

(Unique Video Reference: 103_BT_URC)

Creating Physics Constraints

In this video (objectives)…

  1. Explain position drive.
  2. Introduce the theory of springs.
  3. Explain velocity drive.
  4. Making a suspension.

After watching (learning outcomes)…

Create a spring using the UPhysicsConstraintComponent and linear drives.

(Unique Video Reference: 104_BT_URC)

Making Springs

In this video (objectives)…

  1. Create a base class.
  2. Create all components.
  3. Configure the blueprint.

After watching (learning outcomes)…

Create Blueprint children of C++ classes derived from AActor.

(Unique Video Reference: 105_BT_URC)

Converting The Spring To C++

In this video (objectives)…

  1. Attachment with actors and components.
  2. Using GetAttachParentActor.
  3. Creating a spawning component.

After watching (learning outcomes)…

Understand component versus actor childing.

(Unique Video Reference: 106_BT_URC)

Attachment, Actors and Components
Mid Section Quiz
5 questions

In this video (objectives)…

  1. Spawning and BeginPlay.
  2. Using SpawnActorDeferred.

After watching (learning outcomes)…

Able to spawn actors using SpawnActorDeferred and know when it's needed.

(Unique Video Reference: 107_BT_URC)

SpawnActorDeferred and BeginPlay

In this video (objectives)…

  1. Remove the mass.
  2. Introducing SetConstrainedComponents
  3. Set constraint to the tank root.
  4. Add more wheels.
  5. Tweak the spring parameters.

After watching (learning outcomes)…

Setup constraints between actors in C++.

(Unique Video Reference: 108_BT_URC)

Attaching Constraints In C++

In this video (objectives)…

  1. Chaining constraints together.
  2. Setup the new Axle and its contraint.
  3. Why we need a collider to simulate physics.
  4. Using USphereComponents.
  5. Disabling collisions on the Axle.
  6. Constraining the wheel rotation.

After watching (learning outcomes)…

How to chain constraints together.

(Unique Video Reference: 109_BT_URC)

Chaining Physics Constraints

In this video (objectives)…

  1. Exposing AddDrivingForce().
  2. The requirements for GetWheels().
  3. Update DriveTrack() to apply for all wheels.
  4. Remove OnHit() and ApplySidewaysForce().
  5. How to iterate over child components.

After watching (learning outcomes)…

Iterate over child components.

(Unique Video Reference: 110_BT_URC)

Applying Wheel Driving Force


  1. Add getter to the SpawnPoint.
  2. Implementing GetWheels().

(Unique Video Reference: 111_BT_URC)

Solution: Implement GetWheels()

In this video (objectives)…

  1. Detecting no collision.
  2. Understanding Tick Groups and their order.
  3. When does OnHit get called?
  4. Apply force on collision or reset.

After watching (learning outcomes)…

An understanding of the Tick Group Order and how it interacts with physics notifications.

(Unique Video Reference: 112_BT_URC)

Tick Groups And Physics

In this video (objectives)…

  1. Making a testing level.
  2. Changing linear damping.
  3. Tweak linear damping.
  4. Tweak angular damping.
  5. Add more wheels.

After watching (learning outcomes)…

Understand how damping affects the tank.

(Unique Video Reference: 113_BT_URC)

Tweaking Linear & Angular Damping

How to workaround the "ConvexElem Invalid" errors.

(Unique Video Reference: 114_BT_URC)

BONUS: Fixing Collider Issues
End Of Section Quiz
7 questions
+ Testing Grounds FPS
112 lectures 22:17:04
  • Welcome, fresh start, new energy

  • Did you go back and modify Building Escape?

  • Most ambitious section yet

  • Bookmark the live Google Slides

  • Comment on the slides, especially typos

  • Come say hi at community.gamedev.tv

(Unique Video Reference: 1_TG_URC)

Preview 02:21
  • The concept of the game
  • The rules of the game
  • Some of the asset requirements for the game
  • Identify possible technical challenges.

(Unique Video Reference: 2_TG_URC)

Testing Grounds GDD
WARNING: Tricky Content Ahead
  • The distinction between Git vs GitHub
  • Use Unreal’s toolbar & SourceTree
  • Enable Git Large File Support (LFS)
  • Setup on GitHub (no readme.md or initial commit)
  • Push to GitHub and share
  • Warning: may take a while on slow broadband.

(Unique Video Reference: 3_TG_URC)

Using Git LFS (Large File Support)
  • Limitations of Unreal’s connection to GitHub
  • How to reset to previous commit to combine
  • Presenting your public GitHub page well
  • Using Markdown to enrich formatting.

(Unique Video Reference: 4_TG_URC)

Marketing & Markdown
  • Upgrading my project to Unreal 4.13
  • An overview of the scene
  • How the First Person Character is composed
  • Adding a spiral staircase.

(Unique Video Reference: 5_TG_URC)

Use git clean to Revert Project

(Unique Video Reference: 6_TG_URC)

First Person Character Overview
  • Add a third person character to the scene
  • Caution about tidying files at this stage
  • Add a navmesh, and check it’s continuous.

(Unique Video Reference: 8_TG_URC)

The Third Person Character
  • Setup a Blueprint AI controller class
  • Behaviour Trees controll AI execution flow
  • Blackboards hold AI instance data
  • How to associate a behaviour tree with an AI
  • Testing that our behavior tree is running.

(Unique Video Reference: 9_TG_URC)

Introducing AI Behaviour Trees
  • Blackboard data is like member variables in code
  • Using blackboard data to set patrol points
  • Practice setting blackboard values in Blueprint
  • Test simple AI patrol behaviour.

(Unique Video Reference: 10_TG_URC)

Introducing AI Blackboard Data
  • Add a variable to the NPC’s blueprint
  • How to make a variable an array in blueprint
  • Introducing Target Point actors
  • Using target points to specify patrol routes.

(Unique Video Reference: 11_TG_URC)

Target Points and Patrol Routes
Mid Section Quiz
10 questions
  • Actors are more general than target points
  • How to select an actor from another actor
  • Getting the AI Controller to set Blackboard data
  • Testing our characters go to a set waypoint.

(Unique Video Reference: 12_TG_URC)

Using Any Actor for Waypoints
  • Use layers (usually used for visibility)
  • Use groups as a simple multi-select tool
  • Use tags, can be flexible but easy to forget
  • Use a parent Empty Actor, or a Folder
  • Group on game object (e.g. array on NPC)
  • The key is to know the pros and cons.

(Unique Video Reference: 13_TG_URC)

Options for Grouping Actors
  • How to use Blackboard Key Selector variables
  • Creating new Tasks in Behaviour Trees
  • Pseudocode programming in Blueprint
  • How to use the Execute AI node
  • How to use the Finish Execute node.

(Unique Video Reference: 14_TG_URC)

Blueprint Behaviour Tree Tasks

(Unique Video Reference: 15_TG_URC)

Modular Arithmetic & Cycles
  • The first rule of performance: “profile first”
  • Access profiler from Window > Developer Tools
  • Choose Session Front End
  • Select your running game session
  • Chose Profiler tab, and hit Data Preview
  • Search for your function and double-click.

(Unique Video Reference: 16_TG_URC)

Performance Profiling 101
  • Add “AIModule” and “GameplayTasks” to build
  • Inherit C++ class from UBTTaskNode
  • Override ExecuteTask()
  • Return EBTNodeResult::Succeeded;
  • Don’t try and extend in Blueprint
  • Use Blueprint XOR C++ for a given task.

(Unique Video Reference: 17_TG_URC)

C++ AI Behaviour Tree Tasks
  • Expose a blackboard key selector in C++
  • #include “BehaviorTree/BlackboardComponent.h”
  • OwnerComp.GetBlackboardComponent()
  • Use GetValueAsInt() etc to get the value
  • You can now access blackboard data in C++.

(Unique Video Reference: 18_TG_URC)

Reading Blackboard Data in C++
  • We have coupled our AI ChoseNextWaypoint task to the Third Person Character.
  • We have also specialised our Blueprint class with a variable, PatrolPoints.
  • These dependencies are undesirable, but we will proceed with our conversion.

(Unique Video Reference: 19_TG_URC)

The Consequences of Inheritance
  • OwnerComp.GetAIOwner() to get AI Controller
  • If you’re casting, you’re probably coupling
  • Use .Num() to get number of elements in TArray
  • Use TODO for reminders, to help you FOCUS
  • FOCUS = Follow One Course Until Successful.

(Unique Video Reference: 20_TG_URC)

Converting Blueprint to C++
  • We created PatrollingGuard by inheritance
  • How about if we want a patrolling tank?
  • Another option is to use an actor component
  • This is an age-old debate
  • Let’s get some real-world experience of the two
  • Convert to a component model.

(Unique Video Reference: 21_TG_URC)

Composition over Inheritance
Mid Section Quiz
10 questions
  • What we've covered recently
  • What's coming up.

(Unique Video Reference: 21b_TG_URC)

Talking Head: What We've Covered So Far
  • Yes it should be easier than this, tell Epic!
  • How to remove CPP files from browser in Unreal
  • The process for deleting C++ classes.

(Unique Video Reference: 22_TG_URC)

How to Delete a C++ Class
  • Also called Material Instances
  • These allow modification with little overhead
  • How to create an instanced material.

(Unique Video Reference: 23_TG_URC)

Instanced Materials
  • Use AI Perception, it’s newer than Pawn Sensing
  • How to add AI Perception to your controller
  • Use the apostrophe key ‘ to enable AI debug
  • Remember Shift + F1, F8, F11 etc.

(Unique Video Reference: 24_TG_URC)

Introducing AI Perception
  • Use the On Target Perception Updated event
  • This reports the actor sensed
  • And the class of the sense (e.g. sight, hearing)
  • How to setup perception events.

(Unique Video Reference: 25_TG_URC)

OnTargetPerceptionUpdated Event
  • Hearing is a sense that compliments sight
  • How to set up AI Perception hearing sense
  • How to get hearing perception to trigger
  • Making your actor create a noise.

(Unique Video Reference: 26_TG_URC)

AI Hearing Perception in Unreal
  • The skeleton comprises the bones
  • Over the skeleton lays a skeletal mesh
  • Each vertex of the mesh connects to bone(s)
  • The animation tells the bones how to move
  • The bones tell the mesh how to move
  • The Animation BP controls the animations.

(Unique Video Reference: 27_TG_URC)

The Animation Starter Pack
  • How to change a mesh’s animation class
  • Matching the animation’s mesh to…
  • … the mesh selected on the character
  • You can apply instance changes to blueprint
  • However be careful what you take with you
  • Solving “can’t save… graph is linked” error.

(Unique Video Reference: 28_TG_URC)

Changing a Character’s Animation
  • You can start with a off-the-shelf blueprint
  • We can then add our reusable components
  • Another way of getting our desired character.

(Unique Video Reference: 29_TG_URC)

Customising a Character Blueprint
  • Behaviour trees can get complex
  • We want to keep a consistent level of abstraction
  • Behaviour trees can run “sub” trees
  • This helps us organise our project.

(Unique Video Reference: 30_TG_URC)

Sub Behaviour Trees
Mid Section Quiz
9 questions
  • Congratulations on getting this far in the course.
  • Recapping the AI work we have done so far.
  • Introducing the new instructor for the section: Sam.

(Unique Video Reference: 31_TG_URC)

Talking Head - Introducing Sam
  • Why refactoring is so important.
  • Refactor skills give you the edge.
  • What’s coming up in the next lectures.

(Unique Video Reference: 31b_TG_URC)

Talking Head - Refactoring Superpowers
  • Deleting and Moving folders.
  • Ensuring deletion on the file-system.
  • Good file structure for Unreal.
  • Viewing the dependencies of an object.
  • How and when to fix redirectors.

(Unique Video Reference: 32_TG_URC)

Simplifying Our Project
  • Renaming CPP files.
  • How to deal with renaming blueprint parents.
  • Refactor class names in CPP.
  • Updating .generated.h files.

(Unique Video Reference: 33_TG_URC)

Renaming & Moving CPP
  • Repeating the renaming process.
  • Finishing our refactor.
  • Fixing CDO Constructor errors.

(Unique Video Reference: 34_TG_URC)

Solution: Renaming & Moving CPP
  • Reading existing source code for hints.
  • Creating a socket on a skeletal mesh.
  • Parenting a gun to that socket.
  • Removing unused assets.

(Unique Video Reference: 35_TG_URC)

Holding a Gun with Skeletal Sockets
  • The major components.
  • How to preview animations.
  • Definition of an animation and pose.
  • Understanding the AnimGraph.
  • Playing a custom animation.

(Unique Video Reference: 35b_TG_URC)

Understanding Animation Blueprints
  • Why state machines?
  • What are state machines?
  • What’s inside a UE4 state?
  • How to add transitions.
  • Adding a shooting state.

(Unique Video Reference: 36_TG_URC)

Creating Animation State Machines
  • What is a blend space?
  • How to create a movement blend space.
  • Examining the existing Jog blend space.
  • Replicating for Ironsights.

(Unique Video Reference: 37_TG_URC)

Movement Blend Spaces
  • Creating an offset animation.
  • Applying an offset to a base.
  • Conditional blend nodes.

(Unique Video Reference: 38_TG_URC)

Offset Animations
  • Aim offset assets.
  • 1D vs 2D Aim offsets.
  • Editing an existing animation sequence.

(Unique Video Reference: 39_TG_URC)

Aiming Blend Spaces Offsets
  • Revising Behaviour Tree tasks.
  • Making our character face us.
  • Using AIController’s SetFocalPoint()

(Unique Video Reference: 40_TG_URC)

Rotating with SetFocalPoint()
  • More code reading.
  • Jumping between files in Visual Studio.
  • Difference between movement and rotation.
  • Mapping out complex systems.

(Unique Video Reference: 41_TG_URC)

Character Movement vs Rotation
  • Getting the control rotation.
  • Focus Actor vs Focal Point
  • Splitting rotators and setting pitch.
  • Controlling Animation BP properties.

(Unique Video Reference: 42_TG_URC)

Control Rotation for Aim
  • Creating a decorator.
  • Sequence vs Select nodes.
  • Aborting decorators early.
  • Clearing blackboard keys from blueprint.
  • Patrolling, agro and following.

(Unique Video Reference: 43_TG_URC)

Behaviour Tree Decorators
Mid Section Quiz
10 questions
  • Using decorators vs services.
  • Creating a service.
  • Deeper into behaviour tree states.
  • How to implement suspicion.
  • Giving our character breathing space.
  • Comparing BP Validity and NULL.

(Unique Video Reference: 44_TG_URC)

Behaviour Tree Services
  • Preventing Behaviour Tree flicker.
  • Creating mutually exclusive states.

(Unique Video Reference: 45_TG_URC)

Tweaking AI Behaviour
  • Viewing behaviour while playing.
  • Using tags on Actors.
  • Revising interrupting tasks.
  • Adding in multiple actors.

(Unique Video Reference: 46_TG_URC)

Debugging AI Behaviour
  • Create a Gun actor.
  • Move the firing code over.
  • Revising refactoring.

(Unique Video Reference: 47_TG_URC)

Refactoring to a Gun Actor
  • Revise spawning child actors.
  • Attaching actors to sub-components.
  • Attachment rule to sockets.

(Unique Video Reference: 48_TG_URC)

Attaching Actors to Components
  • Playing montage animations.
  • Connecting to actors in code.
  • Finishing our refactor.

(Unique Video Reference: 49_TG_URC)

Configuring the Gun
  • The pros and cons of LFS.
  • How to move files from LFS.
  • Tracking folder instead of extensions.
  • Where tracking happens.

(Unique Video Reference: 50_TG_URC)

Moving Files from LFS to Git
  • The pros and cons of LFS.
  • Organising your project for clarity.
  • How to deal with .umap assets.

(Unique Video Reference: 51_TG_URC)

To LFS or Not to LFS?
  • Previewing the gun with the skeleton.
  • Positioning the gun.
  • Child actors with Blueprint.
  • Using Child Actor Components.

(Unique Video Reference: 52_TG_URC)

Child Actor Components
  • Local vs component-space poses.
  • Understanding bone-space.
  • The principles of IK.
  • End effectors and Joint targets.
  • Mapping to the Two Bone IK node.

(Unique Video Reference: 52b_TG_URC)

Introduction to Inverse Kinematics
  • Using the Two Bone IK node.
  • Effectors vs Joint targets

(Unique Video Reference: 53_TG_URC)

Inverse Kinematics with Animations
Mid Section Quiz
10 questions
  • Using UE4 built-in version control.
  • Diffing blueprints.
  • LFS vs Git assets in editor.

(Unique Video Reference: 54_TG_URC)

Comparing Blueprints with Diffs
  • Boolean blending in Unreal.
  • Setting variables in animation BP.
  • Making the AI aim.

(Unique Video Reference: 55_TG_URC)

Boolean Blending for Aim States
  • When to use additive identities.
  • Blending additive animations.
  • Creating an additive firing animation.
  • Controlling firing from the AI.

(Unique Video Reference: 56_TG_URC)

Adding Firing Animations
  • Synchronising sound and animation.
  • Creating custom notify events.
  • Hooking up our gun trigger to AI.

(Unique Video Reference: 57_TG_URC)

Animation Notify Events
  • Applying damage from a projectile.
  • Taking damage in a BP character.
  • Detaching a controller from a Pawn.

(Unique Video Reference: 58_TG_URC)

Taking Damage in Blueprint
  • Revision of BP refactoring.
  • Making our Animation BP clean.
  • Death animations on the AI.

(Unique Video Reference: 59_TG_URC)

Death Animations and Refactors
  • Swapping out a 1st to 3rd person character.
  • Wrapping rotations.

(Unique Video Reference: 60_TG_URC)

Switching 1st and 3rd Person
  • Own See vs Owner no see meshes.
  • Why 1st person Meshes.
  • Hooking up Fire input in TPCharacter.

(Unique Video Reference: 61_TG_URC)

Owner Invisible Meshes
  • Why we need two gun meshes.
  • Creating Blueprint components.
  • Scene components vs Actor components.
  • Camera rotation with control rotation.

(Unique Video Reference: 62_TG_URC)

Separating Firing from Gun Meshes
  • Local vs Global rotation.
  • UE4 optimizations for unpossesed characters.

(Unique Video Reference: 63_TG_URC)

Aiming Our 1st Person Camera
Mid Section Quiz
10 questions
  • Using the Arrow component.
  • How to architect an infinite runner.
  • Overview of how we want our levels to work.

(Unique Video Reference: 64_TG_URC)

Architecture of Infinite Runners
  • GameMode BP vs Level BP
  • Creating a blueprint GameMode
  • How to spawn tiled terrain.
  • Using a blueprint for-loop.

(Unique Video Reference: 65_TG_URC)

Spawning Terrain in the GameMode
  • Why we need level gating.
  • Our approach to gating.
  • Enabling/disabling collisions.

(Unique Video Reference: 66_TG_URC)

Level Gating for Testing Grounds
  • Creating material instances.
  • Exposing material parameters.
  • Swapping materials in blueprint.
  • Adding affordance to our barriers.

(Unique Video Reference: 67_TG_URC)

Swapping Materials in Blueprint
  • When to delete previous tiles.
  • How to get hold of the Game Mode.
  • Spawning new tiles when needed.
  • Keeping the minimal tiles in memory.

(Unique Video Reference: 68_TG_URC)

Garbage Collecting Previous Tiles
  • Fix camera glitch while strafing.
  • Merge the NPC and Player folders.
  • Revise redirectors.
  • Revise folder movement and deletion.

(Unique Video Reference: 69_TG_URC)

Merging Our TP and FP Files
  • Debug a projectile spawn issue.
  • Overview the collision system.
  • Understand hit and overlap notifications.
  • Review different Collision Presets

(Unique Video Reference: 70_TG_URC)

Hit vs Overlap Events
  • NavMesh and procedural terrain.
  • Dynamic NavMesh generation.
  • When LFS shouldn’t be used.

(Unique Video Reference: 71_TG_URC)

Dynamically Calculating NavMesh
  • Make the player tough for testing.
  • Deeply understand the AI system.
  • When is code too complex to debug?
  • Write high level pseudo code.

(Unique Video Reference: 72_TG_URC)

Keep It Simple Stupid
  • Parallel actions in Behaviour Trees.
  • Pseudocode-lead refactoring.
  • Aborting lower priority with decorators.
  • Organising conditional Behaviour Trees.

(Unique Video Reference: 73_TG_URC)

Parallel Behaviour Tree Tasks
Mid Section Quiz
10 questions
  • Implementing a conditional decorator.
  • Custom task nodes.
  • Clean up when task node is aborted.

(Unique Video Reference: 74_TG_URC)

Custom BT Tasks and Decorators
  • Updating to 4.15.0
  • Storing build data outside of .umaps.

(Unique Video Reference: 75_TG_URC)

External Build Data in 4.14+
  • Renaming to style guide
  • Problems of our existing architecture
  • Improved gun-centric architecture
  • Challenge: reinstating the gun actor.

(Unique Video Reference: 76_TG_URC)

Physical Gun Architecture
  • Creating and reparenting a character
  • Challenge: Converting the component hierarchy
  • Reviewing my Mannequin.cpp

(Unique Video Reference: 77_TG_URC )

Converting a Character BP to C++
  • Reviewing the architecture
  • Revision: binding input in C++
  • Challenge
  • Remove firing from Animation BP
  • Control trigger from AI

(Unique Video Reference: 78_TG_URC)

Who’s Pulled the Trigger?
  • How cooldown nodes work.
  • Adding gameplay tags.
  • Challenge: Let the AI Cooldown
  • Randomised burst of fire.
  • Separated into sub-behaviour trees.

(Unique Video Reference: 79_TG_URC)

Cooldown Nodes & Gameplay Tags
  • What is an animation slot?
  • How to blend by root bone.
  • "Caching" a pose.
  • Challenge: Create and Play Firing Montage

(Unique Video Reference: 80_TG_URC)

Animation Montages and Slots
  • Attach gun to correct mesh if player
  • Reattach gun when player dies
  • Challenge: Play Two Montages

(Unique Video Reference: 81_TG_URC )

Reattaching the Gun
Mid Section Quiz
9 questions
  • Importing asset pack.
  • Introduction to procedural terrain.
  • Creating ground mesh from BSP.
  • Challenge: creating spawnable props.

(Unique Video Reference: 82_TG_URC)

Procedural Level Generation
  • Create a Tile C++ class.
  • Expose a UFunction to spawn actors.
  • Functions to generate random data.
  • Challenge: generate a random spawn point.

(Unique Video Reference: 83_TG_URC )

Generating Random Numbers
  • Spawn an actor.
  • Randomise the number of actors.
  • Challenge: place the actors correctly.

(Unique Video Reference: 84_TG_URC )

Spawning Actors in the Tile
  • What is a Sweep?
  • How to Sphere Cast in C++.
  • Challenge: visualise the cast.

(Unique Video Reference: 85_TG_URC )

Sphere Casting in C++
  • Creating a Trace Channel.
  • Where to configure presets. 
  • Challenge: make it trace green.

(Unique Video Reference: 86_TG_URC )

Configure Custom Trace Channels
  • Writing an actor spawning algorithm.
  • Challenge: generate empty space.
  • Converting from local to global positions.

(Unique Video Reference: 87_TG_URC)

Spawning into Free Space
  • Adding randomised rotation.
  • Challenge: add randomised scale.
  • Tweaking the spawn radii.

(Unique Video Reference: 88_TG_URC )

Randomising Rotation & Scale
  • Flyweight pattern for rendering
  • Adding LOD for foliage.
  • Challenge: spawn grass instances.
  • Reviewing my code.
  • Configuring my component.

(Unique Video Reference: 89_TG_URC )

Flyweight Pattern for Foliage
  • Outline of EQS.
  • Enabling EQS.
  • Creating and testing queries.
  • CHALLENGE: Create a Waypoint Query.

(Unique Video Reference: 90_TG_URC )

Choosing Waypoint with EQS
  • Overviewing the navigation issue.
  • Getting hold of existing objects.
  • CHALLENGE: Finding NavMeshBoundsVolumes

(Unique Video Reference: 91_TG_URC )

Find Actors of Type from C++
  • Actor Pool architecture.
  • Creating the Actor Pool Component.
  • CHALLENGE: Plumb the Pool.

(Unique Video Reference: 92_TG_URC)

Plumbing an Actor Pool Setup
  • Using the Checkout API
  • Overview of object lifecycle
  • CHALLENGE: Return to Pool
  • Populate the initial pool.

(Unique Video Reference: 93_TG_URC)

Using the Pool API
  • Implementing checkout.
  • Challenge: Implement return and add.

(Unique Video Reference: 94_TG_URC)

Using TArray for Pools
  • Rebuilding the Navigation.
  • Offset the NavMeshBoundsVolumes.
  • CHALLENGE: Spawn on destroy.

(Unique Video Reference: 95_TG_URC )

Rebuilding Navigation Meshes
  • The AI spawning problem.
  • Combining parameters as structs.
  • CHALLENGE: SpawnPosition Generator Function.

(Unique Video Reference: 96_TG_URC)

Structs to Simplify Function Args
  • How to spawn AI.
  • PlaceAIPawns definition.
  • CHALLENGE: spawn AI in the world.

(Unique Video Reference: 97_TG_URC )

Spawning AI from C++
Procedural Generation Quiz
14 questions
  • Adding a GameMode Score.
  • CHALLENGE: Notify on Tile Conquered

(Unique Video Reference: 98_TG_URC)

Keeping Score
  • What is a template.

  • When would you use one?

  • What is the syntax for functions.

(Unique Video Reference: 98b_TG_URC)

Understanding Function Templates
  • When copy and paste isn’t enough.
  • How to handle tricky types.

(Unique Video Reference: 98c_TG_URC)

Template Specialization
  • Fixing out spawn issue.
  • When static polymorphism isn't enough.
  • How to use templates in classes.
  • Caveats to using templates in C++

(Unique Video Reference: 98d_TG_URC)

Fixing Double Spawning
  • Extending the HUD class
  • Why use the HUD class
  • CHALLENGE: Create the scoring UI

(Unique Video Reference: 99_TG_URC )

Using the HUD Class
  • Adding PostProcessing Effects
  • CHALLENGE: Ease in on Damage

(Unique Video Reference: 100_TG_URC )

Post Processing for Tunnel Vision
  • Sharing your game
  • CHALLENGE: Recruit Some Testers
  • Changing the lighting
  • Firing lasers
  • Improving score UI
  • Shorter blackout effect

(Unique Video Reference: 101_TG_URC)

Recruiting Play Testers
  • Making death easier
  • How the camera works
  • Overview of SetViewTargetWithBlend
  • CHALLENGE: Smooth Blend the Camera

(Unique Video Reference: 102_TG_URC)

Smooth Blending the Camera
  • Unpossing with View Targets
  • Auto managed View Targets
  • CHALLENGE: Manually Manage the View Target

(Unique Video Reference: 103_TG_URC)

Possessing and the View Target
  • Peace before the storm
  • CHALLENGE 1: Fix the crashing issue
  • CHALLENGE 2: Make the Actors spawn
  • Parametrise the enemy count
  • BONUS: Fixing multiple camera transitions

(Unique Video Reference: 104_TG_URC)

The Calm Before The Storm
End of Section Quiz
6 questions
  • WELL DONE, over 50h of content

  • You've got a great understanding of Unreal

  • Your C++ knowledge is transferrable

  • Improve with: more weapons, pick-ups, progression

  • Please share screenshots / 20s video with community.

(Unique Video Reference: xxx_TG_URC )

Testing Grounds Wrap-up
+ Continuing Your GameDev Journey
1 lecture 00:27

Congratulations on completing the course, that's no mean feat! So what now?

+ If you're looking to continue to your Unreal journey then check out our Unreal Multiplayer Mastery course.

+ If you’d like to learn C#, another C family language, then head over to our Complete Unity Developer 2.0 course.

+ If you're looking to create assets for your games, then our Blender course is for you.

Look forward to seeing you there soon.

Preview 00:27
  • 64-bit PC capable of running Unreal 4 (recommended).
  • Or a Mac capable of running Unreal 4 (must support Metal).
  • About 15GB of free disc space.

*NEW* The course is being fully updated and remastered to Unreal Engine 4.22+. The first remastered section has been released! New content will be released as full sections over the coming weeks and months. Existing students get all the new material for free.

Thank you to Epic Games for awarding us a grant to update and remaster this "critically-acclaimed" and "insanely successful" Unreal Engine course.

The final section, Testing Grounds, includes...

  • Much more C++ and Blueprint.

  • AI Blackboards & Behaviour Trees.

  • Environmental Query System (EQS).

  • Humanoid Animation Blending.

  • Never-ending Level Design.

The course now has high quality hand written subtitles throughout, available as closed captions so you can turn them on or off at your convenience. This is one of the best Unreal Engine tutorials on the web.

This course started as a runaway success on Kickstarter. Get involved now, and get access to all future content as it's added. The final course will be over 50 hours of content and 300+ lectures.

Learn how to create and mod video games using Unreal Engine 4, even if you're a complete beginner. Unreal is a free-to-use game development engine used by AAA studios and indie developers worldwide. It can be complex beast to get into, but we break it down step-by-step

Already know Unreal and want to learn VR or Multiplayer? Check out our other Unreal courses, just look for the green leaf for our other world-class Unreal courses.

We start super simple so you need no prior experience of Unreal or coding! With our online tutorials, you'll be amazed what you can achieve. We believe project-based learning is the best way to learn Unreal Engine.

Benefit from our world-class support from both other students, and the instructors who are on the forums regularly. Go on to build several games including a tank game, and a First Person Shooter.

You will have access to a course forum where you can discuss topics on a course-wide basis, or down to the individual video. Our thriving discussion forum will help you learn and share ideas with other students.

You will learn C++, the powerful industry standard language from scratch. By the end of the course you'll be very confident in the basics of coding and game development, and hungry to learn more.

"Any serious game programmer needs to know C++"Jason Gregory, Lead Programmer at Naughty Dog (creators of Uncharted & The Last of Us)

Anyone who wants to learn to create games: Unreal Engine is a fantastic platform which enables you to make AAA-quality games. Furthermore these games can be created for Windows, consoles, MacOS, iOS, Android and Web from a single source!

If you're a complete beginner, we'll teach you all the coding and game design principles you'll need. If you're an artist, we'll teach you to bring your assets to life. If you're a coder, we'll teach you game design principles.

What this course DOESN'T cover...

Whereas this course is already huge, we can't possibly cover everything in that time. Here are some things we will not be covering...

  • Team collaboration topics.

  • Editor plugins or modifications.

  • Physics engine modification.

  • Multiplayer features.

Note: access to this course comes with an optional, free community site where you can share games and 3D models, as well as connect with other students.

Start to learn Unreal C++ now, you won't be disappointed!

All future content updates are included free!

Who this course is for:
  • Competent and confident with using a computer.
  • Artists who want to bring their assets alive in a game engine.
  • Developers who want to re-skill across to coding.
  • Complete beginners who are willing to work hard.
  • Existing programmers who want to re-skill to game development.