Search Unity

What to use for making multiplayer game?

Discussion in 'Multiplayer' started by CoolCosmos, Jan 3, 2021.

  1. CoolCosmos

    CoolCosmos

    Joined:
    Nov 21, 2016
    Posts:
    247
    Hi there, i remember that there was a multiplayer service by unity but i can't find it anywhere.

    I want to make a simple multiplayer game however, i don't know how i can do this. Which services do you suggest me to use?

    PS, i would like to do it with c#...
     
  2. CreativeChris

    CreativeChris

    Unity Technologies

    Joined:
    Jun 7, 2010
    Posts:
    457
    Hello

    What genre of game are you looking to create?

    Unity has MLAPI as a C# NetCode library, full open-source (see sticky post on the multiplayer forum).

    There are also several 3rd party solutions worth evaluating such as Photon, Mirror, Forge etc. It all depends on what you are most comfortable with.
     
    CoolCosmos likes this.
  3. CoolCosmos

    CoolCosmos

    Joined:
    Nov 21, 2016
    Posts:
    247
    Hi @CreativeChris Thanks for reply. I want to make a 3v3 shooter game where people can create own rooms or join global rooms. The game won't be complex. They will only shoot and destroy each others. I have no clue about those solutions. Which one would you recommend ?
     
  4. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    279
    CoolCosmos likes this.
  5. CoolCosmos

    CoolCosmos

    Joined:
    Nov 21, 2016
    Posts:
    247
  6. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Figure out what requirements you have for your "simple multiplayer game" (there are no simple multiplayer games). Do you need LAN play? Matchmaking? Dedicated servers? Player hosted? How much ongoing expenses are acceptable? etc, etc. Then look at the available solutions, and try out several which meet those requirements.
     
  7. CoolCosmos

    CoolCosmos

    Joined:
    Nov 21, 2016
    Posts:
    247
    I chose mlapi to use. I want to do matchmaking for my game. Do i need to hire a server to bring two players together on the room by matchmaking? I am newbie to multiplayer systems so if you can show the way for me to move on, i would be happy.
     
  8. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,363
    I made my multiplayergame for Steam several years ago and hence used their lobby/matchmaking services. You can download their SDK. There is a c# version called Steamworks dot net.
    Also, there is the new Epic Online Services but that is harder to use (and I haven't worked out how to use it!)
    Or you could probably write your own lobby as a simple web-app.
    IMO Steam is the easiest way to go.
     
    CoolCosmos likes this.
  9. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845

    Epic has been fantastic so far, I used Unity's for years, and different libs and yet to be impressed with any of them. Unreal uses a typical AAA, solution. Now if someone is not making a game for PC..... I recommend to look at TNET. you can run it LAN, WAN base, or host your own server. TNET is one I been most impressed with for Unity so far. Made by Micheal from NGUI, which is also a fantastic tool.. I used that over a decade myself.
     
    CoolCosmos likes this.
  10. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845

    see above
     
  11. SoftwareGeezers

    SoftwareGeezers

    Joined:
    Jun 22, 2013
    Posts:
    902
    I'm following the internet paper-trail of EOS Unity integration and I see you posting here specifically about TNet on top of your posts in the EOS thread. I have experience of TNet and intend to use it for a cross-plat P2P title, mobile+PC first, potentially then on consoles. How does TNet work with EOS? Does it make sense to integrate EOS and use that for lobbies, and then TNet for the actually netcode? EOS sounded like a great idea when announced instead of 17 different service interfaces, but guidance seems very Unreal focussed.
     
  12. Punfish

    Punfish

    Joined:
    Dec 7, 2014
    Posts:
    401
    That thread is super old. Most of those are legacy now. Fish-Networking, afaik, is the most efficient and feature rich free solution available at the moment.
     
  13. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    460
    There is a EOS transport for fish networking?
     
  14. Punfish

    Punfish

    Joined:
    Dec 7, 2014
    Posts:
    401
  15. SoftwareGeezers

    SoftwareGeezers

    Joined:
    Jun 22, 2013
    Posts:
    902
    Somewhat biased comment! As I see it, Fish-Networking is server based which isn't the only option for multiplayer and isn't the best in all cases. A lot depends on the game type.
     
  16. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    460
    You can make player hosted or p2p games with fish net

    Im currebtly making a p2p game, and it works like a charm
     
  17. Punfish

    Punfish

    Joined:
    Dec 7, 2014
    Posts:
    401
    Definitely bias, but not at all untrue.

    There are a massive number of features Fish-Networking supports that other solutions choose not to, or simply cannot because of how they are designed.
    CPU performance is drastically better than other free solutions.
    Bandwidth used is significantly less than other free solutions as well.
    I cannot prove the following, but I believe my community would agree, that Fish-Networking gains fixes and features at quite a bit faster rate than other solutions in general. In the past 30 days there have been roughly 35 new features/enhancements as recommended by users.

    Personally, I do not think a lot of it depends on game type. There are things that I will say FishNet supports, and things I will say can be probably be done in FishNet. Supported 'things' would be something that FishNet has included technology and API for. Where-as things that could probably be done I think are doable but will likely require the user to build a system on top of FishNet.

    With that said, the only game type I'd potentially warn a user about before starting FishNet are fighting games, such as Tekken, Mortal Kombat, ect. They require a special kind of prediction and rollback system that FishNet does not have built-in. I do think it would be manageable to put such a system on-top of FishNet but that work is on the user.
     
    r31o likes this.
  18. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845

    well of course its Unreal focus its there engine, but they made a Unity plug in and access to Unity, I don't see Unity making an Unreal anything.. Its up to you which aspects of Tnet you want to use or not to use, this can depend on your game as far lobbies.


    I started using EOS the day it was given to us, as I'm also an Unreal user, Epic has shown to be proven to care about developers making games, Unity has NEVER shown to care about us... I speak the truth, and some Unity users decide to be bias about Unity, and most have never actually made anything before.. and they never used Unreal, if they did, it was for a few days.... I look for proven solutions... Not crap that is popular with no games released on the asset store.. Ever notice how many so called popular assets have very few to no games released? and the developer them selves don't use for a game they are making?? Sorry but that is a tech demo...

    So this is why its important to share the information with both Unreal and Unity users so they can decide what is best for them. I don't ever sugar coat anything if you ever see my posts I don't jump on band wagon on popular assets, or tools like Photon, or other ones. I have used every library out there... in real games. So what is important is to use proven tools.. .Unreal is proven due to the thousands of AAA, indie companies using. TNET is proven, due to the developer himself using it and he is very active in his Discord.. Photon is ok, don't get me wrong, but its expensive and I in game development we need source. Something else Unreal you get source through out the engine and for free... To many Unity services, you don't get source.... in game development, its makes things much harder when people want to lock there source down...

    Bottom line these Unity asset devs who want to lock everything down, need to stop, if they are scared of people stealing there source so bad, they need to stop selling work.. if someone wants to steal it they will do it no matter what, so at the end of the day they are screwing over, developers trying to make a game and making honest developers work that much harder.

    Sorry for the little rant , but it gets annoying.

    Back to Unreal networking /EOS, and TNET, its the two I like the most .


    I always post about TNET, for the Unity users, that are using Unity. So I tend to share what I use.

    My current game as i'm no longer a contractor is a Unreal game that uses EOS and Unreal networking. Fast pace FPS shooter, with fast pace combat. PC, Console and MOBILE, Cross platform.

    TNET, mobile game. Unity. (kids are working on it) I help with the net coding and EOS integration.
     
    Last edited: Jun 17, 2022
  19. Punfish

    Punfish

    Joined:
    Dec 7, 2014
    Posts:
    401
    TNet has a $90 price tag on it which seems a little steep for something that's somewhat limited. I'm basing this assessment off the fact that I had a hard time finding any official or note worthy information on TNet, which isn't great because that means resources are just as likely scarce. Again, this is just my initial assessment. I am not saying it is a bad product as I do not know enough about it.

    I also think I might be missing something too. You said developers need to stop worrying about their source code being stolen, are you referring to EOS implementations? Because there are a lot of open source implementations of EOS. The main issue with EOS is that the documentation is not great, just as it always is with epic games products. Another concern about EOS is that the performance is absolutely terrible. They released the kit for unity with a ton of garbage collection and the amount of resources used to simply send a packet is quite high compared to other libraries.

    This does not mean that I am hating on epic games. I actually really like them as a company and I always have even before Fortnite came out. But I also used to develop on unreal engine and from then to now nothing has changed as far as performance and documentation, which is disappointing.

    Finally, I do not believe it is fair to compare unity to unreal engine. They each have their own advantages. I'm not denying that epic games is generous with their services, but you also have to keep in mind that unity is bleeding money every quarter while epic games is doing quite well due to Fortnite. It's probably not as easy for unity to release free services and maintain them; not that we really want them getting sidetracked anymore than they already are.
     
    r31o likes this.
  20. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845

    TNET is NOT over priced, its done by a experienced developer which is PROVEN for years, if you hired a contractor it would of cost you x20 more... If you been on Discord and seen the info there and seen how active Aren is, you would not be saying this, so you couldn't of look to hard.... but like I said I could say the same thing about yours...

    , its used by the developer himself, which on Discord plenty of information, So if you are just going off what you see of an asset on a page, this tells, me I could say the same about your asset, which I have used as well.... So, I would disagree and I used both of them.... but I normally don't say anything..

    It is fair to compare Unreal to Unity... Unreal is used by 70-80% of the AAA industry and assets are NOT needed ...for anything... So not a penny needs to be spent, where Unity you do, need to spend money or your own time, for basic things like networking, decals, Streaming, Lighting, baking, etc.

    I have used Unreal for well over 20 years professionally on many games, and I used Unity for nearly 15+ years since Unity 2, so I'm in the position to do so. I mention the reasons I like both engines, but I don't like using Unreal vs Unity nonsense, as they are used for different reasons.. But nothing wrong with comparing them...... You should be when making a game...... You should be looking at any software for any game your making and decide on what is best before picking the engine, software and so forth... I consulted , mentored for years, this is super important to compare what is best for your game and your team....
     
    Last edited: Jun 22, 2022
  21. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845
    No talking about Developers in general who put out DLL crap... Nothing to do with EOS, but having source in game development is important, if someone says its not, tells me they have NEVER released a game in there life, or been a apart of one, because this is super important, Unless its a basis straight forward game.....

    EOS, is so easy to set up my 8 year old is setting his up now and he has been coding for 2 months....So, not sure why you can't read the source, its clearly documented in the source code, every line nearly of Unreal engine is.....So docs are set up to read what is needed.... Download the source and every line is spelled out for the most basic coder every line just about....

    The source engine is the same way..... I mentor, and taught many Unity and Unreal users over the years and Unreal has the most commented detailed source I have ever seen in this industry , and I used many game engines, in my career .



    What are you talking about??? Epic was doing very well , LONG before Fortnite, which is how they been able to do what they do, They make games, Unlike Unity... They work with Developers who make games, Unlike Unity... So not really sure where you get this nonsense, but my guess is some bias, Unity user who used UE for an hour or so.... But Epic has been successful for years...... Well before..



    As far as your comment about advantages, yes I would agree, but every time I mention another engine, I notice some bias user gets there panties in a bunch..

    EpIc took the time to support Unity users, which is a good thing, so not sure why that is a bad thing.. and its free, and works very well.... as far as EOS, its way easier than STeam to set up, and its free. Now saying that Steam is more mature , but EOS in some ways is not to far off. They are moving fast to give the support we need, if Unity had made something like EOS, it would be done in 10 years... not 1-2 years as Epic has shown. So Unity users should be happy they have another option and not complain about it....
     
    Last edited: Jun 22, 2022
  22. HydraOrcUnity

    HydraOrcUnity

    Joined:
    Jan 31, 2021
    Posts:
    2
    I also have chosen TNet and I must say it is great.
    DataNode is like an object in JavaScript, which can contain dynamic fileds, so you dont need creating custom classes or structs for all your data structures, and running so fast.
    Buffer allows you to send packets of data not only to TNet server, but to any additional custom server you would like to add to your infrastructure.
    TNObject with RFC and RCC is very easy, has everything out of the box, including object pooling.
    You can host the server by yourself and just scale your VM cost based on how much load you get, but you can start with pretty cheap 5$ solution or even try to put it on a free heroku server.
     
    Recon03 likes this.
  23. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    460
    As a plus for EOS, it doesnt need to put your game on EGS, you can use it for free as you want, and it supports mobiles and consoles, which steamworks doesnt.
     
    Recon03 likes this.
  24. Punfish

    Punfish

    Joined:
    Dec 7, 2014
    Posts:
    401
    I checked into the DataNode object best I could without seeing the source code. I cannot imagine that's possibly anywhere near as efficient as specifying types.

    The documentation is actually API, which is unfortunate because that's not terribly helpful when getting started.

    RFC/RCC seem equivalent to todays solutions RPCs

    I want to re-iterate that I'm not implying anything negative, other than I do not understand what makes TNet better than other options, especially at $90. Please do educate me on the matter, I will not be offended.

    I get asked about other networking solutions **all the time**. Sometimes I do guide people to other solutions when it makes sense. Far as I see TNet though, it's a blackbox.
     
  25. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845

    100%, using Datanodes....
     
  26. SoftwareGeezers

    SoftwareGeezers

    Joined:
    Jun 22, 2013
    Posts:
    902
    I've not used it, but I was reading about it yesterday and it sounds very smart. It's a flexible, extensible datatype without effort, and can be handled as either readable text or compressed data. As the docs describe, it allows you to add more variables and data without the risk of breaking things. Dunno if you found the overview as I didn't without following a papertrail, but here it's described:

    https://docs.google.com/document/d/1JDpL25vR0NL3A43C8T_hE8MMX4dSYH4G8u87L3ozIik/edit
    The ability to assemble arbitrary data and compress it to send sounds fabulous to me and investigating datanodes is on my Todo list.
     
  27. Punfish

    Punfish

    Joined:
    Dec 7, 2014
    Posts:
    401
    I just read your link. From the sounds of it DataNodes are likely serializing similar to a json. Might be convenient but that's definitely a massive hit on bandwidth and no doubtedly performance too.

    Imagine passing in a few booleans, which can normally be serialized in ~1 byte. With the structure like that you are most likely using 1 byte per boolean + number of bytes required for object and title formatting.

    I suppose it comes down to convenience over performance.
     
  28. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845
    Having used Data nodes in practice, performance is not an issue ...I don't speculate on any tool I use, I use it...before commenting or assuming anything...


    and by the way TNet has both binary and DataNode serialization.. Binary is what is commonly used in UE.. Binary typically uses less space... Something I have used for years and years in many released games..
     
  29. Punfish

    Punfish

    Joined:
    Dec 7, 2014
    Posts:
    401
    I suspect very much there is an impact to both performance and bandwidth not seen in other solutions, simply because you cannot serialize changing data types at runtime without also including some sort of key as to what type they are. Not to mention the string lookups..

    But anyway, I am after all just speculating because I've not used TNet. I'm not going to spend $90 to confirm my suspicion but if the author would like to provide me with a free copy I can run some tests. I already have benchmark scripts I can utilize that I've run on other solutions.

    The data nodes thing peaked my curiosity and I wanted to understand better. I've developed a conclusion on data nodes. I don't wish to potentially misdirect this thread so I'll leave this as my last comment on the data nodes. I'd be happy to talk more via DM of you like.