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 now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Game Development Patterns with Unreal Engine 5

You're reading from   Game Development Patterns with Unreal Engine 5 Build maintainable and scalable systems with C++ and Blueprint

Arrow left icon
Product type Paperback
Published in Jan 2024
Publisher Packt
ISBN-13 9781803243252
Length 254 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Stuart Butler Stuart Butler
Author Profile Icon Stuart Butler
Stuart Butler
Tom Oliver Tom Oliver
Author Profile Icon Tom Oliver
Tom Oliver
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Part 1:Learning from Unreal Engine 5
2. Chapter 1: Understanding Unreal Engine 5 and its Layers FREE CHAPTER 3. Chapter 2: “Hello Patterns” 4. Chapter 3: UE5 Patterns in Action – Double Buffer, Flyweight, and Spatial Partitioning 5. Chapter 4: Premade Patterns in UE5 – Component, Update Method, and Behavior Tree 6. Part 2: Anonymous Modular Design
7. Chapter 5: Forgetting Tick 8. Chapter 6: Clean Communication – Interface and Event Observer Patterns 9. Chapter 7: A Perfectly Decoupled System 10. Part 3: Building on Top of Unreal
11. Chapter 8: Building Design Patterns – Singleton, Command, and State 12. Chapter 9: Structuring Code with Behavioral Patterns – Template, Subclass Sandbox, and Type Object 13. Chapter 10: Optimization through Patterns 14. Index 15. Other Books You May Enjoy

Working with behavior trees

The last pattern for this chapter is a little specific but no less useful than the others. Behavior trees define decision trees for AI brains to run. These trees define how information stored about the situation the AI thinks it is in will affect the actions it takes. Instead of compartmentalizing code into discrete blocks like other AI brain solutions, the behavior tree favors fragmentation with the aim of reuse. This flows back to the idea from the beginning of the chapter about the reuse of code for efficiency. A tree may look complex with many branches and leaves (yes, that is what we call the composites and tasks that make up a behavior tree), but on closer inspection, you will see that there are only a few building blocks and their arrangement is what creates the illusion of complex decision making.

The flow through a simple tree starts at the root and evaluates each node in the layer below in ascending order from 0 (order matters here) until it...

lock icon The rest of the chapter is locked
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.
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 $19.99/month. Cancel anytime