Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by Larilof · Jun 05, 2017 at 02:47 PM · Matchmaking

Match-making for two-player asynchronous turn-based game

I'm a newby to game development and after reading several posts about match-making I have the following questions regarding match-making for a two-player asynchronous turn-based board game:

1. What are 'rooms' used for? Are they same as 'boards' / 'games'?

2. Is it possible to do the match-making without Photon, using Playfab's Shared Group Data and/or Title Data?

3 If so, Should I worry about race conditions, i.e. multiple players trying to join the same board simultaneously?

4. Are Cloud Script for a single title processed sequentially or should I take into account the possibility that multiple script calls are handled in parallel?

Many thanks in advance for helping me out.

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Brendan · Jun 05, 2017 at 07:18 PM

Sure thing:

1. In Photon, a "room" is simply a shared game session, running in their service (https://doc.photonengine.com/en/realtime/current/getting-started/realtime-intro).

2/3. Matchmaking can be done via Photon Realtime's matchmaker, or the PlayFab matchmaker for titles using hosted game servers. Shared Group Data and Title Data cannot be used for matchmaking.

4. Each executing Cloud Script handler is distinct from every other one, and they are all started asynchronously via calls to ExecuteCloudScript. No client should ever be attempting to run multiple Cloud Script handlers simultaneously - you should always wait on the response from the running handler before the same client tries to start another.

Comment

People who like this

0 Show 2 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Larilof · Jun 07, 2017 at 03:59 PM 0
Share

Many thanks for your reply. What happens if two clients simultaneously call a script which updates SharedGroupData? Will the calls be handled sequentially or in parallel? If in parallel, how can I avoid the SharedGroupData becoming inconsistent?

avatar image Brendan ♦♦ Larilof · Jun 07, 2017 at 10:28 PM 0
Share

The scripts run completely independently - they may not even be running on the same server, for that matter. So it's the same as if you make calls from two different devices to update the same piece of User Data or Shared Group Data - you have to take steps to ensure they don't step on each other, if that could cause issues for your title.

For asynchronous turn-based games, the best thing to do is to have one part of the value be whose turn it is. That way, if you're only updating that via Cloud Script, you can have it check to make sure it's the right player's turn before updating.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    Related Questions

    Can this work for squad joining with Playfab matchmaker? 1 Answer

    when are you going to release Matchmaking? 1 Answer

    Manual Game Session via groups 1 Answer

    Matchmaking with one player? 1 Answer

    Can I get a conceptual explanation of how a custom Matchmaker would work? 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges