Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Better authorative server option?

Discussion in 'Multiplayer' started by Rafael-cmk, Sep 30, 2019.

  1. Rafael-cmk

    Rafael-cmk

    Joined:
    Jun 28, 2016
    Posts:
    56
    Hello guys, I'm looking for a better solution to make an authorative server for my game, at the moment I'm using Photon Server, it works great and all, but it's too expensive to my taste, I wonder if there isn't a better solution. From a simple seach I found that Forge Networking and DarkRift Networking could be good options but didn't had the chance to test any of them yet.
    So, I wanted to know if anyone here has experience with this kind of thing, any suggestion or comment is welcome.
     
  2. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    279
    Black_Demon likes this.
  3. MrsPiggy

    MrsPiggy

    Joined:
    Jun 13, 2018
    Posts:
    154
    I've been using SmartFoxServer for a while now and I think it's a solid option for an authoritative client/server solution. Lots of features, battle tested and good support. Also prices are quite affordable via the elastic license they offer.

    I guess it all comes down to what are your requirements and what is your budget range. Something like Dark Rift sounds like a good option if you need an entry level solution and you don't want to spend any money. The downside with these less known solutions is to trust they are well tested and reliable enough, especially when your traffic grows and you need to scale.
     
  4. Rafael-cmk

    Rafael-cmk

    Joined:
    Jun 28, 2016
    Posts:
    56
    @MrsPiggy Cool, with photon I'm paying 95$ for each 500ccu, and the main thing I don't like here is that this licenses are per app/server, so, if I for example make a new update on my game and I still want to support the old version for a while I would need a new license just for that, then I will have 2 licenses of 500(2x95$) and none of them are close to the limit because half of my players are playing on the new version and half on the old one, it's a waste of money.
    Can you tell if it's different with SmartFox? or even maybe give me some numbers to save me some time, I'll do some studies on it soon as I can.
     
  5. MrsPiggy

    MrsPiggy

    Joined:
    Jun 13, 2018
    Posts:
    154
    @Rafael-cmk
    By photon you mean photon cloud? Or it's a hosted photon server where you can also run the server side game code? As regards SmartFox you need the server itself and a hosting service.

    For hosting I use Amazon EC2 which is reliable and affordable enough. For the SmartFox 500ccu license I pay 25€/mo and I run it on a EC2 t2.small which is another (roughly) 30€/mo, bandwidth included. So overall, it's around 55€/mo

    If you want to calculate the cost of the elastic SmartFox license there's a page at their website: https://www.smartfoxserver.com/buy/sfs2x#p=elastic (also keep in mind that you can start out for free, with 100ccu)
     
  6. Rafael-cmk

    Rafael-cmk

    Joined:
    Jun 28, 2016
    Posts:
    56
    @MrsPiggy It's Photon Server with custom server code, I'm also running it on Amazon EC2.

    SmartFox seems like a better option already, I will look into it further later. thanks for the help.
     
    g_a_p likes this.
  7. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    Why do you think that smartfox seems a better option? How is your experience with photon server and amazon EC2?
     
  8. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    Do you think that SmartFoxServer is suitable for a full feature multiplayer game?
    For example, how is the matchmaking? How authentication is managed on a mobile device? is it possible to use Game Center on iOS and Google Play on Android as user account? How easy is to implement an authoritative server? In my specific case, I dont need and headless unity server.
     
  9. MrsPiggy

    MrsPiggy

    Joined:
    Jun 13, 2018
    Posts:
    154
    Yes, take a look at their website and download the free examples. There're a ton of those and tutorials in the docs, so you can see if it's what you're looking for.
    Matchmaking is solid. I haven't used all of the features: there's private and public games, an invitation system, filtering with custom criteria. For me it's more than I can ask, LOL
    Integration with Game Center or Play Store shouldn't be a problem as those are integrated on the client side, alongside the SmartFox api and other api you may need.

    SmartFox uses a client-server model, so implementing and authoritative server is pretty simple: you just need to deploy your server side code. You can use Java or Javascript for that.
     
    g_a_p likes this.
  10. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    thank you for your comprehensive reply @MrsPiggy.
    I had a look to the documentation, and it seems to be very complete.
    Its a pity that the showcase projects are all very old, this has been a turn off for me the first time i had a look to SmartFoxServer.
     
  11. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    279
    The problem with the showcase is that 97% of our customers don't share their projects with us. We believe that, given the quality of the documentation and reliability of SmartFoxServer (born in 2004 and kept up to date since then), you don't even need to get in touch with us during the whole development process.
    Often the only contact occurs when you (possibly) buy a license, which usually happens in a frantic moment in which you have a lot other things to do than send us information for our showcase.
     
  12. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    @g_a_p I understand but you should put yourself in the shoes of someone who don't know anything about SmartFoxServer and multiplayer in general (like me). The first thing that you usually check in order to understand the goodness of a service is who is already using the service. More, I had a look to the tutorials on the official SmartFoxServer youtube page and the most recent is five years old...
    Anyway, this is fixed now.

    Two questions:
    1) How authentication is managed on a mobile device? is it possible to use Game Center on iOS and Google Play on Android as user account?
    2) How SmartFoxServer manages load? I mean, can it manage a lot of users? Is it scalable?
     
  13. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    279
    1) As MrsPiggy already mentioned, integration with Game Center and Google Play is initiated on the client side, then on the server side you can verify an access token sent by the client. The flow for Google Play is well described on this page: https://developers.google.com/identity/sign-in/web/server-side-flow
    Facebook authentication works in the same way and Game Center should be very similar.

    2) Take a look at (at least) the first two white papers on this page: http://docs2x.smartfoxserver.com/Overview/white-papers
    You will also find another document describing how we were able to have 100K concurrent users on a single SmartFoxServer instance during a stress test scenario.
     
  14. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    I had a look to the link. The example refers to google sign in for web sites. Is there an example on how to make this with an app?
    And btw, which is the best practice in this case? Skip the authentication process? Is this safe? None of the multiplayer racing games that I tested on google play doesn't have any kind of authentication process. At most, they depends on google play or game center sign in.

    "SmartFoxServer 2X Performance and Scalability" is a 2012 document.
    "SmartFoxServer 2X Running 100K concurrent users" is a 2015 document.
    Is there anything more recent?
     
  15. Rafael-cmk

    Rafael-cmk

    Joined:
    Jun 28, 2016
    Posts:
    56
    @newlife My server dosen't authenticate the users yet but my client does, and I use PlayFab(GameSparks is a great option too, never used tho) with facebook for that, 100% safe against hackers, I will do the same with my sever later, I already tested everything and works great, the client just needs to send the login token and then the server can retrieve any information it needs.

    I said that SmartFoxServer seems better because of the price, seem like you can tune it to any ccu you want and if I understood right, it works with credit style, you don't use it for 1 day, you don't pay that day.
    But I'm not sure of this, never used before. I'm just dissatisfied with photon server prices.
     
  16. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    @MrsPiggy, did you have ever considered Amazon gamelift or microsoft playfab?
    Also, I noticed that smartfoxserver supports only java and javascript for the server side code. Photon server supports all .net languages. Can this lead to any performance issues? Java is not known to be a fast language.
    @Rafael-cmk, how did you manage scalability in photon server? It seems that its not managed automatically like in photon cloud. For what concern the server side code, it doesn't seem easy and straightforward as in smartfoxserver. Did you find any difficulties to implement your authoritative code?
     
  17. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    Thank you for your reply @Rafael-cmk.
    Is your game a mobile game? Can you please describe better to authentication process? Do you ask your users to login using facebook? Why you say that its 100% sage against hackers? Sorry for the dumb question, which kind of hacking are you trying to avoid?
     
  18. MrsPiggy

    MrsPiggy

    Joined:
    Jun 13, 2018
    Posts:
    154
    Maybe back in 1998 :)
    No I don't think you'll have any performance issues in Java, unless you're writing bad code of course.
     
  19. Rafael-cmk

    Rafael-cmk

    Joined:
    Jun 28, 2016
    Posts:
    56
    @newlife You can have the same code from photon cloud in your server if you want, they give it to you, and then you can add your own code on top of it.
    Mine is more of a mix with photon cloud style and interest management, I've coded everything from scretch. I only use one server at the moment.
    And let me say, in my opinion it's a lot easier to code a whole server and client than to work with photon cloud, with photon cloud it gets damn confused when you have a complex game.

    And, yes, it is a mobile game, my users login with facebook but there are other options as well.
    It's 100% safe against hacker in the economy subject, all of the store purchases are authenticated from Playfab, and all of the in-game purchases, modifications, etc... involving money go thgouh custom cloud scripts that Playfab let me make.
     
    Last edited: Oct 8, 2019
  20. Rafael-cmk

    Rafael-cmk

    Joined:
    Jun 28, 2016
    Posts:
    56
    And does SmartFoxServer really only works with javascript? I will have to consider other option then, I barelly know anything about javascript, as I said above, I coded the entire server from scratch to fit my needs and I can't repeat it in another language I don't know well.
     
  21. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    Im not sure I got what you mean here... I simply need server code to implement an authoritative server to block multiplayer cheating attempts.

    Ok so you are not using it to avoid multiplayer cheating right?
     
  22. Rafael-cmk

    Rafael-cmk

    Joined:
    Jun 28, 2016
    Posts:
    56
    @newlife If you are looking for a way to detect or block ppl who want to fly around, teleport or insta kill other players for example, that's with you multiplayer server, Playfab dosen't work that way.
    In my case I don't mind these kind of cheats at the moment.
     
  23. MrsPiggy

    MrsPiggy

    Joined:
    Jun 13, 2018
    Posts:
    154
    Java and Javascript.
     
  24. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    279
    I guess the Google documentation is a good starting point.
    Take a look at this link for example: https://developers.google.com/identity/sign-in/android/start-integrating
    In particular the "Authenticate with a backend server" chapter is useful for the server-side part.

    I think the need for authentication depends on your game requirements. In any case if your client is authenticated, you will probably need to identify the currently signed-in user on the server, so you know who is doing what, you can store data related to a given user, etc.

    We don't have other documents, because they are not needed. SmartFoxServer is a rock solid product on the market since 15 years ago and being kept up-to-date since then. So the concepts expressed in those documents are still perfectly valid, and where performance is discussed, you will probably get even better results with modern hardware.
    We think those dates prove the stability and reliability of SmartFoxServer.
     
  25. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    @MrsPiggy, @Rafael-cmk did you have ever considered Amazon gamelift or microsoft playfab?
    They seem to offer both hosting and multiplayer server. What do you think?
     
  26. MrsPiggy

    MrsPiggy

    Joined:
    Jun 13, 2018
    Posts:
    154
    I know very little about both, I get the gist of what they do and I think they'd be good if you don't run a client-server solution. Or maybe if you run a very barebone solution that has limited features so you have to integrate those services for login, storage etc. Personally I don't like having pieces of my game in multiple places unless you do everything with these services.
     
  27. Rafael-cmk

    Rafael-cmk

    Joined:
    Jun 28, 2016
    Posts:
    56
    @newlife I do use Playfab, for login and purchase authetications.
    Playfab is not exatly realtime, you make everything with http request and it takes a while, they offer multiplayer servers too but it's basically Microsoft Azure instances, I prefer to use Amazon EC2.

    Never used Amazon gamelift, from what I've seen it's not a backend server, it's a service that will start instances on demand, similar to Photon Cloud matchmaking. Correct me if I'm wrong.
     
    Last edited: Oct 11, 2019
  28. Rafael-cmk

    Rafael-cmk

    Joined:
    Jun 28, 2016
    Posts:
    56
    @newlife Amazon service similar to Playfab is called GameSparks, I never used it but wish to, from what I've seen it works with websockets, so there is an actual login, in Playfab there is no login since it work with http request, to avoid 2 sessions at the same time you need to make your own custom server side code.
    And talking about custom server side code, Playfab is just horrible to debug, Edit > Save > Pray. Now that I'm more experienced it's not much of a problem but the learning process as hard.
    GameSparks on the other hand has a cool debug system.
     
  29. MrsPiggy

    MrsPiggy

    Joined:
    Jun 13, 2018
    Posts:
    154
    @Rafael-cmk can you actually implement some sort of authoritative server side code with these services?
    I ask for stuff like leaderboards and similar. Since you can't trust a client sending their score, you'll need the server side to calculate the player score and save it. But if these services rely only on HTTP I don't see how you can make a half-decent mp game, unless it's slow and turn based.
     
  30. Rafael-cmk

    Rafael-cmk

    Joined:
    Jun 28, 2016
    Posts:
    56
    @MrsPiggy It depends on the kind of game you are making.
    Mine is a racing game, for leaderboards I need to either trust what the client is sending or only accept scores from my Photon Server instance wich is garantee to be safe.
    These services are most useful for authetication and purchases validation, it's also a cheap way to store the users data, I use Playfab for almost a year and just now I actually needed to pay something, because I need more inventory slots.
     
    MrsPiggy likes this.
  31. MrsPiggy

    MrsPiggy

    Joined:
    Jun 13, 2018
    Posts:
    154
    I see, thanks. So your game logic runs on Photon and your login, leaderboards and general storage is on playfab?
     
  32. Rafael-cmk

    Rafael-cmk

    Joined:
    Jun 28, 2016
    Posts:
    56
    MrsPiggy likes this.
  33. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    The Photon Cloud is managed for you. There are several tiers of the service. The Public Cloud (fully managed, lowest tier) does not allow custom code, as we can not sandbox it sufficiently to run this on shared machines. Tn the highest tier (Enterprise), the developer defines in which places he wants how many machines and custom code can be uploaded (deployment is done by our systems).
    If you run your own Photon Server(s), you can host it on various services. In that case, a Master Server can distribute players to multiple attached Game Servers. This maps to a "region" in Photon Cloud. You'd have to make the clients aware of your Master Servers via some list, if you run servers in multiple regions. This part is not managed.

    For the type of service Photon provides, our pricing is really not all that bad. Yes, there are entirely free options but each lacks some part of the puzzle, which means you may have some other type of effort.
    You probably don't have to buy two 500 CCU licenses if you wanted to run two versions of the server with half of the CCUs each. Running two versions in one process is often an option and in doubt, we could split the license for you.
    Did you get in touch with us?
     
  34. Rafael-cmk

    Rafael-cmk

    Joined:
    Jun 28, 2016
    Posts:
    56
    @tobiass Yeah, sorry about that, I found out I can actually run more than 1 instance in the same process, that's great.
    About the license price, would be great if I could at least buy a cheaper one with less ccu, I will send an email and check with you guys later about this.

    Thank you for the response.
     
  35. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    Anytime. Mail your use case and we'll find a solution.
    Happy coding!