Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Best Solution for an Async Multiplayer Game Backend?

Discussion in 'Connected Games' started by andycodes, Jan 10, 2019.

  1. andycodes

    andycodes

    Joined:
    Jan 22, 2013
    Posts:
    14
    Hi All,

    I've been juggling ideas in my head for some time now, but I seem to keep throwing myself in the same loop. I am looking to implement a sort of Asynchronous turn-based multiplayer into my (mobile) game, with the same gameplay flow as a game like Trivia Crack: Player 1 looks for a game, if one is found, they join that game. If not, they start a game and take the first turn, then the server finds another like-skilled matchup and puts them in the game. Player 1 and Player 2 play at their convenience until the server side logic defines a winner and messages are sent to each user appropriately.

    A forum post on GameSparks has this exact flow model, however it ends with the user concluding that GameSparks just isn't flexible enough to allow a player to take a turn before the second player has been matched.
    https://support.gamesparks.net/support/discussions/topics/1000080956/page/1?url_locale=

    My requirements are as follows:
    • Auth
    • Leaderboards
    • Matchmaking
    • push notifications
    • (would like to have, but not essential) Google+, Facebook game invites (Linking accounts essentially)

    For reasons of the game being non-concurrent, obviously I've thrown UNet out the window, though it would be nice if they had a native solution for non-concurrent game styles.

    The top options that I've considered are GameSparks, PlayFab + Photon, and lastly, just writing my own PHP/MySQL solution (I'm fairly confident in my abilities to implement most of the server side logic and game state handling except maybe for a matchmaker thats nuanced or linking accounts).

    I am currently taking a hard look at PlayFab + Photon, as they seem to meet these requirements and there are some forum questions about this similar type of topic, however all the responses are in verbiage that only seem to make sense to someone that knows their system inside and out. Since this is likely my best lead, is there anyone who has done something like this that could give a few pointers or a good tutorial to follow that could get me on pace to implement these services into my game?
     
    Last edited: Jan 10, 2019
  2. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    2,815
    Your example would work fine with UNET.
    Have a lobby where they meetsee NetworkLobby asset for a start, although it's very buggy), once they both press ready the game starts. When in game, server remembers who's turn it is and let's the person make his move.
     
  3. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,079
    Most of your requirements are met with PlayFab, I'd say. There is actually no need to include Photon in this case. Photon would help if you want realtime interaction between some players.

    However, even an essentially turn based game might benefit from live-interactions. Example: Golf Clash could just show where your ball went but instead they show how you prepare yourself and hit the ball. Not sure if that applies to a trivia game but .. you're the game designer ;)

    In your case, I would try to find the solutions on PlayFab's forum or ask, if they can give you the missing pointers.
    As you already broke the game down into several features, go after each one by one.
     
  4. doctorpangloss

    doctorpangloss

    Joined:
    Feb 20, 2013
    Posts:
    37