1 / 56

Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct

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

teva
Download Presentation

Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Play together! Leaderboards with Windows Azure and Multiplayer with Wi-Fi Direct Jianye Lu Program Manager Priya Dandawate Program Manager 3-051

  2. Play games together! • Gamers have more fun • Play with other people, and discover new people • Developers reach out to more gamers • Grow user base through social networks • Boost game usage with competition/cooperation among friends • New opportunities • New platform and new devices

  3. We help gamers play together in your games with turnkey solutions for key scenarios!

  4. Agenda • Easily connect games with Proximity API • Build social backend with Windows Azure Mobile Services • Do more with our solutions

  5. Demo: multi-player gaming with people nearby

  6. Windows.Networking.Proximity • Easy to connect via Wi-Fi Direct or NFC • No AP required • Proximity discovers nearby PCs running your app in the foreground • No need to deal with IP addresses • Wi-Fi Direct provides a fast, high quality connectionLocal P2P network; no AP required • Connection time: 3-10 seconds • Throughput: 20 mbps – 30 mbps • Latency: 30-100ms • High 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

  7. PeerFinder.Role = PeerRole.Client; PeerFinder.Role = PeerRole.Host;

  8. PeerFinder Networking Model Host Client

  9. PeerFinder Host Client PeerFinder.Role= PeerRole.Host; PeerFinder.TriggeredConnectionStateChanged += TriggeredConnectionStateChanged; PeerFinder.Start(); PeerFinder.Role= PeerRole.Client; PeerFinder.ConnectionRequested += ConnectionRequested; PeerFinder.TriggeredConnectionStateChanged += TriggeredConnectionStateChanged; PeerFinder.Start();

  10. Finding players Client Host privateasyncvoidFindPeers() { progressBar.Visibility= Visibility.Visible; try { varpeerInfoCollection = awaitPeerFinder.FindAllPeersAsync(); if (peerInfoCollection.Count > 0) { // Display nearby clients in a list ... PeerFinder.Role = PeerRole.Client; PeerFinder.Start(); // Wait for Host to find and invite client.

  11. Connecting players Client – incoming connection request Host privateasyncvoidConnectionRequested(object sender, ConnectionRequestedEventArgs e) { List<string> existingInvitations = newList<string>(); existingInvitations.Add(e.PeerInformation.DisplayName); ... ReceivedInvitationsHeader.Text= "STOMP invitations :-)"; progressBar.Visibility= Visibility.Collapsed; } privateasyncTaskConnectToPeers(PeerInformation peer) { progressBar.Visibility= Visibility.Visible; StreamSockets = await PeerFinder.ConnectAsync(peer); ConnectedPeertemp = newConnectedPeer(peer.DisplayName); connectedPeers[temp] = newSocketReaderWriter(s, this); ... startGameButton.Visibility= Visibility.Visible; }

  12. Connecting players (continued) Client – connect devices Host // Host connecting to client... // Navigate client to a new page - WaitingForHost ... { backButton.Visibility = Visibility.Collapsed; WaitingForHostParametersparameters = (WaitingForHostParameters)navigationParameter; StreamSocketsocket = awaitPeerFinder.ConnectAsync(parameters.peer); pageTitle.Text = "Connected! Waiting for Host..."; ... }

  13. ConnectedPlayers.Items.Add(peer.DisplayName);

  14. Tap and connect Client – connect devices Host privateasyncvoidTriggeredConnectionStateChanged(objectsender, TriggeredConnectionStateChangedEventArgs e) { if(e.State == TriggeredConnectState.PeerFound) { // Show indeterminate progress UI } elseif (e.State==TriggeredConnectState.Completed) { socket = newSocketReaderWriter(e.Socket, this); } elseif (e.State == TriggeredConnectState.Failed) { // Inform Game Leader that connection failed } } privateasyncvoidTriggeredConnectionStateChanged(object sender, TriggeredConnectionStateChangedEventArgs e) { if(e.State == TriggeredConnectState.PeerFound) { // Show indeterminate progress UI } elseif (e.State == TriggeredConnectState.Completed) { StreamSocketsocket = e.Socket; WaitForHost(socket); } elseif (e.State == TriggeredConnectState.Failed) { // Inform challenger that connection failed } }

  15. Sending/Receiving data - timer Client Host privatevoidUpdateTime(TickOption option){// Decrement the timer by 1 second foreach (SocketReaderWritertempsocketinconnectedPeers.Values) {string message = string.Format("{0} {1}",Constants.OpCodeUpdateClientTime, timeLeft.ToString(@"m\:ss"));tempsocket.WriteMessage(message); }} publicasyncvoidReadMessage() { // Read incoming message from the socket uintbytesRead = awaitdataReader.LoadAsync(sizeof(uint)); uintmessageLength = dataReader.ReadUInt32(); bytesRead = awaitdataReader.LoadAsync(messageLength); currentMessage = dataReader.ReadString(messageLength); ... } privateintParseMessage() { ... caseConstants.OpCodeUpdateClientTime: if(gamePage != null) gamePage.UpdateClientTime(words[1]); break;

  16. UX considerations • Keep user up-to-date on the state of the connection • Ex: indeterminate progress bars, text • Game terminologyTranslate Host/Client networking model into fun gaming terminology • Ex: Host – Game Leader, Client – Challenger/player • Network failure cases Host connection fails vs. Client connection fails

  17. Don’t stop at Games… • Sharing photos and videos • Drawing, painting, sketching…together • Learning together – interactive virtual chalkboards • Collaborative DJ-ing • Easy translators – multi-lingual chat room • …

  18. 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

  19. Agenda • Easily connect games with Proximity API • Build social backend with Windows Azure Mobile Services • Do more with our solutions

  20. Demo: user log-in, leaderboard & live tiles

  21. Windows Azure Mobile Services • Use cloud storage for structured data • With powerful server scripting and database management • Allow users to login with popular identity providers • Microsoft Account, Facebook, Twitter, and Google • Send push notifications • Integrated with live tiles on Windows/Windows Phone • Integrated with notifications on iOS/Android

  22. Why Windows Azure Mobile Services? • Add a backend service to your game in minutes • Data storage, authentication, push notifications, and more • Cross-platform support • SDKs for Windows/Windows-Phone/iOS/Android/HTML5 • Reliable, scalable and production ready • Enjoy high availability, global reach across multiple data centers, and easily scale your backend up as required • Windows Azure Mobile Services provides preconfigured backend

  23. First things first • Create and register your game with Windows Store • Sign up for Windows Azure Mobile Services • Create and connect your first mobile service

  24. Adding leaderboard • Create 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

  25. Create tables • Update server script • Add client code

  26. Create tables • Update server script • Add client code

  27. Create tables • Update server script • Add client code

  28. Create tables • Update server script • Add client code

  29. Adding authentication • Register 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

  30. Register provider • Connect provider • Add client code • Restrict data access

  31. Register provider • Connect provider • Add client code • Restrict data access

  32. Register provider • Connect provider • Add client code • Restrict data access

  33. Register provider • Connect provider • Add client code • Restrict data access

  34. Register provider • Connect provider • Add client code • Restrict data access

  35. Register provider • Connect provider • Add client code • Restrict data access

  36. Adding push notifications • Register and connect Live Connect service • Acquire and store channels for push notifications • Update server side scripts to send out push notifications

  37. Register and connect service • Acquire and store channels • Update scripts to send

  38. Register and connect service • Acquire and store channels • Update scripts to send

  39. Register and connect service • Acquire and store channels • Update scripts to send

  40. Register and connect service • Acquire and store channels • Update scripts to send

  41. Register and connect service • Acquire and store channels • Update scripts to send

  42. Register and connect service • Acquire and store channels • Update scripts to send

  43. Do more with Windows Azure Mobile Services • Leaderboard • Id and log-in • Live tiles

  44. Do more with Windows Azure Mobile Services Achievements Profiles and data roaming Toast notifications • Leaderboard • Id and log-in • Live tiles → → →

  45. Do more with Windows Azure Mobile Services Achievements Profiles and data roaming Toast notifications Match-making Id, preference, skillset, locations • Leaderboard • Id and log-in • Live tiles → → →

  46. Do more with Windows Azure Mobile Services Achievements Profiles and data roaming Toast notifications Match-making Id, preference, skillset, locations Turn-based gaming Id, game status, push notifications • Leaderboard • Id and log-in • Live tiles → → →

  47. Command line tools • Scripts to automate the creation, verification, and deletion process of a mobile service

  48. Integrated support in Visual Studio • Server Explorer to manage services, tables, and scripts • Wizard to set up push notifications

  49. Windows Azure Mobile Services provides a preconfigured backend so you can focus on your gaming contents and logic, not services.http://aka.ms/mobileservices

More Related