Hi folks,
I’ve been doing some investigations into using some different technologies to facilitate multiplayer connections and maybe some matchmaking thrown into the mix. The reasoning behind this is that it might be advantageous to have tighter integration between a game’s website and the actual game itself. (Think of a community-oriented site where it manages your friends list, win/loss ratio, various other stats from the game but could also allow you to challenge other players to a match while on the message boards or shoutbox etc.) Just wanted to bounce some ideas off the community here.
-So obviously site stats could be managed via MySQL and PHP by using Unity’s WWW class - that part seems fairly straight forward.
-What I am curious about is using that same method to do some matchmaking and lobby stuff. The idea is that when a user creates a server it pushes some info to a MySQL DB table (ip address, player name, some kind of player rating, whatever else you want). A client looking for a host will query that table in the same manner (conceptually) that MasterServer.RequestHostList() and MasterServer.PollHostList() work. At that point some matchmaking algorithmic magic would occur (for sake of example let’s say it just picks the host with the closest player rating to the client). The client then connects to the host and the host’s record in the connections table is subsequently removed if the max number of connections has been reached.
-Where my understanding breaks down is the limits of what is possible inside Unity and what is going on with a Facilitator when it attempts to connect 2 players. Would it be possible to write a C# script (or several) to allow Unity to handle connecting to another player? I would assume that this would be doable if you potentially have access to the System.Net namespace and I’ve seen some examples floating around of some C# UDP fanciness, but this isn’t really my area of expertise.
Any thoughts?