Book Image

Learning Design Patterns with Unity

By : Harrison Ferrone
Book Image

Learning Design Patterns with Unity

By: Harrison Ferrone

Overview of this book

Struggling to write maintainable and clean code for your Unity games? Look no further! Learning Design Patterns with Unity empowers you to harness the fullest potential of popular design patterns while building exciting Unity projects. Through hands-on game development, you'll master creational patterns like Prototype to efficiently spawn enemies and delve into behavioral patterns like Observer to create reactive game mechanics. As you progress, you'll also identify the negative impacts of bad architectural decisions and understand how to overcome them with simple but effective practices. By the end of this Unity 2023 book, the way you develop Unity games will change. You'll emerge not just as a more skilled Unity developer, but as a well-rounded software engineer equipped with industry-leading design patterns.
Table of Contents (23 chapters)
21
Other Books You May Enjoy
22
Index

Creating shareable terrains

Imagine you’re building a 3D tactics game where players explore different locations made of randomized terrain tiles. Each tile may be water (which you can’t walk on), ground (which you can), grass (which may contain ninjas), or edges (which keep you boxed in). When you start building your terrain-generating scripts, everything is fine because you’re only testing with a 10x10 grid with a maximum of 100 tiles (no big deal with today’s hardware). However, during playtesting, you find your players wanting bigger and bigger areas to explore, eventually leading you to consider creating entire tiled worlds. What’s more, you may want to create more than three types of tiles (I know I’d like there to be more variety when I’m walking around a game world), making tile management and performance an even bigger issue.

What are your options when performance optimizations and hardware limitations are in the mix? Can...