Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Unreal Engine 4.X By Example
Unreal Engine 4.X By Example

Unreal Engine 4.X By Example: An example-based practical guide to get you up and running with Unreal Engine 4.X

eBook
AU$41.99 AU$60.99
Paperback
AU$75.99
Subscription
Free Trial
Renews at AU$24.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $24.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Unreal Engine 4.X By Example

Chapter 2. Blueprints and Barrels – Your First Game

Welcome to Blueprints and Barrels! During this chapter, you will be introduced to the visual scripting system called Blueprint. This system will be your first entry point toward creating customized functionality and content, using UE4. This chapter will show you the basics of how to create and work with Blueprints to achieve the same level of freedom that any other text based scripting language can provide. You will also expand on the engine navigational skills you learned in the previous chapter as we delve into the more complicated facets of the Editor panel and how you can communicate between the different components of the engine. You will learn all this by creating your very first UE game project, Barrel Hopper.

This chapter will cover the following points:

  • Creating Blueprints
  • Navigating the Blueprint GUI
  • How to find Blueprint functions
  • Basic coding functionality with Blueprint (logical nodes, objects, and events)
  • Game...

Creating your first Blueprint

Now, it is time to create your first Blueprint. Instead of jumping straight into a new project, I can't think of a better place to create your first Blueprint than our Hello World project. It is time to give our Hello Sphere an upgrade! The first thing we need to do is create a Blueprint from our actor. To do this, we need to select the HelloSphere actor by clicking on the Actor in the viewport or selecting the HelloSphere name in the World Outlier. This will populate our Details Panel with the appropriate options. Just next to the Add Component button, there is a Blueprint/Add Script button, click on this now:

Creating your first Blueprint

You will be prompted to save the Blueprint we are about to create in some folder within our Content Browser. For now, save the blueprint in the Content folder directly. Name this Bluerpint HelloUnrealBP and press the green Create Blueprint button.

The Blueprint window

You will have been presented with an entirely new window, the Blueprint window....

Modifying the Hello Sphere Blueprint

Double-click on the HelloUnrealBP to open it. Now, you should be able to see our spherical friend front and center within the Viewport. You will also notice that the components we added to our Hello Sphere can be found in the Components panel and as variables in the My Blueprint panel. This is so that we can get references to our components within our Blueprint Graphs.

Our goal is to have it, so we can approach our Hello sphere and the 3D text will change from Hello World to Hello Player. To do this, we are going to need to add another component, work with the Blueprints Event Graph, and utilize an Event.

The first thing we need to do is provide a volume we can use to detect other overlapping actors. To do this, we need to add a SphereCollision component via the Add Component button in the top-left corner of the Blueprint window. Do this now, and name it SphereCollision. With the new component selected in the Components panel, you should be able to see...

Creating the Barrel Hopper project!

We are going to create our Barrel Hopper project the same way we created our Hello World project. Load the UE4.11 clients and create a new project that is a Blank Blueprint project titled Barrel Hopper. For this project, we are going to need a few things. We are going to need a Character that can move around and jump, a camera that provides us a side on view, barrels that can spawn and will despawn the player when collided with, and a level for all of these elements to exist in.

Creating our Character

We are going to be creating our first UE Character. To construct our character, we will create a new Blueprint that inherits from the UE4 UCharacter class. UCharacters are designed to be possessed and controlled by various controllers while utilizing UE character movement and physics backend. As UCharacter is at the bottom of the UObject hierarchy, it is the most developed of the objects, inheriting all of the parent object's public or protected functionality. The relationship between UCharacters and the engine will be described in more detail in Chapter 4, Unreal Engine, C++, and You.

Before we create the character, we need to set up our file hierarchy in the Content Browser so that our assets are organized in a logical manner. To create folders simply right-click on the folder hierarchy on the left-hand side of the Content Browser panel and select New Folder. Create a folder now titled Barrel_Hopper, and within that folder, create one titled Character. Every...

Game modes and how to make them

Game Modes in Unreal Engine are a set of instructions that inform the engine which objects to use for things such as the players default pawn (default character to use), the game rules, and what state objects to use for processes such as HUD, Player states, and Game states. We will not only be creating custom game modes but also custom objects for each of the game mode classes. To create a game mode, simply open the blueprint wizard by right-clicking on the appropriate content browser folder and choose to create Game Mode Blueprint.

As we are creating a new category of objects, I would also advise creating a Game_Mode folder in our content browser. Name this new game mode BH_GameMode and save it within the new Game_Mode folder. When you open the game mode blueprint, you will be presented with the standard Blueprint window. You will notice that this object does not have many components, only itself and a default scene root. This is because game modes will...

Creating your first Blueprint


Now, it is time to create your first Blueprint. Instead of jumping straight into a new project, I can't think of a better place to create your first Blueprint than our Hello World project. It is time to give our Hello Sphere an upgrade! The first thing we need to do is create a Blueprint from our actor. To do this, we need to select the HelloSphere actor by clicking on the Actor in the viewport or selecting the HelloSphere name in the World Outlier. This will populate our Details Panel with the appropriate options. Just next to the Add Component button, there is a Blueprint/Add Script button, click on this now:

You will be prompted to save the Blueprint we are about to create in some folder within our Content Browser. For now, save the blueprint in the Content folder directly. Name this Bluerpint HelloUnrealBP and press the green Create Blueprint button.

The Blueprint window

You will have been presented with an entirely new window, the Blueprint window. This will...

Modifying the Hello Sphere Blueprint


Double-click on the HelloUnrealBP to open it. Now, you should be able to see our spherical friend front and center within the Viewport. You will also notice that the components we added to our Hello Sphere can be found in the Components panel and as variables in the My Blueprint panel. This is so that we can get references to our components within our Blueprint Graphs.

Our goal is to have it, so we can approach our Hello sphere and the 3D text will change from Hello World to Hello Player. To do this, we are going to need to add another component, work with the Blueprints Event Graph, and utilize an Event.

The first thing we need to do is provide a volume we can use to detect other overlapping actors. To do this, we need to add a SphereCollision component via the Add Component button in the top-left corner of the Blueprint window. Do this now, and name it SphereCollision. With the new component selected in the Components panel, you should be able to see...

Creating the Barrel Hopper project!


We are going to create our Barrel Hopper project the same way we created our Hello World project. Load the UE4.11 clients and create a new project that is a Blank Blueprint project titled Barrel Hopper. For this project, we are going to need a few things. We are going to need a Character that can move around and jump, a camera that provides us a side on view, barrels that can spawn and will despawn the player when collided with, and a level for all of these elements to exist in.

Creating our Character


We are going to be creating our first UE Character. To construct our character, we will create a new Blueprint that inherits from the UE4 UCharacter class. UCharacters are designed to be possessed and controlled by various controllers while utilizing UE character movement and physics backend. As UCharacter is at the bottom of the UObject hierarchy, it is the most developed of the objects, inheriting all of the parent object's public or protected functionality. The relationship between UCharacters and the engine will be described in more detail in Chapter 4, Unreal Engine, C++, and You.

Before we create the character, we need to set up our file hierarchy in the Content Browser so that our assets are organized in a logical manner. To create folders simply right-click on the folder hierarchy on the left-hand side of the Content Browser panel and select New Folder. Create a folder now titled Barrel_Hopper, and within that folder, create one titled Character. Every time...

Game modes and how to make them


Game Modes in Unreal Engine are a set of instructions that inform the engine which objects to use for things such as the players default pawn (default character to use), the game rules, and what state objects to use for processes such as HUD, Player states, and Game states. We will not only be creating custom game modes but also custom objects for each of the game mode classes. To create a game mode, simply open the blueprint wizard by right-clicking on the appropriate content browser folder and choose to create Game Mode Blueprint.

As we are creating a new category of objects, I would also advise creating a Game_Mode folder in our content browser. Name this new game mode BH_GameMode and save it within the new Game_Mode folder. When you open the game mode blueprint, you will be presented with the standard Blueprint window. You will notice that this object does not have many components, only itself and a default scene root. This is because game modes will...

Creating and receiving input events


Now that we can see our character in the game world, it is time to get him moving! We are going to create some input events via our project settings, then receive those events in our BH_Character Blueprint. Let's start by setting up some input axis mappings and input action mappings. These mappings simply bind an input, that is, a key press or mouse change, to an axis event or action event that we can receive in our objects. Axis mappings should be used when you wish to receive varying levels from an input, these are most commonly used for analogue inputs such as joysticks and mouse movements. Whereas action mappings should be used when you wish to input from something that has no variable movement, for example, a button or key press.

Creating the input Events

Sometimes, you may need to create action or axis mappings that receive input from multiple sources. You may need to create an axis mapping for aiming that can take in input from both the mouse and...

Building the level!


UE provides a very in-depth and multi-use editor. From this editor, developers are able to create amazing and high-detail levels, the combination of editor tools present in UE4 creates a developer environment where the most limiting factor is the imagination! For the scope of this chapter, we will be using a limited tool set of the editor to act as an introduction to building levels with UE4. Each of the game projects you will create during the course of this book will require a new approach to building levels. This chapter will teach you the fundamentals of level creation and manipulation while teaching you some tricks to make position world geometry a breeze. We are going to take the default level arrangement from this:

To a more realized gameplay level, like this:

For this process, we are going to be creating a new level. To do this navigate to File | New Level and select the option default. Save this level as Barrel_Hopper_Map.

Camera tips and tricks

It's time for us...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • A unique resource on Unreal with an interactive example based approach that is sure to get you up and running immediately
  • Will feature four unique game projects that increase in complexity which will enable readers to build their game development skills using Unreal Engine 4 and the C++ programming language
  • Will be the most up to date book in the market on Unreal with full coverage of the new features of UE4

Description

With Unreal Engine 4 being made free to use, for any keen game developer it is quickly becoming the most popular game engine in today’s development industry. The engine offers a rich feature set that can be customized and built upon through the use of C++. This book will cover how to work with Unreal Engine’s tool set all the way from the basics of the editor and the visual scripting system blueprint to the in-depth low-level creation of content using C++. This book will provide you with the skills you need to create feature-rich, captivating, and refined game titles with Unreal Engine 4. This book will take you through the creation of four unique game projects, designed so that you will be ready to apply the engine’s rich development capabilities. You will learn not only to take advantage of the visual tools of the engine, but also the vast and powerful programming feature set of Unreal Engine 4.

Who is this book for?

Unreal Engine 4.X by Example was written for keen developers who wish to learn how to fully utilise Unreal Engine 4 to make awesome and engrossing game titles. Whether you are brand new to game development or a seasoned expert, you will be able to make use of the engine with C++. Experience with both C++ and other game engines is preferred before embarking on the Unreal by Example journey, but with a little external research into the basics of C++ programming, this book can take a complete game development novice to an Unreal Engine Developer!

What you will learn

  • Use C++ with Unreal Engine to boost the development potential of any Unreal Engine project
  • Vastly improve workflow and content creation with the visual scripting system blueprint
  • Design, test, and implement interesting game worlds using Unreal Engines built-in editor
  • Build a networked, feature-rich first person shooter that you can play with others over LAN
  • Build design-centric game worlds that play to needs of your game ideas
  • Paint your game worlds via the creation and modification of visual shaders called materials
  • Gain knowledge of other game development disciplines through the use of the Animation and Material tool sets
  • Create feature-rich game projects with a sophisticated visual quality and feature set

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jul 29, 2016
Length: 506 pages
Edition : 1st
Language : English
ISBN-13 : 9781785885532
Vendor :
Epic Games
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $24.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Jul 29, 2016
Length: 506 pages
Edition : 1st
Language : English
ISBN-13 : 9781785885532
Vendor :
Epic Games
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
AU$24.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
AU$249.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just AU$5 each
Feature tick icon Exclusive print discounts
AU$349.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just AU$5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total AU$ 216.97
Mastering Unreal Engine 4.X
AU$75.99
3D Game Design with Unreal Engine 4 and Blender
AU$64.99
Unreal Engine 4.X By Example
AU$75.99
Total AU$ 216.97 Stars icon

Table of Contents

11 Chapters
1. Introduction to Unreal Engine 4 Chevron down icon Chevron up icon
2. Blueprints and Barrels – Your First Game Chevron down icon Chevron up icon
3. Advanced Blueprint, Animation, and Sound Chevron down icon Chevron up icon
4. Unreal Engine, C++, and You Chevron down icon Chevron up icon
5. Upgrade Activated – Making Bounty Dash with C++ Chevron down icon Chevron up icon
6. Power Ups for Your Character, Power Ups for the User Chevron down icon Chevron up icon
7. Boss Mode Activated – Unreal Robots Chevron down icon Chevron up icon
8. Advanced AI and Unreal Rendering Chevron down icon Chevron up icon
9. Creating a Networked Shooter Chevron down icon Chevron up icon
10. Goodbyes and Thank yous Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.2
(6 Ratings)
5 star 33.3%
4 star 16.7%
3 star 0%
2 star 33.3%
1 star 16.7%
Filter icon Filter
Top Reviews

Filter reviews by




Dejan Seguljev Oct 19, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Excellent for those who have experience in development but no prior experience with Unreal Engine.
Amazon Verified review Amazon
William Lumley Jan 12, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Great book. Easy to read and really walks you through building some quality example projects quite well.
Amazon Verified review Amazon
Patrick Yee Feb 07, 2020
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
It's an okay instructional book, but it is not a textbook. There are portions of the book that should be rewritten where you start to think outside of the box to be inside the box, if that makes sense. It's all about the code, even blueprints, so you are not dealing with the details of a designer. So, you can go through this book really fast, but the wording and the bold face or lack of may distract you. The images to help you aren't in color and it's hard to use as reference.
Amazon Verified review Amazon
Not a fan Oct 13, 2016
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
Lots of typos, variables that change names, unclear directions... If you buy this book, be prepared to spend a few hours trying to figure out what the author meant.This book is definitely not worse the price.
Amazon Verified review Amazon
Aleksandr Palatnik Nov 07, 2016
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
The information in this book is good, but somewhat outdated with the newest Unreal Engine (4.13.2), which is understandable. That's not the main issue, though.My bigger problem with this is that the book needed a lot more editing since it has MANY typos/errors, some of which are in the code examples and lead to totally cryptic errors. The book also occasionally fails to mention necessary steps, once leading to an editor segfault for me (nullptr GameMode because the book never mentions to set it as the default mode). At the time of writing, there are no errata posted on the Packt page addressing this stuff.I'm sticking with this book because, again, for the most part the information is good, but there is the added cost that I have to do quite a bit of research and/or bugfixing to deal with the errors. I expect that with any program-specific tutorial book, but there's more than usual in this book, so I can't recommend it.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.