Reader small image

You're reading from  Game Development Patterns with Unreal Engine 5

Product typeBook
Published inJan 2024
Reading LevelBeginner
PublisherPackt
ISBN-139781803243252
Edition1st Edition
Languages
Right arrow
Authors (2):
Stuart Butler
Stuart Butler
author image
Stuart Butler

Stuart Butler is an Unreal Engine Expert with over 13 years of experience in teaching Games Development in Higher Education. Stuart has published projects in a multitude of disciplines including Technical Design, Art, and Animation. Stuart is the Course Director for Games Technology at Staffordshire University, responsible for the programming team within the UK's largest Games Education Department. Stuart is also an Unreal Authorised Instructor and Educational Content Creator who works with Epic Games on developing learning materials for Unreal Engine 5. Stuart holds a BSc (Hons) in Computer Games Design and a PgC in Higher and Professional Education.
Read more about Stuart Butler

Tom Oliver
Tom Oliver
author image
Tom Oliver

Tom Oliver is a game programmer with over 10 years of experience in working with game engines both commercially and in an educational capacity. He has used Unreal Engine for contract work both in and out of the games industry, creating systems for games to mixed reality training simulations. Tom is the Course Leader for the BSc (Hons) Computer Games Design and Programming program at Staffordshire University, responsible for maintaining the award winning structure and teaching of the course in the UK's largest Games Education Department. Tom holds a BSc (Hons) in Computer Games Design and Programming and a PGc in Higher and Professional Education. Tom specialises in researching gameplay systems driven through mathematical phenomena.
Read more about Tom Oliver

View More author details
Right arrow

Preface

Welcome to Game Development Patterns with Unreal Engine 5. In this book, we will be exploring design patterns, a series of tools and practices through which we can learn to write faster and easier to work with code. We will also be exploring a range of different patterns and learn to apply them to project development in Unreal Engine 5.

By the end of this book, you will be able to design systems with the perfect C++/Blueprint blend for maintainable and scalable systems.

Who this book is for

This book is targeted at beginner and intermediate game developers who are working with Unreal Engine and would like to improve their C++ coding practices. This book will help you produce clean, reusable code using design patterns. We will be covering some introductory tasks to show the key fundamentals of using Unreal Engine 5 and some of its tools; however, we will not be teaching you Unreal Engine from scratch.

You would benefit from having some experience with Unreal Engine 4 or 5, but you do not need a deep working understanding of the toolset.

What this book covers

Chapter 1, Understanding Unreal Engine 5 and Its Layers, explores Unreal Engine 5 and offers a brief history. We will look at the “fuzzy” layer that bridges the gap between C++ and Blueprint and learn how to translate Blueprint back to C++.

Chapter 2, “Hello Patterns”, focuses on the principles that underpin all good code. We will explore design patterns as well as some common Blueprint mistakes, looking at how we can fix them.

Chapter 3, UE5 Patterns in Action – Double Buffer, Flyweight, and Spatial Partitioning, discovers how Unreal Engine 5 employs these three design patterns as we explore a range of tools within the engine.

Chapter 4, Premade Patterns in UE5 – Component, Behavior Tree, and Update Method, utilizes the pre-built implementations of these three design patterns and explores the tools within the engine to expand simple systems.

Chapter 5, Forgetting Tick, develops your understanding of Tick, looks at why its usage can cause issues, and explores two approaches to building systems without it.

Chapter 6, Clean Communication – Interface and Event Observer Patterns, explores design patterns that allow us to improve how different actors communicate with each other, producing more efficient solutions to communication.

Chapter 7, A Perfectly Decoupled System, discovers how we can use UML as a methodology for planning class hierarchies, to decouple the reference train.

Chapter 8, Building Design Patterns – Singleton, Command, and State, examines these three design patterns to understand their usage, limitations, and suitability across a range of game genres.

Chapter 9, Structuring Code with Behavioral Patterns – Template, Subclass Sandbox, and Type Object, explores the three most common structural patterns while building weapons classes in C++, which we will expand with Blueprint, exploring how the two languages can be used together.

Chapter 10, Optimization through Patterns, dives into the key elements of optimization before releasing games by exploring the Dirty Flag, Data Locality, and Object Pooling design patterns.

To get the most out of this book

You will need a version of Unreal Engine 5 installed on your computer. All code examples have been tested on Unreal Engine 5.0.3, and they should work with later versions of the Engine. However, this may not be the case if Epic Games makes any major changes to the core engine.

Software/hardware covered in the book

Operating system requirements

Unreal Engine 5

Windows

Visual Studio or JetBrains Rider

Windows

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

We’ve included commented versions of the code found within the book as part of the GitHub repository, as opposed to including comments in the code samples, making the code easier to read and follow within the book.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Game-Development-Patterns-with-Unreal-Engine-5. If there’s an update to the code, it will be updated in the GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “This also applies to the ScoreWidget class we will use to display the player’s score, which has been provided as part of the Chapter Resources folder.”

A block of code is set as follows:

class APlayerController_CH7 : public APlayerController
{
public:
    void Init();
protected:
    UPROPERTY(EditAnywhere)
    TSubclassOf<APawn> _PlayerPawn;
    UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
    TObjectPtr<ACharacter_CH7> _Character;
}

Bold: Indicates a new term, an important word, or words that you see on screen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “Enable the checkbox next to Editor symbols for debugging and click Apply.”

Tips or important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, email us at customercare@packtpub.com and mention the book title in the subject of your message.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packtpub.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Once you’ve read Game Development Patterns with Unreal Engine 5, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.

Download a free PDF copy of this book

Thanks for purchasing this book!

Do you like to read on the go but are unable to carry your print books everywhere? Is your eBook purchase not compatible with the device of your choice?

Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.

Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application.

The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily

Follow these simple steps to get the benefits:

  1. Scan the QR code or visit the link below
Download a free PDF copy of this book

https://packt.link/free-ebook/9781803243252

  1. Submit your proof of purchase
  2. That’s it! We’ll send your free PDF and other benefits to your email directly
lock icon
The rest of the chapter is locked
You have been reading a chapter from
Game Development Patterns with Unreal Engine 5
Published in: Jan 2024Publisher: PacktISBN-13: 9781803243252
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (2)

author image
Stuart Butler

Stuart Butler is an Unreal Engine Expert with over 13 years of experience in teaching Games Development in Higher Education. Stuart has published projects in a multitude of disciplines including Technical Design, Art, and Animation. Stuart is the Course Director for Games Technology at Staffordshire University, responsible for the programming team within the UK's largest Games Education Department. Stuart is also an Unreal Authorised Instructor and Educational Content Creator who works with Epic Games on developing learning materials for Unreal Engine 5. Stuart holds a BSc (Hons) in Computer Games Design and a PgC in Higher and Professional Education.
Read more about Stuart Butler

author image
Tom Oliver

Tom Oliver is a game programmer with over 10 years of experience in working with game engines both commercially and in an educational capacity. He has used Unreal Engine for contract work both in and out of the games industry, creating systems for games to mixed reality training simulations. Tom is the Course Leader for the BSc (Hons) Computer Games Design and Programming program at Staffordshire University, responsible for maintaining the award winning structure and teaching of the course in the UK's largest Games Education Department. Tom holds a BSc (Hons) in Computer Games Design and Programming and a PGc in Higher and Professional Education. Tom specialises in researching gameplay systems driven through mathematical phenomena.
Read more about Tom Oliver