Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Unity Game Optimization
Unity Game Optimization

Unity Game Optimization: Enhance and extend the performance of all aspects of your Unity games , Third Edition

Arrow left icon
Profile Icon Dr. Davide Aversa Profile Icon Dickinson
Arrow right icon
€19.99
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (1 Ratings)
eBook Nov 2019 404 pages 3rd Edition
eBook
€19.99
Paperback
€24.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Dr. Davide Aversa Profile Icon Dickinson
Arrow right icon
€19.99
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (1 Ratings)
eBook Nov 2019 404 pages 3rd Edition
eBook
€19.99
Paperback
€24.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€19.99
Paperback
€24.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
Table of content icon View table of contents Preview book icon Preview Book

Unity Game Optimization

Evaluating Performance Problems

Performance evaluation for most software products is a very scientific process. First, we determine the maximum/minimum supported performance metrics, such as the allowed memory usage, acceptable CPU consumption, and the number of concurrent users. Next, we perform load testing against the application in scenarios with a version of the application built for the target platform, and test it while gathering instrumentation data. Once this data is collected, we analyze and search it for performance bottlenecks. If problems are discovered, we complete a Root Cause Analysis (RCA), and then make changes in the configuration or application code to fix the issue and repeat it.

Although game development is a very artistic process, it is still exceptionally technical. Our game should have a target audience in mind, which can tell us what hardware limitations...

Gathering profiling data using the Unity Profiler

The Unity Profiler is built into the Unity Editor itself and provides an expedient way of narrowing down our search for performance bottlenecks by generating usage and statistics reports on a multitude of Unity3D subsystems during runtime. The different subsystems for which it can gather data are listed as follows:

  • CPU consumption (per-major subsystem)
  • Basic and detailed rendering and GPU information
  • Runtime memory allocations and overall consumption
  • Audio source/data usage
  • Physics engine (2D and 3D) usage
  • Network messaging and operation usage
  • Video playback usage
  • Basic and detailed user interface performance
  • Global Illumination (GI) statistics

There are generally two approaches to making use of a profiling tool: instrumentation and benchmarking (although, admittedly, the two terms are often used interchangeably).

Instrumentation...

Best approaches to performance analysis

Good coding practices and project asset management often make finding the root cause of a performance issue relatively simple, at which point the only real problem is figuring out how to improve the code. For instance, if the method only processes a single gigantic for loop, then it will be a pretty safe assumption that the problem is either with how many iterations the loop is performing, whether or not the loop is causing cache misses by reading memory in a non-sequential fashion, how much work is done in each iteration, or how much work it takes to prepare for the next iteration.

Of course, whether we're working individually or in a group setting, a lot of our code is not always written in the cleanest way possible, and we should expect to have to profile some poor coding work from time to time. Sometimes, we are forced to implement...

Final thoughts on profiling and analysis

One way of thinking about performance optimization is the act of stripping away unnecessary tasks that waste valuable resources. We can do the same and maximize our own productivity by minimizing any wasted effort. Effective use of the tools we have at our disposal is of paramount importance. It would serve us well to optimize our own workflow by remaining aware of some best practices and techniques.

Most, if not all, advice for using any kind of data-gathering tool properly can be summarized into three different strategies:

  • Understanding the tool
  • Reducing noise
  • Focusing on the issue

Understanding the Profiler

The Profiler is a well-designed and intuitive tool, so understanding the...

Summary

You learned a great deal throughout this chapter on how to detect and analyze performance issues within your applications. You learned about many of the Profiler's features and secrets, explored a variety of tactics to investigate performance issues with a more hands-on approach, and have been introduced to a variety of different tips and strategies to follow. You can use these to improve your productivity immensely, so long as you appreciate the wisdom behind them and remember to exploit them when the situation makes it possible.

This chapter has introduced us to the tips, tactics, and strategies we need in order to identify a performance issue that requires improvement. In the remaining chapters, we will explore methods on how to fix issues and improve performance whenever possible. So, give yourself a pat on the back for getting through the boring part first. We...

Left arrow icon Right arrow icon

Key benefits

  • Optimize graphically intensive games using the latest features of Unity such as Entity Component System (ECS) and the Burst compiler
  • Explore techniques for solving performance issues with your VR projects
  • Learn best practices for project organization to save time through an improved workflow

Description

Unity engine comes with a great set of features to help you build high-performance games. This Unity book is your guide to optimizing various aspects of your game development, from game characters and scripts, right through to animations. You’ll explore techniques for writing better game scripts and learn how to optimize a game using Unity technologies such as ECS and the Burst compiler. The book will also help you manage third-party tooling used with the Unity ecosystem. You’ll also focus on the problems in the performance of large games and virtual reality (VR) projects in Unity, gaining insights into detecting performance issues and performing root cause analysis. As you progress, you’ll discover best practices for your Unity C# script code and get to grips with usage patterns. Later, you’ll be able to optimize audio resources and texture files, along with effectively storing and using resource files. You’ll then delve into the Rendering Pipeline and learn how to identify performance problems in the pipeline. In addition to this, you’ll learn how to optimize the memory and processing unit of Unity. Finally, you’ll cover tips and tricks used by Unity professionals to improve the project workflow. By the end of this book, you’ll have developed the skills you need to build interactive games using Unity and its components.

Who is this book for?

The book is intended for intermediate Unity game developers who wants to maximize the performance of their game. The book assumes familiarity with C# programming.

What you will learn

  • Apply the Unity Profiler to find bottlenecks in your app, and discover how to resolve them
  • Discover performance problems that are critical for VR projects and learn how to tackle them
  • Enhance shaders in an accessible way, optimizing them with subtle yet effective performance tweaks
  • Use the physics engine to keep scenes as dynamic as possible
  • Organize, filter, and compress art assets to maximize performance while maintaining high quality
  • Use the Mono framework and C# to implement low-level enhancements that maximize memory usage and prevent garbage collection

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Nov 29, 2019
Length: 404 pages
Edition : 3rd
Language : English
ISBN-13 : 9781838552299
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning

Product Details

Publication date : Nov 29, 2019
Length: 404 pages
Edition : 3rd
Language : English
ISBN-13 : 9781838552299
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 90.97
Learning C# by Developing Games with Unity 2019
€32.99
Unity Artificial Intelligence Programming
€32.99
Unity Game Optimization
€24.99
Total 90.97 Stars icon

Table of Contents

14 Chapters
Section 1: Base Scripting Optimization Chevron down icon Chevron up icon
Evaluating Performance Problems Chevron down icon Chevron up icon
Scripting Strategies Chevron down icon Chevron up icon
Section 2: Graphical Optimizations Chevron down icon Chevron up icon
The Benefits of Batching Chevron down icon Chevron up icon
Optimizing Your Art Assets Chevron down icon Chevron up icon
Faster Physics Chevron down icon Chevron up icon
Dynamic Graphics Chevron down icon Chevron up icon
Section 3: Advance Optimizations Chevron down icon Chevron up icon
Optimizations for Virtual and Augmented Reality Chevron down icon Chevron up icon
Masterful Memory Management Chevron down icon Chevron up icon
The Data-Oriented Technology Stack Chevron down icon Chevron up icon
Tactical Tips and Tricks Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(1 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Deni Jan 09, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Great learning guide for unity developer's
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.