13
Basic Optimization and Unity Tips & Tricks Yogie Aditya, Hinocyber

Basic Optimization and Unity Tips & Tricks by Yogie Aditya

Embed Size (px)

Citation preview

Page 1: Basic Optimization and Unity Tips & Tricks by Yogie Aditya

Basic Optimization and Unity Tips & Tricks

Yogie Aditya,Hinocyber

Page 2: Basic Optimization and Unity Tips & Tricks by Yogie Aditya

Basic Optimization (What)

• Well it’s something that you have to do to make your game run well and smoothly

Page 3: Basic Optimization and Unity Tips & Tricks by Yogie Aditya

Basic Optimization (Why)

• Game Programming is not just about core mechanic implementation

• Editor != Devices

• Platform X != Platform Y != Platform Z

• You are a Merchant!

• Nice!

Page 4: Basic Optimization and Unity Tips & Tricks by Yogie Aditya

Basic Optimization (When)

• Depends on the scale of your game

• On creation (Based on knowledge and experience)

• On polishing (Based on bugs and issues)

• Mobile > Web > PC

Page 5: Basic Optimization and Unity Tips & Tricks by Yogie Aditya

Basic Optimization (Who)

• Programmer (Code Flow, Math, Asset Management)

• Artist (Images Creation, Low/High Poly 3D Models, File size)

• Sound Composer (Bitrate, Seamless Music Loops, Extension, Channel/Signals, File size)

Page 6: Basic Optimization and Unity Tips & Tricks by Yogie Aditya

Basic Optimization (How)

• Know the limitation of the Game Engine and platforms on which the game would be ported

• Game Designer (Angel vs Devil)

• Patience

Page 7: Basic Optimization and Unity Tips & Tricks by Yogie Aditya

Basic Optimization (Preliminary)

• Draw call : A call to function of the underlying API (e.g Open GLS ES) to draw something on the screen

• Fragment : A candidate pixel which may or may not end up on screen for different reason

• Batching : To group similar draw calls in one call operating the whole data set

• Mobile vs non Mobile Rendering Path : deferred rendering vs Immediate

Page 8: Basic Optimization and Unity Tips & Tricks by Yogie Aditya

Basic Optimization (Tech.)

• Don’t use too much collider when you work for mobile games

• Object Pooler is King (But better know its weakness)

• GameObject.Find(‘’’’) is disaster

• Code Caching

• Baking

• Batching (Static and Dynamic)

• Culling (Frustum, Occlusion)

• Understand the Rendering Path

• Texture Atlas

• Always enable ‘Optimized Mesh’ option in Mesh import settings, always enable ‘Optimized Mesh Data’ option in Player Settings (Mostly for 3D Projects)

• Optimize your code (Related to Unity functions or not)

Page 9: Basic Optimization and Unity Tips & Tricks by Yogie Aditya

Basic Optimization (Tech.)

• CPU Bound

• GPU Bound

• Bandwidth Bound

• Vertices Count

• Use Milliseconds (not FPS)

• Unity Profiler (Free in Unity 5.x)

• Use platform-specific tools

• Adreno Profiler (Qualcomm, Adreno)

• PerfHUD ES (nVidia, Tegra)

• PVRTune, PVRTrace (Imagination tec, PowerVR)

• Mali Graphics Debugger (ARM, Mali)

Page 10: Basic Optimization and Unity Tips & Tricks by Yogie Aditya

Basic Optimization (Tech.)

• Opaque vs Transparent Image

• Texture Compressions

• Audio Optimization

• Short Clips – Native

• Longer (or looping) clips – Compressed in memory

• Music – Stream from disc

• Files which consistently cause CPU spikes – Decompress on load

• Check if everything work properly :D

• And many more…

Page 11: Basic Optimization and Unity Tips & Tricks by Yogie Aditya

• Beware of Nesting Prefabs

• Gizmos Icon

• Drag and drop multiple items with locked Inspector

• Understand Unity Execution Orders

• Unity Remotes

• Unity Documentation

Unity Tips & Tricks

• Configure your Monodevelop

• Use your own Layouts

• Do not stress with Play Mode

• Debug Mode Inspector

• Paste Component Values

• Paste Multiple Component Values

• Use Attributes

Page 12: Basic Optimization and Unity Tips & Tricks by Yogie Aditya

That’s all folks!Thank you

Any Question?

Page 13: Basic Optimization and Unity Tips & Tricks by Yogie Aditya