Game Development Patterns with Unity 2021, 2nd Edition
- Length: 179 pages
- Edition: 2
- Language: English
- Publisher: Packt Publishing
- Publication Date: 2021-08-10
- ISBN-10: 1800200811
- ISBN-13: 9781800200814
- Sales Rank: #1645043 (See Top 100 Books)
Discover practical design propositions to resolve game programming challenges in Unity
Key Features
- Get an overview of Unity engine architecture and coding model
- Refactor the real code of a fully playable game prototype with design patterns
- Build a complete racing game using software design patterns and understand how to implement them in Unity
Book Description
Unity has a particular coding model and architecture that requires knowledge of common software design patterns. This means that to be able to optimally code a game in Unity in the same way you do in other engines, you’ll have to adapt to programming techniques including design patterns.
This second edition is redesigned to update all the code examples present in each chapter to make it easier to understand the process of building a complete game. This approach will help you refactor your codebase by using a specific list of design patterns. Some of the notable additions to the book include chapters on game design document (GDD), object-oriented programming (OOP) techniques, and code optimization with Entity Component System (ECS).
The book starts by explaining Unity engine’s architecture and demonstrates its application in designing games and making better technical decisions. Throughout the book, you’ll build a complete game project, Super Ultra Turbo, and a racing game. You’ll also discover tried-and-tested software patterns with Unity using C#. Finally, the book will help you to identify bad designs to help you avoid unexpected negative impact on your game project.
By the end of this Unity book, you’ll have developed the skills you need to build exciting games with Unity using industry-standard development patterns.
What you will learn
- Structure your Unity code using industry-standard development patterns to make it look professional
- Identify the right patterns for implementing specific game mechanics or features
- Discover anti-patterns to avoid making common bad design choices
- Review practical OOP techniques and learn how they’re used in the context of a Unity project
- Optimize your code using Unity’s ECS
- Analyze the current state of your codebase and plan a refactoring process
Who This Book Is For
This book is for intermediate-level Unity game developers who are looking to figure out industry standards in building Unity games. The book assumes knowledge of the game engine and programming in the C# language. This book won’t be suitable for you if you’re only just starting your journey toward becoming a professional game programmer.
Title Page Copyright and Credits Game Development Patterns with Unity 2021 Second Edition Dedication Contributors About the author About the reviewers Preface Who this book is for What this book covers To get the most out of this book Download the example code files Code in Action Download the color images Conventions used Get in touch Share Your Thoughts Sections 1: Fundamentals Before We Begin Notes about the new edition The philosophy of the book What are design patterns? Which subjects aren't covered in this book? The game project Summary The Game Design Document The design document Game overview Unique selling points Minimum requirements Game synopsis Game objectives Game rules Game loop Game environment Camera, control, character (3Cs) Camera Character Character description Character metrics Character states Controller Game ingredients Superbikes Pickups Obstacles Weaponry Game systems Game menu Game HUD Summary Further reading A Short Primer to Programming in Unity What you should already know C# language features Unity engine features Summary Further reading Section 2: Core Patterns Implementing a Game Manager with the Singleton Technical requirements Understanding the Singleton pattern Benefits and drawbacks Designing a Game Manager Implementing the Game Manager Testing the Game Manager Summary Managing Character States with the State Pattern Technical requirements An overview of the State pattern Defining character states Implementing the State pattern Implementing the State pattern Testing the State pattern implementation Benefits and drawbacks of the State pattern Reviewing alternative solutions Summary Managing Game Events with the Event Bus Technical requirements Understanding the Event Bus pattern Benefits and drawbacks of the Event Bus pattern When to use the Event Bus Managing global race events Implementing a Race Event Bus Testing the Race Event Bus Reviewing the Event Bus implementation Reviewing some alternative solutions Summary Implement a Replay System with the Command Pattern Technical requirements Understanding the Command pattern Benefits and drawbacks of the Command pattern When to use the Command pattern Designing a replay system Implementing a replay system Implementing the replay system Testing the replay system Reviewing the implementation Reviewing alternative solutions Summary Optimizing with the Object Pool Pattern Technical requirements Understanding the Object Pool pattern Benefits and drawbacks of the Object Pool pattern When to use the Object Pool pattern Implementing the Object Pool pattern Steps for implementing the Object Pool pattern Testing the Object Pool implementation Reviewing the Object Pool implementation Reviewing alternative solutions Summary Decoupling Components with the Observer Pattern Technical requirements Understanding the Observer pattern Benefits and drawbacks of the Observer pattern When to use the Observer pattern Decoupling core components with the Observer pattern Implementing the Observer pattern Testing the Observer pattern implementation Reviewing alternative solutions Summary Implementing Power-Ups with the Visitor Pattern Technical requirements Understanding the Visitor pattern Benefits and drawbacks of the Visitor pattern Designing a power-up mechanic Implementing a power-up mechanic Implementing the power-up system Testing the power-up system implementation Reviewing the power-up system implementation Summary Implementing a Drone with the Strategy Pattern Technical requirements Understanding the Strategy pattern Benefits and drawbacks of the Strategy pattern When to use the Strategy pattern Designing an enemy drone Implementing an enemy drone Steps to implementing an enemy drone Testing the enemy drone implementation Reviewing the enemy drone implementation Reviewing alternative solutions Summary Using the Decorator to Implement a Weapon System Technical requirements Understanding the Decorator pattern Benefits and drawbacks of the Decorator pattern When to use the Decorator pattern Designing a weapon system Implementing a weapon system Implementing the weapon system Testing the weapon system Reviewing the weapon system Reviewing alternative solutions Summary Implementing a Level Editor with Spatial Partition Technical requirements Understanding the Spatial Partition pattern When to use the Spatial Partition pattern Designing a level editor Implementing a level editor Steps for implementing a level editor Using the level editor Reviewing the level-editor implementation Reviewing alternative solutions Summary Section 3: Alternative Patterns Adapting Systems with an Adapter Technical requirements Understanding the Adapter pattern Benefits and drawbacks of the Adapter pattern When to use the Adapter pattern Implementing the Adapter pattern Implementing the Adapter pattern Testing the Adapter pattern implementation Summary Concealing Complexity with a Facade Pattern Technical requirements Understanding the Facade pattern Benefits and drawbacks Designing a bike engine Implementing a bike engine Testing the engine facade Reviewing alternative solutions Summary Managing Dependencies with the Service Locator Pattern Technical requirements Understanding the Service Locator pattern Benefits and drawbacks of the Service Locator pattern When to use the Service Locator pattern Implementing a Service Locator pattern Testing the Service Locator pattern Reviewing alternative solutions Summary About Packt Why subscribe? Other Books You May Enjoy Packt is searching for authors like you Share Your Thoughts
Donate to keep this site alive
How to download source code?
1. Go to: https://github.com/PacktPublishing
2. In the Find a repository… box, search the book title: Game Development Patterns with Unity 2021, 2nd Edition
, sometime you may not get the results, please search the main title.
3. Click the book title in the search results.
3. Click Code to download.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.