SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Downloaden Sie, um offline zu lesen
Optimizing Large Scenes in Unity
How we put 5,000 bases on a planet and
lived to tell about it
Noam Gat
Tacticsoft
@noamgat
Hello!
Noam Gat
CTO @ Tacticsoft
Past - JoyTunes, Omek Interactive, OGRE
Earth Arena Case Study
Tacticsoft’s upcoming Mobile Strategy MMO
Take over the world with your friends!
http://www.eartharena.com
Earth Arena Case Study
5,000 bases on a planet, with 3 levels of detail
and smooth transitions
The challenge (today) is not to make a single object
look good, but to make an entire scene run
smoothly
- Frames per second
- Loading Time
- Memory footprint
- Artist pipeline
Scene Management
Step 1 - Prove the problem
Step 1 - Prove the problem
Premature optimization is the
root of all evil
Naive solution
- Instantiate a prefab for every base in the world
- Each object contains 3 LOD objects
- Show / hide object groups based on camera
https://youtu.be/Q2gNauFxwMA
Naive solution
Worked surprisingly well!
- It was faster to disable/enable renderers rather
than game objects
- Started becoming heavy on iPhone 6 with 1k
objects, but was good enough
Test Driven Development (TDD)
Not only about unit tests.
Create a consistent, easy to run, reproducible
environment to check that what you created
meets your expectations.
Stress Test, Take 1
https://youtu.be/fjEkRZsrUSA
Step 1 - Prove the problem
Not stupid, but naive.
Step 2 - Investigate
Step 2 - Investigate
Between the different aspects of the scene, which
one was causing the crash?
- Frames per second
- Loading Time
- Memory footprint
- Artist pipeline
Unity’s Toolset
Benchmarking
A few experiments revealed:
- Unity objects / components cost ~1k per
instance
- 5k objects, 10 GOs/object, 3 components / GO -
> 150k components -> 150MB scene
- Dynamic batching was the biggest CPU hit, and
batching was also becoming a problem
Step 3 - Solve
We wanted a solution that has:
- A stable memory footprint in large worlds
- Good FPS / batching performance
- Looks like the previous solution
- Won’t be a nightmare to control artistically
Solution approaches
Two approaches:
- Pooling - Return out of camera objects to a pool,
reuse them when the camera moves
- Baking - Dynamically a large mesh with many
objects packed together (similar to Unity’s static
batching)
Solution problems
Pooling - When looking at the
world from far away, we see half
of the objects in the world, so
pooling is only a 50% reduction
Solution problems
Baking - When looking at the
world from up close, we have 3d
models with relatively high poly
counts and some with animations
Solution
The problems never happen at the same time, and
we can predict which will happen when.
Solution (Artist side)
Baked objects go
to baking pipeline
Instanced objects go
to pooling pipeline
Array of Structs / Struct of Arrays
- Array of structs is the intuitive way to look at
things (every object has several properties)
- Struct of arrays is a bit weird (several properties
have values for every object)
Struct of arrays allows us to look at a vertical of all
objects (“All baked LOD1 objects”) and do
something special for them
Baked pipeline
Not MonoBehaviour,
~ 200 bytes memory
Minimal amount of
information to
render and order
Baked pipeline
Baked pipeline
Less batches, much less game objects / components
Baked pipeline gotcha
When viewing a lot of sprites from far away, better to
turn off “Tight” sprite packing to allow more sprites in
same amount of geometry
Pooled pipeline
Which instance to
instantiate
Where to put it
Pooled pipeline
Rest of pooled pipeline reiles on previous “camera
culling” method from first naive attempt - instead
of disabling / enabling objects we take / return
them to the pool
Object permutations
The objects have different properties (colors etc)
based on their role in the world.
We do not want a different prefab for each
permutation of each object.
“Visitor” Design Pattern
“Visitor” Design Pattern
“Visitor” Design Pattern
The visitor pattern allows us to easily reuse
prefabs, making modifications as needed in both
the baked and pooled pipelines.
It puts healthy design constraints on what you can
and can’t put on objects placed on the map (MVC
principles etc)
Step 4 - Test
Number of objects
Number of batches
https://youtu.be/Jys5bdeJCtM
Device performance
https://youtu.be/skRCgq093Mc
The future...
https://youtu.be/sOnzYTT793Y
TL;DR
- It’s OK to be naive for 99% of the code
- TDD applies to optimization as well
- Many approaches to solve problems, the
correct one stems from understanding the
problem
- Several design patterns are very useful for
optimization
Thank You!
Come play our games!
http://www.eartharena.com
http://www.tacticsoft.net
@noamgat

Weitere ähnliche Inhalte

Was ist angesagt?

[Ndc11 박민근] deferred shading
[Ndc11 박민근] deferred shading[Ndc11 박민근] deferred shading
[Ndc11 박민근] deferred shading
MinGeun Park
 
UE4 Garbage Collection
UE4 Garbage CollectionUE4 Garbage Collection
UE4 Garbage Collection
QooJuice
 
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Johan Andersson
 

Was ist angesagt? (20)

Modular Rigging in Battlefield 3
Modular Rigging in Battlefield 3Modular Rigging in Battlefield 3
Modular Rigging in Battlefield 3
 
Speed up your asset imports for big projects - Unite Copenhagen 2019
Speed up your asset imports for big projects - Unite Copenhagen 2019Speed up your asset imports for big projects - Unite Copenhagen 2019
Speed up your asset imports for big projects - Unite Copenhagen 2019
 
『DirectX 12를 이용한 3D 게임 프로그래밍 입문』 - 맛보기
『DirectX 12를 이용한 3D 게임 프로그래밍 입문』 - 맛보기『DirectX 12를 이용한 3D 게임 프로그래밍 입문』 - 맛보기
『DirectX 12를 이용한 3D 게임 프로그래밍 입문』 - 맛보기
 
Optimization in Unity: simple tips for developing with "no surprises" / Anton...
Optimization in Unity: simple tips for developing with "no surprises" / Anton...Optimization in Unity: simple tips for developing with "no surprises" / Anton...
Optimization in Unity: simple tips for developing with "no surprises" / Anton...
 
Relic's FX System
Relic's FX SystemRelic's FX System
Relic's FX System
 
[Ndc11 박민근] deferred shading
[Ndc11 박민근] deferred shading[Ndc11 박민근] deferred shading
[Ndc11 박민근] deferred shading
 
Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite
Physically Based Sky, Atmosphere and Cloud Rendering in FrostbitePhysically Based Sky, Atmosphere and Cloud Rendering in Frostbite
Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite
 
NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술
NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술
NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술
 
스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
 
How we optimized our Game - Jake & Tess' Finding Monsters Adventure
How we optimized our Game - Jake & Tess' Finding Monsters AdventureHow we optimized our Game - Jake & Tess' Finding Monsters Adventure
How we optimized our Game - Jake & Tess' Finding Monsters Adventure
 
[UniteKorea2013] Memory profiling in Unity
[UniteKorea2013] Memory profiling in Unity[UniteKorea2013] Memory profiling in Unity
[UniteKorea2013] Memory profiling in Unity
 
DirectX 11 Rendering in Battlefield 3
DirectX 11 Rendering in Battlefield 3DirectX 11 Rendering in Battlefield 3
DirectX 11 Rendering in Battlefield 3
 
UE4 Garbage Collection
UE4 Garbage CollectionUE4 Garbage Collection
UE4 Garbage Collection
 
Forts and Fights Scaling Performance on Unreal Engine*
Forts and Fights Scaling Performance on Unreal Engine*Forts and Fights Scaling Performance on Unreal Engine*
Forts and Fights Scaling Performance on Unreal Engine*
 
Frostbite on Mobile
Frostbite on MobileFrostbite on Mobile
Frostbite on Mobile
 
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
 
Compute shader DX11
Compute shader DX11Compute shader DX11
Compute shader DX11
 
Progressive Lightmapper: An Introduction to Lightmapping in Unity
Progressive Lightmapper: An Introduction to Lightmapping in UnityProgressive Lightmapper: An Introduction to Lightmapping in Unity
Progressive Lightmapper: An Introduction to Lightmapping in Unity
 
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
 
OpenGL 4.4 - Scene Rendering Techniques
OpenGL 4.4 - Scene Rendering TechniquesOpenGL 4.4 - Scene Rendering Techniques
OpenGL 4.4 - Scene Rendering Techniques
 

Ähnlich wie Optimizing Large Scenes in Unity

Unite2013-gavilan-pdf
Unite2013-gavilan-pdfUnite2013-gavilan-pdf
Unite2013-gavilan-pdf
David Gavilan
 

Ähnlich wie Optimizing Large Scenes in Unity (20)

Unity optimization techniques applied in Catan Universe
Unity optimization techniques applied in Catan UniverseUnity optimization techniques applied in Catan Universe
Unity optimization techniques applied in Catan Universe
 
Heroes of Paragon: publishing Unity WebGL game on Facebook
Heroes of Paragon: publishing Unity WebGL game on FacebookHeroes of Paragon: publishing Unity WebGL game on Facebook
Heroes of Paragon: publishing Unity WebGL game on Facebook
 
Umbra 3 IGDA & Unity Presentation
Umbra 3 IGDA & Unity PresentationUmbra 3 IGDA & Unity Presentation
Umbra 3 IGDA & Unity Presentation
 
Umbra 3 & Unity 3.5 - IGDA Helsinki 2012
Umbra 3 & Unity 3.5 - IGDA Helsinki 2012Umbra 3 & Unity 3.5 - IGDA Helsinki 2012
Umbra 3 & Unity 3.5 - IGDA Helsinki 2012
 
Ottawa unity user_group_feb13_2015
Ottawa unity user_group_feb13_2015Ottawa unity user_group_feb13_2015
Ottawa unity user_group_feb13_2015
 
Pharo Status Fosdem 2015
Pharo Status Fosdem 2015Pharo Status Fosdem 2015
Pharo Status Fosdem 2015
 
Pharo Status (Fosdem 2015)
Pharo Status (Fosdem 2015)Pharo Status (Fosdem 2015)
Pharo Status (Fosdem 2015)
 
Performance #1: Memory
Performance #1: MemoryPerformance #1: Memory
Performance #1: Memory
 
Unite2013-gavilan-pdf
Unite2013-gavilan-pdfUnite2013-gavilan-pdf
Unite2013-gavilan-pdf
 
Visibility Optimization for Games
Visibility Optimization for GamesVisibility Optimization for Games
Visibility Optimization for Games
 
Visibility Optimization for Games
Visibility Optimization for GamesVisibility Optimization for Games
Visibility Optimization for Games
 
Synthesizing 3d worlds
Synthesizing 3d worldsSynthesizing 3d worlds
Synthesizing 3d worlds
 
Performance #1 memory
Performance #1   memoryPerformance #1   memory
Performance #1 memory
 
SPU Physics
SPU PhysicsSPU Physics
SPU Physics
 
PHP Backends for Real-Time User Interaction using Apache Storm.
PHP Backends for Real-Time User Interaction using Apache Storm.PHP Backends for Real-Time User Interaction using Apache Storm.
PHP Backends for Real-Time User Interaction using Apache Storm.
 
FGS 2011: Making A Game With Molehill: Zombie Tycoon
FGS 2011: Making A Game With Molehill: Zombie TycoonFGS 2011: Making A Game With Molehill: Zombie Tycoon
FGS 2011: Making A Game With Molehill: Zombie Tycoon
 
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
 
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
 
Chance's "Visual Effects" Lecture
Chance's "Visual Effects" LectureChance's "Visual Effects" Lecture
Chance's "Visual Effects" Lecture
 
Physics Solutions for Innovative Game Design
Physics Solutions for Innovative Game DesignPhysics Solutions for Innovative Game Design
Physics Solutions for Innovative Game Design
 

Kürzlich hochgeladen

Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
Tonystark477637
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 

Kürzlich hochgeladen (20)

(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 

Optimizing Large Scenes in Unity

  • 1. Optimizing Large Scenes in Unity How we put 5,000 bases on a planet and lived to tell about it Noam Gat Tacticsoft @noamgat
  • 2. Hello! Noam Gat CTO @ Tacticsoft Past - JoyTunes, Omek Interactive, OGRE
  • 3. Earth Arena Case Study Tacticsoft’s upcoming Mobile Strategy MMO Take over the world with your friends! http://www.eartharena.com
  • 4. Earth Arena Case Study 5,000 bases on a planet, with 3 levels of detail and smooth transitions
  • 5. The challenge (today) is not to make a single object look good, but to make an entire scene run smoothly - Frames per second - Loading Time - Memory footprint - Artist pipeline Scene Management
  • 6. Step 1 - Prove the problem
  • 7. Step 1 - Prove the problem Premature optimization is the root of all evil
  • 8. Naive solution - Instantiate a prefab for every base in the world - Each object contains 3 LOD objects - Show / hide object groups based on camera https://youtu.be/Q2gNauFxwMA
  • 9. Naive solution Worked surprisingly well! - It was faster to disable/enable renderers rather than game objects - Started becoming heavy on iPhone 6 with 1k objects, but was good enough
  • 10. Test Driven Development (TDD) Not only about unit tests. Create a consistent, easy to run, reproducible environment to check that what you created meets your expectations.
  • 11. Stress Test, Take 1 https://youtu.be/fjEkRZsrUSA
  • 12. Step 1 - Prove the problem Not stupid, but naive.
  • 13. Step 2 - Investigate
  • 14. Step 2 - Investigate Between the different aspects of the scene, which one was causing the crash? - Frames per second - Loading Time - Memory footprint - Artist pipeline
  • 16. Benchmarking A few experiments revealed: - Unity objects / components cost ~1k per instance - 5k objects, 10 GOs/object, 3 components / GO - > 150k components -> 150MB scene - Dynamic batching was the biggest CPU hit, and batching was also becoming a problem
  • 17. Step 3 - Solve We wanted a solution that has: - A stable memory footprint in large worlds - Good FPS / batching performance - Looks like the previous solution - Won’t be a nightmare to control artistically
  • 18. Solution approaches Two approaches: - Pooling - Return out of camera objects to a pool, reuse them when the camera moves - Baking - Dynamically a large mesh with many objects packed together (similar to Unity’s static batching)
  • 19. Solution problems Pooling - When looking at the world from far away, we see half of the objects in the world, so pooling is only a 50% reduction
  • 20. Solution problems Baking - When looking at the world from up close, we have 3d models with relatively high poly counts and some with animations
  • 21. Solution The problems never happen at the same time, and we can predict which will happen when.
  • 22. Solution (Artist side) Baked objects go to baking pipeline Instanced objects go to pooling pipeline
  • 23. Array of Structs / Struct of Arrays - Array of structs is the intuitive way to look at things (every object has several properties) - Struct of arrays is a bit weird (several properties have values for every object) Struct of arrays allows us to look at a vertical of all objects (“All baked LOD1 objects”) and do something special for them
  • 24. Baked pipeline Not MonoBehaviour, ~ 200 bytes memory Minimal amount of information to render and order
  • 26. Baked pipeline Less batches, much less game objects / components
  • 27. Baked pipeline gotcha When viewing a lot of sprites from far away, better to turn off “Tight” sprite packing to allow more sprites in same amount of geometry
  • 28. Pooled pipeline Which instance to instantiate Where to put it
  • 29. Pooled pipeline Rest of pooled pipeline reiles on previous “camera culling” method from first naive attempt - instead of disabling / enabling objects we take / return them to the pool
  • 30. Object permutations The objects have different properties (colors etc) based on their role in the world. We do not want a different prefab for each permutation of each object.
  • 33. “Visitor” Design Pattern The visitor pattern allows us to easily reuse prefabs, making modifications as needed in both the baked and pooled pipelines. It puts healthy design constraints on what you can and can’t put on objects placed on the map (MVC principles etc)
  • 34. Step 4 - Test
  • 39. TL;DR - It’s OK to be naive for 99% of the code - TDD applies to optimization as well - Many approaches to solve problems, the correct one stems from understanding the problem - Several design patterns are very useful for optimization
  • 40. Thank You! Come play our games! http://www.eartharena.com http://www.tacticsoft.net @noamgat