rarebyte - how we use unity and optimize our games
TRANSCRIPT
Rainer AngermannCo-Founder
@rangermann
• Games
• Mobile apps
• Public installations
• Headquarters: Graz, Vienna
• 25+ titles since 2006
• Agile, low overhead
• Work for hire
• Game porting
• Game development fromscratch
RAREBYTE
• Rarebyte as unincorporated association since 1999
• ParadiGm – FPS, own engine, own editor, never released
THE BEGINNING
GREEDY FLY
• TPS MMO, own engine, own editor, never released
THINK BIG?
• Reality-check your ideas
• Manage your available
resources
• Do not start an MMO…
ever…
• 2005 – Waterstorm development started
WATERSTORM
• 2006 – Rarebyte company
• 2008 – Waterstorm release
WATERSTORM
Game Development in Unity
UNITY – WHY USE IT?
• Focus on making games
• Affordable
• Community
• Re-use code and assets
• All major platforms
„Small“ Projects:
• Setup scene in Unity
• Write some code
• Test in Unity editor
• One target platform
„Build and Run“ and you are done!
BUILD PROCESS
• Build/device settings
• Signing identity
• Provisioning profiles
iOS BUILDS
Unity
Xcode Device
BUILD SYSTEM
• Unity (commandline)
• Proprietary build
configurator
• Game State System
• UI Panel System
• Webservices
• Localization
• Asset Bundle Loading
• Logger
• On-Screen Console
RAREBYTE LIBRARIES
Performance Tips
PERFORMANCE OPTIMIZATION
• Graphics/Shaders/Lighting
• Assets/Textures/Meshes/Import Settings
• Physics
• Audio
• Platform-specifics
• Scripting/Game Code
• Gendarme
• Unity rules
STATIC CODE ANALYSIS
https://github.com/fderudder/unity-gendarme
• Cache your components!
• Avoid GetComponent() callsin Update() or FixedUpdate()
CODING TIPS
• Avoid empty MonoBehaviourmethods
CODING TIPS
CODING TIPS
• Use Coroutines
• Avoid GameObject.Find (), GameObject.FindByTag()
• Don‘t use SendMessage() (100x slower!)
PROFILER
PROFILER
POOLING
• Expensive Instantiate() calls
• Use a pool for game objects that need to be instantiated/killedfrequently
• https://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/object-pooling
ADVANCED OPTIMIZATION
• C# Memory and performance tips for Unity:
http://www.somasim.com/blog/2015/04/csharp-memory-and-performance-tips-for-unity/
• for-each vs. for etc.
• GC
GENERAL ADVICE
• Code style/readability (format your code!)
• Use English for all names etc.
• Do not be afraid of refactoring/renaming
• Use a portrait resolution if your game is portrait
• MonoBehaviour/inspector: Use private members with [SerializeField]
• Unity Console (errors/warnings)