Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Unity Multiplayer What are the pros and cons of available network solutions/assets

Discussion in 'Connected Games' started by Serinx, Jan 7, 2019.

  1. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,145
    PlayFab is amazing imho.
     
  2. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    142
    Not sure if it is what you mean, but in SmartFoxServer we already have something along those lines.
    It's the Sign Up Assistant component, which provides a highly customizable API that assists developers in creating a database-driven sign up system, without the hassle of writing their own database access code. This componente can also be paired with the Login Assistant component, an helper class which similarly assists in creating a database-driven login system.
     
  3. Serinx

    Serinx

    Joined:
    Mar 31, 2014
    Posts:
    534
    Playfab is a good option for this, it's free to use up to 1000 MAU. I'm trying it out right now in conjunction with Photon for the gameplay syncing and it looks like it meets all of my needs so far.

    Playfab handles player authorisation, characters, currencies, inventories and custom data. I think they're working on a realtime feature but I haven't looked too far into that.

    I was trying GameSparks out and it looked alright, but since Amazon took over about a year ago, it looks like their support for indie developers is lacking so I moved away from that.
     
  4. Serinx

    Serinx

    Joined:
    Mar 31, 2014
    Posts:
    534
    @F-R-O-S-T-Y
    Thanks for that, I'll add the link in the main post
     
  5. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    265
    I agree! Let's add it to the list in the OP.
     
  6. Vancete

    Vancete

    Joined:
    May 3, 2010
    Posts:
    180
    Which ones works with WebGL? That would be interesting thing to know
     
  7. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,263
    Mirror :)
     
    Vancete likes this.
  8. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,145
    MLAPI runs on Unity 2017 and later. You can make it run on Unity 5, but not out of the box. It works with .NET 3.5 and .NET 4.6 and supports WebGL
     
  9. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,213
    PUN does. Bolt doesn't.
     
  10. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    142
    SmartFoxServer does. Client-server connection can be WS- or WSS-based.
     
  11. ashokdamani

    ashokdamani

    Joined:
    Nov 30, 2016
    Posts:
    1
    How is this different/better than unity connected games (replacement of unet)?
     
  12. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,145
    Better:
    * Easier
    * More support
    * Better documented
    Different:
    * Every way. It's an apples and oranges comparison.
    Worse:
    * Performance. However comparing libraries similar to the MLAPI I have yet found any lib that is as performant as us. Especially not concidering the feature set.

    The MLAPI is a high level library, it does high level things and interacts closley with the engine. It can handle object spawning and such for you.
     
  13. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,400
    Mirror has some ok example scenes demonstrating some of supported features, albeit the multiscene one is broken in on 2019.1.. MLAPI has an example that maybe but probably doesn't even work as it was last updated a year ago? I know I've ask before but you should really keep some updated example scenes that demonstrate the features, it's just a lot easier to see things working, than try go through putting together something from bits of documentation all over the place.
     
  14. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,145
    I understand, the MLAPI's current example is very outdated and should not be used as per documentation.

    Since you really value examples, I would love if you could message me in private what you would value in examples. It's the one thing the MLAPI is lacking in. But I honestly think it's because of our goal with the library, which is very far from what my perceived goal of Mirror, Photon and a few others are.
     
  15. Artaani

    Artaani

    Joined:
    Aug 5, 2012
    Posts:
    410
    And as always, such comparison lists does not contain the most unique one:

    TNet
    Pros:
    - Unique "make multiplayer and receive save load for free and without efforts" feature
    - Battle tested on games Windward and Sightseer (created by developer of these games)
    - Almost out of box support for huge multiplayer open worlds (more than 100x100 km)

    Cons:
    - Out of box does not supports parenting of one networked object into another (but with commenting a few line of code it became possible)
    - Some kind limited \ inconvenient for games which have many hand-made levels (scenes) with manual level design (but very powerful for open world procedural games)
    - Not free (95$) and demo \ free version is not available
     
    Last edited: Apr 28, 2019
    Serinx likes this.
  16. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,145
    Surley €84 is a con?
     
  17. Artaani

    Artaani

    Joined:
    Aug 5, 2012
    Posts:
    410
    Good point, thanks. Updated.
     
    TwoTen likes this.
  18. z3nth10n

    z3nth10n

    Joined:
    Nov 23, 2013
    Posts:
    39
    Has anybody feedback about Forge Networking?? This is an interesting topic. Thanks!
     
  19. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,145
    Honestly, in my eyes Forge is one of the networking libraries that fall into the same category of SmartFox of being underappreciated.
     
  20. Game-Cod

    Game-Cod

    Joined:
    May 28, 2018
    Posts:
    2
    Pretty sure unity's new networking asset is called multiplay.
     
  21. ivan866

    ivan866

    Joined:
    Dec 28, 2018
    Posts:
    2
    I confirm that RakNet is still possible to work with Unity - and always will be, since it is an external DLL lib. Nobody and nothing can break your dependency. The only issue every developer has to go through once is cpp name mangling.
    Plus, RakNet has well documented code and Doxygen-generated pages are perfect.

    Forge dependency is completely broken since 2019.1, because they dropped UNet which it was relying on. End of story.
     
    Joe-Censored likes this.
  22. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,145
    Replacing the LLAPI with something else is not hard. It’s not end of story. The MLAPI did that in a adaptable ”transport” system ages ago, shorly after Mirror and then HLAPI followed the same pattern. It’s easy to do.
     
  23. oomeroo1999

    oomeroo1999

    Joined:
    Jun 26, 2019
    Posts:
    7
    Hi. I know it's a very old topic but I wonder what's this solution he uses in this tutorial :


    He uses TcpListener and TcpClient. Writes his own Server and Client script. What's this solution and is it right to use it on MMO games ?
     
  24. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,682
    In such game like chess and other turn based games, you don't need to worry about lag compensation, prediction etc. In MMO, FPS and others, that is different story.
     
  25. oomeroo1999

    oomeroo1999

    Joined:
    Jun 26, 2019
    Posts:
    7
    Thanks for answer :) I learned that I shouldn't use it : https://forum.unity.com/threads/how-to-finish-a-completed-multiplayer-game-project.715622/

    So I will use Photon or something else. There are lots of things I must change in my project...

    By the way, I saw DarkRift Networking 2 in the network solutions. It offers unlimited users for free. I think I will use it.

    My game looks like this one : https://image.winudf.com/v2/image1/...A3ODQ3XzA2MQ/screen-0.jpg?fakeurl=1&type=.jpg

    Should I use DarkRift Networking 2 ?
     
  26. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,014
    As the author of DarkRift, I would say yes. But then I might be a little bias :)

    In all seriousness though: DarkRift takes a lot more work to get to an initial version but gives you a lot more freedom in the long run. If you're new to networking I usually suggest that you start with something higher level such as Photon; if you find it to be too limiting later on then port over to DarkRift! That's not to say you can't start straight away with DarkRift, there's plenty of people who have!
     
  27. Shablo5

    Shablo5

    Joined:
    Mar 2, 2015
    Posts:
    24

    Darkrift 2 will at some point eclipse Darkrift1 and the original will cease to exist, yes?
     
  28. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,014
    The original has already been deprecated and almost all users now use DarkRift 2!
     
  29. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,511
    TCP sockets can be used for an MMO. You're talking about building your own networking system on top of that, so get ready for a lot of work.

    Photon I suppose could be used for an MMO in theory, but that is not what it is designed for. Photon is designed for separate matches between a relatively small number of players. I think I remember Photon's website recommending keeping it around 8 or fewer players per room, which is effectively per match, unless you really know what you're doing on limiting network traffic to the absolute minimum necessary. They use soft bandwidth caps per room. (I'm not an expert on Photon, so maybe things have changed since I last got up to speed on them)

    A match based MMO like World of Tanks could be made with Photon, but with fewer players per match. An open world MMO though I don't see how their system is set up for that kind of thing.

    Generally when building an MMO you're going to be building a whole lot of custom systems for networking, and doing a lot of network troubleshooting. I'd suggest using a API which provides all the source code so you're not banging your head against a black box, or developing your own on top of sockets. TCP sockets again could work well if your game is not very fast paced, and most of the data you are sending needs to be sent reliably anyways. If most of your data doesn't need to be sent reliably, like if you're sending a ton of transform/rigidbody updates, or if the game is on the faster paced side, then TCP isn't optimal. In that case you're probably better off going with a UDP solution.

    Just as a personal example, the MMO I'm building over 3/4 of the traffic is transform updates, so TCP would be a poor choice for me. After initially building it on Unet (and before that the prototype on uLink) I've been burned on either end of support or networking API bugs I can't actually look at to see what is going wrong, because of closed source. So I went with UDP sockets in my case and built a whole network API on top of that with all the features/functionality my game needs and addressed some annoyances I had with other API's so they weren't annoyances anymore. YMMV

    Whenever you push the limits, and building an MMO means you're pushing the limits, expect to have to do a ton of custom work, where there aren't going to be drop in solutions for your problems.
     
    Last edited: Jul 25, 2019
    nirvanajie and tiggus like this.
  30. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,213
    I want to add a few details that got lost:
    In most "Photon" games, Photon Unity Networking (PUN) is used. This is pretty much as described above but you can get 16 to 20 players out of if, if you put some effort into the networking. PUN is a very generic client side package and it's simplicity is the focus. It works without server-side coding but can be combined with server plugins, too.
    Aside from the Photon Cloud, we offer the Photon Server SDK and the Realtime API on the client side. We use both in PUN but that is only one use case. The game Albion Online uses the Photon Server and has 500 players in a single fight. Of course, the team heavily modified and optimized their server-code but it's running on Photon Servers.
    The point being: Photon is not equivalent with PUN.
     
    Stanchion, Joe-Censored and tcmeric like this.
  31. tcmeric

    tcmeric

    Joined:
    Dec 21, 2016
    Posts:
    181
    @tobiass , thoughts on this comment about difficult to implement cheat prevention (compare to other options).
    Note: I am a PUN 2 users.
     
  32. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,213
    In our experience, cheat prevention is always difficult.

    If the game is not truly deterministic, you need a dedicated server which is running the logic server-side.
    Yes, when you build a game that's hosted in-Unity, you can run it on a dedicated server and prevent cheating. Unless a cheater finds a loophole. As long as you run all the instances on your own machines.

    For PUN it's extra work to make the server aware of the game logic and state. This is hard for cases that need the scene to detect the cheat, as the server does not run Unity. If the game logic does not dependent on the scenes and assets, the implementation may actually be simple and more lightweight. You could implement a C# simulation of the game and run it in the client and server.
    If you want full blown cheat protection with scenes and physics involved, PUN is probably not the best choice, yes.
    If you do a card game (e.g.) it's relatively simple to write a Photon Server Plugin and run it per room.

    Admittedly, PUN is not a very safe option by default, as the clients are authoritative. Quantum has several benefits in that regard. Bolt on the other hand is in-Unity hosted.
     
    Stanchion and tcmeric like this.
  33. oomeroo1999

    oomeroo1999

    Joined:
    Jun 26, 2019
    Posts:
    7
    Thank you all so much. I looked at dark rift documents and I realised that Photon is much easier. Also I couldn't find tutorials about dark rift. For someone newbie like me, it's better to start with Photon I guess.

    But I will learn Dark Rift someday...
     
    Joe-Censored and Jamster like this.
  34. Shablo5

    Shablo5

    Joined:
    Mar 2, 2015
    Posts:
    24
    Any example games you can point to that are public and proudly using darkrift2?

    On a different note, i'm currently working on an RTS/sim game hybrid, and I have no experience with multiplayer. Just picked up a book, working through it with sample projects, but I wanted to know if there's a tried and true solution that I should bark down once I get through the basics? Here's what's important:

    Client-server. No lockstep. Cheat prevention. Multiple persistent servers with few players (similar to the minecraft model with no master server). Ideally not super hard to get into, a decent amount of documentation. I don't need tutorials, I just need solid docs. A ton of the compute is done server side. I'm thinking of putting it on the cloud, but I just don't know enough yet. In terms of cloud, Playfab/azure seems cheapest.

    Thoughts? Any veterans have any input? I am inspired by this networking solution (client-server, all compute on server, etc, just not sure what solution plays friendliest with this type of server architecture https://www.gamasutra.com/blogs/Gaf...346598/Satisfactory_Network_Optimizations.php)
     
    Last edited: Jul 26, 2019
  35. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,014
    Sure! Here's two that are currently available on Steam!
    Koliseum Soccer VR
    Ignis Duels of Wizards

    As for your personal game, Legion TD 2 is an RTS(ish) game running off DarkRift 1 which has a very similar architecture to DR2.
     
  36. Shablo5

    Shablo5

    Joined:
    Mar 2, 2015
    Posts:
    24
    Does the move to DOTS/ECS pose problems for you or users of Darkrift2 in the future?
     
  37. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,014
    As far as I know it doesn't. DarkRift doesn't actually depend on Unity (it'll work for any .NET application) so there's not really much to update for it. Obviously if there are changes that need to be made they will be!
     
  38. F-R-O-S-T-Y

    F-R-O-S-T-Y

    Joined:
    Mar 22, 2013
    Posts:
    234
    I updated the networking frameworks comparison google document (link), and filled out the Dark Rift 2 sections. Plus added an additional section to the Master server description.
    At the top of the document I also added a link to an excel sheet with a side by side comparison of some of the networking solutions available.

    Link to the excel sheet

    Both docs are still a work in progress and I have not received confirmation on some of the info I've written there (marked with light blue background color) but nevertheless, it should offer a good high level comparison.

    I've yet to do performance tests and check the overheads of using these frameworks. Perhaps some time in the future I might be able to do this.
     
  39. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,014
    Nice documents! They're an excellent resource for the community!

    I've added a few comments to clear up some of the unknowns for you :)

    There's also some very good benchmarks here (mainly of transport libraries) that may be of relevance
    https://forum.unity.com/threads/ben...dgren-miniudp-hazel-photon-and-others.512507/

    Jamie
     
  40. Serinx

    Serinx

    Joined:
    Mar 31, 2014
    Posts:
    534
    Jamster likes this.
  41. F-R-O-S-T-Y

    F-R-O-S-T-Y

    Joined:
    Mar 22, 2013
    Posts:
    234
  42. Colin_MacLeod

    Colin_MacLeod

    Joined:
    Feb 11, 2014
    Posts:
    86
    @Serinx Thank you so much for putting together the doc - while we wait for Unity's own new solution to flesh out, choosing a Unity networking solution is complex at the moment, so it really helps to have some neutral, well structured analysis.

    What about SpatialOS (https://improbable.io/spatialos) - did you consider that?
     
  43. Serinx

    Serinx

    Joined:
    Mar 31, 2014
    Posts:
    534
    @Colin_MacLeod Hey, no problem. I just started the thread and everybody else helped to fill it out!

    I haven't heard of that one, I'll have to check it out though, looks very featureful!
     
  44. Colin_MacLeod

    Colin_MacLeod

    Joined:
    Feb 11, 2014
    Posts:
    86
    Yes, it is. I've been experimenting with it a bit and like it a lot. It uses their own ECS implementation under the hood and I'm still grappling with how to make that work for my app.
     
  45. Vancete

    Vancete

    Joined:
    May 3, 2010
    Posts:
    180
    It's cool but expensive as hell.
     
  46. Colin_MacLeod

    Colin_MacLeod

    Joined:
    Feb 11, 2014
    Posts:
    86
    Oh yeah? I couldn't really get a handle on pricing. What did you find? At what level (i.e. player count) are you running or projecting?
     
  47. Serinx

    Serinx

    Joined:
    Mar 31, 2014
    Posts:
    534
    @Colin_MacLeod Looking at their pricing page - it costs $0.54 per hour per 100 player instance.

    That would add up to around $389/month to keep a 100 player instance alive 24/7...
    This model would only really make sense if you had a massive, active playerbase and/or a subscription-based game.
     
  48. Colin_MacLeod

    Colin_MacLeod

    Joined:
    Feb 11, 2014
    Posts:
    86
    @Serinx Thank you so much for decoding this for me. It seems incredible that this is the cost - especially given the Photon PUN v2 rates
     
  49. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    870
  50. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    870
    Dots are already on packages any sample ? somewhere