Search Unity

NAT Traversal - Automatic port forwarding, punch-through, and more!

Discussion in 'Assets and Asset Store' started by thegreatzebadiah, Apr 5, 2016.

  1. Nikodemus

    Nikodemus

    Joined:
    Nov 28, 2014
    Posts:
    32
    Ok, played with the game using two builds instead of one build and one unity editor. Connecting works pretty well but most of the cases the client does not create a player. Just connects and lets me Watch the other player. Have no clue to how this can be.
     
  2. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Hi again everyone,

    Just wanted to let you all know that I'll be out of town for about a week starting next Wednesday the 29th, and by out of town I mean no access to Internet at all. If you've got any pressing questions or issues now is the time to ask! When I return I'll be back to responding super fast as usual :)

    @Nikodemus Did you ever get the spawning issue figured out? Can you send me your project that is having the issue or is it happening in the unmodified Example scene?
     
  3. bug5532

    bug5532

    Joined:
    Aug 16, 2011
    Posts:
    307
    @thegreatzebadiah I have just come across a bug. When I called natHelper.mapPort() something hung up and so onPortMappingDone was never called. the trouble was this meant that stopping the thread also failed and caused the game to hang upon leaving.
    Would it be possible to put a timeout in this method so that onPortMappingDone is always called? And also allow the thread to be stopped whilst it's being called?

    thanks!
     
  4. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Hmm, pretty sure it's supposed to call onPortMappingDone even if it fails. I'll take a look into it and add a timeout, seems useful anyway.

    I'll try and get the update to the store before I leave for vacation on the 29th but no promises.
     
  5. bug5532

    bug5532

    Joined:
    Aug 16, 2011
    Posts:
    307
    Yeah it does call it when it fails to do the port mapping. But I think something else failed and caused it to hang, so then it wasn't called.
    When I rebooted the pc it started working again, so I'm afraid that's all the info I have. I just don't want it causing crashes on customers pcs.
     
  6. Nikodemus

    Nikodemus

    Joined:
    Nov 28, 2014
    Posts:
    32
    Yes it finally sorted itself. Used the Example network and added things from my original until I found the culprits. Anyhow, latest bug is the following:

    NATTraversal.NetworkManager.OnDestroy ()NullReferenceException: Object reference not set to an instance of an object

    Caused everytime I exit back to offline menu and I am using the example network to shut things down.
     
  7. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @Nikodemus Good to hear you got the previous issue sorted. I'll look into the OnDestroy issue but I don't have much free time left before I leave so it may not make it out for a week or so.
     
  8. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    Hi, i'm interested in purchasing; can the Facilitator server run on Linux ?
     
  9. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @PeteLaChatte Absolutely! I usually run it on Ubuntu but I think it's been tested in CentOS and a few others.
     
  10. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    Thanks. Any ETA for iOS/TvOS ?
     
  11. Nikodemus

    Nikodemus

    Joined:
    Nov 28, 2014
    Posts:
    32
    The OnDestroy issue after returning to offline scene makes it impossible to list matches as the matchmaker becomes null. Want to go live with this but this issue is more or less blocking the whole thing.

    *EDIT* Managed to solve it.
     
    Last edited: Jul 2, 2016
  12. KnightPista

    KnightPista

    Joined:
    May 18, 2015
    Posts:
    40
    Hi, I have a bug: after closing the application, following exception appears:

    Also, It would be great if NATHelper class did not connect to facilitator in constructor (Awake?), but we could do it manually, by some natHelper.ConnectToFacilitator() function. It would help in cases people want to dynamicaly add NATHelper with AddComponent<NATHelper>(); Also, we could configure NATHelper (from script) before it starts connecting.
    It's because we're doing other platforms that cannot have NATHelper/NATTraversal in in scene.
     
  13. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @KnightPista
    Yeah, great suggestion, I'll rework that bit right now. I also fixed the bug that you mentioned with isPunchingThrough staying true after failure. I'm still working on the number overflow issue. It seems to be specific to PMP devices. Is it ok if I send you the update to test when it's ready?

    @Nikodemus
    Do you still have problems with DNS lookup hanging? You mentioned it a while back and I've been trying to track it down but I can't seem to make it happen. Does it happen consistently for you? Also I fixed the NullReferenceError being thrown in NetworkManager.OnDestroy().

    @bug5532 I've reworked port mapping a bit so that the NATHelper.portForwardingTimeout is actually used in a few more places. Looking through both my code and the Open.NAT code though it seems like everything already had a default timeout of four seconds so I'm honestly not sure where / how it was hanging. I also added a stopPortForwarding method in case you want to kill it manually. Let me know if it gets stuck again.

    @PeteLaChatte Nope.

    I'll try and get the new build finished and uploaded tonight. Sorry for the wait. Thanks for being patient with me everyone :).
     
  14. Jos-Yule

    Jos-Yule

    Joined:
    Sep 17, 2012
    Posts:
    292
    Hello! Back again, working on more Hosting stuff, and so am trying to re-integrate this asset into our code. I've got a copy of the facilitator running @ amazon EC2 (can see it via ps -aux), but it is from a couple of months ago, just want to make sure that it hasn't changed since then? I was able to connect to it before, but now seem to be getting some strange errors, please see the following screen shot of my log - it looks like it connects to it, but then has issues mapping some ports (and gives bad log info - it says that i'm connected to your URL, but i have changed the url in the NAT Helper script...).



    I've followed the FAQ to 'open' the ports via the RULES... Any suggestions?

    Thanks!
     
  15. Jos-Yule

    Jos-Yule

    Joined:
    Sep 17, 2012
    Posts:
    292
    Even when i use the GrabblesGames.com url for the NAT Helper i am getting errors/warnings (maybe they don't matter?)

     
  16. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    The GrabblesGame.com in those warnings is actually just the description of the port mapping entry, it doesn't effect anything at all. I'll try and make that output less confusing. It has nothing to do with the Facilitator address though.

    The actual problem here seems to be that it's trying to map port 0 for some reason which isn't really something that makes sense to do. Is this happening in the example scene with no modifications? Can you increase the log level to try and get more output?
     
  17. Jos-Yule

    Jos-Yule

    Joined:
    Sep 17, 2012
    Posts:
    292
    Here is some of the log when set to Developer in the Example scene
     
  18. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    My suggestion would be to make sure you have the latest version of the asset (that output looks like from an older version I think). If updating doesn't solve the problem it should at least have some more useful output that might point me in the right direction.
     
  19. Jos-Yule

    Jos-Yule

    Joined:
    Sep 17, 2012
    Posts:
    292
    I just updated the Asset (from the asset store) this morning, so i'm pretty sure i have the latest version. All this could be for naught - i need to do some more testing - i think i was just concerned about the Warnings, thinking they were perhaps more "important" then they actually are. Will report back if i come across any _actual_ bugs. Sorry for the probable goose chase!
     
  20. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    The asset was just updated this afternoon so you actually may still have an older version. If you check the included README file it should say 1.41 at the top.
     
  21. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Version 1.41 released

    This release was a mix of usability and flexibility with just a dash of stability for flavor.

    Changes include:
    • Fixed null reference when destroying network manager.
    • Added better timeouts for port forwarding tasks and a way to cancel them.
    • Better error handling for punchthrough.
    • Improved example scenes.
    • Updated documentation.
    As always if you run into any issues or have any trouble updating just let me know and I'll work with you to get the issues resolved as fast as possible.

    If you bought the asset and have not yet rated / reviewed it on the asset store, please take a moment to do so.

    Cheers!
     
  22. Toumal

    Toumal

    Joined:
    Jun 25, 2013
    Posts:
    8
    Hey there!

    I've recently purchased your asset and I'm trying to get this to work with our custom matchmaking. So far however I haven't been able to get your asset to work.

    We're using a custom network manager, and unity matchmaking is disabled.

    This is what I use to start the host:

    However I don't even get there. Upon startup, before I even try to start hosting, I get this exception which is opaque to me, sadly.

    Do you have any clues for how I can fix this?


    EDIT: Ok so apparently I can't call base.Start() in my network manager or I get this exception. Fine with me - however I still can't start hosting a game. This is the error I get now:


    Any clues?
     
    Last edited: Jul 18, 2016
  23. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Oooh, that's a simple one, you just need to add the NATHelper component to the same game object that your NetworkManager component is on. Totally my bad, I should have added a RequireComponent attribute to the NetworkManager to make it more clear that it requires the NATHelper to work.
     
  24. Toumal

    Toumal

    Joined:
    Jun 25, 2013
    Posts:
    8
    Hmm but I have the NATHelper on there!
     
  25. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    You definitely want to call base.Start() if you override the Start() method.

    The line that's throwing the error is making reference to the NAT Helper so it seems like it's not finding it for some reason, though I can't imagine why that would be. Maybe the NATHelper component gets removed at runtime for some reason? Can you maybe zip up the project and send it to me so that I can dive into a little deeper?
     
  26. Toumal

    Toumal

    Joined:
    Jun 25, 2013
    Posts:
    8
    Aha! So... the trick is to have the NATHelper component on it, AND make sure base.Start() gets called :)

    Ok so now starting the host works again, but I never get an external IP. However, I do see a unity creatematch request that of course fails because we're not using unity matchmaking at all. I do have unity matchmaking unchecked, but I still see this:

    Is there maybe a small bug that makes the NATTraversal Network Manager class always use unity matchmaking? Or did I miss something else?

    EDIT: FYI I do have direct connection, punchthrough and relay enabled.
     
  27. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    You'll have to disable relay connections to completely disable unity matchmaking. You can't use relays without using matchmaking unfortunately. Disabling matchmaking while leaving relays enabled creates kind of a weird situation where you could use custom matchmaking in parallel with Unity's matchmaking, so you would use your custom system to find / list matches but Unity matches would still be used on the backend to make the relays work. Probably not a common use-case. In your case I think you can just disable relay connections and you will be good to go.

    No clue why it wouldn't be fetching the external IP. What happens when you visit http://icanhazip.com in a browser?
     
    Last edited: Jul 19, 2016
  28. Toumal

    Toumal

    Joined:
    Jun 25, 2013
    Posts:
    8
    Thanks for your responses, your help is really appreciated!

    I mixed up relay with punchthrough in my mind, for some reason I thought that using the facilitator requires relay to be enabled...

    As for fetching the external IP, perhaps it's because of the way I start the server? ATM the code looks like this:

    ...and I call it with StartCoroutine(launchServer()). The log line "external IP:" never appears in the output.

    I tried adding
    to the network manager Awake function and then I do get at least some log output for that, but still no external IP. The only thing I see is this:

     
    Last edited: Jul 19, 2016
  29. Toumal

    Toumal

    Joined:
    Jun 25, 2013
    Posts:
    8
    I *think* I got it working somewhat. I had to put a script component extending MonoBehaviour with an awake method that contained the two NATHelper lines (findNatDevice() and connectToNATFacilitator). I still get "NAT Device not found", however I do at least see the facilitator do some stuff.

    Weirdly enough when I run the nathelper example it finds my router and is able to initiate port mappings...
     
  30. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Something definitely seems funky there. Both those methods are called in the NetworkManager's start method so you shouldn't need to call them manually like that (unless you're using the NATHelper without the NetworkManager).
     
  31. Toumal

    Toumal

    Joined:
    Jun 25, 2013
    Posts:
    8
    Well one thing I found out is that I also have to put that script ABOVE my network manager, else it won't find the NAT device. And for some reason it does forward the port 61618 but not the actual game's port. I added the corresponding map command and that produces the desired log output.

     
  32. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    The NetworkManager should forward the direct connect port automatically when you actually start hosting, but it won't hurt anything to forward it as soon as the nat device is found like you're doing here (in fact that's probably what it should do by default).

    I'd still love to get my hands on a copy of your project if you don't mind sending it to me (zeb@noblewhale.com). Something definitely seems wrong with how the NetworkManager and NATHelper are interacting. I'll try and play around with the script ordering in the example scenes and see if I can replicate the issues that way. That's definitely something I didn't think about.
     
  33. Jos-Yule

    Jos-Yule

    Joined:
    Sep 17, 2012
    Posts:
    292
    Hello!

    Ok, so i'm now just trying the ExampleNATHelperOnly scene (on v1.41). I can not get the UPNP bits to work, and i'm assuming that to test the facilitator i'd need two computers on different internet IPs - not just two different computers on the same LAN?

    Wrt the UPnP, when i was writing my own UPnP code, to get it to work with a couple of routers i had to look for the following non-standard UPnP service type:

    Code (CSharp):
    1.  XmlNode node = desc.SelectSingleNode("//tns:service[tns:serviceType=\"urn:schemas-upnp-org:service:" + _connectionType + ":1\"]/tns:controlURL/text()", nsMgr);
    2.             if (node == null){
    3.                 node = desc.SelectSingleNode("//tns:service[tns:serviceType=\"urn:schemas-upnp-org:service:WANPPPConnection:1\"]/tns:controlURL/text()", nsMgr);
    4.                 if(node == null) return null;
    5.                 _connectionType = "WANPPPConnection";
    6.             }
    Here is a screen shot post-Port-Forward click, with Inspector & Console.
     
  34. Jos-Yule

    Jos-Yule

    Joined:
    Sep 17, 2012
    Posts:
    292
    I figured out that code via this site, which was very helpful in getting an understanding (sorta) of Upnp - http://www.upnp-hacks.org/upnp.html

    I also learned that Upnp is a _nightmare_. Oi. :)
     
  35. Jos-Yule

    Jos-Yule

    Joined:
    Sep 17, 2012
    Posts:
    292
    This is what i'm getting when i use the punch through stuff (using the same setup as in the above screen shot)



    199.189.26.14 is the "other" computer doing the "Punchthough". 54.172.52.208 is my EC2 Facilitator instance.
     
  36. Jos-Yule

    Jos-Yule

    Joined:
    Sep 17, 2012
    Posts:
    292
    So, trying to connect to another machine with just the asset imported in an otherwise empty unity project (unity 5.3.4f1 / Nat 1.41) I'm getting this

     
  37. TCROC

    TCROC

    Joined:
    Aug 15, 2015
    Posts:
    230
    Ok so I haven't purchased this product yet but it appears to be exactly what I am looking for! I have recently tried using another networking service but it has been quite difficult to set up over WAN and the developers are hard to contact. (By hard I mean they respond but very slowly like a couple of days with only one message. Then I respond back and they respond back in another couple of days making it almost impossible to fix my issue). So I have a few questions to ask before I purchase this product.

    1.) How active is support if I come across any issues?

    2.) Will NAT Traversal work on the consoles?

    3.) To go along with the question above, does NAT Traversal work with all platforms that Unity3d supports?

    4.) Is it cross platform? Can a Mac directly connect to a Windows PC? Or a Windows PC to an Xbox One or Playstation 4?

    5.) As someone knew to networking but experienced in programming, is this something that will be user friendly for me? And if not is there documentation or tutorials for getting things such as the Facilitator up and running?

    6.) Can the Facilitator run in an Amazon AWS Ec2 instance or with Azure?

    7.) Does this work with host migration as well? (Not asking if this package has code for host migration, but if I migrate hosts, will NAT Traversal run to connect all other clients who lost their previous host to the knew host directly?)

    8.) I saw that players can seamlessly go from relay servers to connecting directly, but can that happen in reverse and back again? As this could help with host migration if other players couldn't connect to the knew host directly, but could through the relay servers, and then back to direct connection if it was just taking too long.
     
    Last edited: Jul 21, 2016
  38. Jos-Yule

    Jos-Yule

    Joined:
    Sep 17, 2012
    Posts:
    292
    Making it further - my client is _almost_ connecting to the server, but is getting this error:

    NullReferenceException: Before using the library you should call Init() and do not forget to call Shutdown() afterwards
    UnityEngine.Networking.NetworkTransport.AddHost (UnityEngine.Networking.HostTopology topology, Int32 port, System.String ip) (at C:/buildslave/unity/build/artifacts/generated/common/modules/UNET/UNETworkingBindings.gen.cs:487)
    UnityEngine.Networking.NetworkTransport.AddHost (UnityEngine.Networking.HostTopology topology, Int32 port) (at C:/buildslave/unity/build/artifacts/generated/common/modules/UNET/UNETworkingBindings.gen.cs:472)
    NATTraversal.NetworkManager.directConnect (System.String externalIP, System.String internalIP) (at E:/_Noble Whale/NAT Traversal Stuff/NAT Traversal DLL/NATTraversalForUNET/NetworkManager.cs:465)
    NATTraversal.NetworkManager.StartClientAll (System.String hostExternalIP, System.String hostInternalIP, UInt64 hostGUID, NetworkID matchID, UnityEngine.Networking.Match.ResponseDelegate`1 joinMatchCallback, System.String matchPassword, Int32 eloScore, Int32 requestDomain, Boolean matchAlreadyJoined) (at E:/_Noble Whale/NAT Traversal Stuff/NAT Traversal DLL/NATTraversalForUNET/NetworkManager.cs:418)
    MenuController+<_JoinMultiplayerGameCoRoutine>c__Iterator91.MoveNext () (at Assets/Scarcity/Scripts/Controller/MenuController.cs:598)

    Where the MenuController's line 598 is:

    Code (CSharp):
    1. networkManager.StartClientAll(smm.publicIP, smm.internalIP, ulong.Parse(smm.guid), (UnityEngine.Networking.Types.NetworkID)(long.Parse(smm.matchID)));
     
  39. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    You can use it for two computers on the same LAN, or even two builds on the same computer, but yeah the only real test is two computers on separate networks.

    I'll have to dive a little deeper into the Open.NAT code to see if I can figure out what to do with that information. It would be cool to get it working for a some new routers so I could contribute back to the Open.NAT project.

    You seem to be having the same problems all over of ending up with port 0 for some reason.

    I really can't imagine how NetworkTransport.Init() isn't getting called but I guess for now just try calling it somewhere early, like in ExampleNetworkManager.Awake(). I'll see if I can find a more permanent fix for the next update.
     
  40. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Check out the history on this post, as well as the reviews on the asset store. You should see that fast and effective support is a common theme :)

    See the FAQ (at the bottom)

    No, desktop platforms only.

    Yes, for sure for desktop platforms. Not so sure about consoles, but I don't see why it wouldn't be possible.

    It shouldn't be any harder to use than UNet itself, or Unity's old networking system that also used a Facilitator. There is also a publicly accessible Facilitator hosted at grabblegame.com that you are welcome to use until you get your own up and running. It is really just a matter of copying a file to a computer and executing it though.

    There's some info specific to AWS on the FAQ. I don't believe it has been tested on Azure yet but you can always be the first :). I use rackspace personally but almost any hosting option should do.

    I haven't looked into host migration much yet so I'm really not sure. The plugin doesn't do anything to handle it, but you may be able to write a bit of extra code to get it to do what you want.

    Well the way the plugin works it tries all enabled connections at once. So if the direct connect finished first, it uses it. If the relay finishes first, it uses it but may replace it with a direct connection that finishes later. No need for switching back and forth I don't think.
     
  41. TCROC

    TCROC

    Joined:
    Aug 15, 2015
    Posts:
    230
    Thanks for the fast and detailed response! I'm definitely buying this asset! It's exactly what I've been looking for! :)
     
  42. NFMynster

    NFMynster

    Joined:
    Jul 1, 2013
    Posts:
    71
    Hello!
    What a wonderful read-up I just had on this thread, such a nice communication between the developer and the users!!
    I'm really looking into buying this asset, however, I have a few questions that I have not come across upon reading almost everything I can about this. (Excluded the thorough documentation haha)

    1.) Since I do not know much about hosting, can I use a VPS service for the Facilitator? (such as random google example )
    2.) Under the "connectRelay" in the documentation, I can see that no matter what, the host will still take a CCU. However, since the "Go Live" requires a pro-license, is it then necessary to have the pro-license?
    Source: Here
    3.) Related to question 2, I read that you made it UNET independent, so is everything in question 2 just old news? :p
    4.) In short, what are the differences between the facilitator server and the Unity Relay one?
    5.) Why aren't there more people like you haha
     
  43. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    I haven't tested everywhere but rackspace and aws for sure work. Any kind of hosting should do as long as it is externally facing (not behind any kind of router).

    If you want to launch your game and use the relays, then yes you need a pro license. Until you launch though you've got the 20 free ccu that Unity lets you use, so you can still at least test with the relays before paying to go live. You can also just turn relay connections and matchmaking off though and use absolutely no CCU, but then you'll have to implement your own matchmaking (steam lobbies are a popular choice) and you won't have the guaranteed connection that falling back to the relays give you.

    It can be UNET independent but then you lose access to the relays / matchmaking. By default it is tied into UNET so that connections will always work no matter. If you don't want to use UNET you need some other networking system (like Forge) and you'll have to implement your own matchmaking.

    Put simply, network traffic passes through the relays, it does not pass through the Facilitator. The Facilitator helps with the initial handshake between clients but then it is taken totally out of the loop and data passes straight from client to host. The relays on the otherhand act as a middleman between the host and clients, so all data passes through the relay server. The advantage of using the relays is that the connection will always succeed. The disadvantage is that it slows down each and every packet your game sends by adding an extra hop through the relay before a message gets from one player to another (and of course it costs money).

    There are dozens of us. Dozens! Honestly I just wish I had more time to put more work into it. There are things like steam integration and mobile support that I know people are itching to get but I just haven't had the time (yet!).

    Thanks for the kind words, hopefully that answers all of your questions.
     
  44. NFMynster

    NFMynster

    Joined:
    Jul 1, 2013
    Posts:
    71
    Alright, thanks, it cleared a lot!
    And you basically wrote all the code you need for the Steam matchmaking to work in the faq, awesome!
    So I'm right now using UNET for offline/LAN networking, however, if I were to make my own matchmaking, is there some network discovery functionality implemented in your solution?
    I might just use Steam however I just find it a bit unconventional to use Steam only for online multiplayer.. (or what?)
    - Not to mention that I would need to get Greenlit first.
     
  45. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Nothing built in, that's the sort of thing your actual networking system should provide (UNET, Forge, Photon, w/e). All the plugin does is add punchthrough / port forwarding functionality (and some nice fallback mechanisms when working with UNet). I don't think you would have any problem just using the network discovery built into UNET regardless of what actual networking system you end up using though.

    Unless I'm mistaken no one has a simple solution yet for tying the UNET api into the steam networking infrastructure. I'm sure it's possible just not sure how feasible. It's simple to use the lobbies for matchmaking (like the example from the FAQ), but tying into the actual networking system is a whole different mess. Ideally you would want to use the UNET api on all platforms but be able to switch between steam networking, unity's networking, and maybe xbox / ps4 networking. Not sure if that's feasible at the moment though so the direction I've been going so far is to just use UNET's networking and api for everything and hope someone figures out true steam integration later. If it's done properly it should be easy to patch in anyway. The alternative of using steam's networking api and being locked into steam for multiplayer, or having to write your networking code multiple times, just seems terrible.

    Hopefully that made some sense, honestly it's still pretty confusing to me. It took me a while to start thinking of the networking infrastructure as a separate thing from networking API. For example steam has their own relays that are totally free. So if we could connect via the UNet api to the steam infrastructure it would mean free relays without rewriting networking code to be steam specific (though I hear steam's relays are pretty crap).
     
  46. NFMynster

    NFMynster

    Joined:
    Jul 1, 2013
    Posts:
    71
    Alright, thank you so much for all the answers.
    So it seems like a free user cannot have more than 20 players hosting, if there isn't custom matchmaking implemented. Thanks!
     
  47. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Actually it's unfortunately even worse, in order for the match to show up in the match list it has to have an open slot, so each host has to start a match with at least two slots, one for the host and one so that it is open. So that means max of 10 simultaneous hosts.
     
  48. NFMynster

    NFMynster

    Joined:
    Jul 1, 2013
    Posts:
    71
    Alright, so small small teams should really try and contact Unity for making a deal on paying for their own bandwidth, to achieve the cheapest multiplayer solution. If this becomes possible, I will definitely buy this!
    Thank you for all your (fast) answers, great support!
     
    thegreatzebadiah likes this.
  49. Deleted User

    Deleted User

    Guest

    Hi, do you feel that this is still something that will be added to NAT Traversal for UNET?
     
  50. robochase

    robochase

    Joined:
    Mar 1, 2014
    Posts:
    244
    Thanks for all the awesome work! Buying this now! I do have a few questions however -

    host migration is kind of mandatory for multiplayer. The game just terminating when a host decides to leave is zero fun and a fast track to uninstalls & bad game reviews. i'm wondering how much extra work that code would be to get host migration working. speaking as someone who hasn't tried your plugin yet.

    A couple unrelated questions -
    What is the nat punch through success rate and what are the reasons for failure?
    Is failure a network configuration problem for certain players (meaning that they'll never be able to connect to that host with this technique until they change some router settings)? Or does the punch through routine just need to run multiple times until it makes a hole?

    In other words, I'm cool with a 20% failure rate if it just means i can attempt the punch through multiple times and it will go through eventually or until the player gives up. Falling back to the relay server is not something i'm interested in. Just trying to manage my expectations here.

    & lastly, what kind of latency gains have people been seeing by ditching the relay server and adopting your plugin? i have a couple interactions in my program that would really benefit from shaving some time off the trip to the relay server.