Unreal Engine 4 Game Development Essentials - Sample Chapter
Unreal Engine 4 Game Development Essentials - Sample Chapter
tools that give you the power to develop your game and
seamlessly deploy it to iOS and Android devices. It can
be used for the development of simple 2D games or even
stunning high-end visuals. Unreal Engine features a high
degree of portability and is therefore in demand.
This book will introduce you to the most popular game
development tool called Unreal Engine 4 with hands-on
instructions for building stunning video games. You will
begin by creating a new project or prototype by learning
the essentials of Unreal Engine by getting familiar with
the UI and Content Browser. Next, we'll import a sample
asset from Autodesk 3ds max and learn more about
Material editor. After that we will learn more about Post
Process. From there we will continue to learn more
about Blueprints, Lights, UMG, C++ and more.
"Community
Experience
Distilled"
Satheesh PV
C o m m u n i t y
D i s t i l l e d
E x p e r i e n c e
Satheesh PV
Epic Games as one of the closed beta testers for Unreal Engine 4 before its public
release. He started his career as a game developer in 2012 by making a first person
multiplayer game with his brother and close friend using Unreal Development Kit.
He also created Unreal X-Editor, which was an IDE developed for UnrealScript,
the native scripting language of Unreal Engine 3. He is also a moderator at Unreal
Engine forums as well as a spotlight member and engine contributor.
Preface
The purpose of Unreal Engine 4 Game Development Essentials is to teach people
interested in using Unreal Engine how to create video games. You will learn what
Unreal Engine is and how to download and use it. From there, we will go through
the collection of tools available in Unreal Engine 4 including Materials, Blueprints,
Matinee, UMG, C++, and more.
Preface
Chapter 5, Lights, gets us halfway through our Unreal Engine 4 Game Development
Essentials journey, and this chapter will introduce you to the lighting system. We
start of by covering the basics, such as placing lights and going through the common
settings. You will then learn more about the Lightmass Global Illumination system,
including how to properly prepare a UV channel for your asset to be used with
Lightmass. By the end of this chapter, you will learn how to build your scene with
Lightmass as well as Lightmass settings.
Chapter 6, Blueprints, teaches you what Blueprints are and about the various types of
Blueprints that are available in the Engine. Blueprints are Unreal Engine's number
one tool that allows artists and designers to quickly prototype their game (or even
make one!). You will also learn about the different graph types, such as event graph,
function graph, macro graph, and so on, and how to spawn a Blueprint dynamically
at runtime.
Chapter 7, Matinee, looks at the cinematic side of Unreal Engine 4 and the tool
associated with it, called Matinee. You will learn what Matinee is, how to create
one, and get familiar with the UI. After the basics, we will learn how to manipulate
objects in Matinee as well as create a very basic cutscene, which we will trigger
using Blueprints.
Chapter 8, Unreal Motion Graphics, teaches you to create a basic HUD that shows
the health of the player. Unreal Motion Graphics (UMG) is the UI authoring tool in
Unreal Engine. UMG is used to create Player HUD, Main Menu, Pause Menu, and so
on. You will also learn how to create 3D widgets, which can be placed in the world
or attached to an actor class.
Chapter 9, Particles, looks at the extremely powerful and robust tool called cascade
particle editor and creates a particle system, as no game is good without good visual
effects. We then combine this with simple Blueprint scripting to create randomly
bursting particles.
Chapter 10, Introduction to Unreal C++, goes over C++ as we draw close to the end
of our Unreal Engine 4 Game Development Essentials journey. In this chapter, you will
learn how to get Visual Studio 2015 Community Edition and learn the basics of C++
by inspecting the Third Person Template character class. We will then extend this
class to add support for health and the health regeneration system. You will also
learn how to expose variables and functions to Blueprint Editor.
Chapter 11, Packaging Project, brings us to the end of our Unreal Engine 4 Game
Development Essentials journey. In this final chapter, we will recap all the things
we've done, including a few tips, and finally, you will learn how to create a release
version of your game.
Introduction to Unreal
Engine 4
Welcome to Unreal Engine 4 Game Development Essentials. In this chapter, you will
learn how to download Unreal Engine's source version and launcher version. After
that, we will get familiar with the Unreal Engine 4 UI and Content Browser.
Launcher (binary) version: These are compiled by Epic and are available
through launcher. You will also get all source files (*.cpp) with the launcher
version, but you cannot make any modifications to Unreal Engine since
launcher versions do not generate a solution file.
GitHub version: These do not have any binary files so you have to compile
the Engine yourself. You get the entire source and you can modify virtually
anything in Unreal Engine. You can add new Engine features, modify
existing features or remove them (which no one does), and create a pull
request on GitHub so if Epic likes it, they will integrate it officially into
Unreal Engine.
When you open the launcher for the first time after installation, it should
automatically download the latest version of Unreal Engine 4. If it doesn't, then go
to the Library tab and click on Add Engine. A new Engine slot will now appear and
here, you can select your Unreal Engine version and install it.
[2]
Chapter 1
[3]
[4]
Chapter 1
Once cloning is complete, navigate to that directory and run the Setup.bat file.
1. This will download all the necessary files that are needed to compile the
engine and will also install all the required prerequisites for the Engine.
2. This might take some time depending on your Internet speed because it has
to download more than 2 GB of files.
This will take from 15 minutes to 1 hour depending on your system hardware. So sit
back, grab a cup of coffee, and wait till Engine finishes compiling.
Starting your custom build: You can either press F5 in Visual Studio
to start debugging the Engine or navigate to the directory where you
downloaded it and go to Engine\Binaries\Win64 folder and double-click
on UE4Editor.exe.
Starting launcher build: Simply click on that big Launch button and you're
good to go.
[5]
You might experience long loading time when you start the
Engine for the first time after compiling. This is because Unreal
Engine will optimize the contents for your platform to derive
data cache. This is a one-time process.
After the splash screen, you should now see the Unreal project browser. Perform the
following steps:
1. Select the New Project tab, and this is where you create your new projects.
2. For this book, we will stick with a Blank Blueprint Project. So, in the
Blueprint tab, select Blank project.
3. You can choose which platform you want for your project. There are two
platforms available: Desktop/Console and Mobile/Tablet. Feel free to
change this setting for your project. The second setting determines the
graphics settings for your platform. If you choose Desktop/Console, it's
better to stick with Maximum Quality and if your project is targeting
Mobile/Tablets, you should choose scalable 3D or 2D, which is aimed at
low-end GPUs. The third and final setting lets you add some Starter Content
from Epic, which contains some basic meshes, materials, and textures. You
can choose not to include Starter Content so the project will only contain
essential elements for the selected project.
4. Note that it is not recommended to include Starter Content when creating
a project for the Mobile/Tablet platform. This can significantly increase the
package size of your project.
5. Choose a name for your project and the location where you want to save it.
[6]
Chapter 1
6. Finally, click on Create Project to start Unreal Engine 4 with your project:
[7]
Once Unreal Engine starts up, you should see a scene similar to the preceding
screenshot. This is the scene that will be displayed by default, if you choose to
include Starter Content. If you skip Starter Content, then the startup scene
will be different.
Transform Tools: These three tools are the move tool, the rotate tool, and the
scale tool.
Coordinate System: This allows you to move, rotate, or scale your Actor
either on world axes (world space) or on its own local axes (local space). By
default, Unreal editor starts in world axes but you can toggle by clicking on
the icon. The globe icon means world space and the cube icon means local
space.
Snapping and Move Grid: Snapping allows you to snap one Actor to
another Actor's surface, and move grid allows you to snap to a threedimensional implicit grid within the scene.
Camera Speed: This lets you control how fast the camera moves in viewport.
You can fine-tune the camera speed by holding down the right mouse
button (while using WASD controls) and scrolling the mouse wheel
up or down to speed up or slow down the camera's movement.
[8]
Chapter 1
Later in this chapter, you will learn how to use Binary Space Partitioning (BSP) and
change some project settings such as Splash screen, game Icon, and so on.
[9]
Modes
The Modes tab contains all five modes of the editor. They are as follows:
Place mode (shortcut key is Shift + 1): Place mode allows you to quickly
place your recently placed objects and also Engine primitives such as lights,
geometries, triggers, volumes, and so on.
Paint mode (shortcut key is Shift + 2): Paint mode (also known as Mesh
Paint) allows you to interactively paint vertex colors on Static Mesh in Level
Viewport.
Landscape mode (shortcut key is Shift + 3): Landscape mode lets you create
a new landscape entirely in Unreal Editor or import a height map from an
external program, such as World Machine, TerreSculptor, and so on, and
make modifications to it.
Foliage mode (shortcut key is Shift + 4): Foliage mode allows you to paint or
erase multiple static meshes on Landscapes, other static meshes, and so on.
An example workflow is to paint grass, trees, and so on on a large area.
Geometry Editing mode (shortcut key is Shift + 5): Geometry mode allows
you to edit BSP brushes.
[ 10 ]
Chapter 1
Content Browser
Content Browser is what you call the heart of your project. This is where you
create, import, view, edit, organize, and modify all the assets for your game.
It also lets you rename, delete, copy, and move assets across other folders just like
you do in Windows Explorer. Additionally, Content Browser also lets you search for
specific assets based on keywords or asset type and you can exclude assets from your
search by adding '-' (hyphen) as the prefix.
You can also create Collections to arrange your commonly used assets for
quick access.
Collections are just references to assets and are not moved into
collections. That means a single asset can exist in multiple collections
and you can create an unlimited number of collections.
Shared collection: These are visible to you and to other users. This option is
active only if you have Source Control (for example: Perforce, Subversion
and so on.) enabled.
Private collection: These are visible only to those who are invited to view the
collection. This option is active only if you have Source Control (for example:
Perforce, Subversion and so on.) enabled.
Local collection: These are only for you. That means they only exist on your
local machine.
If you want to transfer an asset from one project to another, you can right-click on
the asset and choose Migrate, which will copy that asset and all its dependencies
to your new project.
Content Browser can be accessed by pressing Ctrl+Shift+F or from the Windows
menu on the menu bar. You can also have four instances of Content Browser at the
same time.
[ 11 ]
This can be really useful when you want to move assets to different folders or to
preview various assets in different folders.
[ 12 ]
Chapter 1
View Options can be accessed from the bottom-right corner of Content Browser.
World outliner
World Outliner shows all the Actors within the level in a tree view. Actors can be
selected and modified from world outliner. Right-clicking on an Actor in World
Outliner will show the same context menu used in Viewport so you can modify it
without having to navigate to them in Viewport. You can drag an Actor to another
Actor and attach them together.
[ 13 ]
World outliner allows you to search for a specific Actor. You can exclude a specific
Actor by adding - (hyphen) before the search term and you can force a term to match
exactly by adding + before the search term.
Details panel
The Details panel shows all the information, utilities, and functions specific to the
selection in the viewport. It displays all the editable properties for the selected Actor
and provides additional functionality based on the selected Actor. For example, if you
select a Blueprint, the Details panel will show everything related to that Blueprint,
that is exposed variables, Blutility events, and so on. If you select a Static Mesh actor,
the Details panel will show which material was applied, the collision settings, the
physics settings, the rendering settings, and more. The Details panel can be locked
to the selected Actor so it does not change based on Actor selection. Just like Content
Browser, you can have four instances of Details panel open at the same time.
[ 14 ]
Chapter 1
[ 15 ]
BSP
Now that we have some solid understanding of Engine UI, let's use BSP to create
a simple level. BSP is a geometry tool (also known as Geometry Brush or simply
Brush) used for quickly prototyping levels (also known as blocking out levels). Some
developers prefer to call this Constructive Solid Geometry (CSG), which is the more
accurate term since geometry in Unreal editor is created by adding and subtracting
brushes. BSP has been there since the first release of Unreal. It was used for level
designing long ago but later, this role has been passed to static meshes because BSP
is more expensive in performance.
So basically, BSP should only be used to prototype a level. Once you have the basic
idea of how a level should look, you should start replacing it with static meshes.
CSG and BSP are used interchangeably to refer the
geometry in Unreal. Both are the same.
Creating BSP
Unreal Engine 4 comes with seven Brushes and all of them can be customized in
Details panel. They are as follows:
Box: You can adjust the X, Y, and Z axes and set it to Hollow, which is a fast
way to make a room, and adjust Wall Thickness, which defines the thickness
of the inside walls.
Cone: You can customize the number of sides, height, and both outer and
inner radius in Details panel. You can also set this to Hollow and adjust
Wall Thickness to define the thickness of the inside walls.
Cylinder: You can customize the number of sides, height, and both outer
and inner radius in Details panel. You can also set this to Hollow and adjust
Wall Thickness to define the thickness of the inside walls.
Curved Stair: This creates a staircase shape that bends around an angle but
cannot wrap over itself.
Linear Stair: This creates a straight staircase that does not bend.
Spiral Stair: This creates a spiral staircase that can repeatedly wrap
over itself.
[ 16 ]
Chapter 1
Just like any other actor, you can use Transform Tools to move, rotate, and scale as
you see fit.
There are two types of Brushes. They are as follows:
Additive: These brushes are solid. This will add geometry to the level. For
example, you will use the Additive type to create walls, floors, ceilings, and
so on.
Subtractive: These brushes are hollow. This will subtract solid space
from a previously created Additive brush. For example, you will use the
Subtractive type to create windows or doors on walls.
You can also convert BSP geometry to Static Mesh and save them in Content
Browser, but remember, they will have no UVs or additional Material elements.
It is also worth mentioning that this is not a good or recommended workflow.
You should only use BSP to block out your level and later, you should import
your assets created from a DCC application.
You can go to Geometry Editing mode (Shift+F5) to edit
vertices and create a custom shape.
[ 17 ]
4. Here, you can change the game and editor default map.
[ 18 ]
Chapter 1
Summary
Now that you understand the basics of Unreal Engine, it's time to import some assets
from a DCC application such as 3ds Max, Maya, or Blender. In the next chapter,
we will create a simple mesh in 3ds Max and import it into Unreal Engine and go
through various options, such as setting up materials, collisions, and LODs.
[ 19 ]
www.PacktPub.com
Stay Connected: