Social Gaming with Windows Phone and Azure Daron Yondem Chief Architect | DEVELOAD Software Microsof Regional Director Silverlight MVP INETA MEA President
Daron Yöndem is • Silverlight MVP • Microsoft Regional Director for MEA • INETA MEA President • Book Author about HTML5, ASP.NET AJAX, Silverlight • Architect at DEVELOAD Software • Blog at http://daron.yondem.com
DEVELOAD is • Consulting – Software architecture and design – Custom software development of Windows, Web Windows Phone, Azure and Silverlight applications – Mentoring services to get you started and keep you going • Web site: www.deveload.com
Let’s start with... • What Cloud computing can offer? • What we have in hand with Windows Azure? • What kind of integration scenarios can happen between WP7 and Azure. • How can Azure help me fascilitade building Social Games reacing millions of people?
Why Phone + Cloud? • The cloud levels the playing field • The cloud provides a larger pool of resources from which to pull • The cloud provides a way to reach across device platforms
Why WP7 and Windows Azure? • PaaS: you build it, Windows Azure runs it • Automatic O/S patching • Scalable • Utility billing • Additional services (e.g. ACS, Traffic Manager, Caching, CDN, etc.) • Common development tools – Visual Studio – Languages – Emulators for development
Identity Options • Create your own (e.g. username + password, token) – Custom model – ASP.NET Membership Providers • Use a single existing identity system (e.g. Live Id, Facebook, etc.) • Outsource identity management (e.g. Access Control Service)
Storage • SQL Azure – Relational database – Highly available – Managed for you as a service • Windows Azure Tables – Non-relational structured storage – Massive scale-out – OData • Windows Azure Blobs – Big files – REST
Windows Azure Blobs: Public Blobs • Client sends data to web role • Web role stores data in blobs • Client fetches public blobs directly Web Role (1) (2) (3)
Windows Azure Blobs: SAS • Client gets Shared Access Signature from web role • Client stores data in blobs • Client fetches public blobs directly Web Role
Scaling Work in Windows Azure 1. Web role receives message 2. Web role enqueues work 3. Worker role polls queue 4. Worker role sends notifications MPNS Worker Role Web Role (1) (2) (3) (4)
Cloud-Initiated Communication • Push Notifications – Single connection between phone and Microsoft Push Notification Service – Bandwidth- and battery-friendly – No guarantee of delivery • Three kinds of push notifications – Raw – send a message to an application – Toast – send a message to the user – Tile – update an image, title, or count
Subscribing to Push Notifications • Phone opens a channel • Phone sends URL to cloud • Cloud pushes notifications via URL • Microsoft Push Notification service notifies phone MPNS Web Role
Step 2 : Graphics • 2D games easy to build inside Silverlight • What about 3D? – Kit3D - http://www.markdawson.org/kit3d/ – Balder - http://www.codeplex.com/Balder – XNA! • You can create a whole new 3D world!
Step 3 : Audio • Windows Media Audio and MP3 support. • XNA Libraries to play effects and wma files. • MediaElement can help you for background music. • You can even have live streams in your game!
Final Step: Pyhsics • Farseer Pyhsics Engine – It’s for both Silverlight and XNA! – Includes helpers and behaviors easy to use inside Expression Blend!
In Conclusion • Azure and Cloud – Helps us serve millions of gamers with web/worker roles, CDN, SQL Azure, Notification Services – Azure Toolkit for Windows Phone helps us there. • Performanca and tactics for WP7 game development – Composition Thread, DoubleAnimations, Performance Counter and so on. – Using Dispatcher and StoryBoards together.