The MatchMaker : What i got so far + List of non working things that are supposed to, and advices.

Sooooo…

I have been fighting with this mathmaker for about two weeks now, and this is what i got so far

Creating a match works. Like this :

public void CreateMatch ()
    {
        CreateMatchRequest create = new CreateMatchRequest();
        create.name = "TestMatch" ;
        create.size = 2 ;
        create.advertise = true ;
        create.password = "" ;
        networkMatch.CreateMatch(create, MatchCreated);
    }

    public void MatchCreated (CreateMatchResponse matchResponse)
    {
        if (matchResponse.success)
        {
            matchCreated = true ;
            matchInfo  = new MatchInfo(matchResponse);
            Utility.SetAccessTokenForNetwork(matchResponse.networkId, new NetworkAccessToken(matchResponse.accessTokenString));
            StartHost(matchInfo) ;
        } 
    }

And NOT as described in the docs. you must add (matchInfo) after StartHost. otherwise you simply start hosting on your local network…

Same thing for the client : Joining a match works the same info. You request the matchInfo that you wish to join, join it, and if success you do StartClient(matchInfo), otherwise, you only try to connect your client to a localHost.

Now… since that took me some days… i now want to handle when the user Cancel a match he made…

The NetworkMatch.DestroyMatch(…) as described in the docs DOES NOT work.
Example :
networkMatch.DestroyMatch(matchInfo.networkId,CancelMatch) ;
will give you :
System.FormatException: FAILURE Returned from server: DestroyMatch Failed unity_GetAuthInfoFromSourceId appId=41551

Even you are 100 % you are trying to cancel a match that you created, and that you are passing the right networkID.

And last Thing :
If you create a match and StartHost()… Then… you StopHost().
You have to wait a few minutes for your match to be gone from the matchList. Otherwise, since you probably have coded in a way that you will join the first match that is opened to you and has enough space, you will try to rejoin the match that has now …no Host…

unity will give you
"
ArgumentException: An element with the same key already exists in the dictionary.
System.Collections.Generic.Dictionary`2[UnityEngine.Networking.Types.NetworkID,UnityEngine.Networking.Types.NetworkAccessToken].Add (NetworkID key, UnityEngine.Networking.Types.NetworkAccessToken value) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404) "

BUT : you will join the match, and there is no way to catch that error prior.
OnClientError and others similar functions will not trigger.

Conclusion : that matchmaker is simply not workable in its current state. Nowhere near prod ready for any game. Have fun with it may be, but right now, it simply does not work.
Unless i missed something, i am giving up on that matchmaker for now. i will finish my game with everything i want in, and will keep the matchmaker for the last part. Unfortunatly, there is no way to use another matchmaker service, with Unet, other than Unity’s. So that might involves re-coding the network logic of my game… which is a pain…

So, if anyone has something to add to it, point me to as to what i am doing wrong, or what should i go with… that would be appreciated, if not , i hope some people starting with the network and unet specifically will find those infos helpful.

1 Like

We ran into about the same list of issues that you have and spent a couple weeks trying to sort through the errors and issues. We purchase Forge networking last night and were running a game in 30 minutes. I think it took us longer to pull out the Unity networking than to add Forge.

@CaptainMurphy_1
I am thinking about doing just that. Can i ask you a few things though please :
: relay Server ? MatchMaker ? Reliable / efficient ?
: does it work the same way as Unet ( Syncvar, [ClientRPC] and [Command] ? ) ???
: I absolutly need a host/client solution, no dedicated server ( 1 v 1 short game… tower defense ). Does it work the same as unet as well ? or would it be complicated ?

Thanks in advance.

You can do anything that UNET does with Forge that we have seen so far. We have tested both client and server authoritative models and even tested a headless server too. The only thing out of the box that is not supported (that I have found yet) is being able to host your own Master Server, but they provide a master you can use called Arbiter Server. You can always ask them on their main thread here for more info. So far the documentation has been pretty clear and their demo/tutorial vids on YouTube have been very helpful.

I also came to the same conclusions as you guys but I think the team behind UNET is hard at work fixing stuff.

No doubt they are hard at work on it, but the whole UNet system is starting to smell a lot like Photon and that was not what we were wanting. Forge has met all of our needs so far and was a snap to get working. It won’t preclude us from using UNet in the future, just not for the current project.

To be fair, you are not forced to use any of the multiplayer services. You could easily code your own matchmaker using nodejs or something like that and deploy dedicated servers with the game running server only in batchmode. This is all currently supported.

and the match make does not work on my iphone 6. (the same code works on my windows). I suppose it’s the bug right now.

Does anyone knows if the matchmaker destroy match bug is fixed?

according to the 5.1.1 release notes:

  • UNET: Client is not sending/receiving packets and does not disconnect.

i believe that this is what was causing matches to not destroy properly. This should be fixed now

Yes, I think it’s fixed I did a quick test after my reply yesterday and it seems to work.

I wrote a short post about matchmaking for anyone who’s still stuck or confused

1 Like

Thanks Wontonst!