Search Unity

Which MultiPlayer asset/service suits for a simple card game?

Discussion in 'Multiplayer' started by UnbreakableOne, Mar 24, 2015.

  1. UnbreakableOne

    UnbreakableOne

    Joined:
    Nov 16, 2013
    Posts:
    168
    Hi,

    We are prototyping a simple card game (Trading Card Game or TCG if you may) and since it's our first multiplayer project (and are indie and basically cannot afford any paid service, at least now) we are a bit confused about different services out there.

    I understand there are two major problems need to be solved and all solutions out there seem to solve only one of them and I rather use a service that provides both.

    One is player profile, which needs to be stored on a server and stores user profile and attributes such as his or her XP and deck and whatnot.

    The other is game logic which matchmaking and the game logic. I don't know how I should store that on a server. I've read that headless Unity instances on server per game is too much for such game and I strongly agree but I don't know the alternative. Should it be a C# script?

    I know I'm asking a lot but I would appreciate if someone would A) Suggest a services or services that helps me solve the problems and B) Explain how these problems are solved in such services.

    Thanks.
     
  2. Neoshiftr

    Neoshiftr

    Joined:
    Dec 5, 2012
    Posts:
    67
    I am doing fine with Photon Networking and playfab.
     
  3. UnbreakableOne

    UnbreakableOne

    Joined:
    Nov 16, 2013
    Posts:
    168
    Would you please elaborate on your case scenario and what type of game you are making with them? And specifically which Photon Networking service are you using. Are you storing Game Logic on the server?
     
  4. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Honestly, everything will work (including standard Unity networking). The better question to ask is which one is the most efficient.
     
  5. UnbreakableOne

    UnbreakableOne

    Joined:
    Nov 16, 2013
    Posts:
    168
    Yes, my priorities as state above are:

    1) Finding a solution that preferably has both networking and storage.

    2) Not be very complex since our game is very simple and we are prototyping and a smooth learning curve to get fast results is of utmost importance.

    3) Have tutorials/docs on how to do various things I've asked in the first post.
     
  6. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Oh, sorry I didn't see those details. GameSparks, PlayFab, Parse, and Realtime will all work. Maybe flip 2 coins? Imo, GameSparks has the best pricing.
     
  7. UnbreakableOne

    UnbreakableOne

    Joined:
    Nov 16, 2013
    Posts:
    168
    I don't know about GameSparks but I'm sure PlayFab doesnt do messaging and is joining force with Photon for that.

    Would help if others would share their experience as well.
     
  8. Neoshiftr

    Neoshiftr

    Joined:
    Dec 5, 2012
    Posts:
    67
    My game is an online racer and I use playfab to manage accounts, with their login info, inventory, per-player-info as character and car type etc. Photon is used for matchmaking (create room, players meet in room, master sets settings etc and launches game when everybody is ready) and room lists.
    I'm using PUN Realtime. Game Logic is stored at playfab in Javascript. You can easily call it from your game.
     
  9. npsf3000

    npsf3000

    Joined:
    Sep 19, 2010
    Posts:
    3,830
    I agree, it does seem a little silly that you need two services instead of one.

    What I do when building services for games is write my logic in small self-contained snippets of code that communicate by sending messages between each other. Behind the scenes I use a framework to provide scalability/persistence/drivers etc automatically. This lets me have both a high performance scalable networking and persistent storage in a single solution.
     
    Last edited: Mar 26, 2015
  10. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
  11. UnbreakableOne

    UnbreakableOne

    Joined:
    Nov 16, 2013
    Posts:
    168
    Guys, it's way more complicated than I thought.

    I've been watching videos of Playfab, GameSparks, Photon for 3 days and am actually more confused than informed.

    Then there is different pricings that are different from each other and I can't compare them.

    And most importantly, the code required to run on the server. Absolutely have no idea how I should make the game that it would talks back and forth with a server for gameplay, not a one time thing like a leaderboard (that I've implemented myself before).

    I actually have no idea what to ask. I can only think of the initial question I asked, which of these solutions seems best for a simple card game?

    I honestly can't get my head around them because I think you have to have experience with them to be able to compare them and are similar to me from the outside.

    The only thing I understood so far that seems most important is the cloud code, some required JavaScript and some Java. I think Java works better but then again it might require uploading JAR files and whatnot.

    Also, where should I start? I can make the game as a 2 player offline game on a computer but what changes does it need to be able to play online? Should I make my game and THEN try to integrate these MBaaS/MPaaS services or I have to make my game with them in mind?
     
    Last edited: Mar 27, 2015
  12. npsf3000

    npsf3000

    Joined:
    Sep 19, 2010
    Posts:
    3,830
    In short for now, forget about how the networking will work - just build a simple game that *assumes* you have networking (e.g. split server and client code apart) but don't worry about how that'll work.

    Get a prototype of that up and running, and *then* look into networking solutions.

    If you want, add me to skype and I'll give you some guidance.
     
    tobiass likes this.
  13. UnbreakableOne

    UnbreakableOne

    Joined:
    Nov 16, 2013
    Posts:
    168
    Thanks. I've drawn state machine of the game on paper and need to know how to hook online services to it in the particular way that I was after described in the first post of this topic.
     
  14. Suyash Mohan

    Suyash Mohan

    Joined:
    Sep 12, 2013
    Posts:
    4
    Hi,

    You should check out AppWarp and App42 from shephertz. You can use both to create the type of game you are looking for. AppWarp handles all the multiplayer logic like rooms, lobby, matchmaking, etc. App42 can handle all the other logic like User management, Leaderboard, Storage, Push Notifications, etc. Both come with free plans for Indie and great support through forum and email.You should check out http://www.shephertz.com

    Disclaimer : I am part of Shephertz :D
     
  15. UnbreakableOne

    UnbreakableOne

    Joined:
    Nov 16, 2013
    Posts:
    168
    I've checked it but it requires me to host a server with Java and ANT, even for testing.

    Open to other suggestions.
     
  16. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    I use AppWarp & App42 for my turn-based board game and I didn't need to host a server with Java and ANT. You must have been looking at this: http://appwarps2.shephertz.com . That requires hosting. But you should look at this (which I use) and it doesn't require you to host anything: http://appwarp.shephertz.com/game-development-center/turn-based-games/ (for the Async Turn-based or the Sync Realtime Turn-based).You just make calls to AppWarp or App42 cloud services.
     
    Last edited: Jun 10, 2015
  17. UnbreakableOne

    UnbreakableOne

    Joined:
    Nov 16, 2013
    Posts:
    168
    Are you using server side coding? I don't think so.

    If you take a look at the turn based games link you provided, on the far right, in the "Dealer Based Games", it says that it requires their S2 solution.
     
  18. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    S2 is only required when you need server side code.

    Take a look at this video that I made:

    In that video there is absolutely no server side code. In your case imagine the 1st player, instead of human interaction to send a move (deal cards), uses it's AI to send the moves (or the hands that are dealt) to itself and the other 3 players. Each client displays the hand that it has been dealt (by the 1st client) to its human player. Then all four clients use human interaction to play the hands that each has been dealt. That is all you need to do.


    You can do everything you want with App42 or AppWarp. My game is a 2-player in offline mode (human vs AI), or 2 to 4 player in online mode. There is no reason why I couldn't set up a 3-player online game with one of those players being an AI player who controls (deals cards) the game. And that can all be handled with AppWarp. You don't need server side code.

    All of my clients have the the human player code built in, and also the AI code (which could be on the server but isn't) is also built into the client. Which ever client starts a game by creating a room (on Shephertz's server) is the controlling player. So in a card game of two players. Player A starts the game by creating the room (or card table), Player B joins the room. Player A controls the game by dealing the cards. This could be a command that sends data (which cards are dealt) to Shephertz server and the server relays that command with it's data to Player B. Then both players' clients deal the cards by reading the data in that command. And both players (clients) have the same game state.

    Just think that instead of needing a hosted server, every client can also act as a server. But this would be more open to hacking and cheating. So you'd have to code with that in mind.

    Or you could use Amazon or Googles web services. They allow you to upload and run code on their servers. I used Google App Engine to perform iOS AppStore Receipt Verification. I had to upload a PHP program. That could be your dealer.
     
  19. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
  20. moh05

    moh05

    Joined:
    Nov 26, 2015
    Posts:
    65
    @UnbreakableOne , I'm just passing by what you passed before :)

    I'm totally lost...How did you implemented your networking feature? Any tips?