native code is dead aka cross platform development with unity3d

Post on 31-Aug-2014

1.278 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

To survive in today's ultra fast paced game development ecosystem, you can no longer develop native code stuck to one platform. This presentation walks through all of the major cross-platform development tools and explains why I chose Unity3D and how I used it to build games on multiple platforms simultaneously. This is the GDC Taipei Summit version of my GDC China talk. Pretty much the same.

TRANSCRIPT

Native Code is DeadAKACross Platform Development with Unity3D

Ralph BarbagalloFounder, FLARB LLC

2001

2007

2008

The Platform Problem

20XX…

Choosing A Solution• Most Platforms With Least Code

• Licensing Model That Won’t Eat Margins

• Broad Community Support

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

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

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

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

• Stage3D

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

Other Options• Titanium Studio• Corona• GameMaker• Stencyl• Marmalade

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

Win8)• Console

Tech• Native Plug-ins• Can support any platform-specific

functionality• Amazon App Store• Google Play Game Services• Write your own native plug-in

Support• Awesome forums• Awesome feedback from support• Twitter!

Asset Store

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

Brick Buddies

Camera Birds

iOS to Android with Unity3D

Plug-ins• Used mostly cross-platform plug-ins

• Access platform specific features (IAP, etc.)

Platform Specific Code• Only spent a few days of re-factoring

• Swapped out iOS plug-ins for Android

• Runtime platform checks and #IF compiler directives

• AndroidJavaClass!

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

mConfig = activity.Call<AndroidJavaObject>("getResources").Call<AndroidJavaObject>("getConfiguration");

Screen Sizes• iOS has 3 aspect ratios to deal with

• Made interface work in “safe zone”

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

Android Fragmentation

Performance and Testing

Cross Platform Export Tools• Per-Platform Asset Settings• Compression settings• Filtering

• Cache Server

• Multi-Platform Toolkit• Build-time asset changes

In Summary• Best Business Model

• Widest Platform Support

• Best Community Support

• Dead Simple Porting Process

?

Thanks!Email: ralph@flarb.com

Twitter: @flarb

Blog: www.ralphbarbagallo.com

Site: www.flarb.com

WeChat: ralphbarbagallo

top related