Unreal Engine Game Development Blueprints - Nicola Valcasara - E-Book

Unreal Engine Game Development Blueprints E-Book

Nicola Valcasara

0,0
39,59 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

With the arrival of Unreal Engine 4, a new wonderful tool was born: Blueprint. This visual scripting tool allows even non-programmers to develop the logic for their games, allowing almost anyone to create entire games without the need to write a single line of code. The range of features you can access with Blueprint script is pretty extensive, making it one of the foremost choices for many game developers.
Unreal Engine Game Development Blueprints helps you unleash the real power of Unreal by helping you to create engaging and spectacular games. It will explain all the aspects of developing a game, focusing on visual scripting, and giving you all the information you need to create your own games.
We start with an introductory chapter to help you move fluidly inside the Blueprint user interface, recognize its different components, and understand any already written Blueprint script. Following this, you will learn how to modify generated Blueprint classes to produce a single player tic-tac-toe game and personalize it.
Next, you will learn how to create simple user interfaces, and how to extend Blueprints through code. This will help you make an informed decision between choosing Blueprint or code. You will then see the real power of Unreal unleashed as you create a beautiful scene with moving, AI controlled objects, particles, and lights.
Then, you will learn how to create AI using a behavior tree and a global level Blueprint, how to modify the camera, and how to shoot custom bullets. Finally, you will create a complex game using Blueprintable components complete with a menu, power-up, dangerous objects, and different weapons.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 314

Veröffentlichungsjahr: 2015

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Unreal Engine Game Development Blueprints
Credits
About the Author
About the Reviewer
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Getting Started with Unreal Blueprints
What is Blueprint?
Types of Blueprints
Level Blueprints
Blueprint class
Data-Only Blueprint
Blueprint Interface
Blueprint Macro Library
Knowing the environment
Creating a project
Creating your first Blueprint class
Menu bar
Toolbar
Viewport
Component panel
Detail panel
My Blueprint panel
Graph editor
Types of variables and data
Nodes
Pins
Blueprint debugging
Blueprint debugger tab
Compiler result
Visual Studio
Creating the project solution
Add a new class from the editor
Summary
2. Tic-Tac-Toe
What do we need?
Preparing the game
Clean the unnecessary items and scripts
The symbols – create the O and the X
Creating a new material for the symbols
Writing our Blueprints
Turn-based mechanics
Set Static Mesh via Blueprint
Working with arrays
Creating a macro
UI using text render
Custom events
Format text
Score
Game flow
Summary
3. C++ Code – PAC-MAN
Preparing the game
Creating the project
Transparent materials
The maze
Designing the maze
Applying a material to multiple surfaces
The code
Class Wizard
Collectable
Player character
Movements
Collisions
Winning or losing the game
Dead
C++ class to Blueprint class
Enemies
Enemy Pawn
Enemy AI
Navigation mesh
Game mode
User Interface
Collisions – custom presets and types
Summary
4. UFO Run - Play with the Environment Effects
Particle system
Cascade
Modules
Emitters
Level of detail
The Cascade interface
UMG
Widget Blueprint
HUD class
The game
Blocking volumes
The menu camera
Wizard Blueprint
Import a custom font
Buttons
Click events
Set the default camera
HUD class
Player controller class
Start button
In-game screen
Property binding
Switch user interface
Collectables
Materials
Particle system
Required
Spawn
LifeTime
Initial size
Initial velocity
Color Over Life
Size over life
Cylinder
Acceleration
Blueprint script
Spawn volume
Components
Random point function
Actor reference
Gameplay
Prepare the needed references
The player controller class
StartGame
The useFuel event
Spawn Collectable function
Update
Collect Item
The gameOver event
Summary
5. Top-Down Shooter
Animations
Skeleton
Persona
Animation Sequence
Additive animations
Blending animation
Animation poses
Animation Blueprints
The game
Cleaning the unnecessary files
Adjust the imported files
Skeletal Mesh retarget
Animations
Aim Offset
Blend Space
Animation Blueprint – AnimGraph
Animation Notifies
Inputs
Player movements
Aim logic
Rotate To Aim
Set Aim angle
Gate
Start and stop shooting events
Flip the player
Weapon
Socket
Weapon Blueprint class
Animation reloading
Bullet
Player character weapon slots
Weapon collectables
Mono-use weapon
Spawner
Custom component
Animation Blueprint – EventGraph
Enemies
Pawn
AI
Game Mode
User interface
Summary
6. A Platform Maze
Ragdoll physics
Destructible meshes
Physics constraint
Matinee
Curve Editor
Track View
Create a Matinee
Fake platform corridor
Blueprint Function Library
Kill and respawn a player ragdoll
Create and use a function library
Door trigger volume
Doors within Matinee
Doors within Blueprint
Killer objects
The game
Don't fall
Rolling stones
The falling path
Wrecking balls
Summary
7. An Open World Survival Game
Landscapes
Manage mode
Sculpt mode
Landscape material
Paint tool
Foliage
Day-Night cycle
Collectables and items
Blueprint structures
Superclasses
Extending the superclass
Crafting handler
Implementing the Blueprint Interface
Super item interaction
Inventory system
The inventory button
The inventory craft button
Main user interface
Main setup and visibility
Design the UI
Prepare the cookbook
Receipe button bindings
Add objects to the inventory
Remove and use items
Drop item – character side
Craft items logic
Inventory button logic
Item details and buttons
Summary
Index

Unreal Engine Game Development Blueprints

Unreal Engine Game Development Blueprints

Copyright © 2015 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: December 2015

Production reference: 1181215

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-78439-777-7

www.packtpub.com

Credits

Author

Nicola Valcasara

Reviewer

Martin Pernica

Commissioning Editor

Edward Bowkett

Acquisition Editor

Shaon Basu

Content Development Editor

Adrian Raposo

Technical Editor

Suwarna Patil

Copy Editor

Vibha Shukla

Project Coordinator

Sanchita Mandal

Proofreader

Safis Editing

Indexer

Mariammal Chettiyar

Graphics

Disha Haria

Production Coordinator

Arvindkumar Gupta

Cover Work

Arvindkumar Gupta

About the Author

Nicola Valcasara is a freelance game developer and cofounder of Deuxality Games Ltd. He is an expert programmer, specializing in mobile development, with a strong passion for games and technology. He started to work in the game industry in 2012, after winning the first prize at the Microsoft Rapid2D competition for young developers.

He has also been a reviewer of Unreal Engine Android Game Development, Packt Publishing.

My first thanks goes to my friends. Darroch, for your omnipresent optimism and for the great artist that you are, Pelo, for being my tester and a valid reviewer of the book content, Mene, for your bike and genuine friendship, and thank you all to be always there to support me with my choices.

A thank you to my family, a safe haven where I find peace in the bad periods of my life. Thank you, mum, even if you don't approve my career, you are always in my life with your reassuring presence.

About the Reviewer

Martin Pernica is a game developer with a focus on rendering and physics. He started programming on old PCs very young age, and after this, he started working mainly as a web developer for companies. After some years of web development, Martin switched to the game development industry and started his own game studio. He is also teaching his own courses in the local university about mobile, web, and game development. He always tries to look under the hood of problems and challenges, and then solve and optimize them, which is his passion.

www.PacktPub.com

Support files, eBooks, discount offers, and more

For support files and downloads related to your book, please visit www.PacktPub.com.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

https://www2.packtpub.com/books/subscription/packtlib

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?

Fully searchable across every book published by PacktCopy and paste, print, and bookmark contentOn demand and accessible via a web browser

Free access for Packt account holders

If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.

Preface

This book will help you learn how to develop wonderful games using Unreal Engine 4 and its Blueprint Visual Scripting.

Discover all the secrets of this engine and create seven fully functional games with step-by-step instructions. In this book, you will learn the secrets of Blueprint; from the single node to the most complex function. Whether you are a beginner or an expert programmer, this guide will introduce you to this world and show you the infinite possibilities that this engine can offer by developing seven exciting and fully functional games.

What this book covers

Chapter 1, Getting Started with Unreal Blueprints, introduces you to the Unreal Engine editor and Blueprint graph. We will create the first project on both Unreal Engine and Visual Studio 2013.

Chapter 2, Tic-Tac-Toe, covers a simple game: a player versus player, classic board game. You will learn how to the create a Blueprint graph with nodes and wires.

Chapter 3, C++ Code – PAC-MAN, explains the creation of a classic coin-up game only using the C++ code. You will learn how to communicate between Visual Studio and UE4 in this chapter.

Chapter 4, UFO Run - Play with the Environment Effects, explains the particle effect system and user interface tools by creating an action game, starting from a template offered by the engine.

Chapter 5, Top-Down Shooter, helps you to play with animations and create an artificial intelligence by customizing the assets that are offered by the marketplace.

Chapter 6, A Platform Maze, explains how to use Matinee to create short cinematic clips or move objects around a level. Use the physics to handle ragdolls and destructible objects.

Chapter 7, An Open World Survival Game, creates huge worlds with the terrain manipulation tools that are offered by the engine, populate them with object using the brush tools, and give them a life by creating an inventory system using the knowledge learned during the book.

What you need for this book

You will require the following software:

Unreal Engine 4 (at least version 4.8)Visual Studio 2013

A knowledge of basic C++ is recommended; however, not required. Some generic knowledge of the game programming terminology could be useful; however, not necessary.

Who this book is for

This book is ideal for intermediate-level developers who know how to use Unreal Engine and want to go through a series of projects that will further develop their expertise. A working knowledge of C++ is a must.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We can include other contexts through the use of the include directive".

A block of code is set as follows:

#pragma once #include "GameFramework/Actor.h" #include "Collectable.generated.h" UCLASS() class PACMAN_API ACollectable : public AActor { GENERATED_BODY() public: // Sets default values for this actor's properties ACollectable(); // Called when the game starts or when spawned virtual void BeginPlay() override; // Called every frame virtual void Tick( float DeltaSeconds ) override; };

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Click on the Blueprints button in the Level Editor toolbar."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail <[email protected]>, and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/7777OT_ColoredImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at <[email protected]> with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at <[email protected]>, and we will do our best to address the problem.

Chapter 1. Getting Started with Unreal Blueprints

Welcome! If you have arrived here, it is because you want to look at Blueprints in depth and learn all its secrets, from the simplest node to the most complex code extension. This is an introductory chapter. Here, you will take your first steps in Blueprint, you will create your first project, and start with the editor, learning its interfaces and its tools.

In this chapter, we will cover the following:

What is Blueprint?Different types of data, nodes and BlueprintKnowing the environmentDebugging your BlueprintsCreating a visual studio solution

What is Blueprint?

Blueprint is a high level, visual scripting system that provides an intuitive, node-based interface that can be used to create any type of script events in the Unreal editor. The tools that are provided can be used by level designers, artists, and any non-programmer person, to quickly create and iterate gameplay (or even create entire games) without ever needing to write a line of the code:

For those of you coming from UE3, Blueprint is the evolution of Kismet. It inherits most of the strong keys of the Kismet system, adding the full range of concepts and tools that are generally only available to programmers.

Through the use of Blueprints, anyone can virtually prototype, implement, or modify any gameplay element. Here, we are going to discover how to create most of them. The following is a list of common uses that are covered by this guide:

Games: Sets up game rules and tweaks gameplay conditionsPlayers: Creates variants with different meshes and materials, or allows character customizationCameras: Changes the camera dynamically during playInputs: Handles the inputs that are passed by the playerItems: Includes weapons, pickups, triggers, and so onEnvironment: Creates randomized props or procedurally generated items

In order to understand Blueprint, we first need to understand its structure. The following image is an extremely simplistic graph that shows where Blueprint is collocated in a game and who are its parent and child:

Each of these elements can have multiple children and each element has its different type and behavior.

Types of Blueprints

There are four main types of Blueprint, each one has a specific purpose and is useful in a specific situation. We will learn how to choose the correct one while studying the examples of this guide; however, in the meantime, let's take a look at them in order to understand their differences.

Level Blueprints

A Level Blueprint is a specialized type of Blueprint that, as the name suggests, acts as a level-wide event graph. A level Blueprint is created by default for each of your levels and can be edited only in the Level Blueprint Editor. This is the only type that cannot be created and there is only one Level Blueprint for each level.

In this Blueprint file we handle the level flow: we can control events, Matinee, and sequences of actions in the form of Function Calls or Flow Control operations.

To open the Level Blueprint for the purpose of editing, click on the Blueprints button in the Level Editor toolbar and select Open Level Blueprint, as follows:

Blueprint class

A Blueprint class, simply called Blueprint, is the most used type and you will become familiar with it during this guide. This type allows the content creator to easily add functionality on top of any existing gameplay classes. A Blueprint class extends a parent (either a code parent or another Blueprint class) and can be edited with a visual editor. Any Blueprint class that is created in the editor can be found in Content Browser and can be added to the map as an instance, like any other type of Actor.

The following are the most common Parent Classes that are used when creating a new Blueprint:

Actor: It is an object that can be placed or spawned in the worldPawn: It is an Actor that can be possessed and it receives input from a Controller (which can be a user or an Artificial Intelligence)Character: It is a Pawn that includes the ability to walk, run, jump, and so onPlayerController: It is an Actor that is responsible for controlling a PawnGame Mode: It defines the game rules, scores, and any aspect of a game type

Data-Only Blueprint

Data-only Blueprints are basically Blueprint classes without the node graph. They contain all the properties and components that are inherited from its parent and allow the user to tweak properties or set items with variations without needing to find these properties in a big node graph.

A data-only Blueprint doesn't allow you to add new elements; however, it can be converted in a Blueprint class with just one click, if required:

Blueprint Interface

A Blueprint Interface is similar to an interface in general programming. It allows different types of object to share a common information setup. It is a collection of one or more functions (declarations only, no implementations) that can be added to other Blueprints. A Blueprint Interface needs to be added to a Blueprint class in order to work, and a Blueprint class that has implemented an interface can have and use all of its functions.

A Blueprint Interface can be made in the editor; however, it has limitations as it cannot do the following:

Add new variablesEdit graphsAdd components

A good example to understand an interface is that a player, a tree, and a concrete wall are three completely different objects but all of them can receive a projectile shot by a weapon. Instead of creating a different function for all of them, an interface can help us by creating a function called onReceiveDamage that is shared (however, implemented differently) by all of them.

Blueprint Macro Library

A Blueprint Macro Library is a container that holds a collection of Macros or graphs that can be placed as nodes in other Blueprints. They are very handy as they can store the commonly used sequences of nodes with inputs and outputs for execution and data transfer.

Knowing the environment

Let's take a look at Unreal Engine 4 and its editor. I am assuming that you have already installed the engine and visual studio 2013 on your machine; therefore, I will skip the process of registering, downloading, and installing the engine. If this is not the case, you can go to the epic website (www.unrealengine.com), sign up for free and get your copy by following their instructions with a couple of easy steps.

Creating a project

Open the Unreal Engine Launcher. Under the Library section, choose the version of the engine that you prefer, and launch it, as follows:

The Unreal Project browser will open. By default, you will see the Projects screen. Here, you can see your projects and the samples that you downloaded from the Marketplace. For our purpose, we want to create a brand new and empty project. Under the New Project section, you can choose between the Blueprint or C++ projects in a list of built-in templates:

Due to the nature of Blueprint, the code and Blueprint live happily together. These choices are different in only one way: the C++ project will also create the visual studio solution for your project but each of those choices will generate the same Uproject and the needed files to launch the editor.

Due to this harmony between Blueprint and code, if you choose to create a project from the Blueprint section you can, at any time, generate its C++ project: the engine will create the Visual Studio solution as soon as you add your first code class from the editor (File | Add Code to Project).

Choose a Blank Blueprint project, name it and choose a location (the default is C://Users/Your Name/Documents/Unreal Projects/). Before creating the project you can also set three main aspects of it: the general graphic quality, the device target (mobile, pc, console), and if you want to you can include the Unreal Engine Starter Content in it (the Starter Content contains some useful general purpose assets such as primitive meshes, particle effects, materials, and so on).

For our purpose, we can leave those settings as is and click Create Project.

Creating your first Blueprint class

Welcome to the Unreal Engine 4 editor. You will now see the example map opened and ready for your input in front of you. We are not creating anything fancy right now: we will only explore the user interface of Blueprint and start to learn the basic commands and shortcuts in Blueprint.

There are two ways to create a Blueprint class: from Content Browser or from the top tool bar. The toolbar Blueprint button gives you quick access to the existing modifiable Blueprint classes and you can access to the Level Blueprint only from here. Be aware that from here you can only create the Blueprint class. If you want to create, for example, Blueprint Macro Library, you need to use the Add New button from the Content Browser:

The Add New button and its equivalent mouse command (right-click in the Content Browser), will open a pop-up menu with all the assets that you can create in the engine, as follows:

Most of the asset needed for you projects can be created in the editor. We are now focusing on Blueprint; however, it is worth specifying what we can create from this menu and what needs to be created with an external software:

Can be created in Unreal Editor:

Needs to be created using an external software:

Game Levels

Materials

Particle Systems

Cinematic Sequences

Blueprint Scripts

AI Navigation Meshes

Pre-calculated Light Maps

Level Lights

Static Meshes

Skeletal Meshes

Skeletal Animations

Textures

Sounds (WAVs)

IES Light Profiles

Nvidia APEX files (APB and APX)

During studying the examples written in this book, we will see some of them, such as particle systems, navigation meshes, and materials, and some external assets, such as meshes and textures.

Note

About the Static Meshes, it is possible to create them in the editor using the Binary Space Partitioning (BSP) brushes; however, it is a tedious process and worth only when talking about simple shapes such as walls or stairs. A dedicated software such as the freeware Blender or the more famous 3ds Max or Maya can surely do a better job in less time.

Navigate to Add New | Blueprints | Blueprint Class, as follows:

Here, we will choose the Parent Class of our Blueprint script. The editor shows us the Common Classes (we already saw them when previously talking about Blueprint classes); however, the list of parents that we can use is potentially unlimited. If you click on All Classes, in the left-hand side corner at the bottom, you can see a very long list containing all the objects that are available at that moment as a parent for your Blueprint.

Click on Actor and call it BP_Introduction.

Note

It is very important, even for a small project, to name your assets/scripts in a smart manner from the very beginning using a suffix in order to recognize and immediately find the required file even between hundreds of files.

Double-click on the BP_Introduction file to open it and we will finally arrive at our Blueprint Editor:

As you can see from the preceding image, the Blueprint Editor is divided into several panels. Each panel is independent; this means that they can be moved, resized, deleted, and duplicated in order to have a workspace that fits your choice.

Let's take a closer look at all of these sections in the following:

Menu bar

Menu Bar has the following options:

File: You can manage your Blueprint files from here. You can save and import other assets in the session, and manage source control. There is also a section dedicated to Blueprint, where you can compile, refresh, and compare your Blueprint revision in source control.Edit: This is a typical edit menu. It can undo, redo, and modify history. You can also search for something in your Blueprint or change the editor settings and preferences.Asset: Go here to open Content Browser or to check the references viewer of any of your assets.View: View preferences can be set by this menu. Change the pin visibility or set the zoom.Debug: Here, you can set the brake points and the watches for your Blueprint. We will go through the Blueprint debugging later in this chapter.Window: If you accidentally close one of these tabs or you want to open another tab, you can do this going in this menu. All the Blueprint Editor specific tabs are contained. It is also possible to save or load a custom layout here.Help: You can find useful information about Blueprint here or directly through the epic forum and Wiki.

Toolbar

The toolbar is displayed at the left-hand side top of the Blueprint Editor. Its buttons provide easy access to the common commands that are needed when editing Blueprints. This is a dynamic bar, which means that it provides different buttons, depending on which mode is active and which Blueprint type you are currently editing, as follows:

Compile: Every time you modify the script and want to run it, you need to compile. This button changes, depending on the state of your script. It shows if there is an error or a warning and if the script need to be recompiled.Save: It saves the current Blueprint.Find in CB: It shows Content Brower and highlights the selected Blueprint.Search: It finds references to functions, events, variables, or pins in the current script.Class Settings: It opens the Blueprint properties Details panel. These settings usually belong to the parent class of Blueprint. You can add Blueprint Interfaces to the Blueprint class here.Class Defaults: It shows the default properties in the detail panel. Here, you can change the default properties of the new instances of this class.Simulation: It starts the game in simulation mode.Play / Stop / Pause: It manages the execution of the game in the selected environment such as mobile, standalone, and custom viewport.Possess/Eject: It switches from Simulate in editor to play in editor mode.Debug Filter: If you have two or more instances of this class in the game, you can choose which one to debug here.

Viewport

In Viewport, you can view and manipulate your Blueprint's components:

By default, you have a three-dimensional perspective view of your object. You can manipulate the settings of the Viewport using the buttons on the top-left corner. The first button allows you to switch between Perspective and the orthographic view, the second one sets how you see the object if it is Lit (rendered with light), Unlit (rendered without light) or in simple Wireframe instead.

The right-hand top series of buttons gives you some useful tools in order to manipulate your object:

Select and translate / rotate / scale object: If one of these is selected, the corresponding three axis images appear on the pivot point of the object and you are allowed to move, rotate, or scale the object in one or all its axis.Toggle Coordinate System: This button toggles the coordinate system between world and the local (object-related) system.Surface snapping: This button toggles surface snapping, it enables an object to snap in a surface when possible.Snap to the grid: This button toggles whenever the object snap to the grid or not.Snap size: This button sets the accuracy of the snapping.Rotation snapping: This button toggles the snap through a rotation grid.Rotation size: This button sets the rotation-snap angle.Scale snapping: This button toggles snapping object through a scale grid.Scale size: This button sets the scale snap value.Camera Speed: This button sets the speed of the camera when it is moving in the viewport with values between 1 to 8.

Component panel

In the Components panel, you can find all the components of your Blueprint that are shown in a hierarchy form. A component is a piece of functionality that can be added to an Actor. Components cannot exist by themselves; however, when added to an Actor, the Actor will have access to the component and use the functionality provided by it:

In this panel, you can add/remove and manage your components. Each component has its own specific purpose and combining them allows you to create almost anything that you need.

CapsuleComponent, for example, provides collision geometry to the Actor. MovementComponent controls the movement, AudioComponent enables the Actor to emit sound, and so on.

Components added in the component list can also be assigned to instance variables, providing them access in the graphs editor.

In order to add a component to Blueprint, you can click on the Add Component button and select the component from its menu, as shown in the following image:

Components can also be added by dragging and dropping them from Content Browser in the Components panel.

Each component is placed at the location of the instance by default. However, they can be transformed, rotated, and scaled if necessary in either the Details panel or the Viewport, as we saw earlier.

Detail panel

The Details panel contains information, utilities, and functions that are specific to the current selection in the Viewport or the content panel.

It contains all the editable properties of the selected object (such as the Transform parameters to move, rotate, and scale it):

At the very top, you find the search filter. This allows you to quickly find the property that you need (very handy when you have a long list of properties).

The Property Matrix button will open the Property Matrix grid. It is a special tool that allows easy bulk editing and value comparison for a large number of objects or Actors. It displays a configurable set of properties for a collection of objects as columns in a table view that can be sorted on any column. The Property Matrix grid also provides a standard property editor that displays all the properties for the current selection set in the table view.

The display filter icon allows you to filter the properties according to your need.

Some properties have three buttons. They allow you to open the selected property in Content Browser, attach the property from the selected one in Content Browser, or revert the property to default:

My Blueprint panel

The My Blueprint panel shows all the Graphs, Functions, Macros, Variables, and Event Dispatchers contained in your Blueprint, including component instance variables that are added in the component list or variables that are created by promoting a value to a variable in the graph editor.

By default, your Blueprint contains one EventGraph and one ConstructionScript for your Functions but you can add any Graph, Variable, or function you might need by the Add New button:

Graph editor

The graph editor panel is the heart of the Blueprint system. It is here that you will create your network of nodes and thanks to their wires, your game lives:

First of all, this table gives you some handy shortcuts for your movements in the graph.

Note

A smart usage of these shortcuts can save a lot of time when developing your projects. Try to memorize this table and always use the shortcuts when possible.

Control

Action

Right-click + Drag

Pans the graph

Mouse Scroll

Zooms the graph

Right-click

Opens context menu

Click on node

Selects the node

Click + Drag in the empty space

Selects the nodes in the marquee select box

Ctrl + Click + Drag in the empty space

Toggles selection of the nodes in the marquee select box

Shift + Click + Drag in the empty space

Adds the nodes in the marquee select box to the current selection

Click + Drag on node

Moves node

Click + Drag from pin to pin

Wires the pins together

Ctrl + Click + Drag from pin to pin

Moves the wires from the origin pin to the destination pin

Click + Drag from pin to the empty space

Brings up the context menu, showing only relevant nodes. Wires the original pin to a compatible pin on the created node

Click + Drag + C on the empty space

Adds a comment box containing the selected nodes

To add a new node to the graph, you can use the two methods explained in the table (right-click on the empty space or drag any pin from an existing node) and you can also drag and drop any asset from Content Browser to the graph editor. It will automatically add the corresponding node to the graph, as follows:

You can also drag and drop any Variables from the My Blueprint panel to the graph in order to automatically add its correspondent getter or setter (by selecting the desired node from the pop-up window that appears or by holding control for a getter or Alt for a setter) as shown in the following image:

You can find the same behavior seen in the Blueprint graph editor exhibited in the Construction Script Editor and in the Macros Graph Editor.

Let's now check the graph editor in deep: which variables are accepted and what are the nodes and pins that we just introduced.

Types of variables and data

Under Unreal, there are different types of variables: typical data types, such as Boolean, Integer, Float, and so on, and more complex reference types, such as objects, Actors, and custom classes. Each type has a unique color for easy identification, as shown in the following table:

Variable type

Color

Example

Description

Boolean

Red

Boolean represents true/false data.

Byte

Dark Green

Numbers from 0 to 255. This is the smallest data type in terms of spaces; only 1 byte of memory.

Integer

Cyan

Integer values (number without decimals). Ranges from -32,768 to 32,767.

Used to store values such as ammo, lives, and collected items.

Float

Light Green

Float values (numbers with decimals).

More accurate than integers as it has a precision of seven digits and is used, for example, to store the radius of a sphere, or the damage taken by an enemy, or any value that should contain decimal numbers.

Name

Violet

Name is the lightweight system for using string. It is case-insensitive and cannot be manipulated.

Similar to the byte, it is the smallest data type when talking about text and is used to store keywords and indices.

String

Magenta

String is the only string class that allows manipulation. It is more expensive than the other two text data; however, strings can be searched, modified, and compared against other strings.

Text

Pink

Text represents a display string. It is used to store object descriptions, times, numbers, and any formatted text. It is typically used in a table for the localization system and cannot be manipulated.

Vector

Yellow

Vector contains an array of three float values and is typically used to store positions on three-dimensional space (XYZ) or color information (RGB).

Rotator

Purple

This is similar to Vector, it stores an array of three float values that contains the rotation of an object in a three-dimensional space (in the order: Roll, Pitch, and Yaw).

Transform

Orange

Transform combines translation, rotation, and scale of a three-dimensional object.

Apart from these default data types, there are tons of other custom data types and we will see how to create our custom