Basic Optimization and Unity Tips & Tricks
Yogie Aditya,Hinocyber
Basic Optimization (What)
• Well it’s something that you have to do to make your game run well and smoothly
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!
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
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)
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
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
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)
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)
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…
• 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
That’s all folks!Thank you
Any Question?