Search Unity

CCU Apply to Matchmaking or Relay?

Discussion in 'Multiplayer' started by techmage, Feb 4, 2016.

  1. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,133
    So I follow what matchmaking is. Unity has a server running with a service which you can use to matchmake games for players. However what is the relay server? What is it's role?

    Also, I would assume in terms of matchmaking, the 100 CCU count would only matter for players actively using the matchmaking. So as a player is finding a match, they count as a CCU, but once they are connected to the other players, they no longer are taking up a CCU slot. Is that correct?

    How then do relay servers working into that?

    Also, is it then possible to connect players without taking up a CCU? Where they could type in the IP of the other person and correct directly?
     
  2. AllMightyNico

    AllMightyNico

    Joined:
    Jun 12, 2015
    Posts:
    14
    Hehe as I see, I am not the only one having trouble to figure out relay servers. First of all, the relay server is there to avoid difficultys with NAT and router-firewalls. In my opinion it's sort of a must-have if you don't want to exclude players with older routers.

    I also have trouble finding out how to use the relay server. In the documentation http://docs.unity3d.com/Manual/UNetInternetServicesOverview.html it says, that you have to use a Singleton. However, it is not described in detail on how to use it. The docs show that via a relay server, you can also send other data from client to client using the LAPI. If you find out something more about the relay server please let me know.
     
  3. JeremyUnity

    JeremyUnity

    Joined:
    Mar 4, 2014
    Posts:
    147
    @techmage The 100 CCU limit is purely a relay server concept, counting the number of player spots reserved on relay per game.

    For instance let's say a player creates a match with 4 players. The 100 free CCU will have 4 debited at that point, leaving 96 free. As players join that game the free CCUs will remain at 96. If another game with a 4 limit is made then another 4 will be debited, leaving 92.

    When one of those matches ends the CCU free count will go to 96, and when both are gone it will go back to 100. This pre-debiting is done to avoid any cases where a match is open, but players are unable to join because all free CCUs are taken already, even though the match is not full.

    @AllMightyNico I'm replying to your thread. Please try to keep these threads topical, doing so will make it easier to solve issues. I realize you ran into an issue with the documentation but this question was specifically about CCU.
     
  4. AllMightyNico

    AllMightyNico

    Joined:
    Jun 12, 2015
    Posts:
    14
    Okay, I apologize. And thank you for your patience and helpfulness :).
     
  5. JeremyUnity

    JeremyUnity

    Joined:
    Mar 4, 2014
    Posts:
    147
    @AllMightyNico, not a problem, i'm here to help! Let's see if we can get your issue solved too.
     
  6. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,133
    Can I use the Unity Networking system without the cloud relay servers and needing to take up CCU's?
     
  7. JeremyUnity

    JeremyUnity

    Joined:
    Mar 4, 2014
    Posts:
    147
    Yes, you can avoid matchmaker all together for LAN games if you use local discovery
     
  8. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    518
    For me is not clear, why CCU is not refreshed how it supposed to work?
    In my case I got prototype, testing multiplayer game. I got 2-3 player at once maximum, but in project multiplayer dashboard (developer web page) I see 18 out of 20 CCU used.
    Why data is not correct?
    Also, how can I remove project from multiplayer service?
     
  9. -chris

    -chris

    Joined:
    Mar 1, 2012
    Posts:
    99
    Aye, my multiplayer project's CCU has been stuck at 4 for a few days now, doesn't seem to move up or down, no matter if I'm using it or not.
     
  10. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    518
    would be nice to get explanation from Unity developers like @JeremyUnity . I really didn't find any info about it
     
  11. moco2k

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    294
    There is an explanation about how the relay server works here but it seems to be missing some aspects like the CCU cleanup stuff and such. Also I don't understand why such important information are only in the forum and not in the docs.

    @-chris: The malfunctioning CCU cleanup is a real issue at the moment indeed. There are some threads about this already, for example: #1 #2
     
    Last edited: Mar 31, 2016
    -chris likes this.
  12. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    518
    Time is going, but no progress at all with that issue. As well as no information about approximate terms for such important fix.
    I spend so much time to implement uNET to my project and finally just can't test it well because of not refreshed CCU counter. That is weird. Looks like I should migrate to another networking system
     
  13. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,191
    Can you please explain a bit more?
     
  14. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    This has been going on for ever now this issue!
    If im a sole developer developing and testing a game it should be impossible for me to use up 20 CCU while only hosting one game at a time, still i get the error that i have used up all my CCU frequently. ALso, why cant we remove old projects that somehow eats CCU but are abandoned for ages??
     
  15. faatal

    faatal

    Joined:
    Nov 21, 2012
    Posts:
    9
    I've been creating hundreds of test multiplayer games using matchmaking the last few days without problem.

    Today a few people tried a build and couldn't connect. Neither could I in the editor. CCU limit reached. Developer website shows CCU pegged at 20. After an hour it finally went down to 12. Started a game and is now stuck at 16.

    matchMaker.ListMatches shows a few of my own games created from PIE and they won't timeout. Yesterday they would be gone in a few seconds.

    Any update on when this will be fixed?
     
  16. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Yeah, today seems worse than usual for some reason.

    Edit: Anyone know if the CCU only counts for the whole play session, or is it removed as soon as a match is started?
     
    Last edited: Apr 8, 2016
  17. JustinAtParticleCity

    JustinAtParticleCity

    Joined:
    Apr 8, 2016
    Posts:
    4
    We've been using UNET matchmaking on our game for months, and all of a sudden today we are hitting CCU limit problems and are frequently unable to create new matches. There haven't been any changes to network-related code in weeks.

    When I use the matchmaker's DestroyMatch call, I get a successful response with no extended information. However, the match still shows up in the list the next time I use the ListMatches method. It says that there is 1 user still connected to each of our abandoned "zombie" matches. I suspect this is what's keeping our CCU count artificially high.

    We are still on 5.3.2.p4 -- is it possible a server-side change has made our disconnection code incompatible, or if there's a new server-side issue?

    Thanks in advance for any news.
     
  18. JustinAtParticleCity

    JustinAtParticleCity

    Joined:
    Apr 8, 2016
    Posts:
    4
    Long story short, if you kill the matchmaker using NetworkManager.
    StopMatchMaker (or never start it to begin with), you can use NetworkManager.StartHost in one session/device and NetworkManager.StartClient in another session/device and they will magically link up without going through UNet's matchmaking servers. The limitation is that they need to be on the same local network -- ie. connected to the same router.

    The source for NetworkManagerHUD shows how to do it:

    https://bitbucket.org/Unity-Technol...gerHUD.cs?at=5.3&fileviewer=file-view-default
     
    pKallv likes this.
  19. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,191
    Interesting, thanks.

    Would that mean that if two people are in the same place they would be able to create a network and connect via that?
     
  20. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Of course, Host and Clients are not connected to the matchmaker really, matchmaker is just a way of connecting clients to a host easier. You can use this to connect through the internet as well, but then you either need NAT punch through or a direct IP address (not behind a router).
     
  21. JustinAtParticleCity

    JustinAtParticleCity

    Joined:
    Apr 8, 2016
    Posts:
    4
    Yes, they need to be on the same LAN (usually this means being connected to the same router).
     
  22. JustinAtParticleCity

    JustinAtParticleCity

    Joined:
    Apr 8, 2016
    Posts:
    4
    A couple more data points to the zombie match issue:

    1) zombie matches seem to expire sometime between 2-3 hours after they are abandoned (and then the CCU drops accordingly) Note that you won't see them disappear from the Multiplayer Developer Dashboard until you actually create another game -- it seems the list is lazily culled.

    2) updating to the latest version of Unity (5.3.4p2) had no effect
     
    GrymmyD likes this.
  23. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    No, updating wont change anything since its a server side issue. They know about it and are working on a fix according to another post here, no one knows when it will arrive though : /
     
    GrymmyD likes this.