Gamasutra is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Gamasutra: The Art & Business of Making Gamesspacer
View All     RSS
September 24, 2020
arrowPress Releases







If you enjoy reading this site, you might also want to check out these UBM Tech sites:


 

Checklist for a Top-Performing Game in 2020+

by Ruben Torres Bonet on 02/04/20 10:17:00 am   Expert Blogs   Featured Blogs

2 comments Share on Twitter    RSS

The following blog post, unless otherwise noted, was written by a member of Gamasutra’s community.
The thoughts and opinions expressed are those of the writer and not Gamasutra or its parent company.

 

[Check the original post at Unity Performance Checklist for a Top-Performing Game in 2020+]

In this post you'll get a simplified version of my Unity performance checklist that I've been completing over the years.

Game development is a very complex topic, which makes forgetting action points extremely likely. A mental Unity performance checklist is just not enough.

In this post you'll get access to a Unity Performance Checklist to:

  • Improve your CPU performance
  • Reduce the GPU load
  • Decrease memory usage, loading times and build sizes

I hope you'll be able to use it over and over again across your projects.

This should be no secret, but...

Game development is a life-lasting career plagued with mountain-sized obstacles along the way. It is complex and you might lose chunks of your sanity in your journey.

The bright side? The #gamedev trail hides valuable treasures and sexy rewards.

As you advance in the game development career, you learn new patterns, processes and tricks that over time will become part of your development style.

The downside to learning is that we also unlearn. Well, kind of.

The useful insights you and I gained years ago are probably hidden by now in the darkest corners of our minds, desperately waiting for the right trigger to surface.

Only that... some of these mental triggers won't happen when you need them.

I sometimes see myself and others doing the same performance-ruining mistakes over and over again, project after project.

And this doesn't happen because of a lack of knowledge, but rather due to forgetting small thingies.

And so I work hard to make knowledge more explicit for me and for others. By documenting your learnings, you'll help not only others but also your future self.

I mean, just look at this blog...

A checklist is a useful piece of documentation that will give you quick reminders about often-forgotten facts. You can quickly scan over it and perform a sanity check in just a few minutes. That's why checklists are so powerful.

And you should have one. Now, I can't force you to write a checklist — that's my job—, but at least consider using one. In this post, you'll be tapping into my personal unity performance checklist.

As always, these are suggestions for you to think about. These tips have gotten me far in the industry of game performance, but you must evaluate whether they make sense for your game and for you.

Ideally, you should always measure your changes.

Don't attempt to sue me if following my advice steals a millisecond from your  game (but feel free to toss in some coin if you gain it).

To keep it simple, I divided the checklist in three main sections: CPU, GPU and Memory/Loading Times.

At the end of the post you'll have the chance to get an extended version of the list that includes further explanations and online references.

Pay attention to the star symbol (*). These usually mean: be careful with that change, as it will have negative side effects in other unity performance areas.

If you're curious about the importance of checklists, check out The Checklist Manifesto (no referrals — that's why I'm poor).

Have fun, my friend.

Quick Navigation (redirects to new tab)

Chapter 1: Unity CPU Performance Checklist

Chapter 2: Unity GPU Performance Checklist

Chapter 3: Unity Memory Performance Checklist

Chapter 4: The Extended Unity Performance Checklist (91+ Tips)

CHAPTER 1: 
Unity CPU Performance Checklist

You can get higher CPU performance by reducing the total CPU work you do or by splitting it into different threads.

The best way to measure the effect of your changes is by using the Unity Profiler and to analyze the CPU section. You'll want to focus on the main thread and render thread.

Tip for Unity 2019.3+: increase your profile frame count to 2000 in your profiler settings to detect spikes easily.

Rendering: Use a single camera, especially in mobile

Rendering: Try lighter APIs such as Vulkan or Metal

Rendering: Are you using occlusion culling for interiors?

Rendering: Pre-bake 24/7: lighting, shadows, reflection probes*

Rendering: Create atlases to reduce Unity SetPasses and Draw Calls below 100 on mobile. No multi-material assets (evil asset store)

Rendering: Leave all static and dynamic batching on*

Rendering: Keep particle systems small in world space — i.e. small bounding boxes

Rendering: Are all your particle systems procedural?

UI: Use color property instead of in-sprite color variations and use the new SpriteAtlas tool

UI: Watch "Unite '17 Seoul - Tips and Tricks for Optimising Unity UI"

UI: Avoid per-frame changes in UI components (UI properties or RectTransforms)

UI: Don't use auto-layouting components on dynamic UI

PlayerSettings: Keep only the target architecture you're really building for

PlayerSettings: Use il2cpp in master mode, disable script debugging

PlayerSettings: Use GPU skinning*

GraphicsSettingsEnable only necessary built-in shader settings

Animation: Enable Optimize Game Objects on rigging import settings

Animation: Use animators exclusively in characters. For the rest: custom scripts or tweens.

Animation: Reduce blend tree complexity in animations

Animation: Reduce bone and vertex count for skinning. Aim for max 2 bones on mobile

VR: Use single-pass stereo

OculusVR: Set CPU level to 4*

Unity Scene Hierarchy: Don't forget scene hierarchy static flags on static game objects

Unity Scene Hierarchy: dynamic root objects are less than 3 levels deep and have less than 50 total children

AudioClip (longer ones): Decompress on load and load in background*

MultithreadingUse Burst and tweak the job system job count parameter if needed

Scripting: Coroutines are not endless and use small local variables

Scripting: Use interlaced logic execution whenever possible

Scripting: use CullingGroups to pause out-of-screen subsystems

Scripting (10+ entities): Use your own UpdateManager + ManualUpdates instead of relying on Update. Also, try DOTS.

Physics: Disable autosync transforms end enable reuse collision callbacks

Physics: Avoid mesh colliders; if needed, enable read/write on its mesh importer

CHAPTER 2: 
Unity GPU Performance Checklist

So far, I've given you a checklist to improve the Unity CPU performance of your game.

However, we have another player: the GPU.

The GPU can very well be your bottleneck, so watch out for the following items.

General: No post-processing nor real-time shadows on mobile

General: Use 4x MSAA on (most) mobile platforms

General: Set optimal compression mode for textures, meshes, etc..

General: Use forward rendering and disable HDR on mobile

General: Avoid baked reflection on mobile; RT are forbidden

General: Use 0 (or max. 1) real-time pixel lights on mobile

General: Disable soft particles on mobile

Overdraw: Avoid transparent regions in your sprites. Cut them

Overdraw: Avoid stacking more than 2 UI layers on top of each other

Overdraw: Consider opaque UI with alpha to coverage to reduce overdraw (advanced)

Overdraw: check opaque geometry is rendered front-to-back with frame debugger; this often breaks with batching

Geometry: Use LODs for high-poly models and consider impostor rendering to get < 300k vertices/poligons on mobile

VR: Consider reducing render resolution (backup solution)

OculusVR: Set Oculus GPU level to 4*

Shaders: Avoid multi-pass shaders

Shaders: No standard shader or GrabPass on mobile

Shaders: Use necessary decimal precision only (half vs float) on mobile

Shaders: avoid sampling from reflection probes

Shaders: Avoid conditionals

Color Space: use gamma instead of linear on mobile

CHAPTER 3: 
Unity Memory Performance Checklist

We're getting to the end of the blog post.

You see, optimizing CPU and GPU will often give you all you need to achieve high frame-rates.

But high FPS won't be enough if your game crashes due to extreme memory pressure. And long loading times will certainly upset your players. Really, they don't enjoy waiting nowadays with so many possible distractions.

So, what are going to do to optimize memory usage and bandwidth?

Capacity: Use indirect references instead of direct references for heavy content

Capacity: Remove direct references to inaccessible content

Capacity: Global GameObjects shouldn't direct-reference heavy content

Capacity: Seldomly used scene GameObjects shouldn't direct-reference heavy content

Capacity: Try texture streaming*

Capacity: Set optimal compression settings for textures, meshes, animations, etc..

Capacity: Disable read/write asset import setting whenever possible

GC: Reduce memory allocations to avoid growing the reserved heap size

AudioClips: enable streaming on long clips*

Performance: Avoid Resources directory

Performance: Preload commonly used shaders to avoid gameplay spikes and strip unused shaders

Performance: Try incremental Garbage Collector to reduce spikes

Performance: Use indirect-referenced object pools to reduce spikes

GC: Control GC manually for fine control (advanced)

GC: Avoid garbage-generating methods such as FindObjectsOfType

GC: Aim for less than 32 bytes of memory allocations per frame

GC: Avoid C# boxing

BuildSize: Reduce build sizes with CDNs

CHAPTER 4: 
The Extended Unity Performance Checklist (91+ Tips)

So far I've given you a simplified version of The Unity Performance Checklist that plays well with the web.

But there's much more to it than just a few titles...

What does each item really mean? And more importantly, what can we actually do about them?

Luckily, I prepared an extended version. Check it below.

In the extended edition of The Unity Performance Checklist for 2020+, you'll get access to a spreadsheet and a PDF that includes:

  • growing catalog of 91+ Unity Performance Tips
  • Descriptions: why is each suggestion relevant to you?
  • Online references with actionable steps to apply in your project

Get it here and then answer this question...

Which Unity performance checkboxes will you leave without a tick and why?


Related Jobs

Disbelief
Disbelief — Cambridge, Massachusetts, United States
[09.24.20]

Programmer
Phantasma Labs
Phantasma Labs — Berlin, Germany
[09.23.20]

Senior Software Engineer - Unreal Engine specialized in networking
Square Enix Co., Ltd.
Square Enix Co., Ltd. — Tokyo, Japan
[09.23.20]

Experienced Game Developer
Deep Silver Volition
Deep Silver Volition — Champaign, Illinois, United States
[09.17.20]

Senior Engine Programmer





Loading Comments

loader image