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

Timeline for integration with Steam networking & matchmaking

Discussion in 'Multiplayer' started by dan-kroymann, Apr 11, 2016.

  1. dan-kroymann

    dan-kroymann

    Joined:
    Feb 5, 2013
    Posts:
    17
    In your recent Reddit AMA, Larus mentioned that Steam networking support is on your immediate roadmap. Can you share any more information about your plans here?

    I am really enjoying the HLAPI, with the glaring exception of the matchmaking APIs which are woefully inadequate for our needs. As far as I can tell, there's no way to meaningfully filter the matches based on app defined criteria (ie: game mode, map, etc.), nor is there a way to give preference to nearby servers/hosts that are likely to have lower pings. Steam's networking/matchmaking APIs provide exactly these features, and as an added bonus their networking stack also attempts direct p2p connections via NAT punch through before falling back on a relay server. As a result, I am very interested in using Steam to establish my network topology, and then use UNET on top of that network.

    I spent last weekend digging through the UNET source code and hacking together a very rough proof of concept of this integration (still not done yet), but I would really rather discard this code and switch to a proper version implemented by Unity devs who have visibility into the LLAPI source code.

    Another one of the developers on my team recently began the process of migrating our game to Photon, purely because Photon has better matchmaking. All else being equal, we would prefer to stay on UNET, so if it turns out that UNET+Steam support is right around the corner (or if there is an alpha version that we can be early adopters of), then I would love to know that so we can abort the Photon work.
     
    schkorpio likes this.
  2. nocanwin

    nocanwin

    Joined:
    May 7, 2009
    Posts:
    176
    I too would love to hear about the plans for steam support and how far off it might be!
     
  3. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    If you haven't already run across it in your research you might be interested in my plugin that does something similar to the steam networking but for UNet. It attempts to connect directly via NAT punch-through before (optionally) falling back to the relays. Also includes automatic port forwarding which is pretty dope.

    You can check it out here: http://forum.unity3d.com/threads/re...g-punch-through-and-more.395835/#post-2583035
     
  4. nocanwin

    nocanwin

    Joined:
    May 7, 2009
    Posts:
    176
    I've run across it @thegreatzebadiah, but I'd like to avoid running my own facilitator if possible. I'd also like to go through steam matchmaking since my game is steam only and like the OP said, steam give you a little more ability to filter matches.
     
    Last edited: May 11, 2016
  5. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @nocanwin For what it's worth you actually can use steam's matchmaking with my plugin, or even with plain old UNet. The matchmaking / lobby stuff is totally separate from the actual steam networking connection so you are free to use one without the other.
     
  6. nocanwin

    nocanwin

    Joined:
    May 7, 2009
    Posts:
    176
    I'd just really like to know what the networking teams timeline is. Hopefully we'll get some answers when hack week is over.
     
  7. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    Ok hack wees is almost over... I cannot promise for sure, but steam support has one of the top priority right now with nat punching solution. Hence, the most priority task is stabilizing library. I m personally not satisfyed with stability and performance... When? Good, again cannot promise here, 5.5 or 5.6 i guess. 5.5 optimistic, 5.6 realistic dates (for steam)

    Sorry if i disappoint you
     
  8. AntonBertelsen

    AntonBertelsen

    Joined:
    Oct 13, 2014
    Posts:
    37
    I had hoped for earlier Steam support, but it's amazing to actually get a estimated release time. It's really great to have a developer communicating with the users again. :) - It's always preferable to get an answer, even if it's not what you wanted. It's much better than not getting a response at all.

    Can you perhaps also give an estimated time for when the library will be available?
     
  9. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    We are doing everything to publish it with 5.5, it is too late for 5.4 :(
     
  10. nocanwin

    nocanwin

    Joined:
    May 7, 2009
    Posts:
    176
    Thanks for the info @aabramychev! Like others have said it's better to have an answer you'd rather not hear than no answer at all. We need to be able to plan for the future. Here's hoping for 5.5 :)
     
    moco2k likes this.
  11. petersvp

    petersvp

    Joined:
    Dec 20, 2013
    Posts:
    63
    I never actually used ANY of the Unity networking. We already have plain old Net Scokets available, but I don't like these too. Using ENET or Steam NEtworking directly through separate threaded C++ Native plugin is my way to go. You bypass Unity's networking at all this way but you become responsible for everything as a side effect. C++ server & Unity Client is perfectly possible case with ENET / EnetSharp. Also Unity should open UNET's source code for everybody since this piece of code will make us possible to implement C++ servers and Unity clients, for example.
     
  12. simbaDraco

    simbaDraco

    Joined:
    Oct 16, 2014
    Posts:
    18
    Any update for this ?? our game is almost complete with broken HLAPI matchmaking :(
     
  13. alivegames

    alivegames

    Joined:
    Mar 25, 2014
    Posts:
    4
    Is this stopped? i see unet has 2 months with no update on bitbucket
     
  14. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    269
    FYI Photon Bolt already has a great Steam integration
     
  15. arutyutyu

    arutyutyu

    Joined:
    Apr 23, 2013
    Posts:
    1
    Any news??
     
  16. TheWesselGames

    TheWesselGames

    Joined:
    Aug 31, 2016
    Posts:
    31
    Still on the roadmap for 5.6?
     
    arutyutyu likes this.
  17. Frima

    Frima

    Joined:
    Jan 26, 2016
    Posts:
    52
    Bump!

    I want to start the development of a new multiplayer game on Steam. I would like to use uNet + Steam matchmaking+NAT. Do you have any news concerning Steam support? Any dates?

    I'm also looking at Photon Bolt. It seems quite easy to integrate Steam matchmaking system...

    Thank you!
     
  18. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    269
    Yes we have an SDK with Steamworks integration for punchthrough, relay, lobby, matchmaking, email support@boltengine.com for info
     
  19. TheDogtoy

    TheDogtoy

    Joined:
    Jan 5, 2017
    Posts:
    11
    Should we be using bolt? Did this get implemented in 5.5? Is it in 5.6?
     
  20. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    No, not yet, still in process...
     
    HiddenMonk likes this.
  21. Zullar

    Zullar

    Joined:
    May 21, 2013
    Posts:
    651
    Thanks for the update!
     
  22. robochase

    robochase

    Joined:
    Mar 1, 2014
    Posts:
    244
    heh, i got this working in a modified version of unet myself. it took a couple weeks to hook up. 80% of that time was me just combing through unet's code figuring out how it all works.

    this should be easy for unity devs to hook up, not sure what the hold up is here. i'm guessing there's probably some legal/logistical hurdles to get past because they'd probably need to bundle something like steamworks.net with unity, and develop a plan to accommodate changes to the steamworks api.
     
  23. moco2k

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    294
    Do you think you can share your experiences and lessons learned on bringing together UNET and steamworks with the community? Maybe in a separate thread?
     
  24. robochase

    robochase

    Joined:
    Mar 1, 2014
    Posts:
    244
    i may have been a little boastful when i said this would be easy :) in actuality, this was a pretty intense coding problem. the gist of it is not terrible, but learning UNET enough to manipulate it to your whim took a decent amount of study time and lots of notes (literally like 10 pages of diagrams in a sketchbook lol). i stand by my claim that a unity dev who knows UNET shouldn't have too much trouble coding this, though.

    unfortunately i don't have time to put together a comprehensive guide on this right now. when my game is finally shipped, i might have more time for a detailed writeup, however i can offer a brief summary of my approach so far.

    the approach involves a few key points to keep these changes minimally invasive. i wrote this code back in january, so my memory is a little foggy. but here i go:

    0. get familiar with grabbing UNET source code from bitbucket & making changes to it.

    1. keep in mind that UNET provides a couple ways to inject your own classes into the framework. you can inject your own version of NetworkClient & NetworkConnection into the mix. understanding these two classes & knowing which functions to override is vital.

    2. you want to look at where UNET calls on the NetworkTransport class and hijack it... Primarily, NetworkTransport does 3 important things that you want to short circuit: establishing connections, sending data, and disconnecting. for example, when it calls NetworkTransport.Send, you want to replace that with a call to the SteamAPI for sending a P2P packet.

    3. NetworkServerSimple and NetworkClient have functions where they poll the NetworkTransport class for data and react to connect/disconnect/data events. you want to hijack this and route it to the steam sdk instead. for connections & disconnections, you'll want to write your own code for establishing connections where clients send data to one another to let each other know they're there. you can use the steam lobby stuff to get players into a lobby together, using the lobby id as a way to establish a 'secure' connection.

    4. i have a class that polls the steam sdk for packets. when you ask the steam sdk for packets, it tells you which Steam ID the packet was sent from. so, you need to keep a mapping of Steam IDs to Network Connections. so basically you find the right network connection object, and you pass the data to its TransportReceive function. once that happens, UNET kind of takes over and figures out if it's an RPC/Command and does all the routing for you. which is kind of magic/happiness.

    i can probably expand on individual points if you have specific questions. it's hard to just dump a bunch of code about this because it's like 8 UNET source code changes and maybe a dozen classes outside of that managing everything. also no offense, but shakespeare has got to get paid, son 8)

    i'd be happy to put this on the asset store if i could, but i can't really bundle up UNET source code changes (i think! let me know if i'm wrong!)

    if you're on the fence about pursuing this, i can say that it's totally worth it, with caveats. a few immediate benefits: no relay servers, no bandwidth cap, no server costs & NAT punch through is immediately solved for you via the steam sdk. you can use the steam SDK to do voice chat too, which would cost you an astronomical amount of $ with unity's relay server plan (i've made substantial progress on voice chat integration, but it's not perfect yet btw...some audio popping i need to figure out still..less of a network problem at this point and more of an audio decoding issue...).

    caveats...you're tied to steam. but if you're releasing on PC wtf else are you going to do? haven't looked into console development yet, but i assume PS4 & XBONE have their own networking libs. if so, the above approach should still roughly apply, but instead of calling on the steam sdk, i'd be calling on sony/ms's sdk to do the same job. naive, i know :)
     
    Last edited: Mar 10, 2017
    Lofar42, Knil and moco2k like this.
  25. Knil

    Knil

    Joined:
    Nov 13, 2013
    Posts:
    66
    Any idea if this will make it into 5.6?

    We are looking in upgrading our game Tabletop Simulator from Unity 4 networking to Unet + Steamworks P2P.
     
  26. Raystorm

    Raystorm

    Joined:
    Mar 28, 2016
    Posts:
    9
    Any more news about this?
     
  27. Marijn_Kiwi

    Marijn_Kiwi

    Joined:
    May 15, 2013
    Posts:
    9
    Hi everyone,

    We're creating a new game for steam-platform, and would like to use the Unet NetworkServer. It wil be a p2p game only, no matchmaking or something like that, just the possibility to invite your friends and link them to the Unity NetworkServer. Has anyone got an idea how to get players invited through steam and after they accept the invite, make them connect to the NetworkServer as normal? Also, how does this work with the Steam PunchThrough? Or do users still have to setup port-forwarding to be able to join?

    Thanks in advance!
     
  28. robochase

    robochase

    Joined:
    Mar 1, 2014
    Posts:
    244
    have a look at the steamworks documentation - friend invites are built around the steam lobby system. they have a fairly straightforward writeup about inviting friends on the matchmaking page. basically if you're in a lobby, there's an API call you can use to invite a friend, and if they accept, they get a callback from the API with your lobby id that you can use to join that lobby. anyways, once they're in a lobby together, you can fire up unet whenever.

    it's up to you how heavily you want to rely on the HLAPI, or if you want to even use it at all. like you can just use steam's matchmaking lobbies & exchange connection info via the matchmaking lobby message system, then use that to fire up the HLAPI.

    if you want to use steam's P2P stuff with the NetworkServer, you're going to have to make some modifications to the HLAPI that i outlined in a previous post in this thread.

    users do NOT have to set up port forwarding for steam's P2P layer, though it might help somewhat. their service falls back onto a steam's relay server, and it's somewhat opaque to tell if your players are connected directly or via a relay.
     
    XCO likes this.
  29. TheWesselGames

    TheWesselGames

    Joined:
    Aug 31, 2016
    Posts:
    31
    Bump, any news?
     
  30. starikcetin

    starikcetin

    Joined:
    Dec 7, 2017
    Posts:
    340
  31. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    269
    If you want to easily use the Steamworks integration I recommend Photon Bolt, it lets you automatically use Steam punch, relay, lobbies. and matchmaking.
     
    XCO likes this.
  32. rempelj

    rempelj

    Joined:
    Aug 3, 2013
    Posts:
    54
    robochase and s-ta-c like this.
  33. starikcetin

    starikcetin

    Joined:
    Dec 7, 2017
    Posts:
    340
  34. robochase

    robochase

    Joined:
    Mar 1, 2014
    Posts:
    244
    nice, i'm glad someone was able to get a shareable project out there!