Unity - лекарство от фрагментации Android - Олег Придюк - Unity

Post on 14-Jan-2015

847 views 1 download

description

 

Transcript of Unity - лекарство от фрагментации Android - Олег Придюк - Unity

Oleg PridiukUnity - the cure to Android fragmentation

Page

Sociality Rocks, Kyiv 2012 2

Is there a fragmentation actually?

Why do you care?

Page

Sociality Rocks, Kyiv 2012 3

Oh that Unity guy…

Page

Sociality Rocks, Kyiv 2012 4

Spooky stories about Android

Page

Sociality Rocks, Kyiv 2012 5

Spooky stories about Android

Page

Sociality Rocks, Kyiv 2012 6

Spooky stories about Android

Page

Sociality Rocks, Kyiv 2012 7

Spooky stories about Android• Hardware fragmentation

• CPU• GPU• Screen resolution• DPI

• Software fragmentation• Operating system• Customized firmwares• Cellular operator’s love

• Marketplace restrictions• Regional• App size

Page

Sociality Rocks, Kyiv 2012 8

Nah, I’d rather do the iOS stuff

Kamon! You can do it!

Page

Sociality Rocks, Kyiv 2012 9

Yes I care about all the zoo!

I am doing freemium games, so I care about the long tail

Page

Sociality Rocks, Kyiv 2012 10

Hardware fragmentation• CPU fragmentation

• Clock frequency 600MHz – ~2000MHz• Most devices 1000MHz – 1,2GHz• NEON (SIMD) instructions?• Dual core? / Quad core?

• Unity takes care of it• Detects and utilizes NEON to speed up

computations• Uses multi-threading to scale to dual/quad

core

Page

Sociality Rocks, Kyiv 2012 11

Hardware fragmentation• GPU fragmentation

• GPU usually the bottleneck, because of screen resolution

• Also more diverse than CPUs

• Completely different architectures• Tile Based Deferred (TBDR) - PowerVR SGX• Tile Based Rendering - ARM Mali, Qualcomm Adreno• Immediate Mode (IMR) – NVIDIA Tegra, [Adreno 3xx]

• Unity cannot solve these GPU differences entirely• Some special handling exists for the worst cases• We try to hint about potential problems / best practices

where we can

Page

Sociality Rocks, Kyiv 2012 12

Hardware fragmentation• Resolution/screen size fragmentation

• 800x480, 854x480, 960x540, 1024x600, 1024x768, 1280x600, 1280x800, 1920x1200

• Flip the above

• Performance is different• Often same hardware has to hold 800x480 and

1280x800• Phones / Tablets / TV-Out

• DPI nightmare• 1280x800 on 10” is very different on 4”

• Solution• Make the game UI (somewhat) resolution independent• Can have impact on game mechanics (input)

Page

Sociality Rocks, Kyiv 2012 13

Software fragmentation

Android OS fragmentation• Android 2.1-2.2 (API 7 and 8) – 17.7%

• Worse than Gingerbread, but still doable

• Android 2.3 (Gingerbread, API 9) – 57.5%• Most devices (includes last year tops) use it• Most ‘feature complete’ for gaming

• Android 3.x – 4.x – 24.2%• Most tablets + newer devices

• “Proper” OS still covers ~82% of the market• Earlier than API 9 is hard to support• Earlier than API 7 is next to impossible to support

Page

Sociality Rocks, Kyiv 2012 14

Software fragmentation• Unity takes care of OS fragmentation

• Unity prepares the manifest file for you• Unity abstracts some API for you (think input, camera)• Unity switches to NativeActivity at runtime, if possible

• How can you help yourself• Choose the right minimum supported API level• Develop with this minimum API level in mind

• E.g. Unity cannot make Gingerbread OS recognize a joystick

• But generally not a problem for developers using Unity• We solve the problems with different OS version and provide

fallbacks where appropriate

Page

Sociality Rocks, Kyiv 2012 15

Software fragmentation• Cellular operators make your life interesting

• App size is limited• By market restrictions, cellops, cache size, etc.• Sometimes very small• And when your game needs to be preinstalled – the space is even smaller

• Customized operator firmware• Software updates are slow/rare• Unique bugs• Modified drivers

• Custom operator policies• Free your imagination• App stores you never heard of

• How can Unity fix it for you• We build device zoos, farms, regression testing rigs• We talk to cellops, OEMs• We fix/workaround what we can on our side

Page

Sociality Rocks, Kyiv 2012 16

What have we learned today

Unity users care about the Android fragmentation much-much less and are generally happier. True

story!

Page

Sociality Rocks, Kyiv 2012 17

Slide sponsored by our marketings

• Bad Piggies• CSR Racing• The Room• Gears• Emaki• Jelly Defence• Battleheart• Paper Moon• Escape Plan• Airport City• King's Bounty: Legions• Max & the Magic Marker• Marvel Superhero Squad

Online• Star Wars: the Quest for R2-

D2

• Windows• Windows 8 [Metro]• Mac• Web• Flash• iOS• Android• Windows Phone 8• PS3• Xbox 360• Nintendo Wii• Nintendo Wii U• Union

• Roku• Maemo• Smart TV

Page

Sociality Rocks, Kyiv 2012 18

Page

Sociality Rocks, Kyiv 2012 19

Now you’re feeling like a user playing an ads-

supported game.

Imagine if it was feemium or free to play…

Page

Sociality Rocks, Kyiv 2012 20

That’s your minimum zoo• Define low-end:

• Adreno 205, API 8 (HTC Desire HD)• Tegra 2, API 12 (ASUS Transformer TF101)• PowerVR SGX, API 7/8 (Samsung Galaxy S)

• Define high-end• HTC One X

• Tegra 3 , also because Sence 3 is…

• Samsung Galaxy S III• JB of Samsung, newest PowerVR

• Kindle Fire HD • Full HD at small screen, custom firmware, custom marketplace

• Samsung Galaxy S II• ARM Mali and very popular, JB supported

• Anything else reported to be selling in tones

Page

Sociality Rocks, Kyiv 2012 21

Questions?

Now or never!

Page

Sociality Rocks, Kyiv 2012 22

Slide sponsored by our marketings

• Bad Piggies• CSR Racing• The Room• Gears• Emaki• Jelly Defence• Battleheart• Paper Moon• Escape Plan• Airport City• King's Bounty: Legions• Max & the Magic Marker• Marvel Superhero Squad

Online• Star Wars: the Quest for R2-

D2

• Windows• Windows 8 [Metro]• Mac• Web• Flash• iOS• Android• Windows Phone 8• PS3• Xbox 360• Nintendo Wii• Nintendo Wii U• Union

• Roku• Maemo• Smart TV