Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Unet discontinuation.

Discussion in 'General Discussion' started by pod11, Feb 10, 2019.

  1. pod11

    pod11

    Joined:
    Jan 6, 2019
    Posts:
    37
    I've been planning to start learning unity for a long while, but got to it seriously just recently.
    Tracking whats going on i know there was Unet, and tutorials on how to make basic multiplayer over internet.

    Doing tutoials, and planning what i need next, i realized Unet was discontinued, and don't see any substitute, or tutorials anymore.

    Is there something im missing?
    Is there some tool ( and tutorials teaching how to set-up lobby etc) that functions like Unet?
     
  2. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    13,872
  3. pod11

    pod11

    Joined:
    Jan 6, 2019
    Posts:
    37
    It seems to be lacking " follow thru " tutorials for beginners, but i guess i need to put in some more time to find those myself.
     
    Last edited: Feb 10, 2019
  4. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    4,290
    Networking is one those things you might want to think about doing yourself. For the sake of full control and customization. We use a SDK for the lower level UDP reliable rpcs, NAT punchthrough etc, but the mid to higherlevel is written by us.
     
  5. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,359
    I agree that writing custom network code specifically for the needs of your own game is the best solution. I wrote all of my own network code on top of raw UDP sockets. It works better for my needs than any off the shelf networking solution.
     
  6. moonjump

    moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,271
    Writing custom network code may the optimum solution, but probably not the best solution for someone starting to use Unity.

    Networking is already a difficult choice for learning Unity, but this is probably not a great time to start in the UNet replacement process.

    However, as a tutorial was asked for, Unity's FPS Sample is the obvious choice: https://unity.com/fps-sample
     
  7. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,504
    UNET depreciation in a nutshell :
    - Unet was not up to the task so it is depreciated.
    - Unet will still be available using Unity Relay services until Spring 2022, the latest editor version supporting it will be 2018.4 LTS, so unless Mirror users invest a fortune in servers infrastructure this will be the EOL for this solution as well.
    - No official production-ready replacement is available yet.

    I kindly suggest that the official replacement for UNET should be named "stay tuned".
    Unet Depreciation FAQ
     
  8. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    13,872
    There are a couple reasons for this. First, networking is not a beginner topic. Most devs assume that someone looking for networking solutions has a basic understanding of Unity and that they're not just starting to use it for the first time.

    Second, Mirror is Unet. Any tutorial you would use to learn Unet is a tutorial you would use to learn Mirror. Like the thread for Mirror says the process of switching from Unet to Mirror is literally a five minute one. If you need tutorials beyond the basic guide it means you're in way over your head.

    Unity Relay has been stripped out of Mirror for a while now. If you need a relay server you can use the following community developed open source relay server. Just spin up a VPS (I recommend Digital Ocean as they have a $5/mo tier that offers 1 TB of bandwidth), following the instructions to upload and start the server, and you're good to go.

    https://github.com/MidLevel/MLAPI.Relay
     
    Last edited: Feb 10, 2019
  9. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,504
    Thanks for the info @Ryiah, I appreciate that you are sharing this.
    I do not have the means or the interest to investigate this solution, my first impression is that it seems very nice for setting up a game jam game or a game prototype.
    Do you know if any bigger projects/studios use this solution - aka is it battle tested ?
     
  10. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    13,872
    Ippokratis likes this.
  11. pod11

    pod11

    Joined:
    Jan 6, 2019
    Posts:
    37
    Yea, as you said i am thinking ahead of what i'm actually able to do, its just that i know i will need to set-up some network functionality eventually.
    Thanks for your time and help.
     
  12. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    4,290
    If you are new to unity but a senior developer that's fine. But if you are both new to unity and are a junior Dev I would stay away from networking. Atleast until you get the hang of things.
     
  13. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    5,410
    The fact that they decided to deprecate unet while giving us nothing in its place is still mind-boggling to me.
     
  14. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    1,636
    Well, to be honest it never was production ready. Nor HLAPI, nor LLAPI (hello memory leaks!).

    It was okay to use to some degree of complexity, and after that point it usually turned a project into a nightmare.

    Mirror is probably best that happened to it. (Previously HLAPI Pro)
    I've used that one and Master Server Framework to create decent client - server infrastructure, but unfortunately that project that I was working on was completely shutdown (and probably for good).

    Back to OP's question:
    For small scale / semi-simple games it's okay to use Mirror, plus something to distribute / connect game servers to like Master Server Framework (dedicated server required to run on), or even GameSparks should work well as a database (up to 100k MAU I think?).
    Playfab is probably good too, although 1k MAU is too small for the average userbase.

    Alternative solutions: Use Photon, or Forge.

    Also, do not use tutorials from youtube on networking. If you can't do it by yourself - you'll get stuck really fast.
    Either dig into manual / scripting API, or go do something way simpler.
     
    Kiwasi likes this.
  15. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    4,290
    I cant speak for Forge in recent time. But we got burnt by it. Tons of bugs, and the code quality was very low. Wouldnt trust it sadly.
     
  16. theuncas

    theuncas

    Joined:
    Feb 21, 2015
    Posts:
    23
    Hello, Yes, you're right Unet will be useless. There is a lot of alternative...
    I'm currently working on some projects where i use DarkRift2 for the Network part.

    DarkRift is very fast ans reliable. 2 ways of sending messages (TCP and UDP)
    There is a free version and a pro version (90$)

    I'm writing articles on how to implement it quickly and efficiently

    Link to articles

    Don't hesitate to ask your questions.
     
  17. unity_15692004655

    unity_15692004655

    Joined:
    May 31, 2018
    Posts:
    1
    Oh God... I'm doing graduation project using Unet. So even if it's depreciated I can still using it(for a few months) in older version and finish my project right?
     
  18. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    1,636
    Stay on the LTS version, or upgrade to Mirror instead. (Might cut down some nasty bugs as well).
     
  19. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    5,435
    I ended up doing the same after first building the game around Unet then running into low level problems I could not work around. It is certainly a lot nicer when hitting a network issue to just go directly to the code I wrote and understand, rather than play guessing games regarding what is going wrong with this black box low level networking system built into Unity.
     
  20. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    4,290
    We went with a ready to go low level UDP solution, though highly customizable, for example we can choose precisely what a reliable channel should stretch over. For example in most cases that means items in our case. So if a item misses it's reliable message not all items networking is delayed only that item for example a firearm.
     
    Joe-Censored likes this.
  21. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    5,435
    That's an interesting approach. I went with a channel system with message queues per channel, so a reliable channel with a missed message results in messages for only that channel being blocked until the missed message is received. So for messages I need reliable but do not want other unrelated reliable messages to block, I can put them on their own channel.

    I also implemented automatic message fragmentation on all channels so I don't have to pay as close attention to the size of messages I'm sending (but in practice reliable messages I know to be very large I put on a channel set aside for them, so a missed fragment from a very large message doesn't block the channel).
     
    AndersMalmgren likes this.
  22. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    4,290
    Yeah, thats how we do it too. But on a higher level that channel is in our case one item. But keep in mind, our game is a complex VR game. Each item is much, much more complex than in a standard desktop game. For example a sniper rifle you actually operate the bolt. etc

    edit: The items variable sync is on a unreliable channel and is not affected by reliable RPC btw
     
    Joe-Censored likes this.
  23. RichardKain

    RichardKain

    Joined:
    Oct 1, 2012
    Posts:
    1,217
    How will this discontinuation affect a project that is focused only on using Unity's current networking tools for a local-area implementation? I am specifically interested in connecting and communicating between devices on a local-area-network, and only over that network. (no connecting to on-line servers) Would it be possible to continue using an existing or older version of Unity for such purposes? I understand that future releases will be deprecating the existing networking library, but my projects don't currently require any of the more advanced features that the upcoming releases are offering. Would it be possible to just pick an existing Unity version and nail my project down to that?
     
  24. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    5,435
    When the Unet API is removed around 2019.2 or .3 as last mentioned by the Unity devs as the likely removal versions, if you are using Unet still your project won't be able to move to those Unity versions unless you replace the networking API with an alternative. If you have no plans to move to those editor versions when they come out, then you shouldn't be affected by Unet's removal.

    If I was still using Unet and didn't want to get off it, I'd stick to an LTS release (2017.4, 2018.4) and not move to 2019.1 even though Unity devs have said they decided to postpone Unet's removal (origianlly the plan was to remove Unet in 2019.1).
     
  25. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    13,872
    Alternatively you could migrate to the community fork Mirror. One of the main advantages to Mirror is that it's not using the LLAPI like the original. Instead it's using an MIT licensed low level API known as Telepathy.

    https://github.com/vis2k/Telepathy
     
  26. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    5,435
    I didn't mention that because he mentioned it is a LAN game, so I was making a guess he was using network discovery. I doubt Mirror has that implemented, but I could be wrong. @vis2k would know of course.
     
  27. RichardKain

    RichardKain

    Joined:
    Oct 1, 2012
    Posts:
    1,217
    Thank you for the clarification, that helps.

    Eventually, I will likely start learning whatever networking system they use in the newer versions of Unity. But for the time being, I will likely just stick to one of the stable releases, as you recommended, and keep going with the networking solution I'm already familiar with. The networking needs of my current project are very modest. I'm keeping it intentionally as bare-bones as possible. And I had already prototyped out the core functionality successfully, so I have no need to upgrade. I'm probably going to target 2017.4 for the moment.

    I strongly suspect that the growing popularity of battle-royale style games may be a major factor in the impetus to replace Unity's existing networking. It wouldn't surprise me if there had already been some push to update or replace Unity's networking before the genre started gaining traction. But I suspect that push multiplied in intensity after 100-player games became as popular as they currently are. It also probably didn't reduce the pressure that the two most prominent titles fueling this genre trend were both made in Unity's biggest competitor's engine. (Epic's Unreal Engine) I imagine that lit quite a fire under Unity to step up their networking tools and support, and the end result was a deprecation of the previous structure in favor of a more robust and volume-friendly solution.
     
  28. RichardKain

    RichardKain

    Joined:
    Oct 1, 2012
    Posts:
    1,217
    You would be correct in that assessment. I was planning on applying network discovery to the local server-side of the application, broadcasting it's presence to any potential clients connected to the same network.

    And I really don't need to keep upgrading Unity going forward. Unity has contained the vast majority of features that I need since version 5. A lot of the nicer features that have gotten added on since then are just bonuses for me, not requirements. Sticking to an older version of the engine is not a burden for me.
     
  29. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    5,435
    Don't be held captive to whatever Unity puts out. There are many 3rd party networking API's as well as rolling your own with the Socket class. Unity's history regarding their networking implementations, as well as the amount of time they have spent to release so little with their latest effort, has me entirely skeptical of what they are doing right now.