Search Unity

What is The Best Server Solution For Real Time Multiplayer Game For Mobile?

Discussion in 'General Discussion' started by tcscorp, Oct 31, 2017.

  1. tcscorp

    tcscorp

    Joined:
    Sep 4, 2017
    Posts:
    8
    Hi Guys,
    Thanks for your time reading the question.

    i want to make a real time multiplayer card game, not much bandwidth usage like fps but fast paced where logic is done on server side and player informations are saved on servers too.

    After googling i came across these names:
    -photon engine
    -game sparks
    -google app engine
    -appwarp
    -unet
    -Amazon web services
    -playfab

    Gamesparks Is cool but fair play policy says that a single player can only send 5000 api requests each month, which is too low.

    Photon looks pretty easy but isnt it too expensive? what do you say? it doesnt allow server side logic for non enterprise customers. what do you say about photon + playfab?

    I have also searched about google cloud and AWS but i didnt understand anything. what do i have to do with AWS to set up with my game development and what are the pricing?
    i have very low budget so i think free tiers of these services would help me pay as i grow.

    I'm Inspired From Clash Royale And My Game Is A lot based on a multiplayer gameplay like this. There are a millions of player playing clash royale and most of them dont do any in-app purchases then how do they handle it?
    what is the the best way for handling millions of players?
    Can i do it too? if yes, Then How?
    can anyone please tell me the best way to do it? Or any Advice That lead me to a better direction?

    What do you guys do for your game? What do you prefer if you had to implement multiplayer support?

    Any help is Appreciated!
     
  2. JakeOfSpades

    JakeOfSpades

    Joined:
    Aug 22, 2015
    Posts:
    44
    I am currently and have used Photon (PUN not Bolt) so I may be biased.

    Photon has everything I needed, and work seamlessly with cross platform multiplayer (web and mobile).I used UNET previously but matchmaking didn't work with the WebGL (it might now, this was 2 years ago) so I switched to Photon and never looked back!

    It is pricey past 100 CCU's, I will give it that but works fantastic for my needs.

    Clash of Clans inspired me too :)
     
  3. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Someone out there probably knows, but most likely clash royale type games just use http. The general rule in mobile is use http until it won't work, because it's far cheaper and easier to scale.

    Websockets would be my next option here, because there are free implementations of that and again it scales easier then something designed for realtime multiplayer.
     
  4. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    I use Photon for realtime multiplayer, and Gamesparks for all other server logic/data/player management/matchmaking.
    I'm very happy with both.

    Photon is free for 25 CCU. If your game gets to the 500 CCU mark ($95 a month), you should be able to afford that anyway.

    Photon's network will scale automatically to your game's demand, so don't worry about having millions of players. And since only 2-4 players are playing at a time, you don't need to worry about all the other issues of syncing hundreds or thousands of players in a single game instance.

    Gamesparks will also scale to your game's demands.

    As it stands I am working on a Clash Royale clone for a client and Photon and Gamesparks are working just peachy.
     
    theANMATOR2b and Ryiah like this.
  5. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    UDP is a better protocol for realtime multiplayer. WebGL doesn't support UDP but does Websockets. Photon uses UDP on all platforms and Websockets on WebGL, so handles that all for you.
     
  6. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    clash royale type games most likely don't need what most of us think of as realtime, that's why I said what I did. Some might, but I know a lot of games like that are almost 100% client driven. It's all decided up front using pseudo random generators. Why? Because mobile is all about scale, and realtime at mobile scale is complexity you want to avoid if you can.
     
  7. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    To elaborate a bit. Even though players might make decisions, a common approach is seeded random numbers, so there is no calculation on the server for combat. Movement is all client side. You can drive a game like that with less then 2-3 requests per second at most.

    If the game allows for multiple players making moves simultaneously in real time (not turns), that's where it changes. But even with click to move they won't be sending 15 messages second to synchronize stuff most likely, it will be at a far lower rate.

    A lot depends on the studio's background, developers have preferences and since you can do it both ways you will see a mix, but the norm is you avoid realtime until you have to, it's not your go to solution.
     
  8. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    BrainCloud is pretty handy too. They have a specific API for clash of clan style games and they have a quasi-real time API for Hearthstone like games planned for release early next year.

    They aren't quite as big as some of the others, but they support some very big games (e.g. Simpsons Tapped out).
     
  9. tcscorp

    tcscorp

    Joined:
    Sep 4, 2017
    Posts:
    8
    Thanks Everyone For Their Answers! Looking To Go With Photon And Gamesparks.
     
  10. grimunk

    grimunk

    Joined:
    Oct 3, 2014
    Posts:
    278
    Photon is only server-authoritative is you are managing the entire deployment architecture, probably on something like AWS or the google cloud. If you are doing that, you could just use unet, forge, or bolt (also from photon). Gamessparks has some javascript-based multiplayer that I think might just be a nodeJS/Websockets deployment. Playfab doesn't do multiplayer, they do persistent back-end storage. They have a partnership with photon.

    For us, Unity's core is not flexible enough, so you end up having to run in a separate thread. If you're already doing that, then why even use Unity? Besides, it is good to stay flexible. Photon is not nearly good enough, and while being easy at first is very hard later on without server authority - at which point it's just a socket server, so not a lot of value. None of the other solutions seem to hit the nail on the head. Our approach was to build our own. It powers Scene Fusion and kazap.io, and a few more small games we have in the pipe.
     
  11. tcscorp

    tcscorp

    Joined:
    Sep 4, 2017
    Posts:
    8
    Whats The Difference Between Using AWS and Photon or gamesparks For A Realtime Multiplayer Game? What do i need with AWS to set it up for my game? is it fast enough? Can anyone please give me a brief explanation about Services like google app engine and AWS ?
     
  12. grimunk

    grimunk

    Joined:
    Oct 3, 2014
    Posts:
    278
    If you know what you are doing, you can just write your own multiplayer solution, deploy it to AWS, and have your game run.

    The question is, do you want to maintain it? The game may run for years, which means you will need to keep it running for that long. By then, you may have written 10 - 50 more games. Each may be making you money, but not without the hassle of maintaining the servers.
     
  13. GCatz

    GCatz

    Joined:
    Jul 31, 2012
    Posts:
    282
    clash royale is actually pretty complex, it uses UDP and is lockstep deterministic
     
    RavenOfCode likes this.
  14. tcscorp

    tcscorp

    Joined:
    Sep 4, 2017
    Posts:
    8
    do i have to host my own servers on AWS? Cant i just code for network programming according to my needs and then let the AWS run it along with its own servers and i just pay for it?
     
  15. Deleted User

    Deleted User

    Guest

    @Meltdown: Why did you decide to go with Photon for realtime multiplayer rather than use GameSparks for all? I'm making a multiplayer racing game and was planning to use GameSparks for all.
     
  16. grimunk

    grimunk

    Joined:
    Oct 3, 2014
    Posts:
    278
    AWS allows you to spin up virtual servers. It is up to you to management and provide operations. This is one of the reasons why people go for solutions like photon - you don't have to worry about or put time into the server-side of things: Just write your client and go. The problem with photon is that it is just a relay service, so you game is very much client authoritative, and if you want to circumvent the problems associated with that you end up having to put a LOT of work into your multiplayer game - or worse, you discover late in development that a relay server is just not the correct approach to your game.
     
    shinichikudo997 and theANMATOR2b like this.
  17. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    Because I had already implemented Photon before Gamesparks came out with their realtime component.

    The current project I'm working on now we re-evaluated both, and Photon again came out on top. I did the multiplayer tutorial for Gamesparks and just found their documentation/api quite complicated for the realtime stuff, and I just didn't like the thought of working with it.

    Whereas Photon's just seemed a lot friendlier and efficient to work with, and has an established knowledge base, has been around for longer and seems more specialised towards Unity, but this may also me just being biased towards Photon as I had already worked with it and had good results.

    If you haven't worked with either, I would suggest evaluating both, it might appear different to a fresh set of eyes.
     
    Ryiah, theANMATOR2b and Deleted User like this.
  18. MetaDOS

    MetaDOS

    Joined:
    Nov 10, 2013
    Posts:
    157
    @Meltdown Please keep us updated on the evaluation of your solution.
     
  19. eltrexx

    eltrexx

    Joined:
    Feb 1, 2018
    Posts:
    11
    Hi I'm bumping this thread for my case :
    We are developing a Quiz Game for an university, so we have low credit and we won't monetize our game (they have to be absolutely free for students).
    Plus we are very protective about privacy and personal data. So we will end up using our own server (hardware), and need to have full control about it.

    My predecessor put their choice for nakama from heroicLab, because it's free and it a dedicated server logic with an Unity client.

    I don't know anything about multiplayer, but as I begin documenting about it, I think the issue with Nakama is that it's too recent, less documented, less support and may be more difficult to implement.

    At first I thoigh hey why you didn't chose to use integrated Unity Network solution. But they said it is because only client host the game, we can't have a server handling connection between client.

    So I wondering other solution used by the industry.

    I discovered Playfab, but I don't understand if it can handle simple multiplayer for our Quiz without Photon witch cost money.
    Same for Gamespark. I watch this :
    and the guy explain taht gamespark is way on top of playfab by majority of criteria. (and this how I discorver GameSpark).

    But I don't know if you can use your own dedicated server, that you have full control on it, with GameSpark, like you can with playfab according to this : https://api.playfab.com/docs/tutorials/external-game-servers.

    Sorry I'm new about this aspect of game, I'll continue to document myself, but I'm interested about your opinion for my case.
     
  20. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    Hi,

    GameSparks doesn't work with external servers unfortunately. But I've been using it for 2 years with my games and its a great solution.
     
  21. mofirouz

    mofirouz

    Joined:
    Jul 14, 2015
    Posts:
    27
    I'm one of the developers behind Nakama - it can handle all of the requirement posted by the OP. We were actually inspired by Crash Royale gameplay and server needs. Feel free to ask the engineering team questions over the community chat channel.
     
  22. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    Meltdown likes this.
  23. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
  24. verybinary

    verybinary

    Joined:
    Sep 23, 2015
    Posts:
    373
    I have most interest in photon, but they refuse to give you a download.
    What if I don't want to use your cloud?
    What if I want to continue multiplayer with the same system after you die
    Let me run a local f$#*&%@ server
    I'll do my own upkeep
     
    jovino likes this.
  25. mofirouz

    mofirouz

    Joined:
    Jul 14, 2015
    Posts:
    27
    @verybinary Have you had a look at Nakama - it's open-source and you can download and run the entire server yourself.
     
  26. verybinary

    verybinary

    Joined:
    Sep 23, 2015
    Posts:
    373
    @mofirouz I had not until I read this thread. I tried to open a tab, but cant get to it at work. I'm curious about the flexibility between a multiplayer fps or similar, or a networked single player game that interacts with stats in a database(like an old school pimpwars type browser game). "Both" wouldn't be required, just curious, and interested reguardless.
    But I'll be checking out Nakama as soon as I get home
     
  27. Kaiserludi

    Kaiserludi

    Joined:
    Jan 21, 2009
    Posts:
    94
    You are aware that there is a Photon-Server SDK for self-hosting available?
    See https://www.photonengine.com/en-US/OnPremise.
     
  28. Emile97

    Emile97

    Joined:
    May 28, 2017
    Posts:
    105
    Hey, hi bro Did you finish your game also can I PM you ? I have some questions...
     
  29. Deleted User

    Deleted User

    Guest

    A giant server in the sky called PI.
     
  30. shinichikudo997

    shinichikudo997

    Joined:
    Jul 1, 2018
    Posts:
    33
    Sorry to necro this, but now that gamesparks is dead, what are the options?
     
  31. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    My recommendation is Mirror for multiplayer networking, and Playfab for backend logic/player data.

    Photon has released Fusion but from what I can see it doesn't support WebGL at this point which was a dealbreaker for me.
     
  32. grimunk

    grimunk

    Joined:
    Oct 3, 2014
    Posts:
    278
    We have now made our Reactor system available.

    It supports WebGL and all platforms. We focused on bandwidth efficiency (the largest cost of running a server-authoritative multiplayer game) so that it uses 1/10th that of what photon fusion uses, and about 1/50th of what Mirror uses. This means a single server with 5000-10000 concurrent players, all visible to each other, is possible.

    It also has fully integrated hosting - you can actually launch online game servers directly from Unity during development, and the runtime publishing system is scriptable so you can integrate with with a workflow specific to your project.

    If you're interested we have a bit more info on our website: https://kinematicsoup.com
     
  33. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    That sounds like a bit of a stretch.
    Do you have case studies to back those statements up?
     
  34. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,191
    What about PlayFab?
     
  35. grimunk

    grimunk

    Joined:
    Oct 3, 2014
    Posts:
    278
    Case studies are coming, and people can try the system out for themselves. We can't talk about other people's projects yet. Right now we use an online multiplayer demo to demonstrate what we can do, and we have a number of internal scenarios we test against. The best way to vet it is to contact us for access and try it for yourself.
     
  36. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    838
    Always neat to see new networking packages for Unity. I tested the demo, and used Clumsy to add latency, it seems like the setup for handling latency is delay based (movement/firing became delayed the more latency I added). Is delay based setups the main paradigm for Reactor? Or is there also prediction for projects that require more responsiveness?
     
  37. grimunk

    grimunk

    Joined:
    Oct 3, 2014
    Posts:
    278
    Yes, the nature of the demo requires the controller to be set up for a server bias - the chunks of debris all all synced to all clients, and are part of gameplay because they do damage in impact. The default predictor has other modes which bias more towards the client, and we've provided a full API in the controller allowing you to do any other kind of thing such as client physics simulation with rewind/resim capabilities.

    As time goes on, we will add more predictors that use different strategies, so people can use them in a game or modify them to suit their own needs.