Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Making a multiplayer game? Read this.

WarpWarp Member
edited June 2020 in Programming

So something I am noticing across the programming forum is that the "How do I do multiplayer" question is raised multiple times throughout the day, almost every day. The purpose of this post is to clear up some confusion about multiplayer, and how to implement it.

WHAT YOU SHOULD KNOW:

There is no universal way to implement multiplayer into Unity as of now. Many people reference the Brackeys "How to make a multiplayer FPS" tutorial as a guideline, but this should not be used as a way to implement multiplayer. In that video, Brackeys uses "UNET". This is Unity's old, legacy networking system that is being phased out.

If you make a game with UNET, that code will be obsolete and unsupported in less than a year. You can read more about UNET deprecation here.

Before I talk about options, I want to point out that networking is not only difficult, but it requires knowledge in C# and networking itself. Please make sure you understand how Unity works, and at the very least can program small games on your own, with minimal help from tutorials. If you dont know what you're doing, networking a game will hit you like a pile of bricks.

READ THIS ARTICLE! It has information about different networking protocols, and networking theory that will be imperative to your success!

OPTIONS:

Until Unity's new networking system is released, and complete, you're going to have to use your own networking code, or 3rd party software. Lets talk about the pros and cons of these.

PHOTON

  1. Photon is a tried, tested and solid option for networking. Its free on the asset store, relatively easy to set up, and has a ton of examples to get you going.
  2. Has a forum and developer support
  3. Uses a client-client model with a cloud server.

FORGE NETWORKING REMASTERED

  1. My personal choice, and what I recommend.
  2. Has built in NAT punch through software to allow for client server -> client models, used in games like Call of Duty.
  3. Free and open source
  4. Tons of examples, and a powerful, easy network wizard to set up everything.
  5. Works outside of Unity. You can use Forge to network anything.

YOUR OWN IMPLEMENTATION / C# SOCKETS

  1. You control what happens. You dont wait for updates, and you own the software.
  2. You understand whats going on, and can tailor it to your game.
  3. Much more advanced. Requires knowledge of sockets in C# and networking systems.
  4. Hard to make, and prone to error unless done well.

USEFUL NETWORKING INFORMATION:

Transmission Control Protocol - Wikipedia

Socket Programming In C#

Network Programming in the .NET Framework | Microsoft Docs

https://mirror-networking.com/

There are many more systems you can try and use, these are just popular ones you might want to try. If I made any mistakes please correct me, I am not an expert. I just see this question very often.

Comments

  • WarpWarp Member
    edited May 2020

    If you have any corrections, questions, or info about other software to put onto this list @Warp me, with a list of pros, cons tutorials etc and I will amend this post to reflect that.

  • thanks

  • Roby65Roby65 Member
    edited May 2020

    I never used it, but Mirror is popular too: https://mirror-networking.com/

    I personally went with the websocket approach when I needed multiplayer but I plan moving to one of those soon

  • WarpWarp Member

    @Roby65 I actually wanted to add Mirror to the list, but there is a letter limit. Im going to make a comment with some extra software people can use. Thanks!

  • that helps me a lot , but i believe that every big thing come by steps , as an amateur in game dev world i think we should make it step by step , muliplayer is an advanced level .

  • Forge also has a very helphulf community... You should join their discord even the creators of forge try to help you with any questions.

  • I have used both forge and mirror and I can say that both have absolutely great communities with devs ready to help anytime. I just find mirror easier to use, so I went with it, but your preference may vary.

  • MuradoMurado Member
    edited May 2020

    Nice Post, this should be pinned!

  • Sl0thSl0th Member
    edited May 2020

    I have recently had to make the decision of which path to take, and this post is very helpful to answer some of the questons I had. There is, however, still something I am unsure about - which is what Unity advices people to do. I haven't paid much attention to Unity's development the last few years, but from my understanding, this has been going on for a couple of years. And it will go on for one or two more, right? When you visit the UNET manual, you are told that it is deprecated and that you can see a blog post or FAQ to get more information. They have a flow chart that shows which system you should use, but it seems... Odd. And not very actionable. UNET will be deprecated, so it seems silly to pick that up now. But the new system is not at all done, and I have found next to no information about it (except for people explaining what it is). Unity's official web page on it seems more like an abstract ad with fancy buzz words than something that might be helpful.

    Does Unity have any actionable advice on which path to take? Or is it simply left up to the community to figure out some Thord party software in this 4-year void? Have I missed something obvious?

    Cheers

  • I do not know about "Unity's actionable advice", if they had one, we probably would have known it. But, the reason why mirror and forge exist is the void you mentioned. Mirror for example is better version of UNET, simply put.

  • WarpWarp Member
    edited May 2020

    @Sl0th

    That is exactly what prompted me to make this post, other than the people asking about it on the forum. Unitys manual has an entire section dedicated to UNET multiplayer, but at the top of every single page in the manual is a link to the deprecation page.

    I dont understand why Unity is treating multiplayer this way. Its a real shame too, because the new system will apparently not have good P2P support, which is what made UNET so great. The P2P relay system was awesome, because you didnt need to pay for servers. Now, it looks like they're leaving indie multiplayer in the dust.

    They don't have any official advice as far as i'm concerned, but I dont care. Forge is better than UNET. Photon is better than UNET. Mirror is better than UNET.

    I probably wont even check out their new multiplayer system. I dont trust them enough for it. Forge suits my needs, is open source, and has P2P capability, which is literally #1 when it comes to indie multiplayer.

    Ill be sticking with 3rd party software for multiplayer.

  • Sl0thSl0th Member

    @Fissioner @Warp

    I see. Thanks for the replies!

  • WarpWarp Member

    Happy to help!

  • @Warp This is a perfect discussion, thank you.

    June 2020 - I am trying to get ECS + NetCode working on 2+ physical devices and am struggling. I have tried all the samples at https://github.com/Unity-Technologies/multiplayer with no luck as well as the DOTS Sample, which works brilliantly with Thin Client bots, but even if I build a Server and Client build and have running on the same LAN, they just don't connect.

    I DID get the FPS Sample working perfectly with very little effort, so I could theoretically strip that down and start from there, but that seems a very hard way to get going. I'm happy to advise on how I did this if anyone wants to know.

    I also recently stumbled on DOTSNET, but haven't checked that out yet.

    Does anyone have a good way to get an absolutely basic ECS/Netcode mutliplayer actually working on 2+ physical devices on a LAN?

    Thanks all!

  • Thank you very much for this! It'll be super useful in the future, I'm sure! <3

  • I have been looking for networking solution for some time, trying the Forge Networking Remastered now.. thanks!

  • does anybody knows a tutorial series about full photon setup in unity.i really want it.

  • Search on youtube

  • gamedev64gamedev64 Member
    edited May 2021
  • kimimiielkimimiiel Member
    edited August 2021

    When a new web development company is being considered, it is important to look at the web development basics. In order to find the right company, it is helpful to consider the three basic web application basics: database, web application, and user interface. These basic web application basics include the three items that make up the web development process. Recommend view this review https://mlsdev.com/blog/top-custom-software-development-companies

  • I have recently had to make the decision of which path to take, and this post is very helpful to answer some of the questons I had. There is, however, still something I am unsure about which is what Unity advices people to do.


    I haven't paid much attention to Unity's development the last few years, but from my understanding, this has been going on for a couple of years. And it will go on for one or two more, right? When you visit the UNET manual, you are told that it is deprecated and that you can see a blog post or FAQ to get more information.


    They have a flow chart that shows which system you should use, but it seems... Odd. And not very actionable. UNET will be deprecated, so it seems silly to pick that up now. But the new system is not at all done, and I have found next to no information about it (except for people explaining what it is.

    Unity's official web page on it seems more like an abstract ad with fancy buzz words than something that might be helpful.


    <a href="https://sanjosecivilweddings.com/">San José Civil Weddings</a>

  • kimimiielkimimiiel Member
    edited April 21

    The business analyst is a critical member of a software development team https://mlsdev.com/blog/how-to-build-a-social-network-website-from-scratch. They are involved from the earliest stages of a project and drive initial due-diligence and requirements gathering. This person generates a comprehensive understanding of the operating model of the client. A thorough understanding of business is necessary to play this role well. But it is not always the case. For example, some teams don't identify themselves as agile, while others are more traditional.

  • LinneaGenghLinneaGengh Member
    edited April 30

    It's true. I am currently a 3rd year student at the Faculty of Information Technology, and I chose the topic of the course game development on Unity. From that moment I started to study this game engine and make small games. I wanted to make even a multiplayer game, but I ran into the problem you described. I wanted to make something like minecraft, focusing on https://servers-minecraft.net/minecraft-prison-servers , and I managed to implement many mechanics, except for the multiplayer system. I just looked at the Brackeys tutorial and was thinking about using unet, but now I'm not sure if that's a good idea.

  • kimimiielkimimiiel Member
    edited May 23

    Lack of space on phone memory is one of the major reasons causing app abandonment by the users. App streaming technology was designed to address this concern of mobile app users https://mlsdev.com/blog/devops-services. Just like video streaming, app streaming also enables the users to harness some features of an app directly from the app store, without downloading it. Therefore, App Streaming opens vast possibilities, for example, app developers can give a taste of their app's experience to the users without any installation hassles. This will potentially improve user retention as the user acquisition costs will also be hugely reduced.

  • In general, I believe that games of this level can only be mastered by experienced developers, such as https://sloboda-studio.com/. I have nothing about books, but still experience is more important. As for videos I could recommend this one https://www.youtube.com/watch?v=Tf66OFU7mzU .

  • AdeyLoriAdeyLori Member
    edited July 4

    When I started coding, there was so much information that it became overwhelming at one point, so I had this brilliant idea to search and read the resources for kids to understand everything better. Even if there aren't a lot of resources dedicated to kids, I found this platform with coding classes for kids, and everything became clearer. I would love people to create more content destinated for kids regarding this subject since most of them are using gadgets and love to comprehend everything about them.

  • GlanRiaGlanRia Member
    edited July 25

    Hello @keansargent


    AppStudio have a team of talented ios app developers with years of experience in the industry. We have successfully delivered high-quality apps for some of the world’s top brands. To know more about our services, please visit us at www.appstudio.ca and read our blog to get to know more about our practices and how we can help your business achieve success with mobile app development.

  • Thank you a great deal for this! Surely, it will be really beneficial in the future!

    drift hunters

Sign In or Register to comment.