native code is dead aka cross platform development with unity 3d

38

Upload: ralph-barbagallo

Post on 31-Aug-2014

793 views

Category:

Technology


1 download

DESCRIPTION

These are the slides from my GDC China 2013 presentation. Which is an updated version of my older cross-platform Unity3D slides.

TRANSCRIPT

Page 1: Native Code is Dead AKA Cross Platform Development with Unity 3D
Page 2: Native Code is Dead AKA Cross Platform Development with Unity 3D

Na#ve  Code  is  Dead  AKA  Cross  Pla2orm  Development  with  Unity3D  

Ralph  Barbagallo  Founder,  FLARB  LLC  

Page 3: Native Code is Dead AKA Cross Platform Development with Unity 3D
Page 4: Native Code is Dead AKA Cross Platform Development with Unity 3D

2001  

Page 5: Native Code is Dead AKA Cross Platform Development with Unity 3D

2007  

Page 6: Native Code is Dead AKA Cross Platform Development with Unity 3D

2008  

Page 7: Native Code is Dead AKA Cross Platform Development with Unity 3D

The  Pla2orm  Problem  

Page 8: Native Code is Dead AKA Cross Platform Development with Unity 3D

20XX…  

Page 9: Native Code is Dead AKA Cross Platform Development with Unity 3D

Choosing  A  Solu#on  • Most  Pla9orms  With  Least  Code  

•  Licensing  Model  That  Won’t  Eat  Margins  

• Broad  Community  Support  

Page 10: Native Code is Dead AKA Cross Platform Development with Unity 3D

HTML5  • HTML5  Frameworks  • PhoneGap  • GameSalad  • Game  Closure,  AppMobi,  Ludei  

• HTML5  SHll  Sucks  • Horrible  Performance  • Gated  by  mobile  browsers  

Page 11: Native Code is Dead AKA Cross Platform Development with Unity 3D
Page 12: Native Code is Dead AKA Cross Platform Development with Unity 3D

Cocos2d  • Cocos2d-­‐X  • Straight  C++  version  of  Cocos2d  • Great  2D  library,  widely  used  • Amazing  updates  and  support  • No  web  support  

Page 13: Native Code is Dead AKA Cross Platform Development with Unity 3D
Page 14: Native Code is Dead AKA Cross Platform Development with Unity 3D

Flash  /  Adobe  AIR  •  Flash  isn’t  dead!  •  Use  Flash,  FlashBuilder,  etc.  •  AIR  NaHve  Extensions  •  Flash  game  engines  •  Starling  

Page 15: Native Code is Dead AKA Cross Platform Development with Unity 3D
Page 16: Native Code is Dead AKA Cross Platform Development with Unity 3D

Unreal  Developer’s  Kit  •  Don’t  need  a  Mac!  •  Top  of  the  line  renderer  •  25%  of  revenue  to  Epic  •  Weak  pla9orm-­‐specific  support  

Page 17: Native Code is Dead AKA Cross Platform Development with Unity 3D
Page 18: Native Code is Dead AKA Cross Platform Development with Unity 3D

Other  Op#ons  • Titanium  Studio  • Corona  • GameMaker  • Stencyl  • Marmalade  

Page 19: Native Code is Dead AKA Cross Platform Development with Unity 3D
Page 20: Native Code is Dead AKA Cross Platform Development with Unity 3D
Page 21: Native Code is Dead AKA Cross Platform Development with Unity 3D

Why  I  Chose  Unity3D:    Tech  • Best  support  for  criHcal  pla9orms  • Mobile  (iOS,  Android,  etc.)  • Web  (NaCL,  Web  Player,  Flash)  • Desktop  (Steam,  Mac  App  Store,  Win8)  • Console  

Page 22: Native Code is Dead AKA Cross Platform Development with Unity 3D

Tech  • NaHve  Plug-­‐ins  • Can  support  any  pla9orm-­‐specific  funcHonality  • Amazon  App  Store  • Google  Play  Game  Services  • Write  your  own  naHve  plug-­‐in  

Page 23: Native Code is Dead AKA Cross Platform Development with Unity 3D

Support  • Awesome  forums  • Awesome  feedback  from  support  • Twi]er!  

Page 24: Native Code is Dead AKA Cross Platform Development with Unity 3D

Asset  Store  

Page 25: Native Code is Dead AKA Cross Platform Development with Unity 3D

Business  Model  • Flat  fee  per-­‐seat  (‘perpetual’)  • Monthly  SubscripHon  • No  rev-­‐share  

Page 26: Native Code is Dead AKA Cross Platform Development with Unity 3D

Brick  Buddies  

Page 27: Native Code is Dead AKA Cross Platform Development with Unity 3D

Camera  Birds  

Page 28: Native Code is Dead AKA Cross Platform Development with Unity 3D

iOS  to  Android  with  Unity3D  

Page 29: Native Code is Dead AKA Cross Platform Development with Unity 3D

Plug-­‐ins  • Used  mostly  cross-­‐pla9orm  plug-­‐ins  

• Access  pla9orm  specific  features  (IAP,  etc.)  

Page 30: Native Code is Dead AKA Cross Platform Development with Unity 3D

Pla2orm  Specific  Code  • Only  spent  a  few  days  of  re-­‐factoring  

• Swapped  out  iOS  plug-­‐ins  for  Android  

• RunHme  pla9orm  checks  and  #IF  compiler  direcHves  

• AndroidJavaClass!  

Page 31: Native Code is Dead AKA Cross Platform Development with Unity 3D

AndroidJavaClass  AndroidJavaObject activity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity”)! !mWindowManager = activity.Call<AndroidJavaObject>("getSystemService","window");!!mConfig = activity.Call<AndroidJavaObject>("getResources").Call<AndroidJavaObject>("getConfiguration");!!

Page 32: Native Code is Dead AKA Cross Platform Development with Unity 3D

Screen  Sizes  •  iOS  has  3  aspect  raHos  to  deal  with  

• Made  interface  work  in  “safe  zone”  

• For  Android’s  common  16:10  raHo,  scaled  NGUI  interface  to  fit  

Page 33: Native Code is Dead AKA Cross Platform Development with Unity 3D

Android  Fragmenta#on  

Page 34: Native Code is Dead AKA Cross Platform Development with Unity 3D

Performance  and  Tes#ng  

Page 35: Native Code is Dead AKA Cross Platform Development with Unity 3D

Cross  Pla2orm  Export  Tools  • Per-­‐Pla9orm  Asset  Sehngs  • Compression  sehngs  • Filtering  

• Cache  Server  

• MulH-­‐Pla9orm  Toolkit  • Build-­‐Hme  asset  changes  

Page 36: Native Code is Dead AKA Cross Platform Development with Unity 3D

In  Summary  • Best  Business  Model  

• Widest  Pla9orm  Support  

• Best  Community  Support  

• Dead  Simple  PorHng  Process  

Page 37: Native Code is Dead AKA Cross Platform Development with Unity 3D
Page 38: Native Code is Dead AKA Cross Platform Development with Unity 3D

Thanks!  Email:    [email protected]    Twi]er:  @flarb    Blog:  www.ralphbarbagallo.com    Site:    www.flarb.com