Presentation is loading. Please wait.

Presentation is loading. Please wait.

Xbox LIVE Multiplayer Gaming on Windows 8 and Other Devices Tim Gill Brian Tyler Architect Lead Developer Microsoft Corporation.

Similar presentations


Presentation on theme: "Xbox LIVE Multiplayer Gaming on Windows 8 and Other Devices Tim Gill Brian Tyler Architect Lead Developer Microsoft Corporation."— Presentation transcript:

1

2 Xbox LIVE Multiplayer Gaming on Windows 8 and Other Devices Tim Gill Brian Tyler Architect Lead Developer Microsoft Corporation

3 Xbox LIVE Services  Simple web APIs:  HTTP services with JSON payloads  Single authentication model  Enable gameplay across any of our client platforms, including Windows Phone, Windows 8, the web, and the Xbox 360 console

4 Multiplayer Today on Xbox LIVE  Fast, efficient real time peer-to-peer networking  Xbox 360 and Games For Windows LIVE only  In use on a wide range of very successful titles

5 Xbox LIVE Asynchronous Gaming Services Messaging Invite friends to play with you Send notifications to players outside the game to notify them of in-game events Matchmaking Find players to play against Custom-match criteria Multiplayer Game state storage in the cloud Session and player management

6 Which Types of Game Are We Enabling? Very Low Latency “twitch” Low Latency “connected” High Latency “sometimes connected” “Pseudo connected” World of Warcraft™ Diplomacy™ Farmville™

7  Simple card game with players betting against the house hand (not each other)  Cards are dealt from a shared deck to players on demand  Total value of the cards must be < 21 or the player loses.  Once all players are done getting new cards the house hand plays.  If the house does not go > 21 it pays all player hands with a greater value.

8 Multiplayer Service  Session Storage – session management in the cloud  Manages session metadata and player management  State Storage - generic “game server” technology  Game state in the cloud  No cloud logic (mimics P2P)  Supports multiple HTTP based access models for different latency needs:  Slower polling – easy to code, higher latency  “Comet”/”Hanging GET” – more work to code, lower latency

9 Multiplayer Workflow Create Session Join Session Post, Get, and Delete State Data Update Session Object Update Session Session Start Session End Gameplay Join Session Leave Session

10 Multiplayer Service – State Storage Game State Queue 1 Message 4 Message 3 Message 2 Message 1 Message n Queue 2 Message 3 Message 2 Message 1 Queue 3 Message 4 Message 3 Message 2 Message 1 Message n Queue 4

11 State Storage Game State Object Queue 1 Game State { "bankerInfo": { "cards": [{"s":"h","v"=3},...], "showCards": true}, "currentPlayer" : 1, "deck": [{"s":"s","v"=2},...], "playerInfos": [ {"bet": 1200, "money":1600, "name":"ShiFu", "picture":"http://cdn.xboxlive.com/188D655F- C306-4AA5-9D4E-1560B6BF0F6A/1.jpg", "cards": [{"s":"c","v"=10},...]} ] }

12 Multiplayer Service – Collision Detection Queue 1 Message 3 Message 2 Message 1 Player B Message 4 Player A Message 4 POST /system/mutiplayer/sessions/123/queues/1/messages ? mustFollow=3

13 Multiplayer Service – Race Condition Queue 1 State Player B New State B Player A New State A DELETE POST /system/mutiplayer/sessions/123/queues/1/messages? replaceAll POST

14 Session Object Players Multiplayer Service – Session Objects XUID Gamertag Seat Index Is Currently In Session XUID Gamertag Seat Index Is Currently In Session Custom User Data (1Kb) Custom User Data (1Kb) Session ID Title ID Game Variant Display Name Creation Time Visibility Players Can Be Removed By Custom Game Data (1Kb) Max Players Available Seats Is Closed? Has Ended?

15 Session Object Session Objects Session ID Blackjack TitleID Creation Time Visibility.Everyone PlayersCanBeRemovedBy.Self MaxPlayers: 4 Session ID Blackjack TitleID Creation Time Visibility.Everyone PlayersCanBeRemovedBy.Self MaxPlayers: 4 Player Roster

16 Matchmaking Service “Allows you to find people to play the game you want to be in, without putting your life on hold”

17 Async Matchmaking Experience Matchmaking Service POST Match criteria Match Found!

18 Matchmaking Service - Response  Successful match requests return a requestID in response.  Two options for detecting it completes: 1. Periodic polling using the request ID for the result of the match 2. Match Found notification from the messaging service. Match Found

19 Matchmaking Simple match algorithm – any table with open seats. Simple polling model

20 Messaging Service - Getting into the Game  Two ways to get into a session:  Anonymous matchmaking  Invitation messages from session owner POST https://services.part.xboxlive.com/system/messaging/outbox HTTP/1.1 Content-Type: application/json x-xbl-contract-version: 1 Authorization: XBL2.0 x=STSTokenString Host: services.part.xboxlive.com Content-Length: 39 Connection: Keep-Alive { "body": { "attachments":null, "partnerData": { "MultiplayerMessageType":“Invitation", "SessionId": "C8921C4E-4FC2-439E D26889BD1BB" } }, "header": { "attributes":null, "expiration":" T23:59: ", "id":null, "messageType":"Multiplayer", "recipients":[{"userId":“worsethanuseless","userType":"Gamertag"}], "sender":"Striker", "senderPlatform":null, "sent":" T16:40: :00", "targetPlatforms":["WP7"], "titleId":0 } } POST https://services.part.xboxlive.com/system/messaging/outbox HTTP/1.1 Content-Type: application/json x-xbl-contract-version: 1 Authorization: XBL2.0 x=STSTokenString Host: services.part.xboxlive.com Content-Length: 39 Connection: Keep-Alive { "body": { "attachments":null, "partnerData": { "MultiplayerMessageType":“Invitation", "SessionId": "C8921C4E-4FC2-439E D26889BD1BB" } }, "header": { "attributes":null, "expiration":" T23:59: ", "id":null, "messageType":"Multiplayer", "recipients":[{"userId":“worsethanuseless","userType":"Gamertag"}], "sender":"Striker", "senderPlatform":null, "sent":" T16:40: :00", "targetPlatforms":["WP7"], "titleId":0 } } Game Invitation Tim Gill (worsethanuseless) Checkers

21 Multiplayer Blackjack Brian Tyler Lead Developer Xbox LIVE on Windows 8 Windows 8 SDK

22 So – What Do I Get?

23 What’s in the SDK?  Rich Integration with Windows 8  Windows Runtime APIs: C++,.NET and JavaScript  Tiles and Toasts with Windows Notification Service  Account Creation and Sign-in UI

24 What’s in the SDK?  Windows Runtime projections for mainline scenarios  Profile and avatar  Achievements and leaderboards  Async matchmaking and multiplayer  Friends and game invites  Title Managed Storage  Windows Runtime projections for REST access  Simplified API to call REST/JSON endpoints directly

25 What’s in the SDK?  Downloadable Content (DLC)  Durable and consumable  Commerce, tracking and delivery  Offline Support  Grant achievements  Leaderboard updates while on a plane  Avatar Rendering Library  DX11 C++ API fully documented and supported  Integrate rich, animated avatars in your game

26 What’s in the SDK?  Server Side User Authentication  Microsoft Account  Xbox Secure Token Service (XSTS)  Server Side Proof of Purchase validation with Windows Store license  Federated Identity for your game services

27 Drilling In architecture

28 Architecture Offline Support Network Policies Network Policies Foundation Layer Authentication HTTPS/JSON OS Integration Logging Diagnostics Logging Diagnostics Strongly Typed API Third-Party Logic Toasts WNS Store

29 Async and Parallel Patterns Library UI THREAD or THREAD POOL Completion Event Run Then Message Loop

30 Multiplayer Blackjack Brian Tyler Lead Developer Xbox LIVE on Windows 8 Refresher

31 Multiplayer Workflow Create Session Join Session Post, Get, and Delete State Data Update Session Object Update Session Session Start Session End Gameplay Join Session Leave Session

32 Matchmaking Simple match algorithm – any table with open seats. Simple polling model

33 Multiplayer Blackjack Brian Tyler Lead Developer Xbox LIVE on Windows 8 demo

34 Creating a Session // Create a new session settings object auto sessionSettings = ref new MultiplayerSessionSettings(); sessionSettings->DisplayName = "Blackjack"; sessionSettings->MaxPlayers = 4; sessionSettings->IsClosed = false; sessionSettings->Visibility = VisibilityLevel::Everyone; sessionSettings->TitleGroupId = titleGroupId; task createTask( signedInUser->CreateMultiplayerSessionAsync(sessionSettings, PlayerAcl::Self));

35 Requesting a Match auto matchRequest = ref new MatchRequest(); matchRequest->TitleId = titleId; matchRequest->TitleGroupId = titleGroupId; matchRequest->SessionId = sessionId; matchRequest->MaxSeats = 4; matchRequest->SeatsOccupied = seatsOccupied; matchRequest->MatchCriteria->Restriction = MatchRestriction::PreserveSession; matchRequest->MatchCriteria->CustomMatchType = "Blackjack"; matchRequest->TimeoutSeconds = 60; task requestTask(service->PostRequestAsync(matchRequest));

36 Multiplayer Blackjack Brian Tyler Lead Developer Xbox LIVE on Windows 8 Notifications

37 Keeping in Touch  Windows Notification Service (WNS) provides push notifications to Windows clients  Xbox LIVE services integrates into WNS to deliver events.  Deliver game invites  “Your Turn”, Nudges  Results in toasts and tile updates

38 WNS + Xbox LIVE Create Channel Register Channel Friend You Invite Friend Send Message On Channel Push Notification

39 Live Tile Update Example

40 What do you need to do?  To get a channel and into the database  Do nothing  SDK handles it all  To receive toasts and tiles  Optionally you can do nothing  If in the user is in the game, you probably want to clear the tile update

41 Questions?

42


Download ppt "Xbox LIVE Multiplayer Gaming on Windows 8 and Other Devices Tim Gill Brian Tyler Architect Lead Developer Microsoft Corporation."

Similar presentations


Ads by Google