Search Unity

UNET seems fine?

Discussion in 'UNet' started by iCode, Aug 23, 2016.

  1. iCode

    iCode

    Joined:
    May 25, 2013
    Posts:
    33
    I feel like i am missing something. I see a lot of people upset with UNET's lag, network prediction, Interpolation, etc. However, when I play this:
    https://www.assetstore.unity3d.com/en/#!/content/62227
    It seems fine, even though the relay server, I feel like it is very responsive. Is this sample overly simple, so it doesn't show the flaws I read about? What am I missing?
     
  2. isidro02139

    isidro02139

    Joined:
    Jul 31, 2012
    Posts:
    72
    For me, it was/still is a little hard to understand the best-practices for more complex architectures from such a simple example.

    1) I want to completely automate the lobby system, Clash Royale style, and
    2) I want each player to control 5 custom units, where the player themselves have no representation in the game world. I think I will end up with an empty gameobject prefab with a single "game player" controller script that has local player authority and (somehow) spawns its units via the server and has control over them.
     
    moco2k, Megaphone_ and CarterG81 like this.
  3. Megaphone_

    Megaphone_

    Joined:
    Mar 23, 2016
    Posts:
    41
    I think what you're hearing will vary quite a bit depending on the types of projects people are working on.

    For me UNET was an amazing tool to learn networking with but due to the requirements of my project it quickly became apperant UNET would just simple not be able to handle the load my project needs.

    Depending on how many connections a single server will need to support and the amount of data you are trying to send UNET can either be a perfect solution or an absolute nightmare.

    What kind of project are you working on?
     
  4. Megaphone_

    Megaphone_

    Joined:
    Mar 23, 2016
    Posts:
    41
    Ps. I don't have a link to verify but I have read that UNET will have a CCU limit even if you host yourself... Pretty much the end of using UNET at all for me
     
  5. CarterG81

    CarterG81

    Joined:
    Jul 25, 2013
    Posts:
    1,773
    I read a lot of confusion with UNET & its hidden (or even announced) costs. Everyone seems confused. I really wish Unity would clarify this in as simple a way as possible. So that even a 5 year old could understand.

    ELI5 style sticky.
     
    isidro02139 likes this.
  6. Megaphone_

    Megaphone_

    Joined:
    Mar 23, 2016
    Posts:
    41
    Completely agree, I fail to see how that is justified if your hosting yourself and not using any of their other services like matchmaking and relay server etc.

    Hopefully this is just another meme fueled conspiracy! :p
     
    isidro02139 likes this.
  7. moco2k

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    294
    I guess they really could make documentations more explicit and clear, but I don't think it is that complicated.

    If you go live with your game and use UNET matchmaking relay servers, you have to pay for all of your game's consumed bandwidth which runs through the relay servers. Basically that's it.

    If you do whatever else (like self-hosting without UNET relay servers, doing stuff in dev. mode, etc.), you do not have to pay for anything regarding UNET.
    CCU limits are only in place if you use UNET matchmaking relay servers in development mode. In live mode, CCU limits do not apply anymore as you pay for consumed bandwidth (information here, click on the grey question marks next to the CCU numbers). Theoretically, there are still CCU limits in live mode, but you can set the limits yourself (ref). So, in live mode, the limits are more of a measure to prevent you from paying too much in case your player counts grow higher than expected.

    Of course, unity could improve on information and communication strategies (especially considering the official docs). Nevertheless, at least relevant information are available in the forum:
    http://forum.unity3d.com/threads/relay-server-bandwidth-explanation.364594/
    http://forum.unity3d.com/threads/unity-multiplayer-launch-faq-march-2016.392474/

    As it regards the original thread question of UNET capabilities, I agree with isidro02139. For example, there are very few information on best practices and such. So, yepp, UNET is not perfect yet, the docs are lacking and you have to do a lot of research yourself. There are still some bugs and some features are missing. There is good reason why we have this thread.

    Still my personal experience using UNET for a 5 player multiplayer FPS game is quite positive so far. At least for this low-player-count scenario, UNET works well for me. I don't know how it scales for games with significantly high player counts though (I guess it would be a matter of efficient network game architectures). If the UNET devs add things like NAT punchthrough, Steam integration and bandwidth measurement tools, I guess I would be ready to release a UNET-based game soon enough as it regards the multiplayer aspects.
     
    Last edited: Aug 25, 2016
    isidro02139, CarterG81 and Megaphone_ like this.
  8. Megaphone_

    Megaphone_

    Joined:
    Mar 23, 2016
    Posts:
    41
    Thanks for clearing that up!
     
  9. CarterG81

    CarterG81

    Joined:
    Jul 25, 2013
    Posts:
    1,773
    Thanks for the post & links. I'll link back to this if I see anyone confused in the future.

    That's all what I thought initially, but I see so much confusion on the forums, it even made me question what I understood, hehe. I've seen people argue the opposite as well, stating others were incorrect in their understanding. And when I've read people explain this in a similar way, they were without the links... so I couldn't tell if they were legit or just assuming that is how it is. (An incorrect assumption in this is very dangerous for gamedevs, so it's good to have the links to Unity's announcements & official evidence.)

    Altho would be even better if Unity would make your post an eli5 sticky. It's a big enough issue that I see people confused in a lot of the network threads I visit, so would be nice so we stop seeing that.
     
  10. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,926
    That strikes me as a common best-practice, even in offline games. Always good to have an abstract object representing a "Player" and having it be a separate thing from the actual character. That way, even if the character gets destroyed or changed, the Player retains the data that it needs to retain. Many game engines offer this kind of structure out-of-the box (UE4 with PlayerControllers and Pawns, for example).

    As for assigning authority to the character, you can use either of those:
    Assign authority upon spawning
    Assign authority at any point in the game

    The advantages of this structure become very clear when you consider a game like DayZ or Unturned, for example. Players can enter/exit vehicles, but they still can access their inventory while inside the vehicle. You can consider that the human character and the vehicles are both types of "controllable things" that the PlayerController can control and gain authority over, but the inventory-access functionality remains in the PlayerController, not in the character. So your inventory remains accessible even if you are now controlling a vehicle and not a human. The PlayerController would also keep a reference to its "main character object" at all times, so that it can regain control/authority over it upon exiting the vehicle
     
    Last edited: Aug 25, 2016
    isidro02139 and CarterG81 like this.
  11. iCode

    iCode

    Joined:
    May 25, 2013
    Posts:
    33
  12. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,926
    Yeah. I think it's a little bit crazy that people expect an all-purpose networking system to be able to handle MMOs efficiently. I don't think they realize the amount of work that goes into making an MMO either, and that it's incredibly unrealistic for hobbyists or even small companies to pull that off well.

    However, I would expect this networking system to be able to handle games like Unreal Tournament, CS:GO and LoL. I'm not talking about giving me the whole e-sports infrastructure/ecosystem surrounding those games out of the box (whatever that means), but I'd expect it to be able to handle the networked gameplay aspect of those games correctly and efficiently. I'd be very sad to hear that UNET doesn't have the basic "network performance" to handle high-precision 16 player online games, even if I'm not planning on making a game like this.

    Something that would help tremendously is if Unity was actually making games instead of real-time movies like Adam and The Blacksmith. UE4 has UT, Paragon and Fortnite to give us solid proof that its networking system is great and reliable and also to drive the development of the whole engine. Unity has nothing
     
    Last edited: Aug 25, 2016
    Xain likes this.
  13. iCode

    iCode

    Joined:
    May 25, 2013
    Posts:
    33
    100 percent agree with this. If i were making a more competitive style game, i would pick UE4, because you have your hands on the same networking that they use to make their AAA games. Plus they have great examples for c++ (Shooter game) and blueprints (Generic Shooter on their marketplace) to follow.
     
  14. CarterG81

    CarterG81

    Joined:
    Jul 25, 2013
    Posts:
    1,773
    Take this as you will, but before I even knew how to program, many years ago... I worked with a small team who made their own MMO.

    It consisted of two programmers. That's it. No artist even (I joined the project on contract, to redo the entire game's graphics.)

    While I don't remember exactly how long they worked on it (2 years?) they were coming out of Alpha & entering Beta. Needless to say, the game worked very well even in Alpha. In just 3 days upon a test release, it made thousands of dollars without any network issues.

    I apologize that I can't provide any evidence to back this up, since
    the game has been obliterated from the internet. A week after I left the project, having completed my contract & deciding to reject their offer to join permanently, the CEO died IRL, and the entire project collapsed as a result. Just days/weeks before introducing the major graphics rehaul; An entire game's graphics reworked; never to see the light of day. I got paid for the work, but it was heartbreaking to know it was never seen by even a single player.

    With this, my own experience in gamedev, and extensive reading on the subject? I am a huge advocate of how anyone, even a solo developer, can create a MMO. It's not this impossible task that people make it out to be. Not just because of all the evidence or the intelligent articles I linked, but in my own (secondhand?) experience working on a MMO with two others.

    It's very realistic for anyone to create a MMO. As realistic, anyway, as anyone making any other big project (ex. Survival game w/ Authoritative Server; turn based multiplayer card game; whatever type of multiplayer game). So while I agree Multiplayer is very difficult (extremely time consuming) I do not agree that the MMO part is this enormous leap ahead of other multiplayer types. (Obviously there is more work to be done- but that doesn't necessarily mean it's all that more difficult.) Although the work you do AFTER release is infinitely more (maintaining your own servers vs allowing users to host their own).

    However, I also am a big advocate of innovative game design & not doing something (like create an MMO) when you really don't have to.

    While I don't have any experience with UE4, that is indeed quite tempting if they provide a well tested networking system & great documentation / examples. I trust Unreal infinitely more than I would ever trust Unity (no offense intended - just being honest. Unity feature releases seem like rushed Alpha's that don't reach Beta/Release status until years later...if not abandoned before then (bugs fixed 5 years too late, if at all)). I've always felt this way, as Unreal has a lot of positive PR about it. A very consistent "they're competent, unlike the rest" vibe about the company. (Again, no offense intended to Unity. Just being honest. Unity is great, np, even if ppl sometimes question their competence when compared to the very well established Unreal Tech.)
     
  15. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,926
    I'm basing my opinion almost entirely off of this classic gamedev post, because I have no actual personal experience with making an MMO, so I can't really argue with you on that.

    I'm just not entirely sure that we're talking about the same thing when we're saying "MMO" (persistent world, thousands of players per server, etc.... basically games like WoW or Guild Wars). Most of the time, even if a small team could potentially make a working MMO, they'd probably never have the resources and manpower to make it actually good and well fleshed-out. That's why I think it's almost never a good idea to make one.

    Yeah that's by far my biggest gripe with Unity. UE4 adds fully-stable, professional-quality, best-in-industry features to the engine every 3-4 months. I do not know how they do it. Meanwhile, Unity is stuck in perpetual alpha and its tools/systems feel very buggy, untrustworthy and underwhelming. I don't know how it's possible that the disparity between the two engine is that huge. Blame Unity's focus on services?

    UE4's networking system is so good and well-optimized that it may very well be an industry leader in that respect. It's an incredibly well-designed and powerful system that has been battle-tested in many games. The whole engine is actually built around networking (read up on UE4's "Gameplay Framework")

    There is a reason, though, why I haven't fully made up my mind about switching to UE4. In UE4, you feel like you have much less freedom. It's not an engine that was designed from the ground up to be "all-purpose" like Unity. It feels rigid. You need to follow a certain framework for your gameplay code (it's a good framework, though), you can't write your own shaders unless you modify the renderer in the engine sources (say goodbye to making fancy graphics features by yourself, like ocean systems, planet generation, etc), the main engine classes are nowhere near as clean and intuitive as Unity's, there's bloat and pollution everywhere (there's built-in gameplay logic leftovers from UT in UE4's equivalent of Monobehaviour), editor extensions are hell, etc, etc.... it's just really hard to be happy about all that when you're coming from a Unity background.
     
    Last edited: Aug 29, 2016
    Xaon, Megaphone_ and CarterG81 like this.
  16. iCode

    iCode

    Joined:
    May 25, 2013
    Posts:
    33
    My main reason for using UNET for a multiplayer game is i want the game to be on mobile. If i were making a PC game, i would use UE4.
     
    CarterG81 likes this.
  17. CarterG81

    CarterG81

    Joined:
    Jul 25, 2013
    Posts:
    1,773
    I'm a jerk, but when in doubt I always just default to competence. Er, the lack thereof. Although currently I am more confident the incompetence is not in ability, but in 'leadership', company policy, bureaucratic lunacy.

    All it takes is a business to forget that their own rules & policy is to assist productivity, not restrict it. To be forced to abide by red tape nonsense (as can be seen in Unity's insane argument as to why they can't swap out the Splash Screen) can cripple the competence of an organization. Must remember - the moment the rule harms the company, is the moment it should be broken. Rules are made to prevent problems, not cause organizational incompetence.

    But you could be right. Very likely it is just their focus is bad. I've been around since Unity 2.0, and their overall decision making skills have always befuddled me.
    I'd be honestly surprised of Unity's success, except for its competition is either far worse or far more expensive (revenue share). And the community & asset store, IMO, is the only reason Unity even exists as 5.0 (successful year after year) & onward. That, and I've heard their mobile game (area) is top tier? I wouldn't know anything about that.