View Full Version : Multiplayer lobby/matchmaking
ggambett
12-10-2004, 05:11 AM
The game I'm working on will have a multiplayer component. The idea is to have some kind of "board" and play a game loosely based on Risk, but instead of throwing dice, you play a level, and whoever gets a high score "wins". Note that both players do not see each other during the level - you play alone, if you make more points than your opponent, you win that round.
Since each "level" lasts 3-5 minutes, there's no need to have the players connected, and it can be server-based without consuming too much bandwidth, since all I'd need is exchange some data at the end of the rounds, and maybe keepalives during the game.
Now the questions...
1) I can't imagine how to do the matchmaking, from an user point of view. When the player enters the multiplayer mode, I could show a list of available players, but I see a huge potential for collisions - player A is available, player B and player C see A and click the "challenge this player" button, one of them gets A, the other gets an error message. That's awful! Finding an automatic match would work, but it takes away the idea of having friends and foes and personal vendettas against someone.
2) A complete "campaign", spanning many 3 minute levels, will be somewhat long. Players abandoning campaigns in the middle will be frustrating to other players. Most casual users won't play this mode, but is it reasonable to assume there will be enough serious players to make this work? Bots are an alternative but not the best one, I'm afraid.
Hamumu
12-10-2004, 06:59 AM
I've thought of things like this in the past, and my advice is make the levels much much shorter - something like Wario Ware would be really good, but maybe think like 30 second or 1 minute games. And of course make sure the opponents have things to do if they aren't playing at the same time (why not have 3+ player games as well? People not involved in the combat can keep setting up their moves or whatever while the 'battle' is played out). And lastly, besides keepalives, at a bare minimum, I'd be sending score updates every second or two - it's much more fun to see some aspect of what your opponent is up to, giving you something to fight for.
As far as matchmaking, I don't see a problem with the situation you describe. In a 2-player game, that's just how it works. When someone challenges you, you get a dialog asking if you wish to accept, and anybody else trying to challenge you gets a message "That player is already being challenged." That's perfectly fine. I still like >2 players better though, so the whole system would be different: one player sets up a game and waits with a big "set up game" dialog going, which people can join into until the game starter clicks go, or a maximum number of players is reached.
I don't see any reason for a campaign outside of single player play. Tournament style rankings is what the players will want. If they want to compete further against the same opponent, they can always just start a new game!
BantamCityGames
12-10-2004, 07:05 AM
For situation #1 I would say that the first person to challenge player A gets to play them immediately. Any players that try to challenge a split second later get a message that says something like: You are currently the 8th player on a waiting list to challenge player A. Do you wish to wait or leave?
I'm not sure about situation #2. Either the player left in the game should get some kind of reward for winning, or using the bot idea doesn't seem so unreasonable.
Hiro_Antagonist
12-10-2004, 10:50 AM
I recently coded a 2-player matchmaking server/lobby for Land of Legends, and it follows the same model I've always seen, which is what you've already described.
A player (A) can challenge another player (B) -- that player can reject or accept. If another player (C) tries to challenge one of them during that window, which is actually pretty rare, they get a message saying that user is already challenged/challenging. There are lots of games out there that use this model, and I've never seen it cause any real problems or annoyance.
Also, automated blind matchmaking is basically out of the question unless you are going to have a *massive* user base that exceeds a very high critical mass threshold. For all indie games and most commercial games, just provide a lobby and your players will be able to chat and challenge.
One last comment -- I've found the 'whisper' feature to be very handy in chat rooms where players can directly challenge one another. This allows players to politely ask another player if they're up for a game rather than cold-challenging them. If you don't have that, I recommend adding it.
-Hiro_Antagonist
Tubular
12-11-2004, 07:59 AM
I recently released the demo version of my game with this same sort of lobby behavior. If player C challenges player A just a second after player B, player A gets a message saying, "Player B is challenging you to a game." Player B gets a message that says "Waiting for A to accept your challenge," and player C gets the message, "Waiting to connect to A." If A accepts the game, it starts right away with B, and C gets the message, "A is already playing a game with someone else." Otherwise, B gets a refuse message, and C's challenge pops up next, along with the "Waiting for Player A to accept" message on C's screen...
Supposedly this happened a lot. The maximum number of simultaneous players online after the release was 21, and thanks to people's firewalls, most of them were waiting for someone without a firewall to connect. Then they'd all send invites at the same time. I got no feedback from the players to know how this worked out, though. (My own internet connection was way too slow to play against anyone.) I really don't see any other way to go about it.
ggambett
12-11-2004, 09:09 AM
Supposedly this happened a lot. The maximum number of simultaneous players online after the release was 21, and thanks to people's firewalls, most of them were waiting for someone without a firewall to connect.
I hope to avoid that problem doing all the communication via the server, using common HTTP requests. It won't work for realtime games, but in that case you could so something like this : http://www.mindcontrol.org/~hplus/nat-punch.html
Tubular
12-12-2004, 08:08 AM
in that case you could do something like this : http://www.mindcontrol.org/~hplus/nat-punch.html
Thanks for that link. This NAT problem was one I've been shaking my head at for a while. (I had a thread going over at GameDev.net earlier.) I'm using DirectPlay for my networking code, and DirectPlay 8 includes something called the NATResolver which I think basically does exactly what this link describes. The only reason I didn't implement it is because I don't have root access on my rented server, so I can't just go running any kind of server software that I want. Actually reading the idea spelled out like this made me realize I may be able to do it myself, in PHP or something. I'll have to give it a try.
In any case, you shouldn't have much trouble with simultaneous game requests. I understood you'd be running over HTTP from your first post. That seems like it would be such a relief. The day after I released my last demo, over 2,000 people logged in in 12 hours and 21 was as long as the list of players got. With everyone able to connect to eachother through HTTP, it should be extremely rare that anyone will have to wait for someone else to decide which game to accept, even with two or three times that number of players.
Also, I forgot to mention, in my game, "Auto Matchmaking," where the game automatically attempts to play with the player with the lowest ping, is an option. (As well as "Auto-accept Invitations.) I don't know if many people actually use this, but it was a request from my play-tester, and it couldn't hurt. It should take a lot of the pain out of connecting, for real beginners.
vBulletin v3.6.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.