Building social games for windows 8 with windows azure
Download
1 / 37

Building Social Games for Windows 8 with Windows Azure - PowerPoint PPT Presentation


  • 136 Views
  • Uploaded on

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

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Building Social Games for Windows 8 with Windows Azure ' - skyla


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

Agenda
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

Data

Communication

Handling Scale

Windows 8 Games

What You’ll Leave With

Understanding of Cloud-based Casual Gaming architectures


Context
Context

Building for a Rich Ecosystem

Not locked into a particular device

Best Experience for targeted device

High Resolution for Windows 8

Scaled down for mobile


Features of connected games
Features of Connected Games

Authentication

User Settings

State Storage

Real-Time Communication

Game Services: i.e. Leaderboard & Achievements



Tankster

Tankster

demo




Start a game
Start A Game

Game Services

Worker

WAZ

Storage


Invite to play
Invite to Play

Game Services

Worker

Notification Services

WAZ

Storage


Accept a game invite
Accept a Game Invite

Game Services

Worker

WAZ

Storage


Begin playing a game
Begin Playing a Game

Game Services

Worker

WAZ

Storage


Connect to the socket server
Connect to the Socket Server

Game Services

Worker

WAZ

Storage


Connect to the socket server1
Connect to the Socket Server

Game Services

Worker

WAZ

Storage


Patterns
Patterns

Command – Query Separation

Reliance on Windows Azure Storage

Queues

Blobs

Rest Services

Sockets + Web Sockets



Decoupled systems
Decoupled Systems

Many Independent Systems

Scale parts not the entire application

Rely on cloud services


Command query separation
Command – Query Separation

Send a command to the web server

Web server enqueues the command’s message

Worker role reads message from queue and acts on message


Architectural diagram
Architectural Diagram

Game Services

Worker

WAZ

Storage


Javascript start game
JavaScript Start Game

  • GameService.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)

  • });

  • };


Send game command
Send Game Command

  • publicHttpResponseMessageSendCommand(GameCommandgameCommand)

  • {

  • varqueueClient = account.CreateCloudQueueClient();

  • varqueue = queueClient.GetQueueReference("gameCommands");

  • varserializer = newJavaScriptSerializer();

  • varjson = serializer.Serialize(gameCommand);

  • try

  • {

  • queue.AddMessage(new CloudQueueMessage(json));

  • }

  • catch

  • {

  • return newHttpResponseMessage(HttpStatusCode.InternalServerError,

  • "error sending game command. try again.");

  • }

  • return new HttpResponseMessage(HttpStatusCode.OK, null);

  • }


Process game command
Process Game Command

  • public void ProcessCommands()

  • {

  • varqueueClient = account.CreateCloudQueueClient();

  • varqueue = queueClient.GetQueueReference("gameCommands");

  • while (true)

  • {

  • varmessage = queue.GetMessage();

  • if(message != null)

  • {

  • varserializer = newJavaScriptSerializer();

  • vargameCommand = serializer.Deserialize<GameCommand>(message.AsString);

  • gameCommandService.DoSomething(gameCommand);

  • }

  • }

  • }




Push communication
Push Communication

Real-Time

Requires More Compute Instances

More Cost Effective for fast paced games


Push technology
Push Technology

WebSockets

SignalR

Socket.IO

Somewhat limited compatibility on browsers/devices/platforms



Pull communication
Pull Communication

Slight delay in game commands

Less compute instances

Increased storage costs

More cost effective for slow paced games


Pull technology
Pull Technology

Blob Storage

Http Requests

Compatible on every browser/device/platform



Push or pull
Push or Pull?

Speed

Scale



What is the toolkit for social games
What is the Toolkit for Social Games?

Samples

Tools

Guidance

Tic-Tac-Toe

Connect Four

Server APIs

Client Scripts

Test Client

Docs

Architecture


Server apis
Server APIs

Game Invitations

Leaderboards

Game Friends

User Profile

Game Commands


Generic server apis
Generic Server APIs

Web

Mobile

PC

HTML

Windows Phone

iOS

Android

Windows

Mac OS X


Additional resources
Additional Resources

Windows Azure Toolkit for Social Games – watgames.codeplex.com

Nathan Totten’s Blog – ntotten.com


ad