Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

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

  1. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
  2. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    I just submitted a new update. It should hit the store within a week or two. Changes to look forward to include:
    • Added support for 2018.1 (though the current build actually works anyway).
    • Added OnReadyToHostMatch() and isReadyToHostMatch.
    • Removed match created callbacks from StartHostAll() and StartServerAll()
    • Fixed false positives in port forwarding callback.
    • Maybe fixed port forwarding callback sometimes never being called.
    • Improved except handling in port forwarding.
    • Improved error message when trying to create a match but not hooked up to Unity's multiplayer services.
    • Replaced broken Facilitator executable with working one.
    • Update FAQ.
    • Updated documentation.
     
    Last edited: May 4, 2018
  3. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Just a heads up there is a new Demo out. It's very similar to the old one, just updated to use the latest version of the plugin. It now displays your connection type (just like the example scene in the plugin) so you'll know if you're connected via relay, punch through, or directly. If you are considering purchasing NAT Traversal, give the demo a try!
     
  4. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    NAT Traversal 1.59 Released
    • Added support for 2018.1
    • Added OnReadyToHostMatch() and isReadyForMatchmaking
    • Removed match created callbacks from StartHostAll() and StartServerAll()
    • Fixed false positives in port forwarding callback.
    • Maybe fixed port forwarding callback sometimes never being called.
    • Improved exception handling in port forwarding.
    • Improved error message when trying to create a match but not hooked up to Unity's multiplayer services.
    • Replaced broken Facilitator executable with working one.
    • Updated Demo
    • Updated FAQ
    • Updated documentation
    Wow that was fast! As always thanks everyone who pointed out issues or gave feedback. I added some improvements that should make it a bit less confusing to get started, especially when not using Unity's built in match making.

    There is now an OnReadyToHostMatch() method that you can override in the NetworkManager. This method will be called when the host has gathered all necessary connection data and is ready to host a match. If you're using Unity's matchmaking or Match Up then you don't need to do anything here, but if you're using custom matchmaking this is the place to create your match. I also added a similar isReadyForMatchmaking property that you can check if you don't want to use the method.

    I also removed the "match created" callback that could be passed in to the StartHostAll() and StartServerAll() methods. The callback was just causing confusion, and most people shouldn't need it anyway. If you do need to know when a UNET match is created, you can still override the OnMatchCreate() method, just make sure to call the base method.
     
    Last edited: May 5, 2018
  5. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @JWLewis777 Matchmaking is required as the Facilitator is not a matchmaker itself and has no way to list games. The only purpose it serves is negotiating ports between two players.

    The plugin uses Unity's matchmaking by default because everyone has access to it but you are welcome to use any matchmaking system you choose. Steam lobbies are a popular choice if you're releasing on steam. There's a bit in the FAQ about how to use them if you want to go down that path. You could also write your own matchmaking fairly simply, or you could use our Match Up plugin which integrates nicely with NAT Traversal. You could also just use Unity's matchmaking service. It doesn't cost anything. You're only charged for bandwidth over the relays so if you keep "Connect Relay" unchecked it will be free.

    [edit]
    If the reason you don't want to use it is that you already have your own matchmaking then all you need to do is pass around the guid along with your other connection data however you do that. Then the client's pass all the connection info in to StartClientAll
     
  6. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @JWLewis777 I'm posting again just to be super clear.

    NAT Traversal doesn't require matchmaking any more than any multiplayer game requires matchmaking. What it does require is some way for the clients to get the host's connection info so that they know where to connect. If you're not using UNET matchmaking or Match Up then you need to handle that yourself which means passing the info in to StartClientAll(). How you get it there is up to you. The guid is required to identify the host for punch though so make sure to include it.
     
  7. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Yes.

    Yeah, in this scenario "you" are performing the job of the matchmaker by copy and pasting the server's ip to the client.

    The minimum you need is the server's internal IP, external IP, port, and guid on the client. If you want to copy and paste them into some gui text boxes or some inspector fields that would work fine. On the server after you start hosting you can get the internal IP from NetworkPlayer.ipAddress. You can get the external IP from networkManager.externalIP. You can get the guid from networkManager.natHelper.guid. Also the port should be the networkPort on the network manager. Output those four things on the server, copy them to the client, and pass them in to StartClientAll() and you should be good to go.

    Unfortunately the plugin is very much designed with matchmaking in mind so you do have to go a bit out of your way to get it up and running without it.

    You'll need to modify the ExampleNetworkManager.cs so that the "Join" button calls StartClientAll() instead of ListMatches().
     
    hickna likes this.
  8. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @JWLewis777 Really not sure what the issue is, hosting without matchmaking seems to be working fine for me.

    I just opened up the example scene, unchecked "Connect Relay" and "Connect Matchmaking" and then modified the example script to not add the NetworkMatch component or call StartMatchmaker.

    The relevant part of my ExampleMatchMaker.cs now looks like this:
    Code (CSharp):
    1.         if (GUI.Button(new Rect(10, 10, 150, 100), "Host"))
    2.         {
    3.             //if (matchMaker == null) matchMaker = gameObject.AddComponent<NetworkMatch>();
    4.             //StartMatchMaker();
    5.  
    6.             StartHostAll("Hello World", customConfig ? (uint)(maxConnections + 1) : matchSize, false);
    7.         }
    When I click the host button it Hosts as expected with no errors.
     
  9. daggada2

    daggada2

    Joined:
    Sep 8, 2015
    Posts:
    9
    So I just upped to v1.59 and I notice when I run I'll sometimes get the log spammed with:

    NullReferenceException: Object reference not set to an instance of an object
    NATTraversal.NATHelper.Update ()

    This doesn't happen every time I run unfortunately, so that's no fun. But here's some output from my program, not sure how helpful it'll be, but might give you an idea as to timing... Seems to happen right after the host connects to itself.

    StartServer: Starting on udp port=12127 pw=
    OnStartServer
    OnServerConnect: connId=0 hostId=-1
    OnStartClient
    StartHostAll: STARTED
    OnClientConnect: connId=0 hostId=-1
    OnServerAddPlayer: connId=0 playerControllerId=0
    NullReferenceException: Object reference not set to an instance of an object << ERROR HERE, SPAMS
    NATHelper: Connected to Facilitator: 1526226108638884

    If I uncheck the NATHelper from my NetworkManager object, that obviously turns off Update calls, but that doesn't seem like a solution. I wish I could give some more info as to the cause. It seems to be some weird timing thing during initialization, is there maybe an object in the Update loop that could potentially require a null check?

    I know it's not a lot to go on, and so I'm trying to consistently trying to repro. If there's something I can provide just let me know...
     
  10. jaglitegrann

    jaglitegrann

    Joined:
    Feb 25, 2014
    Posts:
    10
    Hi, quick question. Is host migration supported when clients are connected through the relay server?
     
  11. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @jaglitegrann Unfortunately it is not. It's simply not possible because there is no way for a new host to take over an existing relay. This is an issue with Unity's services and not anything that can be fixed by the plugin unfortunately.
     
    Last edited: May 15, 2018
  12. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    [EDIT] You can probably ignore all of this except for the bold question at the bottom. I left the rest up anyway though because more info is always better.

    @daggada2 I don't see too much going on in the Update method that could cause null reference errors, but I've gone ahead and wrapped everything in null checks anyway. Hopefully it's not a symptom of some larger problem though. I really can't see how anything could be null but I'm probably just missing something.

    Just for reference the Update method looks like:
    Code (CSharp):
    1.  
    2.         virtual public void Update()
    3.         {
    4.             for (int i = portMappingDoneInfo.Count - 1; i >= 0; i--)
    5.             {
    6.                 if (portMappingDoneInfo[i].isDone)
    7.                 {
    8.                     portMappingDoneInfo[i].fireEvent();
    9.                     portMappingDoneInfo.RemoveAt(i);
    10.                 }
    11.             }
    12.  
    13.             if (justFinishedSearchingForNATDevice)
    14.             {
    15.                 if (natDevice == null)
    16.                 {
    17.                     if (LogFilter.logDebug) Debug.Log(TAG + "NAT Device not found");
    18.                     if (onDoneSearchingForNATDevice != null) onDoneSearchingForNATDevice(false);
    19.                 }
    20.                 else
    21.                 {
    22.                     if (LogFilter.logDebug) Debug.Log(TAG + "NAT device found");
    23.                     if (onDoneSearchingForNATDevice != null) onDoneSearchingForNATDevice(true);
    24.                 }
    25.                 justFinishedSearchingForNATDevice = false;
    26.             }
    27.         }
    portMappingDoneInfo is instantiated right when it is declared at the top of the class so I don't think it can be null when Update gets called. The only other place I use that list is when I:
    Code (CSharp):
    1.  
    2.             PortMappingDoneInfo info = new PortMappingDoneInfo();
    3.             info.onPortMappingDone += onPortMappingDone;
    4.             info.mapping = mapping;
    5.             portMappingDoneInfo.Add(info);
    So I don't think any of the entries can be null.

    And everything else in there is already wrapped in null checks.

    Let me know if you see anything that I'm not seeing. Like I said, I threw some more null checks in there, I'm just baffled as to how it's even possible to get a null there. Not that I don't believe you, you're not the first person to report this issue. I just keep adding more null checks but I feel like I'm missing something...

    [Edit] Maybe I just had a revelation after writing all of that up?
    I think that maybe the issue is in your callback and it's just being reported as if it is coming from NATHelper.Update because it's coming from a DLL so it's not able to properly stack trace. Are you using a custom port mapping callback? Either way I guess I need to rework that a bit, right now if the callback throws an error then the PortMappingDoneInfo entry never gets removed from the list so it will keep calling it over and over.
     
    Last edited: May 15, 2018
  13. daggada2

    daggada2

    Joined:
    Sep 8, 2015
    Posts:
    9
    @thegreatzebadiah Thanks for taking a look!

    Hmm, unfortunately I do not use a custom portmapping callback as you've shown above, no. And yeah looking at Update there, it's hard to see a potential offender there beyond portMappingDoneInfo. Pretty straightforward there.

    This issue has been tough to repro consistently, and I've since kept on developing elsewhere, and surprisingly have seen less of it lately. Perhaps it is something on my end, and I think it's a good thought that perhaps it's a false positive reporting that the DLL is the culprit if something else went wrong in that code path somehow.

    I'll keep at it and if I can get it to happen again more often, I'll see if I can get you some more info. And as an aside, if I can get it to happen frequently again, I'd be happy to try and zero in on the line if you wanted to pass me a DLL with instrumented code, maybe we can get a line number... But again, let me at least prove out that it's not something on my end.

    Thanks again =]
     
  14. daggada2

    daggada2

    Joined:
    Sep 8, 2015
    Posts:
    9
    Ok yeah, pretty sure it's not on my end. Or at least, I wasn't able to pin it to anything specific coming from the DLL code path. I've got a hunch it has something to do with initialization of something somewhere, perhaps even from my derived NetworkManager, perhaps I'm not calling a base somewhere?

    I probably should come up with a demo scene or something to try and isolate, but...

    I have it happening fairly consistently now, did you maybe want to try and grab some info from my setup, perhaps something with some debug, that I can show you from a run? I'm pretty curious myself what this could possibly be, given the contents of Update that you showed me... bizarre.
     
  15. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Sure, send me anything you've got. Logs or a project I can use to reproduce the error would be great.
     
  16. My64K

    My64K

    Joined:
    Jun 11, 2015
    Posts:
    10
    Hi, I'm having problems with the facilitator application.

    How do I specify which IP the facilitator will bind to? My Linux box has three. Only the third one is public and it only binds to the first two, which is of no use. I only want to to bind to a single public IP. Not any of the other two private IPs.

    EDIT: I've managed to find out that there is a -i and -p option. So I am using -i 0.0.0.0 Are there any other command line options available? The usual --? -? -h --h and --help didn't give any instructions.

    Thankyou
     
    Last edited: May 28, 2018
  17. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @My64K Glad you got it figured out.

    -i and -p are the only options.

    You can also pass in multiple IP's with -i if you separate them by a comma.
     
  18. ceitel

    ceitel

    Joined:
    Jan 3, 2017
    Posts:
    35
    @thegreatzebadiah
    I am unable to connect to a hosted game that is using ipv6 (or at least the ipv6 that http://ipv6.icanhazip.com/ is seeing.
    Running ipconfig from command line results in several different ipv6 addresses:
    Ethernet adapter Ethernet:

    Connection-specific DNS Suffix . :
    IPv6 Address. . . . . . . . . . . : a:b:c:d::g
    IPv6 Address. . . . . . . . . . . : a:b:c:d:e:h:i:j
    Temporary IPv6 Address. . . . . . : a:b:c:d:k:l:m:n
    Link-local IPv6 Address . . . . . : f::e:h:i:j%4
    IPv4 Address. . . . . . . . . . . : 10.0.0.100
    Subnet Mask . . . . . . . . . . . : 255.0.0.0
    Default Gateway . . . . . . . . . : f::eek::p:f:0%4
    10.0.0.1

    of these the one seen by icanhazip is the 'Temporary IPv6 Address'
    my router appears to see the first 'IPv6 Address' as well as the 'Link-local IPv6 Address'

    Topology
    Host: Home computer (IPv6 behind Xfinity router)
    Client: Work computer (static outward facing IPv4)
    Facilitator and Matchmaker: AWS (IPv4)
    Result: host is able to host a game and client can see match list, but cannot connect to host

    if I disable IPv6 at home...

    Topology
    Host: Home computer (IPv4 behind Xfinity router)
    Client: Work computer (static outward facing IPv4)
    Facilitator and Matchmaker: AWS (IPv4)
    Result: successful host and client connection!

    Any ideas why hosting from IPv6 isn't working?
     
  19. daggada2

    daggada2

    Joined:
    Sep 8, 2015
    Posts:
    9
    Hmm, it might be related to instantiation of an object with the asset's overridden NetworkManager on it. In my main launch scene there's an main control object which has the NetworkManager script on it, and that's saved into the scene. (It's one those "don't destroy on scene change" objects). When launching from this scene in the editor, I've never encountered this problem.

    However, for development purposes, when launching from within one of the other game scenes (that do not have he main control objected saved within them), I have a method that checks to see if the main control object exists, and if not, it then instantiates the main controller object right away. It seems when I do that, as soon as NatHelper calls Update, it starts spamming NullRef exceptions . I tried delaying the NatHelper script's enabling for a second or 2, just to see if perhaps something needing to initialize first, but no dice. As soon as update is called there's NullRef spam.

    Any thoughts there perhaps?
     
    Last edited: Jun 3, 2018
  20. piotr-gwiazdowski

    piotr-gwiazdowski

    Joined:
    Dec 2, 2015
    Posts:
    5
    Could you please make sure NATHelper shuts down all its threads on destroy? If it has trouble connecting with facilitator, the game freezes on exit.

    The simplest repro: open Example scene, change Facilitator IP to some rubbish, build a player with Example scene only, exit and admire the hang.

    EDIT: seems it happens too when Facilitator IP is set to its default (noblewhale.com). I am on Unity 2017.4.4f1.
     
    Last edited: Jun 8, 2018
  21. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Does this same connection work if you take NAT Traversal out entirely and connect directly to the ipv6 address via regular UNet? If so then I've probably done something wrong to break IPv6 support. If not then there's probably an issue with the client's network, or the host's, or somewhere in between.
     
  22. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    No thoughts yet but I think you've given me enough here to replicate the issue now.
     
  23. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    I'm downloading 2017.4.4f1 now but I'm not getting any hanging in 2017.4.1 so it's either something specific to that version or I'm failing to replicate the issue properly. When running the build should I exit immediately or try and wait for the facilitator connection to time out, or does it make no difference?
     
  24. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @piotr-gwiazdowski I'm not getting any hanging in 2017.4.4f1 either. Any other clues on how I can replicate the issue? Do you have any other unique project settings? What is your operating system?
     
  25. piotr-gwiazdowski

    piotr-gwiazdowski

    Joined:
    Dec 2, 2015
    Posts:
    5
    I've just created an empty project, nothing changes - still the same thing. I am sending you a link to the project & build via PM.

    My operating system is Windows 10.

    To recreate the bug, just try to close the game moments after the example scene has loaded - window becomes unresponsive and never recovers. If you run the game again and let it run for 20s or more, closing the game works.
     
    Last edited: Jun 15, 2018
  26. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    NAT Traversal 1.60 Released
    • Fixed hanging when quitting while connecting to Facilitator.
    • Improved connection replacing so that message handlers are not lost.
    • Added on-screen instructions to example scenes.
    • Updated external ip stuff to use noblewhale server instead of icanhazip which keeps going down.
     
  27. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    There may be an issue in the latest release if you use ServerChangeScene or the onlineScene on the NetworkManager. I've got a fix on the way already, but you may want to avoid updating to 1.60 until the fix is out. If you've already updated or you don't have an old version for whatever reason contact me at the support email and I can get you a working version. Sorry for any issues.
     
  28. Imtnt

    Imtnt

    Joined:
    Nov 13, 2013
    Posts:
    8
    I'm having some issues getting host migration to work. I'm using the example host migration script with as setup similar to the lobby example (using a menu scene and a game scene). FindNewHost seems to throw an InvalidCastException and I can't seem to determine why. It's pretty likely that I'm just missing something as it works fine in the included exam
     
  29. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @Imtnt
    If you call Initialize() or BecomeHost() you need to be careful to call it on a MigrationManager instance that is cast as NATTraversal.MigrationManager:
    Code (CSharp):
    1. ((NATTraversal.MigrationManager)migrationManager).Initialize(client, null);
    Initialize not being properly called would cause the error you're seeing, so that's my guess.

    Oh also if you extend from the NATTraversal.MigrationManager and override Start() you should make sure to call the base.Start() method.
     
    Last edited: Jun 24, 2018
  30. Imtnt

    Imtnt

    Joined:
    Nov 13, 2013
    Posts:
    8
    @thegreatzebadiah
    I'm using the example migration manager script, but I can't seem to find where Initialize is called. It seems like it is internally invoked by NetworkManager by SetupMigrationManager but in the example that is only called when leaving the game.
     
  31. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Can I see your HostMigrationManager.cs script?
     
  32. daggada2

    daggada2

    Joined:
    Sep 8, 2015
    Posts:
    9
    @thegreatzebadiah It appears 1.60 has fixed the issues I was seeing with nullref spam. Looking good now, thank you!
     
    thegreatzebadiah likes this.
  33. Imtnt

    Imtnt

    Joined:
    Nov 13, 2013
    Posts:
    8
  34. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @Imtnt Can you set your NetworkManager log level to "debug" and let me know if you see any "OnExtraPeerInfo" messages in the console?

    I'm really struggling to see what can be going wrong since your HostMigrationManager.cs is basically identical to the example.
     
  35. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @Imtnt I did just notice though that your HostMigrationManager.cs file contains a class called ExampleMigrationManager. Usually the file name should match the class name so maybe that's causing some weirdness?
     
  36. MarcinFuero

    MarcinFuero

    Joined:
    Jun 28, 2017
    Posts:
    6
    Hi,
    does your plugin support Android/IOS/Switch platform? (of course not as Facilitator but as client who would like to play p2p)
     
  37. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Android and IOS definitely not. I don't know enough about Switch to say for sure but probably not.
     
    MarcinFuero likes this.
  38. DaveLloyd

    DaveLloyd

    Joined:
    Nov 15, 2011
    Posts:
    21
    Hi!

    A getting started problem:
    • I am doing my own matchmaking (which has very different requirements to normal)
    • I've created myself a class derived from NATTraversal.NetworkManager
    • The first user in a room calls StartHostAll and records (in our own database) the natHelper GUID along with IP addresses.
    • Subsequent users call StartClientAll with the natHelper GUID and host IP addresses
    • I am running the Facilitator on an AWS instance and that all seems fine - I get the NATHelper connected to Facilitator messages
    • However when I force Connect Punchthrough by disabling Direct - I always disable Relay and MatchMaking - I do not get a connection.
    • I am running separately on Windows 10 and on a Mac
    • Both machines are on the same network and the NATHelper example works when I copy the guids by hand.
    • But I'm not seeing any evidence of trying the punchthrough even with the log level set to developer
    • Both machines talk happily when connecting directly
    • One oddity: on Windows the NATHelper reports NAT Device not found while the Mac reports NAT Device found - same network, same router (which should indeed be capable of uPnP).
    Any suggestions for how to attack this?
     
  39. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    I would output the guid on the host and output it again on the client before passing it in to StartClientAll(). I suspect the guid is becoming mangled. If you're storing it as a number in c# it's an unsigned long. In c++ that would be an unsigned long long. In mysql I believe it would be unsigned bigint. You're likely either unintentionally truncating the value somewhere or messing up some signed / unsigned conversion.
     
  40. DaveLloyd

    DaveLloyd

    Joined:
    Nov 15, 2011
    Posts:
    21
    I had the guid as a ulong but it turned out that I needed to wait for natHelper.isConnectedToFacilitator before calling StartHostAll() and then everything worked. Great stuff!
     
    thegreatzebadiah likes this.
  41. nauroman

    nauroman

    Joined:
    Nov 1, 2014
    Posts:
    13
    Hi. Thank you for your great asset!

    I use Unity 2018.2.b10 and NAT Traversal 1.60

    1. Load Example scene.
    2. Run it in editor.
    3. Press Host button
    4. Get the error:

    MissingMethodException: UnityEngine.NetworkPlayer UnityEngine.Network.get_player()
    NATTraversal.NetworkManager.StartHostAll (System.String matchName, System.UInt32 maxPlayers, System.Boolean advertise, System.String password, System.Int32 eloScore, System.Int32 requestDomain, System.Int32 directConnectPort) (at <dd567cf07d824ff88f7c1cec504b358a>:0)
    ExampleNetworkManager.OnGUI () (at Assets/NAT Traversal Example/ExampleNetworkManager.cs:66)
     
  42. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @nauroman Thanks for the heads up. I'm looking into it now.
     
  43. FromTheFuture

    FromTheFuture

    Joined:
    Jul 25, 2012
    Posts:
    57
    Hello,

    We're also having this issue in 2018.2.0f2. Any general idea of a timeframe for the fix?

    Appreciate your time!
     
  44. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @FromTheFuture, @nauroman I've got the update ready to go but it will take a while to be released on the store. If you'd like to get your hands on it faster hit me up at the support email and include your invoice number and I'll send you a copy.
     
  45. Sholms

    Sholms

    Joined:
    Nov 15, 2014
    Posts:
    84
    hello do you have plans to integrate it into playmaker?
     
  46. Bryan-Legend

    Bryan-Legend

    Joined:
    Sep 8, 2012
    Posts:
    80
    @thegreatzebadiah Any chance this tool could be integrated with steam's relay servers?

    The API is described in these:
    https://partner.steamgames.com/doc/api/ISteamNetworking
    https://partner.steamgames.com/doc/features/multiplayer/networking

    There's also an example for the steamworks.net wrapper:
    https://github.com/rlabrecque/Steamworks.NET-Test/blob/master/Assets/Scripts/SteamNetworkingTest.cs

    Would this be out of scope of the asset or something that could maybe work well?

    Bryan
    https://store.steampowered.com/app/711810/Never_Split_the_Party/
     
  47. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    I'm not that familiar with playmaker but what kind of integration would you be looking for? I guess you would want some way to start hosting or connect via playmaker? Maybe just need a custom action script or two? I've used playmaker in the past but not very extensively. If you can describe in a little more detail what you're looking for it might be something I can look in to. I've got some other stuff keeping my busy at the moment but if it seems quick and easy I might be able to fit it in.
     
  48. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Not any time soon. I believe I have seen some reports of success getting UNET to connect via the steam network so that it takes advantage of the steam punchthrough and relays, but last I checked it wasn't really a solved problem and seemed like a lot of ugly code.

    If your goal is to release on steam and not-steam my suggestion is:
    1. Google around for existing solutions for using the steam networking via unet.
    2. When running on steam, use whatever steam-via-unet code you find, since steam has punchthrough and relays built in.
    3. When not running on steam, fall back to NAT Traversal.
     
  49. Sholms

    Sholms

    Joined:
    Nov 15, 2014
    Posts:
    84
    Yes just actions like, start host, connect and get host list to array.
     
  50. Minamu

    Minamu

    Joined:
    Apr 28, 2014
    Posts:
    5
    Hi! Thanks again for this third party asset, it's been super helpful for us so far. Integrating it into a 2+ year old project wasn't without its pains (a dll file didn't get linked into VS on some PCs, but did on others o_O that took a while lol) but it has worked really great once we were up to speed.

    Lately though, we've noticed that changing scenes is acting up. Now, I can't say for sure if it's our code, or NAT Traversal to be honest. Going from the "offline" main menu.scene (where players join up) to a game match is working fine as far as loading a new scene goes. However, going back from an active game to the main menu lobby, alone or in a group, seems to have problems with getting all GameObject Components back to their default settings. This is primarily noticeable by the fact that it takes a couple of seconds for our Audio Listener to get activated, even though we never disable it to begin with. Same thing goes with the main menu graphics, besides the UI elements.

    I've noticed that the level we're coming from is still lying in the hierarchy for a few seconds before getting "deleted" even though we've reached the new scene, and when it does, the main menu's GameObjects start working. This creates a graphical and auditory hiccup to say the least :)

    A quick google search suggests it could be due to the game using the classic "SceneManager.LoadScene()" and not "LoadSceneAsync", but very long story short, we haven't found a way to change the NetworkManager's way of changing scenes, assuming LoadScene() is how you guys do it. Got any ideas I can relay to my team? :)

    I suppose it's a bit weird that it doesn't act up in both directions though, so I don't know. It's not like our game scenes are that big either, They're not even 10MB each, so I don't think that would bottleneck the loading that much, yeah?