Search Unity

Unity Multiplayer UNet Deprecation Thread

Discussion in 'Connected Games' started by BHouse, Aug 2, 2018.

  1. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    693
    @Anjin_nz you have more options than that:

    3. Update to 2018.x (still has Unet)
    4. Update to 2019.x and use the packaged HLAPI with the built in LLAPI
    5. Switch to Mirror or something else.
     
    Anjin_nz likes this.
  2. Anjin_nz

    Anjin_nz

    Joined:
    Jun 24, 2014
    Posts:
    74
    thanks for the advice and replying
    I think 3 is really just the same as a double rewrite.
    HLAPI support is confusing. One moment it's in, then its 3rd party then it will work with both.
    I'm not sure that switching to a 3rd party solution is a good idea. We need offnet functionality (which works well with legacy)

    Right now the best option seems to be to wait until Unity realises this is critical and changes their due date to 2019/ early 2020.
     
    Monteworks likes this.
  3. R1PFake

    R1PFake

    Joined:
    Aug 7, 2015
    Posts:
    241
    No offence either, but I would rather have a fully working solution instead a "rushed" early release.
    And you you can't really blame anyone for removing the legacy networking which was deprecated years ago and then "demand" that they should work harder/faster for a early release.

    Sure UNET had a rough start, but the people who changed from legacy to UNET can still use it now, and it's in a usable state (even more with the current open source projects who added bug fixes)
     
    Anjin_nz likes this.
  4. Anjin_nz

    Anjin_nz

    Joined:
    Jun 24, 2014
    Posts:
    74
    Thanks for your reply :)
     
  5. Kylotan

    Kylotan

    Joined:
    Feb 17, 2011
    Posts:
    194
    Does anyone want to explain what DOTS means?
     
  6. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    555
    Kylotan likes this.
  7. Kylotan

    Kylotan

    Joined:
    Feb 17, 2011
    Posts:
    194
    Thanks. I'm not interested in any of that except the job system, so that's okay.
     
  8. namdh1212

    namdh1212

    Joined:
    Dec 26, 2018
    Posts:
    2
    Hello I cannot request to Activate Live Mode (UNET).
    Button Submit request not show?

     
  9. JTovey

    JTovey

    Unity Technologies

    Joined:
    Oct 30, 2018
    Posts:
    34
    Hi Namdh,

    This is not the best place for this issue, as this thread is for questions regarding UNET deprecation, rather than UNET support. I would advise that you raise a support ticket and our team will do their best to assist you as much as possible.
     
  10. megabrobro

    megabrobro

    Joined:
    Jul 8, 2017
    Posts:
    100
    Hi all. I just read this: https://support.unity3d.com/hc/en-us/articles/360001252086-UNet-Deprecation-FAQ. (I haven't used Unity for around 6 months). I am starting a fresh project today. I'm still trying to teach myself how to properly code multiplayer games.

    I'd made a few demo games working in Unet before (using the Network Manager, Network Transform etc Unity components).

    BUT NOW, if I install the latest Unity beta 2019 and make my project using this, what is the new recommended way to make a networked game? Is there a tutorial/documentation guide for the new "networking layer" and "Game Server Hosting service"?

    I'd rather not install Unity 2018 and then be stuck unable to update my Unity client for the duration of the project (which might take me months/1yr+).

    Any small examples of how it works and/or the documentation link would be excellent.
     
  11. CallMeSpam

    CallMeSpam

    Joined:
    Feb 10, 2018
    Posts:
    19
    The short answer to your question is there is no documentation, and there hasn't been much information about the project. The last bit of info we got was that they are waiting on changes to the Unity core before releasing any updates, so who knows when that will happen. I haven't used it myself, but Mirror is really popular and seeks to mimic UNET's HLAPI. For low level API's LiteNetLib, and ENet are solid RUDP libraries.

    Edit: I would like to add, that I believe they either have or will make UNET a downloadable package.
     
  12. Red_Dragon69

    Red_Dragon69

    Joined:
    Sep 7, 2015
    Posts:
    65
    I'd recommend to try Mirror https://assetstore.unity.com/packages/tools/network/mirror-129321 as this is basically UNET, but it's actually working. :) I've built a few smaller games with it, and it's fantastic :)

    There's also a converter, to get your old UNET projects easily converted to Mirror https://github.com/Lymdun/MirrorConverter
     
    megabrobro likes this.
  13. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    69
    While they have now said UNet will remain active in unity builds till the 2019 LTS version, it does seem odd that there has been a lot of talk of ditching UNet but as others have pointed out exceptionally little documentation on moving to the new one.. I havent even seen records of what they are calling it - and if I have Ive not associated it with the UNet replacement
     
    megabrobro likes this.
  14. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    255
    I've dabbled with a few of the networking solutions for Unity but worked mostly with HLAPI in my personal projects for the last 4 years. After all the pain and BS, with the benefit of hindsight...I'll still recommend HLAPI/LLAPI for projects being started by networking novices. (Particularly over the often recommended Mirror. The shortcomings there are well documented, so please do your research.)

    That comes with a few more suggestions: Use it sparingly with Unity's new data-oriented focus in mind. Read the source and understand what you do use. Most importantly, keep it well separated from your game because by the time you find the point where networking performance or features are true limiting factors, you'll probably have better options available or want to roll your own anyway. If you must use Mirror, these suggestions still apply, perhaps more-so.

    HLAPI is available as a package starting in 2019.1. You can even copy the package to github and reference it from there in your projects. You can make your own tweaks and fixes like this: https://github.com/angusmf/HLAPI-ex
     
    megabrobro likes this.
  15. daschatten

    daschatten

    Joined:
    Jul 16, 2015
    Posts:
    163
    Any news on the progress?
     
  16. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    555
    Soon can mean months to a year at Unity, so don't hold your breath. Everything becomes a rocket science when done by Unity. Exiting developers probably called it a quit and they are probably looking for new rocket scientist. This is pretty common. Multiplayer project is one of the worst I've seen.
     
    antey3064 likes this.
  17. Soulice

    Soulice

    Joined:
    Aug 18, 2014
    Posts:
    45
    as @angusmf said above. We have done a number of single player games and now starting a new game with multiplayer functionality at the forefront. So which path do we follow? UNET, Mirror, Photon, new unity multiplayer (https://github.com/Unity-Technologies/multiplayer), roll our own ( I wrote a udp/tcp server a while back for a non Unity multiplayer game and it works rather well), or what???

    Where does Multiplay come in to all of this?
     
    Last edited: Apr 1, 2019
  18. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    Multiplay is for hosting. They once mentioned that you can host there no matter which networking solution you use.
     
  19. daschatten

    daschatten

    Joined:
    Jul 16, 2015
    Posts:
    163
  20. CallMeSpam

    CallMeSpam

    Joined:
    Feb 10, 2018
    Posts:
    19
  21. Kylotan

    Kylotan

    Joined:
    Feb 17, 2011
    Posts:
    194
    Not very encouraging. Still little sign of anything high level, and they seem to have added a reliability layer that doesn't support more than 32 messages in flight at once (because they're trying to track them with a bitmask for some reason).
     
  22. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,149
    I think that's to get explicit NACK's. It can be really useful. But 32 is not that many. But it's really easy to estimate it wrong. Try it.
     
  23. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,041
    Sending a bitmask for ACKs is a very common technique, and it's used to provide high redundancy for ACK/NACK with very little overhead.

    I don't understand why the limited it to 32 packets in fligth at any point tho.
     
    TwoTen likes this.
  24. Kylotan

    Kylotan

    Joined:
    Feb 17, 2011
    Posts:
    194
    I guess what I said wasn't very precise. The bitmask is obviously an implementation detail that can work well, but there's a difference between using it as an compact way to send acks within the message header and enable selective acknowledgements (great), and using it to store the currently acked packets at each end (not so great).

    To quote their docs, "trying to send a 33rd packet will result in an error and it will not be reliable". Worse, it's a silent error you have to remember to check for manually, on a different object, so this is going to cause people a lot of problems if not addressed. Personally, I would argue that any transport that can drop a message silently without dropping the entire connection cannot be called 'reliable' in the normal sense of the term.
     
  25. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,041
    This I agree with completely, using bitmask to store the currently pending packets in flight from the senders perspective seems like a weird choice.
     
  26. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    546
    In terms of performance, the efficiency of their implementation highly depends on window size. The larger is window size, the more significant will be overhead, computation costs, and therefore the latency to keep tracking which data designated for retransmission. I'm expecting that ack vector should perform better than any sliding window (look at Valve's implementation), but I don't have any numbers.

    In general, I'm quite disappointed regarding the implementation/time that was spent, UNet was way more progressive in that vein. There's still a lot of work that should be done.
     
    Last edited: Jun 29, 2019
    Vincenzo and TwoTen like this.
  27. larus

    larus

    Unity Technologies

    Joined:
    Oct 12, 2007
    Posts:
    268
    Thanks for the feedback, good comments here. Currently the implementation work being done on the transport is focused on supporting an FPS game scenario, like the FPS Sample game. Certain things are not required there, like congestion and flow control, and a more robust reliable communication channel. But we'll be making improvements for this and will cover more use cases as we go. Regarding certain issues:
    • By mistake the samples in the docs were not updated to reflect API changes, this will be addressed of course.
    • Only 32 reliable packets in flight at the same time. This was enough for what we needed at the moment but support for more will be added. Also, without any flow and congestion control it probably doesn't make sense to have a lot of packets in flight.
    • Improvements will be made to the error handling, at the moment there is no return value path in the pipeline implementation when you send something. So at the moment it just sets the error code and this needs to be checked.
    • Packet should be dropped when the queue is full, and the packet can't be sent reliably, instead of just sending it unreliable like now. Because of the error handling situation described above it can only set an error code in this case which the user can check and then retry sending later.
     
    aabramychev likes this.
  28. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,041
    I've never seen the senders window size (unless you make it waay to big and send way to many packages) cause any issues in relation to performance, as even with a ring buffer getting to the right packets meta data is just a matter of an modulo into an array.

    Maybe I'm missunderstand what you're saying, but 32 outgoing packets seems like a very tight and arbitrary limitation which is there for almost no reason at all. Yes it is reliable packets, which isn't very common in fast paced games like FPSes, but still.
     
  29. sad-ois

    sad-ois

    Joined:
    Apr 25, 2019
    Posts:
    1
    So the bottom line is

     
    ModLunar and camhx like this.
  30. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    546
    Larus noted it correctly, without a flow and congestion control where traffic is efficiently controlled by adaptable congestion window in order to avoid flooding connection and preserve a fast retransmission and recovery, sooner or later depending on workload, network environment, and other conditions, the reliability (especially Unity's implementation where sequencing will stall delivery in a whole reliable pipeline) will cause performance issues because the transport cannot adapt to user data and connection quality: it needs more memory, more iterations, more bandwidth, and while for the client this might be okay, for the server is not (but again, it depends on many conditions). Everything in their implementation has a fixed size and capacities due to very limited functionality, this helps to keep stuff fast and predictable, but hurts usability.

    I don't know what numbers they aim for and which exactly issues they encountered, my assumptions are based only on what I see in the code and my personal experience.

    All these things just the tip of the iceberg, the saddest part is that not so many people are realizing that, probably including some people at Unity itself.
    Without a doubt, especially if you are building a general-purpose networking library.
     
    Last edited: Apr 26, 2019
    Joe-Censored and TwoTen like this.
  31. Rowell

    Rowell

    Joined:
    Sep 22, 2014
    Posts:
    26
    I write games for use on private (secure) networks. There is no connectivity to the internet, due the classified nature of the network. Is whatever new networking structure that Unity is developing going to be able to be used on closed networks (in a Client/Server/Master Server style format)?

    And why in the world would you deprecate UNet with no real replacement for it? Even the current documentation on the Unity Web Site references UNet commands and components.
     
    Last edited: May 6, 2019
    DarkRewar likes this.
  32. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    2,206
    Never take the docs as relevant, up to date or even correct, especially the networking docs. There have been contradictions and outright incorrect info on there for over a year now
     
  33. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,905
    The new networking system is client/server and should be usable without interwebs. Official docs don't typically cover alpha/preview state features, which is why you don't see anything covering the new networking system there. Most of the pages for Unet state clearly at the top that the feature documented is deprecated.

    https://docs.unity3d.com/Manual/UNet.html

    You've caught my curiosity about what kind of games get developed for use specifically on a disconnected secure and "classified" network. I'm surprised in that environment you wouldn't have strict networking requirements where you'd have to either use a specific networking library or roll your own in compliance with some security standard imposed on you.
     
  34. jflatmo

    jflatmo

    Joined:
    Apr 4, 2017
    Posts:
    2
    I think for me the deprecation annoyance is that I've got hundreds of warnings in my code due to 'deprecated' features that are still in use (using HLAPI) - but no replacement in sight.

    The FPS sample is fine if that's what you need, but without a decent tutorial there's so much complexity in the code it's very difficult to reverse engineer for less intensive cases.

    Either release something we can use or un-deprecate the functions so we don't have so many warnings...

    It's frustrating to me that the mantra for the last year and a half has been "if you're not releasing for at least six months, wait... something will be here any day now.." - had I been listening to that advice I'd still be waiting.

    My "wants" are pretty simple.

    * Basic client/server connectivity (client can connect to server at IP Address X and the server knows it's there)
    * An equivalent to rpcX() and cmdX()
    * A way to set up communications so that I can choose whether ONLY the client's playerObject is sync'd or whether ALL playerObjects are sync'd to each client (BONUS: 'nodes' where I can box clients together and only have them sync each other but ignore everyone else)

    HLAPI does this already, albeit imperfectly (minus the last one without some aggressive tweaking).

    I think it's ridiculous that networking support doesn't *already* include a traditional client/server path instead of having to kitbash p2p - particularly since most of Unity's appeal is cross-platform (especially mobile...) and most of your probable clients are behind NAT.
     
    Karsten and IkkeKirke like this.
  35. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,149
    I advice you to go the third party route, you will get much better support than you ever got with UNET as the support you get is from the first party developer.

    Don't be scared about the "not made by unity". There are many good libraries, both high and low level. Many of them even share a ton with UNET, some of them are compatible with UNET, and some of them make it a breeze to convert from UNET.

    Just look at your options, I would argue that sure, UNET's deprecation is not optimal. But it's far from the end of the world. I can only understand developers feeling "left" to a certain extent, the Unity Networking community has the knowledge to write custom, better solutions.


    I would argue that a third party option is better than what you get from UNET because it's totally independent. You get help from the developers itself, updates are not dependent on the next Unity release etc. I myself have one of these libraries very similar to UNET, and when people find a bug and I can push a fix in 20 minutes, that's something you won't have with something by Unity.


    As for your needs, my library ticks them all. Unlike UNET. You have full control over visibility, much finer control than UNET.
     
  36. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    361
    @larus How about latest Unity version (2019.1.2f1) supports status? It seems that current Unity Transport makes Burst error and application crashes in 2019.1.2f1.

    Edit: Updating Burst to 1.0.4 resolved this issue.
     
    Last edited: May 16, 2019
  37. IkkeKirke

    IkkeKirke

    Joined:
    Jun 18, 2018
    Posts:
    3
    I can understand needing to upgrade, adapt or even rewrite the network library to support more robust networking requirements. But I don't see at all how that requires Unity to abandon UNET. Especially without a replacement at hand.

    I feel like Unity is, in turn, abandoning a lot of its user base here. Both the users who'd never need anything more than UNET as well as those who need something more robust who are left to guess at the direction in which Unity is going. Is there even any indication that the new network library will be able to allow - by adding a few components to your game objects - the ability to setup a quick multiplayer game?

    I appreciate all the work that goes into Unity and I realize I'm complaining about something that I'm using for free over here, but this just seems like a massive step in the wrong direction, and so far the responses from the Unity team on here makes the situation seem dismal. I just started my game last year and this has gutted me, I can't imagine how someone who's been spending years building their game must feel.
     
  38. Studiomaurer

    Studiomaurer

    Joined:
    Sep 5, 2012
    Posts:
    28
    Just for the heck of it I upgraded a Unet Project to 2019.1.4f and imported the HLAPI Package. Everything looks fine ,except the one single script isn't compiling (NetworkTransformChild.cs). It's not showing any errors. I've got no warnings for anything (on any other script), it just won't load on my player prefab (Cannot be loaded. Please fix any compile errors and assign a valid script). Does anyone know how I might fix this? Thanks!
     
  39. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,905
    Another thread mentioned there is a misspelling in that script that Unity hasn't fixed.
     
  40. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    2,206
    Guys we used mirror which was almost 1:1 with UNET, its free, it works, its supported, the discord always has around 6 people replying to your queries, and we have live client projects that are working well with it. Its also cleaner, so take a gander at Mirror and rejoice!

    Their UNET to Mirror conversion guide takes less than 5 minutes to convert an entire project over!
     
    MCoburn, vis2k and Joe-Censored like this.
  41. MCoburn

    MCoburn

    Joined:
    Feb 27, 2014
    Posts:
    68
    Can confirm - Doing contract work for a client and what @GameDevCouple_I said is pretty accurate. The UNET to Mirror adapter does 90% of the hard work for you, the rest you have to rewrite/reimplement yourself depending how deep the code goes.

    Discord is pretty active too and it's mostly friendly be it you trying to get support or just on coffee break and having a chat with the developers.
     
  42. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,149
    On paper Mirror is almost 1:1 with UNET, it's a UNET fork after all.

    But it's important to explain what that actually means:
    Since Mirror is still UNET, it will inherit the poor design choices of UNET. For projects that use UNET and that face the bugs of UNET, Mirror is worth looking at. But for new projects, it's a poor choice. Other libraries can offer much more than Mirror since they are not UNET forks. Some of them (like my own MLAPI) even shares tons with UNET which makes it easy to transfer, but not a 1:1 process. Mirror very rarley evolves because of this.
     
    BHouse likes this.
  43. BHouse

    BHouse

    Unity Technologies

    Joined:
    Jan 10, 2018
    Posts:
    66
    ModLunar and Anjin_nz like this.
  44. Kylotan

    Kylotan

    Joined:
    Feb 17, 2011
    Posts:
    194
    Seems to be the same as what we saw a year ago - kicking the can down the road, leaving everyone with a choice of:
    1. The new transport, i.e. a low level wrapper around a socket with little in the way of actual gameplay features
    2. Deprecated HLAPI code that will never be fixed
    3. DOTS preview code that might be ready next year (and does that mean DOTS is essentially mandatory for it? As opposed to "Job System compatible and optimized to pair well with ECS-based games, though neither are required"?)
    Unless I've missed something, there's no sign of the "networking “archetypes” that work best for different types of games" promised last August except for FPS (and let's face it, most people who want to write an FPS would probably have just started with UE4 anyway, where their HLAPI-equivalent works well for FPS and has done for 20 years).
     
  45. Genay78

    Genay78

    Joined:
    Jul 5, 2019
    Posts:
    24
    Hi,

    I’m an indie and I have a new coop game project (4 players within client server host p2p), and I’m not really into networking programming.

    What do you guys suggest? Keep waiting for a potential solution from Unity? Go to third solutions like Mirror or Photon, and build it by myself (and first learn occasionally).

    I can’t hide I’m a bit upset about the news…

    They say they do this to improve performance, but in another hand, they advise small coop indie game to use p2p…

    Have a good day
     
    ModLunar likes this.
  46. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,905
    Unfortunately, you're not going to be able to build a relatively problem free networked multiplayer game unless you really get into network programming, as all the systems in your game will need to be in some way built around networking.

    Networking has never really been a priority for Unity, and seeing how little has been pushed out the door in a year that has obviously not changed. I'm not knocking the Unity devs, as this must be a decision made higher up. If Unity was making this a big priority, they would have been able to ship a rather feature complete and well tested solution by now.

    I'd suggest looking at third party options, as networking isn't even something you need Unity to provide anyways. (Probably why they don't make it a priority in the first place)
     
  47. Genay78

    Genay78

    Joined:
    Jul 5, 2019
    Posts:
    24
    I understand, thank you for your answer.
    I'm now investigating how Photon could help in this project.

    Have a good day !
     
    Joe-Censored likes this.
  48. jzaun

    jzaun

    Joined:
    Feb 20, 2010
    Posts:
    25
    Sat down to try an start a simple new project after a year or so away, and UNet is gone without any replacement. So can't use Unity. Sure I could use 3rd party, but that putting a lot of work into something that's not really supported my Unity and will have to change when Unity finally gets their act together.

    I can't believe they removed UNet without a replacement. Really bad project management.
     
  49. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    255
    It's not gone. LLAPI was never removed and HLAPI is a package now. Window->Package Manager
    Then install Multiplayer HLAPI
     
  50. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,029
    There's also Mirror, which is open-source copy of the old one. Tons of people have switched to that.
     
    Joe-Censored, vis2k and jzaun like this.