Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All 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
Game Development Projects with Unreal Engine
Game Development Projects with Unreal Engine

Game Development Projects with Unreal Engine: Learn to build your first games and bring your ideas to life using UE4 and C++

Arrow left icon
Profile Icon Reis Profile Icon Hammad Fozi Profile Icon Gonçalo Marques Profile Icon David Pereira Profile Icon Devin Sherry +1 more Show less
Arrow right icon
£9.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.6 (35 Ratings)
Paperback Nov 2020 822 pages 1st Edition
eBook
£26.99
Paperback
£32.99
Subscription
Free Trial
Renews at £9.99p/m
Arrow left icon
Profile Icon Reis Profile Icon Hammad Fozi Profile Icon Gonçalo Marques Profile Icon David Pereira Profile Icon Devin Sherry +1 more Show less
Arrow right icon
£9.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.6 (35 Ratings)
Paperback Nov 2020 822 pages 1st Edition
eBook
£26.99
Paperback
£32.99
Subscription
Free Trial
Renews at £9.99p/m
eBook
£26.99
Paperback
£32.99
Subscription
Free Trial
Renews at £9.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. £13.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

Game Development Projects with Unreal Engine

2. Working with Unreal Engine

Overview

This chapter will focus on many of the basic concepts and features within Unreal Engine. You will be shown how to create a C++ project, how to perform some basic debugging, and how to work with character-specific animations.

By the end of this chapter, you'll be able to create C++ template projects, be able to debug code within Visual Studio, understand the folder structure and the best practices involved, and finally, be able to set up character animations based on their states.

Introduction

In the previous chapter, we went through the basics of the Epic Games Launcher, along with Unreal Editor fundamentals. We saw how to work with Objects and what Blueprints are on a basic level, in addition to exploring the First Person Template. In this chapter, we'll be building upon those fundamentals by exploring the Third Person Template and working with Input and Animations.

Game development can be done in a wide variety of languages, such as C, C++, Java, C#, and even Python. While each language has pros and cons, we will be using C++ throughout this book as it is the primary programming language used within the Unreal Engine.

In this chapter, we will get you up to speed on how to create a C++ project and basic level debugging in UE4. It is very important to be able to debug code as it helps the developer while dealing with bugs. The tools provided come in very handy and are essential for any Unreal Engine developer.

Following this, we will get up close...

Creating and Setting Up a Blank C++ Project

At the start of every project, you might want to start with any of the templates provided by Epic (which contain ready-to-execute basic code) and build on top of that. Most/some of the time, you might need to set up a blank or an empty project that you can mold and sculpt to your requirements. We'll learn how to do that in the following exercise.

Exercise 2.01: Creating an Empty C++ Project

In this exercise, you will learn how to create an empty C++ project from the template provided by Epic. This will serve as the foundation for many of your future C++ projects.

The following steps will help you complete this exercise:

  1. Launch Unreal Engine 4.24 from the Epic Games Launcher.
  2. Click on the Games section and click Next.
  3. Make sure the Blank project template is selected and click Next.
  4. Click the Blueprint section dropdown and select C++.

    Note

    Make sure the project folder and project name are specified...

Content Folder Structure in Unreal Engine

In your project directory (E:/UnrealProjects/MyBlankProj in our case), you will observe a Content folder. This is the primary folder that your project uses for different types of assets and project-relevant data (including Blueprints). The C++ code goes into the Source folder in your project. Please note that the best practice is to create new C++ code files directly through the Unreal Editor as this simplifies the process and results in fewer errors.

There are many different strategies you can use to organize the data inside your Content folder. The most basic and easy-to-understand is using folder names to depict the type of content inside. Therefore, a Content folder directory structure may resemble the example at https://packt.live/3lCVFkR. In this example, you can see that each file is categorically placed under the name of the folder representing its type on the first level, with the following levels further grouping it into meaningful...

Working with the Visual Studio Solution

Every C++ project in Unreal Engine has a Visual Studio solution. This, in turn, drives all the code and provides developers with the ability to set up execution logic and debug code in its running state.

Solution Analysis

The Visual Studio solution (.sln) file that's produced inside the project directory contains the entire project and any associated code that's been added to it.

Let's have a look at the files present in Visual Studio. Double-click the .sln file to open it within Visual Studio.

In Solution Explorer, you will see two projects called Engine and Games.

The Engine Project

At the base level, Unreal Engine itself is a Visual Studio project and has its own solution file. This contains all the code and third-party integrations that work together in Unreal Engine. All the code within this project is called the "source" code.

The Engine project consists of the external dependencies, configurations...

Importing the Required Assets

Unreal Engine gives users the ability to import a wide range of file types for users to customize their projects. There are several import options that developers can tweak and play around with to match their required settings.

Some common file types that game developers often import are FBX for scenes, meshes, animations (exported from Maya and other similar software), movie files, images (mostly for the user interface), textures, sounds, data in CSV files, and fonts. These files may be obtained from the Epic Marketplace or any other means (such as the internet) and used within the project.

Assets can be imported by dragging and dropping them into the Content folder, or by clicking the Import button in the Content Browser.

Now let's tackle an exercise where we'll learn how to import FBX files and see how this is done.

Exercise 2.03: Importing a Character FBX File

This exercise will focus on importing a 3D model from an FBX file...

The Unreal Game Mode Class

Consider a situation where you want to be able to pause your game. All the logic and implementation required to be able to pause the game will be placed inside a single class. This class will be responsible for handling the game flow when a player enters the game. The game flow can be any action or a set of actions occurring in the game. For example, game pause, play, and restart are considered simple game flow actions. Similarly, in the case of a multiplayer game, we require all the network-related gameplay logic to be placed together. This is exactly what the Game Mode class is there for. 

Game Mode is a class that drives the game logic and imposes game-related rules on players. It essentially contains information about the current game being played, including gameplay variables and events, which are mentioned later on in this chapter. Game Mode can hold all the managers of the gameplay objects, it's a singleton class, and is directly accessible...

Levels

Levels, in gaming, are a section or a part of a game. Since many games are quite large, they are broken down into different levels. A level of interest is loaded into the game for the player to play, and then when they are done with that, another level may be loaded in (while the current one will be loaded out) so that the player can proceed. To complete a game, a player usually needs to complete a set of specific tasks to move on to the next level, eventually completing the game.

A Game Mode can be directly applied to the level. The level, upon loading, will use the assigned Game Mode class to handle all logic and gameplay for that particular level and override the game mode of the project for this level. This can be applied using the World Settings tab after opening a level.

A Level Blueprint is a blueprint that runs with the level, but cannot be accessed outside the scope of the level. Game Mode can be accessed in any blueprint (including the level blueprint) by...

Animations

Animation is essential for adding life and richness to a game. Superb animations are one of the major factors that differentiate average games from the good and the great from the best. Visual fidelity is what keeps gamers excited and immersed in games, and hence animations are a core part of all games and experiences created in Unreal Engine.

Note

This chapter seeks to cover animation basics. A more in-depth approach to animation will be taken in Chapter 13, Blend Spaces 1D, Key Bindings, and State Machines.

Animation Blueprints

An Animation Blueprint is a specific kind of blueprint that allows you to control the animation of a Skeletal Mesh. It provides users with a graph specifically for animation-related tasks. Here, you can define the logic for computing the poses of a skeleton.

Note

A Skeletal Mesh is a skeleton-based mesh that has bones, all of which come together to give form to the mesh, whereas a Static Mesh (as the name suggests) is an un-animatable...

Summary

To summarize this chapter, we first learned how to create an empty project. Then, we learned about the folder structure and how to organize files in the project directory. After that, we looked at template-based projects. We also learned how to set breakpoints in code so that we can watch variable values and debug entire objects while the game is running, which would help us find and eradicate bugs in our code.

Thereafter, we saw how Game Mode, Player Pawn, and Player Controller are relevant classes used in Unreal Engine for setting up game flows (the execution order of code), as well as how they are set up inside a project.

Finally, we transitioned toward animation basics and worked with State Machines, Blend Spaces 1D, and Animation Blueprints to make our character animate (walk/run and jump) within the game according to the keyboard input.

Throughout this chapter, we became more familiar with the powerful tools in Unreal Engine that are essential to game development...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Kickstart your career or dive into a new hobby by exploring game design with UE4 and C++
  • Learn the techniques needed to prototype and develop your own ideas
  • Reinforce your skills with project-based learning by building a series of games from scratch

Description

Game development can be both a creatively fulfilling hobby and a full-time career path. It's also an exciting way to improve your C++ skills and apply them in engaging and challenging projects. Game Development Projects with Unreal Engine starts with the basic skills you'll need to get started as a game developer. The fundamentals of game design will be explained clearly and demonstrated practically with realistic exercises. You’ll then apply what you’ve learned with challenging activities. The book starts with an introduction to the Unreal Editor and key concepts such as actors, blueprints, animations, inheritance, and player input. You'll then move on to the first of three projects: building a dodgeball game. In this project, you'll explore line traces, collisions, projectiles, user interface, and sound effects, combining these concepts to showcase your new skills. You'll then move on to the second project; a side-scroller game, where you'll implement concepts including animation blending, enemy AI, spawning objects, and collectibles. The final project is an FPS game, where you will cover the key concepts behind creating a multiplayer environment. By the end of this Unreal Engine 4 game development book, you'll have the confidence and knowledge to get started on your own creative UE4 projects and bring your ideas to life.

Who is this book for?

This book is suitable for anyone who wants to get started using UE4 for game development. It will also be useful for anyone who has used Unreal Engine before and wants to consolidate, improve and apply their skills. To grasp the concepts explained in this book better, you must have prior knowledge of the basics of C++ and understand variables, functions, classes, polymorphism, and pointers. For full compatibility with the IDE used in this book, a Windows system is recommended.

What you will learn

  • Create a fully-functional third-person character and enemies
  • Build navigation with keyboard, mouse, gamepad, and touch controls
  • Program logic and game mechanics with collision and particle effects
  • Explore AI for games with Blackboards and Behavior Trees
  • Build character animations with Animation Blueprints and Montages
  • Test your game for mobile devices using mobile preview
  • Add polish to your game with visual and sound effects
  • Master the fundamentals of game UI design using a heads-up display

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Nov 27, 2020
Length: 822 pages
Edition : 1st
Language : English
ISBN-13 : 9781800209220
Languages :
Concepts :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. £13.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 : Nov 27, 2020
Length: 822 pages
Edition : 1st
Language : English
ISBN-13 : 9781800209220
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
£9.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 6,500+ 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
£99.99 billed annually
Feature tick icon Unlimited access to Packt's library of 6,500+ 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 £5 each
Feature tick icon Exclusive print discounts
£139.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 6,500+ 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 £5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total £ 133.97
Blueprints Visual Scripting for Unreal Engine
£67.99
Game Development Projects with Unreal Engine
£32.99
Hands-On Artificial Intelligence with Unreal Engine
£32.99
Total £ 133.97 Stars icon
Visually different images

Table of Contents

18 Chapters
1. Unreal Engine Introduction Chevron down icon Chevron up icon
2. Working with Unreal Engine Chevron down icon Chevron up icon
3. Character Class Components and Blueprint Setup Chevron down icon Chevron up icon
4. Player Input Chevron down icon Chevron up icon
5. Line Traces Chevron down icon Chevron up icon
6. Collision Objects Chevron down icon Chevron up icon
7. UE4 Utilities Chevron down icon Chevron up icon
8. User Interfaces Chevron down icon Chevron up icon
9. Audio-Visual Elements Chevron down icon Chevron up icon
10. Creating a SuperSideScroller Game Chevron down icon Chevron up icon
11. Blend Spaces 1D, Key Bindings, and State Machines Chevron down icon Chevron up icon
12. Animation Blending and Montages Chevron down icon Chevron up icon
13. Enemy Artificial Intelligence Chevron down icon Chevron up icon
14. Spawning the Player Projectile Chevron down icon Chevron up icon
15. Collectibles, Power-Ups, and Pickups Chevron down icon Chevron up icon
16. Multiplayer Basics Chevron down icon Chevron up icon
17. Remote Procedure Calls Chevron down icon Chevron up icon
18. Gameplay Framework Classes in Multiplayer Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.6
(35 Ratings)
5 star 77.1%
4 star 17.1%
3 star 0%
2 star 2.9%
1 star 2.9%
Filter icon Filter
Top Reviews

Filter reviews by




Christopher May 30, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Fantastic tool for Unreal Engine beginners! You can't go wrong with making this investment to motivate yourself learning more about UE4. With UE5 around the corner, it's a great time idea to start at the beginning and get knowledgeable about the fundamentals of Unreal Engine. I highly recommend.
Amazon Verified review Amazon
Frederico Ribeiro Barnabe Aug 03, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Ótimo produto eu recomendo
Amazon Verified review Amazon
saiga Jan 08, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This is a very well thought out guide to getting you started developing with the Unreal Engine. There is a good overview of the Unreal Editor including blueprints, animations, actors, line traces, etc. There are sample game projects you build in the later chapters to use all of the core concepts learned through the first several chapters of the book. Overall this is an outstanding beginners guide to developing with Unreal and is a great place to start if you are just getting started or don't fully know how to use the engine.
Amazon Verified review Amazon
Carlos A Dec 02, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Disclaimer: I was contacted by the authors of the book and gifted a review copy.I'm reading the book and I'm loving it a lot!Great references and practical examples to start to develop in UE4. I have some experience watching some video tutorials about the engine, and I prefer this way to learn, is more specific and you can progress step by step. I would like to see expanded screenshots, or some references to find better each interface, if you are new with the engine this could be an obstacle to reading it fluidly. Except for that, the book is an excellent resource.
Amazon Verified review Amazon
Terrance C. May 26, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Regardless of your level of experience, I think this book does a good job of leading the reader through the journey of learning how to build games with the Unreal Engine. I’m an experienced game developer, but my experience with Unreal is dated. So this was a great opportunity for me to brush-off and update my Unreal knowledge. I’m thankful that an Editor from Packt Publishing offered me a free copy of this book for my honest review here.I will say, I’m not sure who is the target audience for this book. On one hand, its instruction is step-by-step from the very basics of using Visual Studio, to some of the more advanced topics like roles and authority in multiplayer programming. That’s a lot of ground to cover. And someone who’s familiar enough with C++ to be implementing multiplayer logic is likely to already be familiar with Visual Studio. But this book is successful at making few assumptions about the reader’s level, and takes the reader through every step.The risk with trying to accommodate a wide range of experience levels, is that books like this will inevitably lose beginners, or bore experts. I think that this book strikes an excellent balance between filling-in the gaps, while still offering enough meat for experienced developers to pick up tips & tricks, and to learn some things they’ve missed.Another tricky balance that technical tutorials of this kind must make, is covering theory for the generalized cases, while drilling down into specific examples to ground the theory. Again, this text does a good job of balancing those. The concepts are presented well, and then grounded in the continuous thread of building a simple but real-world game with Unreal.The only criticism I would have is that the language and grammar isn’t perfect. Examples abound. In some instances, I’ve had to read a sentence or paragraph multiple times to follow the idea. This was not because of the technical discussion (I’m on the more experienced end), but because the language is a bit confusing. It’s not often, and does not substantially detract from the learning process. But if you’re not a native English speaker, or are sensitive to precise grammar, you may struggle with some parts of the book. The topic is already an advanced one, so concise and readable language makes a difference. This book is successful, but with some friction.
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.