Search Unity

Match Up - Drop in matchmaking system

Discussion in 'Assets and Asset Store' started by thegreatzebadiah, Nov 7, 2017.

  1. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Provides easy-to-use, hassle free matchmaking support for any networking system.
    Just call CreateMatch() or GetMatchList() to get started. Once you've selected a match from the list you can join it with JoinMatch(). It's as simple as that.

    Also includes advanced filtering options and the ability to store additional data related to the match.


    Asset | Docs | API

    Painless to Use
    Just drop it in and go. There is no set up and nothing to configure. Even the most advanced features are a breeze to use.

    Advanced Features
    MatchData and MatchFilters can easily be used to implement an ELO system or any other kind of filtering you desire.

    Fully Documented
    Absolutely everything is fully commented and documented including the example scripts. The API is available online and updated with each release.

    Professional Support
    We have a consistent record of prompt and effective support. Contact us via email, forums, or discord any time and we will work with you to resolve any issue.

    Supports Windows, Linux, OSX, Android, IOS, and probably anything else Unity runs on (but not WebPlayer)

    Full source code is included for both the client and the matchmaking server.


    But Why?
    The primary motivation for creating this was so that small time developers like myself wouldn't be so dependent on Unity's multiplayer services. Having a matchmaking server that we can host ourselves frees us from Unity's services and allows us to choose our own hosting option.

    Requirements
    Unity 5.3 or above. Tested in 5.3.0f4, 5.4.0f3, 5.5.0f3, 5.6.0b11, 2017.1.0f3

    Matchmaking requires a matchmaking server. By default Match Up uses a test server that
    we've set up. You are welcome to use the test server while developing your game, but you will want to host your own matchmaking server before releasing, as the test server could go down at any time.

    The server side component is included with the plugin. It is a tiny executable that should run on just about any flavor of Linux. Just copy it to your server and run it, then make sure to update the matchmakingURL on your Matchmaker component to point at your server.
     
    Last edited: Mar 27, 2023
  2. Fsilva

    Fsilva

    Joined:
    Mar 31, 2015
    Posts:
    36
    Is the others assets that you made will be compatible with this one?
     
  3. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    590
    @Fsilva
    Yes! Match Up has no problem working with NAT Traversal and Smooth Sync.
     
  4. msantore22

    msantore22

    Joined:
    Nov 19, 2015
    Posts:
    24
    I'm very much In need of this. When will it be available on the asset store? I bought your other 2 assets already. I'l buy it as soon its available depending on the price. Thanks
     
  5. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    We've been waiting for it to be approved for quite a while now. I'm assuming they are holding off on approving new assets until after the sale is over so look for it around then. The price will be $14 USD.
     
    ScoobyNooby likes this.
  6. msantore22

    msantore22

    Joined:
    Nov 19, 2015
    Posts:
    24
    cool, thank you for letting me know. can't wait to buy it! :)
     
  7. PartyBoat

    PartyBoat

    Joined:
    Oct 21, 2012
    Posts:
    97
    I'm a big fan of your networking stuff and own the other two assets you've made, so this definitely looks promising to me!

    Can you comment at all on how stable the matchmaking server is, and have you done any stress testing or measured up-times at all? Is there any built in functionality for the matchmaking server to self-manage any problems (e.g. If it goes down while I'm asleep can it reset itself?). I think this asset will live and die by how rock solid the matchmaking server is, and we all know how questionable even AAA master servers can be sometimes.
     
  8. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    I have not done any real stress tests, but I have thoroughly checked the code for things like memory leaks using valgrind. As far as making sure it stays up as much as possible I would recommend a simple solution like this https://www.digitalocean.com/commun...simple-bash-script-to-restart-server-programs

    I fully expect that there will be at least some issues, but it's a very simple program so I'm confident that I anything that comes up will be simple to address. The full source for the server is also included with the plugin so you can hack away at it on your own.

    If you have any recommendation / methods for stress testing I can give it a go. I'm not sure if there's some standard way to go about it other than writing some code to quickly create / list / join a ton of matches.
     
  9. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Match Up 1.02 RELEASED

    It's finally out! The test server is up and running. Let me know if you have any questions while getting started and I will start compiling a FAQ.

    NOTE: If you are using Match Up in combination with the NAT Traversal plugin you will need to add MATCH_UP to the Scripting Define Symbols in the Player settings. This will allow the plugins to work together and also allow you to use the ExampleMatchUp scene and script that are included with the NAT Traversal examples.

    @msantore22
     
  10. PartyBoat

    PartyBoat

    Joined:
    Oct 21, 2012
    Posts:
    97
    Well that's good to know, thanks for the link! I suppose the main test I can think of would be to create a couple hundred fake client connections to see how well it handles sudden increases in activity. Might be worth adding some kind of message queue/buffer system (if it doesn't already have one) to prevent overloading the matchmaking server with too many requests at the same time if that turns out to be a problem.

    P.S. It still says "[Submitted but not yet released]" in the OP.
     
    thegreatzebadiah likes this.
  11. fmelogno

    fmelogno

    Joined:
    Oct 2, 2016
    Posts:
    24
  12. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Sure, it's just

    Code (CSharp):
    1. echo $_SERVER['REMOTE_ADDR'];
     
  13. fmelogno

    fmelogno

    Joined:
    Oct 2, 2016
    Posts:
    24
    Thank you.
     
  14. msantore22

    msantore22

    Joined:
    Nov 19, 2015
    Posts:
    24
    just purchased it. looks good so far
     
  15. fmelogno

    fmelogno

    Joined:
    Oct 2, 2016
    Posts:
    24
    I have other question, i have my own linux server hosting in godaddy, it actually hosts my wordpress site.
    The doubt is, I have to upload the MatchUpServerSource.zip in the root folder and extract it, and then how do i execute it?
    Could it change the operation of my wordpress site?

    Thanks.
     
  16. fmelogno

    fmelogno

    Joined:
    Oct 2, 2016
    Posts:
    24
    Update, i used the command make but i got this errors:
    I think that occur because the version compiler of my server gcc is 4.4.7?

    Code (CSharp):
    1. mkdir -p ./bin/debug/
    2. mkdir -p ./obj/debug/
    3. gcc  ./src/sqlite/sqlite3.c   -c -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIK                                                             E_DOESNT_MATCH_BLOBS -DSQLITE_MAX_EXPR_DEPTH=0  -O0 -o obj/debug/sqlite3.o
    4. g++  -c ./src/main.cpp -Wall -std=c++0x -lpthread -ldl -O0 -g -o obj/debug/main.                                                             o
    5. In file included from ./src/main.cpp:4:
    6. ./src/Debug.h: In static member function 'static void Debug::SqlError(int, sqlit                                                             e3*, std::string)':
    7. ./src/Debug.h:54: error: call of overloaded 'to_string(int&)' is ambiguous
    8. /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_                                                             string.h:2604: note: candidates are: std::string std::to_string(long long int)
    9. /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_                                                             string.h:2610: note:                 std::string std::to_string(long long unsign                                                             ed int)
    10. /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_                                                             string.h:2616: note:                 std::string std::to_string(long double)
    11. ./src/main.cpp: In function 'int main(int, char**)':
    12. ./src/main.cpp:158: error: call of overloaded 'to_string(int&)' is ambiguous
    13. /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_                                                             string.h:2604: note: candidates are: std::string std::to_string(long long int)
    14. /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_                                                             string.h:2610: note:                 std::string std::to_string(long long unsign                                                             ed int)
    15. /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_                                                             string.h:2616: note:                 std::string std::to_string(long double)
    16. make: *** [obj/debug/main.o] Error 1
    17.  
     
  17. fmelogno

    fmelogno

    Joined:
    Oct 2, 2016
    Posts:
    24
    Update,
    Changing to_string(int) to to_string(long long int),
    and changing loop for for other loop for who the gcc compiler accept worked to make the exe file.
    but when execute; it create the matchServer database, but get the error: Error on acceptCan't open database
     
  18. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @fmelogno You shouldn't need to compile from source unless you're changing the source. There is a precompiled executable (MatchUpServer) included with the plugin that should be easier to get working.

    Your final error about not being able to open the database may be some sort of permissions error. The database lives in a file that sits next to the executable so you'll want to make sure the user that runs the executable has permission to create / read / write files in the same directory.

    My gcc version is 4.6.4 so I guess anyone compiling with anything older than that is likely to run in to some issues.
     
  19. msantore22

    msantore22

    Joined:
    Nov 19, 2015
    Posts:
    24
    i have a little bit of an offtopic question regarding one of your other assets. for the nat traversal, i found github repository over here: https://github.com/strich/KeyHoleNAT which has an MIT licence. it uses mono.nat + a Stun Server to create punchthrough effect. as i understand it, Stun servers have a higher success rate than raknet and are more likely to support websockets. could this be implented somehow along with matchup?
     
  20. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @msantore22

    It's hard to say without actually testing it but I don't see any reason why it wouldn't work with Match Up. Matchmaking is basically just a way to pass around connection data. It doesn't really care what you're doing with it. For example with NAT Traversal I store the host's GUID (assigned by the Facilitator) as part of the match data. The clients get the GUID from the match data and use it for punchthrough. I imagine you'll be able to do something similar with KeyHoleNAT.
     
  21. fmelogno

    fmelogno

    Joined:
    Oct 2, 2016
    Posts:
    24
    Hi again, i think that the error its some about problem in listen port: 20202.

     
  22. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Hmm, good catch. Not entirely sure what's going wrong though. What are the specs of the server that is running on? Are you still compiling form source or is that from the precompiled binary?
     
  23. fmelogno

    fmelogno

    Joined:
    Oct 2, 2016
    Posts:
    24
    I'm using the executable already included, its create the database MatchUpServer.db, but can not open it !.
    The permission is 755
     
  24. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    You may be able to get some more output by throwing a -v on there.
     
  25. fmelogno

    fmelogno

    Joined:
    Oct 2, 2016
    Posts:
    24
    It's a linux server, based on Godaddy, deluxe hosting
     
  26. fmelogno

    fmelogno

    Joined:
    Oct 2, 2016
    Posts:
    24
    I tried with -v option, but i got the same output.
     
  27. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    You may already know this if you're looking at the code but the "Failed to bind" message comes from the socket failing to bind. My guess is binding to "any" ip isn't working. You can try passing in a specific ip like:

    ./MatchUpServer -i 51.63.177.100
     
    Last edited: Dec 12, 2017
  28. fmelogno

    fmelogno

    Joined:
    Oct 2, 2016
    Posts:
    24
    when I pass a specific ip fail in the same line, after first 50.62.176.... IP
     
  29. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    You can also use:
    netstat --numeric | grep 20202

    to check on the status of that port. If it's ESTABLISHED or TIME_WAIT when the MatchUpServer server is not running then maybe I'm not always cleaning up the port correctly. The OS should free the port after 4 minutes though.
     
  30. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    To dig any deeper I'm going to have to add some more error logging around the socket binding. I'm off to the grocery store right now but I'll dig into this more when I get back.
     
  31. fmelogno

    fmelogno

    Joined:
    Oct 2, 2016
    Posts:
    24
    Ok, thanks!
     
  32. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @fmelogno I've got a new server build for you to try out with some improved logging. If you email me at the support email I will send it to you.
     
  33. fmelogno

    fmelogno

    Joined:
    Oct 2, 2016
    Posts:
    24
    Hi again, I think the problem is on the server. I tried the new compilation and the server does not have the lib GLIBCXX.
    Code (CSharp):
    1. /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by ./MatchUpServer)
    I will try with the DigitalOcean server and I keep you up to date with the news.

    Regards.
    Federico
     
  34. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    ahh yeah, I guess I shouldn't be too surprised since I had a similar issue with the Facilitator for NAT Traversal. Maybe today I'll finally get around to setting up an environment to compile for different versions of GLIBC.
     
  35. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @fmelogno I finally got a new version of the MatchUpServer compiled with a much lower GLIBCXX requirement. I'm about to email it to you. Just posting here so anyone else searching can see that the issue is resolved.

    The new GLIBCXX minimum version is 3.4.0 which should cover even fairly ancient servers.
     
    Last edited: Dec 16, 2017
  36. msantore22

    msantore22

    Joined:
    Nov 19, 2015
    Posts:
    24
    The latest Nat Traversal comes with an example asset that shows you how to use it with match up. i myself took bits of that example code, and implented it into CCG Kit. now i have a working 2v2 ccg Game, with no need for game servers, other than the matchup and nat traversal.

    everything is working like a treat. although there seems to be an issue with the Matchup server itself. i had the program running for 3 days on my vps. then out of nowhere it just stopped running. i had to manually reboot the software. but maybe @thegreatzebadiah can look into that? i might just write a bash file that will monitor the program and relaunch it if it closes :D
     
    thegreatzebadiah likes this.
  37. fmelogno

    fmelogno

    Joined:
    Oct 2, 2016
    Posts:
    24
    Some Updates, the new compilation in GoDaddy server fails because not have the library: libstdc++.so
    Code (CSharp):
    1. ./MatchUpServer: error while loading shared libraries: libstdc++.so.6: cannot op                                                       en shared object file: No such file or directory
    2.  
    I delayed answering because I was trying on the digitalocean server, and in the first attemp with the first compilation, works like a charm.
    Thanks.

    Federico
     
  38. MicahDuck

    MicahDuck

    Joined:
    Nov 25, 2016
    Posts:
    8
    I have a Amazon ec2 Linux server and am trying to run your matchup on it. I'm a bit of a beginner with servers, i've created and connected to the server. How would I run the executable? Any help would be great thanks :)
     
  39. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    590
    @Micahdog
    It should just be
    Code (CSharp):
    1. ./MatchUpServer
    from the command line.

    You may have to run
    Code (CSharp):
    1. chmod +x ./MatchUpServer
    first to make it executable.

    Let me know if you have any problems.
     
  40. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @msantore22 I'm looking in to the crashes but I haven't been able to figure out the cause so far. If you notice any pattern to it definitely let me know. I've seen my own server go down once since launch so it's definitely a thing, but so far nothing I've tried has been able to bring it down.
     
  41. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Hmm, shame the other version didn't work but at least you've got it working. Cheers.
     
  42. Kobaltic1

    Kobaltic1

    Joined:
    Jan 22, 2015
    Posts:
    183
    Any chance we could get a windows version of the server?
     
  43. Kobaltic1

    Kobaltic1

    Joined:
    Jan 22, 2015
    Posts:
    183
    About that server??? Any chance of compiling it for windows or giving us the solution???
     
  44. dylan92

    dylan92

    Joined:
    Jul 10, 2012
    Posts:
    32
    @thegreatzebadiah Are you planning on adding a windows executable in the future? I'd definitely pick this up if I could easily get it running on my Amazon EC2 windows sever.
     
  45. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    590
    LostPanda likes this.
  46. LostPanda

    LostPanda

    Joined:
    Apr 5, 2013
    Posts:
    173
    watting for windows exe future, thanks!
     
  47. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    590
    @Kobaltic1 @dylan92 @LostPanda
    Alright, it looks possible and not so bad to do. I'll start working on it and get back to you all when I'm done.
     
    dylan92, LostPanda and Kobaltic1 like this.
  48. LostPanda

    LostPanda

    Joined:
    Apr 5, 2013
    Posts:
    173
    any news?thanks;)
     
  49. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    590
    @LostPanda
    It's a bit rougher than I thought. Probably by weekend's end.
     
  50. LostPanda

    LostPanda

    Joined:
    Apr 5, 2013
    Posts:
    173

    Thank you very much. Hope is getting better.