play together! leaderboards with windows azure and multiplayer with wi-fi direct
DESCRIPTION
Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct. Jianye Lu Program Manager Priya Dandawate Program Manager 3-051. Play games t ogether!. Gamers have more fun Play with other people, and discover new people Developers reach out to more gamers - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/1.jpg)
![Page 2: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/2.jpg)
Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi DirectJianye LuProgram Manager
Priya DandawateProgram Manager3-051
![Page 3: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/3.jpg)
Play games together!Gamers have more funPlay with other people, and discover new people
Developers reach out to more gamersGrow user base through social networksBoost game usage with competition/cooperation among friends
New opportunitiesNew platform and new devices
![Page 4: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/4.jpg)
We help gamers play together in your games with turnkey solutions for key scenarios!
![Page 5: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/5.jpg)
Easily connect games with Proximity API
Build social backend with Windows Azure Mobile Services
Do more with our solutions
Agenda
![Page 6: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/6.jpg)
Demo: multi-player gaming with people nearby
![Page 7: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/7.jpg)
Windows.Networking.ProximityEasy to connect via Wi-Fi Direct or NFC
No AP requiredProximity discovers nearby PCs running your app in the
foregroundNo need to deal with IP addresses
Wi-Fi Direct provides a fast, high quality connection
Local P2P network; no AP requiredConnection time: 3-10 secondsThroughput: 20 mbps – 30 mbpsLatency: 30-100msHigh through-put and low latency
Simple user experience
Windows takes care of the complexity of getting connected so you can focus on the gaming experience
![Page 8: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/8.jpg)
PeerFinder.Role = PeerRole.Client;
PeerFinder.Role = PeerRole.Host;
![Page 9: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/9.jpg)
PeerFinder Networking ModelHost
Client
![Page 10: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/10.jpg)
PeerFinderHost Client
PeerFinder.Role = PeerRole.Client;
PeerFinder.ConnectionRequested += ConnectionRequested;
PeerFinder.TriggeredConnectionStateChanged += TriggeredConnectionStateChanged;
PeerFinder.Start();
PeerFinder.Role = PeerRole.Host; PeerFinder.TriggeredConnectionStateChanged += TriggeredConnectionStateChanged;
PeerFinder.Start();
![Page 11: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/11.jpg)
Finding playersHost Client
PeerFinder.Role = PeerRole.Client;
PeerFinder.Start();
// Wait for Host to find and invite client.
private async void FindPeers(){ progressBar.Visibility = Visibility.Visible; try { var peerInfoCollection = await PeerFinder.FindAllPeersAsync(); if (peerInfoCollection.Count > 0) {
// Display nearby clients in a list ...
![Page 12: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/12.jpg)
Connecting playersHost Client – incoming connection request
private async void ConnectionRequested(object sender, ConnectionRequestedEventArgs e){ List<string> existingInvitations = new List<string>(); existingInvitations.Add(e.PeerInformation.DisplayName);
...
ReceivedInvitationsHeader.Text = "STOMP invitations :-)";
progressBar.Visibility = Visibility.Collapsed;}
private async Task ConnectToPeers(PeerInformation peer){ progressBar.Visibility = Visibility.Visible; StreamSocket s = await PeerFinder.ConnectAsync(peer); ConnectedPeer temp = new ConnectedPeer(peer.DisplayName); connectedPeers[temp] = new SocketReaderWriter(s, this); ... startGameButton.Visibility = Visibility.Visible;}
![Page 13: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/13.jpg)
Connecting players (continued)Host Client – connect
devices// Navigate client to a new page - WaitingForHost ...{ backButton.Visibility = Visibility.Collapsed;
WaitingForHostParameters parameters = (WaitingForHostParameters)navigationParameter; StreamSocket socket =
await PeerFinder.ConnectAsync(parameters.peer);
pageTitle.Text = "Connected! Waiting for Host..."; ...}
// Host connecting to client...
![Page 14: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/14.jpg)
ConnectedPlayers.Items.Add(peer.DisplayName);
![Page 15: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/15.jpg)
Tap and connectHost Client – connect
devicesprivate async void TriggeredConnectionStateChanged(object sender, TriggeredConnectionStateChangedEventArgs e){ if (e.State == TriggeredConnectState.PeerFound) { // Show indeterminate progress UI }
else if (e.State == TriggeredConnectState.Completed) { StreamSocket socket = e.Socket; WaitForHost(socket); }
else if (e.State == TriggeredConnectState.Failed) { // Inform challenger that connection failed }}
private async void TriggeredConnectionStateChanged(object sender, TriggeredConnectionStateChangedEventArgs e){ if (e.State == TriggeredConnectState.PeerFound) { // Show indeterminate progress UI }
else if (e.State==TriggeredConnectState.Completed) { socket = new SocketReaderWriter(e.Socket, this); } else if (e.State == TriggeredConnectState.Failed) { // Inform Game Leader that connection failed }}
![Page 16: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/16.jpg)
Sending/Receiving data - timerHost Client
public async void ReadMessage(){ // Read incoming message from the socket uint bytesRead = await dataReader.LoadAsync(sizeof(uint)); uint messageLength = dataReader.ReadUInt32(); bytesRead = await dataReader.LoadAsync(messageLength); currentMessage = dataReader.ReadString(messageLength); ...}
private int ParseMessage(){ ... case Constants.OpCodeUpdateClientTime: if (gamePage != null) gamePage.UpdateClientTime(words[1]); break;
private void UpdateTime(TickOption option){ // Decrement the timer by 1 second
foreach (SocketReaderWriter tempsocket in connectedPeers.Values) { string message = string.Format( "{0} {1}",
Constants.OpCodeUpdateClientTime,
timeLeft.ToString(@"m\:ss"));
tempsocket.WriteMessage(message); }}
![Page 17: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/17.jpg)
UX considerationsKeep user up-to-date on the state of the connection
Ex: indeterminate progress bars, textGame terminology
Translate Host/Client networking model into fun gaming terminology
Ex: Host – Game Leader, Client – Challenger/playerNetwork failure cases
Host connection fails vs. Client connection fails
![Page 18: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/18.jpg)
Don’t stop at Games…Sharing photos and videos Drawing, painting, sketching…togetherLearning together – interactive virtual chalkboardsCollaborative DJ-ingEasy translators – multi-lingual chat room …
![Page 19: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/19.jpg)
Proximity APIs provide a quick and easy way to get your app connected
Windows takes care of the complexity of getting connected so you can focus on the
gaming experience
![Page 20: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/20.jpg)
Easily connect games with Proximity API
Build social backend with Windows Azure Mobile Services
Do more with our solutions
Agenda
![Page 21: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/21.jpg)
Demo: user log-in, leaderboard & live tiles
![Page 22: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/22.jpg)
Windows Azure Mobile ServicesUse cloud storage for structured dataWith powerful server scripting and database management
Allow users to login with popular identity providersMicrosoft Account, Facebook, Twitter, and Google
Send push notificationsIntegrated with live tiles on Windows/Windows PhoneIntegrated with notifications on iOS/Android
![Page 23: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/23.jpg)
Why Windows Azure Mobile Services?Add a backend service to your game in minutesData storage, authentication, push notifications, and more
Cross-platform supportSDKs for Windows/Windows-Phone/iOS/Android/HTML5
Reliable, scalable and production readyEnjoy high availability, global reach across multiple data centers, and easily scale your backend up as required
Windows Azure Mobile Services provides preconfigured backend
![Page 24: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/24.jpg)
First things firstCreate and register your game with Windows Store
Sign up for Windows Azure Mobile Services
Create and connect your first mobile service
![Page 25: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/25.jpg)
Adding leaderboardCreate tables on Azure server to record results and leaderboard
Update server-side scripts to insert new data and update leaderboard
Add client code to insert results and retrieve/display leaderboard
![Page 26: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/26.jpg)
Create tables
Update server script
Add client code
![Page 27: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/27.jpg)
Create tables
Update server script
Add client code
![Page 28: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/28.jpg)
Create tables
Update server script
Add client code
![Page 29: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/29.jpg)
Create tables
Update server script
Add client code
![Page 30: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/30.jpg)
Adding authenticationRegister an account provider
Connect your account provider with your app and your Azure mobile service
Add client code to bring up built-in log-in page
(Optionally) Restrict data access based on authentication
![Page 31: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/31.jpg)
Register provider
Connect provider
Add client code
Restrict data access
![Page 32: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/32.jpg)
Register provider
Connect provider
Add client code
Restrict data access
![Page 33: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/33.jpg)
Register provider
Connect provider
Add client code
Restrict data access
![Page 34: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/34.jpg)
Register provider
Connect provider
Add client code
Restrict data access
![Page 35: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/35.jpg)
Register provider
Connect provider
Add client code
Restrict data access
![Page 36: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/36.jpg)
Register provider
Connect provider
Add client code
Restrict data access
![Page 37: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/37.jpg)
Adding push notificationsRegister and connect Live Connect service
Acquire and store channels for push notifications
Update server side scripts to send out push notifications
![Page 38: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/38.jpg)
Register and connect service
Acquire and store channels
Update scripts to send
![Page 39: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/39.jpg)
Register and connect service
Acquire and store channels
Update scripts to send
![Page 40: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/40.jpg)
Register and connect service
Acquire and store channels
Update scripts to send
![Page 41: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/41.jpg)
Register and connect service
Acquire and store channels
Update scripts to send
![Page 42: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/42.jpg)
Register and connect service
Acquire and store channels
Update scripts to send
![Page 43: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/43.jpg)
Register and connect service
Acquire and store channels
Update scripts to send
![Page 44: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/44.jpg)
Do more with Windows Azure Mobile Services
LeaderboardId and log-in Live tiles
![Page 45: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/45.jpg)
Do more with Windows Azure Mobile Services
LeaderboardId and log-in Live tiles
AchievementsProfiles and data roamingToast notifications
→→ →
![Page 46: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/46.jpg)
Do more with Windows Azure Mobile Services
LeaderboardId and log-in Live tiles
AchievementsProfiles and data roamingToast notifications
Match-makingId, preference, skillset, locations
→→ →
![Page 47: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/47.jpg)
Do more with Windows Azure Mobile Services
LeaderboardId and log-in Live tiles
AchievementsProfiles and data roamingToast notifications
Match-makingId, preference, skillset, locations
Turn-based gamingId, game status, push notifications
→→ →
![Page 48: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/48.jpg)
Command line toolsScripts to automate the creation, verification, and deletion process of a mobile service
![Page 49: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/49.jpg)
Integrated support in Visual StudioServer Explorer to manage services, tables, and scripts
Wizard to set up push notifications
![Page 50: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/50.jpg)
Windows Azure Mobile Services provides a preconfigured backend so you can focus on
your gaming contents and logic, not services.
http://aka.ms/mobileservices
![Page 51: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/51.jpg)
Easily connect games with Proximity API
Build social backend with Windows Azure Mobile Services
Do more with our solutions
Agenda
![Page 52: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/52.jpg)
Turnkey solutions for “Playing Together”
Find and play with people nearby
Games are personalId and log-in, profiles and data roaming, …
Games are connectedLeaderboard, achievements, live tiles, toasts, match-making, turn-based gaming, …
Let everyone play together!
With tools like Proximity APIs and Windows Azure Mobile Services, you can easily build connected games that allow gamers to play together in your games.
![Page 53: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/53.jpg)
ResourcesProximity APIshttp://msdn.microsoft.com/en-us/library/windows/apps/windows.networking.proximity.peerfinder
Windows Azure Mobile Serviceshttp://aka.ms/mobileservices
Related Talks at //BUILD2-047, Building Games for Windows2-542, Mobile Services - Soup to Nuts3-511, Going Live and Beyond with Windows Azure Mobile Services3-116, Developing Windows Blue Apps with Mobile Services
![Page 54: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/54.jpg)
Q&A
![Page 55: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/55.jpg)
Evaluate this session
Scan this QR code to evaluate this session and be automatically entered in a drawing to win a prize!
![Page 56: Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct](https://reader035.vdocuments.site/reader035/viewer/2022081604/56816468550346895dd652e6/html5/thumbnails/56.jpg)
© 2013 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.