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
Explore 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
Arrow up icon
GO TO TOP
Game Development Patterns with Godot 4

You're reading from   Game Development Patterns with Godot 4 Create resilient game systems using industry-standard solutions in Godot

Arrow left icon
Product type Paperback
Published in Jan 2025
Publisher Packt
ISBN-13 9781835880289
Length 304 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Henrique Campos Henrique Campos
Author Profile Icon Henrique Campos
Henrique Campos
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Part 1: Object-Oriented Design Principles FREE CHAPTER
2. Chapter 1: Understanding Object-Oriented Design 3. Chapter 2: Learning the Four Fundamental Pillars 4. Chapter 3: Creating SOLID Design Solutions 5. Chapter 4: Favoring Composition Over Inheritance 6. Part 2: Basic Design Patterns
7. Chapter 5: Maintaining Global States with the Singleton Pattern 8. Chapter 6: Decoupling Objects with the Observer Pattern 9. Chapter 7: Spawning Game Objects with the Factory Pattern 10. Chapter 8: Changing Object Behavior with the State Pattern 11. Chapter 9: Designing Actors with the Command Pattern 12. Part 3: Advanced Design Patterns
13. Chapter 10: Implementing AI with the Strategy Pattern 14. Chapter 11: Creating a Power-Up System with the Decorator Pattern 15. Chapter 12: Cross-Fading Transitions with the Service Locator Pattern 16. Chapter 13: Improving Game Feel with the Event Queue Pattern 17. Index 18. Other Books You May Enjoy

Preface

Hello there! I’m Henrique Campos, also known as Ludonaut, and in this book, we will talk about a topic that always intrigues me: design patterns. Specifically, in this book, we will talk about object-oriented programming design patterns. The idea behind this is that there are numerous problems regarding design that are common, so instead of reinventing the wheel, we can stand on the shoulders of giants and rely on tested, time-proven solutions. But in doing so, we are going to take a non-conventional path. You will learn the following from this book:

  • Create reusable and scalable code that follows SOLID principles
  • Identify common game development issues and apply industry-standard solutions
  • Understand feature requests and how to turn them into concrete solutions leveraging design patterns
  • Analyze game development pathologies to figure out underlying issues
  • Architect reliable systems that are understandable, intuitive, and scalable
  • Structure professional, collaborative game systems that are easy to maintain

We will use our imagination by role-playing a game mechanics engineer who is responsible for implementing requests from a fictional game designer. This allows us to work in a similar context to real life, where a designer responsible for the creative direction of a game, comes with game design requests that a programmer should implement. In this process, we will create a complete platformer game with a player, an enemy with complex artificial intelligence, interactive objects, multiple levels, music, and more.

By the end of this book, you will have a solid knowledge of how to create reliable architectures for your game’s code bases that you can scale and reuse knowing exactly what its points of pressure are and how to solve potential problems. You will also understand that design patterns should not be used as an initial approach to implementing features; instead, they are used as solutions for problems that arise as we develop our games. In this process, you will learn refactoring techniques that will save you time and energy.

As a friend of mine says: an amateur knows how to create new code, and a professional knows how to fix old code. In that sense, the skills you will learn from this book will help you avoid the urge to make things from scratch and instead deal with ugly and messy situations, thriving through them and leaving a trail of elegant and scalable solutions.

Throughout the book, we will use Godot Engine 4.3, by the time of writing, the latest version of the rising star open source project that has been getting the industry’s eyes. To make the onboarding easy, we will use the built-in text editor and GDScript as the main tools. Godot has many built-in features that help us implement the design patterns we are going to see. In some cases, such as the Observer pattern, Godot provides the implementation and all we have to do is use it, but we must understand the principles behind it.

lock icon The rest of the chapter is locked
Next Section arrow right
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