37
Building Social Games for Windows 8 with Windows Azure Name Title Microsoft Corporation

Building Social Games for Windows 8 with Windows Azure

  • Upload
    skyla

  • View
    57

  • Download
    0

Embed Size (px)

DESCRIPTION

Building Social Games for Windows 8 with Windows Azure . Name Title Microsoft Corporation. Agenda. Who Will Benefit From This Talk Developers Interested in HTML5 Games Interested in Windows Azure Interested in Game Development Topics Games on Multiple Devices Architecture of Games - PowerPoint PPT Presentation

Citation preview

Page 1: Building Social Games for Windows 8 with Windows Azure

Building Social Games for Windows 8 with Windows Azure NameTitleMicrosoft Corporation

Page 2: Building Social Games for Windows 8 with Windows Azure

AgendaWho Will Benefit From This TalkDevelopersInterested in HTML5 GamesInterested in Windows AzureInterested in Game Development

TopicsGames on Multiple DevicesArchitecture of GamesDataCommunicationHandling ScaleWindows 8 Games

What You’ll Leave WithUnderstanding of Cloud-based Casual Gaming architectures

Page 3: Building Social Games for Windows 8 with Windows Azure

ContextBuilding for a Rich EcosystemNot locked into a particular deviceBest Experience for targeted deviceHigh Resolution for Windows 8Scaled down for mobile

Page 4: Building Social Games for Windows 8 with Windows Azure

Features of Connected GamesAuthenticationUser SettingsState StorageReal-Time CommunicationGame Services: i.e. Leaderboard & Achievements

Page 5: Building Social Games for Windows 8 with Windows Azure

Casual Gaming Ecosystem

Page 6: Building Social Games for Windows 8 with Windows Azure

Tankster

demo

Page 7: Building Social Games for Windows 8 with Windows Azure

Architecture

Page 8: Building Social Games for Windows 8 with Windows Azure

Three Versions of Tankster

Page 9: Building Social Games for Windows 8 with Windows Azure

Start A Game

Page 10: Building Social Games for Windows 8 with Windows Azure

Invite to Play

Page 11: Building Social Games for Windows 8 with Windows Azure

Accept a Game Invite

Page 12: Building Social Games for Windows 8 with Windows Azure

Begin Playing a Game

Page 13: Building Social Games for Windows 8 with Windows Azure

Connect to the Socket Server

Page 14: Building Social Games for Windows 8 with Windows Azure

Connect to the Socket Server

Page 15: Building Social Games for Windows 8 with Windows Azure

PatternsCommand – Query SeparationReliance on Windows Azure StorageQueuesBlobsRest ServicesSockets + Web Sockets

Page 16: Building Social Games for Windows 8 with Windows Azure

Scale

Page 17: Building Social Games for Windows 8 with Windows Azure

Decoupled SystemsMany Independent SystemsScale parts not the entire applicationRely on cloud services

Page 18: Building Social Games for Windows 8 with Windows Azure

Command – Query SeparationSend a command to the web serverWeb server enqueues the command’s messageWorker role reads message from queue and acts on message

Page 19: Building Social Games for Windows 8 with Windows Azure

Architectural Diagram

Page 20: Building Social Games for Windows 8 with Windows Azure

JavaScript Start GameGameService.prototype.startGame = function (queueId, success, error) {

this.serverInterface.sendAjaxPost(this.apiURL + "game/start/" + queueId, { gameType: "invitation" }, success, error);

};

ServerInterface.prototype.sendAjaxJsonCommand = function (type, url, data, success, error) {

$.ajax({type: type,url: url,dataType: "json",data: data,success: success,error: (error != null ? error : this.onAjaxPostError)

});};

Page 21: Building Social Games for Windows 8 with Windows Azure

Send Game Commandpublic HttpResponseMessage SendCommand(GameCommand gameCommand){

var queueClient = account.CreateCloudQueueClient();var queue = queueClient.GetQueueReference("gameCommands");var serializer = new JavaScriptSerializer();var json = serializer.Serialize(gameCommand);try{

queue.AddMessage(new CloudQueueMessage(json));}catch{return new HttpResponseMessage(HttpStatusCode.InternalServerError,

"error sending game command. try again.");}return new HttpResponseMessage(HttpStatusCode.OK, null);

}

Page 22: Building Social Games for Windows 8 with Windows Azure

Process Game Commandpublic void ProcessCommands(){

var queueClient = account.CreateCloudQueueClient();var queue = queueClient.GetQueueReference("gameCommands");while (true) {

var message = queue.GetMessage();if (message != null){

var serializer = new JavaScriptSerializer();var gameCommand = serializer.Deserialize<GameCommand>(message.AsString);gameCommandService.DoSomething(gameCommand);

} }

}

Page 23: Building Social Games for Windows 8 with Windows Azure

Communication

Page 24: Building Social Games for Windows 8 with Windows Azure

Two Communication Methods

Page 25: Building Social Games for Windows 8 with Windows Azure

Push CommunicationReal-TimeRequires More Compute InstancesMore Cost Effective for fast paced games

Page 26: Building Social Games for Windows 8 with Windows Azure

Push TechnologyWebSocketsSignalRSocket.IOSomewhat limited compatibility on browsers/devices/platforms

Page 27: Building Social Games for Windows 8 with Windows Azure

Push Communication Architecture

Page 28: Building Social Games for Windows 8 with Windows Azure

Pull CommunicationSlight delay in game commandsLess compute instancesIncreased storage costsMore cost effective for slow paced games

Page 29: Building Social Games for Windows 8 with Windows Azure

Pull TechnologyBlob StorageHttp RequestsCompatible on every browser/device/platform

Page 30: Building Social Games for Windows 8 with Windows Azure

Push Communication Architecture

Page 31: Building Social Games for Windows 8 with Windows Azure

Push or Pull?

Page 32: Building Social Games for Windows 8 with Windows Azure

Toolkit

Page 33: Building Social Games for Windows 8 with Windows Azure

What is the Toolkit for Social Games?

Page 34: Building Social Games for Windows 8 with Windows Azure

Server APIsGame InvitationsLeaderboardsGame FriendsUser ProfileGame Commands

Page 35: Building Social Games for Windows 8 with Windows Azure

Generic Server APIs

HTML

Web

Mobile

PCWindows PhoneiOSAndroid

WindowsMac OS X

Page 36: Building Social Games for Windows 8 with Windows Azure

Additional ResourcesWindows Azure Toolkit for Social Games – watgames.codeplex.com Nathan Totten’s Blog – ntotten.com

Page 37: Building Social Games for Windows 8 with Windows Azure

© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to

be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.