𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

Game Development Patterns with Unity 2021: Explore practical game development using software design patterns and best practices in Unity and C#, 2nd Edition

✍ Scribed by David Baron


Publisher
Packt Publishing
Year
2021
Tongue
English
Leaves
232
Edition
2
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Discover practical design propositions to resolve game programming challenges in Unity

Key Features

  • Get an overview of Unity engine architecture and coding model
  • Build a complete racing game using software design patterns and understand how to implement them in Unity
  • Download the source code of the complete prototype demonstrating each of the software patterns used

Book Description

Unity's coding model and architecture require knowledge of common software design patterns. To optimally code a game in Unity, in the same way you do in other engines, you'll have to adapt to programming techniques that involve the use of design patterns.

In this second edition, you'll get to grips with using design patterns with the help of supplemented code examples based on actual implementations of game mechanics and systems of a playable racing game prototype. You'll be introduced to the core principles of reusable software patterns and how to employ them to build components efficiently. Some notable additions include a game design document (GDD), a Unity programming primer, and the downloadable source code of a complete prototype.

You'll start by learning about the overall design of the core game mechanics and systems that you'll be building throughout this Unity book, and discover tried-and-tested software patterns to code essential components of a game in a structured manner. You'll also find out how you can use classic design patterns to utilize Unity's unique API features. Finally, you'll identify the negative impacts of bad architectural decisions and understand how to overcome them with simple but effective practices.

By the end of this book, you'll be able to develop Unity games in a structured, scalable, and optimized way.

What you will learn

  • Structure professional Unity code using industry-standard development patterns
  • Identify the right patterns for implementing specific game mechanics or features
  • Develop configurable core game mechanics and ingredients that can be modified without writing a single line of code
  • Review practical object-oriented programming (OOP) techniques and learn how they're used in the context of a Unity project
  • Build unique game development systems such as a level editor
  • Explore ways to adapt traditional design patterns for use with the Unity API

Who this book is for

This book is for Unity game developers who want to learn industry standards for building Unity games. Knowledge of the Unity game engine and programming in the C# language is expected. If you're only just starting your journey to becoming a Unity game developer, this book is not suitable for you.

Table of Contents

  1. Before We Begin
  2. The Game Design Document
  3. A Short Primer to Programming in Unity
  4. Implementing a Game Manager with the Singleton
  5. Managing Character States with the State Pattern
  6. Managing Game Events with the Event Bus
  7. Implement a Replay System with the Command Pattern
  8. Optimizing with the Object Pool Pattern
  9. Decoupling Components with the Observer Pattern
  10. Implementing Power-Ups with the Visitor Pattern
  11. Implementing a Drone with the Strategy Pattern
  12. Using the Decorator to Implement a Weapon System
  13. Implementing a Level Editor with Spatial Partition
  14. Adapting Systems with an Adapter
  15. Concealing Complexity with a Facade Pattern
  16. Managing Dependencies with the Service Locator Pattern

✦ Table of Contents


Cover
Title Page
Copyright and Credits
Dedication
Contributors
Table of Contents
Preface
Sections 1: Fundamentals
Chapter 1: 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
Chapter 2: 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
Chapter 3: 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
Chapter 4: 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
Chapter 5: 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
Chapter 6: 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
Chapter 7: 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
Chapter 8: 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
Chapter 9: 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
Chapter 10: 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
Chapter 11: 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
Chapter 12: 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
Chapter 13: 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
Chapter 14: 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
Chapter 15: 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
Chapter 16: 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
Other Books You May Enjoy
Index


πŸ“œ SIMILAR VOLUMES


Game Development Patterns with Unity 202
✍ David Baron πŸ“‚ Library πŸ“… 2021 πŸ› Packt Publishing 🌐 English

Code <p><span>Discover practical design propositions to resolve game programming challenges in Unity</span></p><h4><span>Key Features</span></h4><ul><li><span><span>Get an overview of Unity engine architecture and coding model</span></span></li><li><span><span>Build a complete racing game using sof

Game Development Patterns and Best Pract
✍ John P. Doran; Matt Casanova πŸ“‚ Library πŸ“… 2017 πŸ› Packt Publishing 🌐 English

You’ve learned how to program, and you’ve probably created some simple games at some point, but now you want to build larger projects and find out how to resolve your problems. So instead of a coder, you might now want to think like a game developer or software engineer. To organize your code well,

Software Development, Design and Coding:
✍ John F. Dooley πŸ“‚ Library πŸ“… 2017 πŸ› Apress 🌐 English

<div><p>Learn the principles of good software design, and how to turn those principles into great code. This bookΒ introduces you to software engineering ― from the application of engineering principles to the development of software. You'll see how to run a software development project, examine the