question

Brent Batas (Lisk) avatar image
Brent Batas (Lisk) asked

Best practice for canceling a player's matchmaking ticket if they ALT+F4 from your game?

Suppose a player wants to play a match, so they enter the matchmaking queue.

Then their game crashes (or they ALT+F4).

This would mean the program would exit without being able to call something like CancelAllMatchmakingTicketsForPlayer()

It seems, then, that a player could be matched who already quit the game. This will be a pain point in our game, because a match is ruined if a player doesn't show up. It would also feel bad for the disconnected player (for being AFK) if they are punished for the fact that their game simply crashed.

What is a best practice for handling this case?

Custom Game ServersMatchmaking
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brandon@uprootstudios.com avatar image
brandon@uprootstudios.com answered

While I don't know for sure, I'd imagine the best way to handle this would just have a somewhat-shorter timeout period so if the player terminates during MM and their ticket doesn't match, it will timeout.

For the actual in-game handling of the player leaving before their ticket is cancelled, if they match and are put in a game you should have your server check if they have left before the game has started and if so, either end the match or use a Backfill Ticket to try to put another player into the game

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Brent Batas (Lisk) avatar image Brent Batas (Lisk) commented ·

Hmm, I see. So something like having a pretty low timeout of like ~5 seconds, then just create a new matchmaking ticket every 5 seconds? It feels kind of wasteful to have tons of API calls just for the sake of an edge case, but I can certainly try it if it's the recommended approach.

Yeah, currently we do a "match canceled" if a player fails to connect in the first 90 seconds. It's still pretty annoying for the players, though, since they will have spent 90 seconds + another minute or so in the loading screen, plus they have to requeue again. Canceling a match that already started should be a last-resort.

Backfill tickets probably won't work for us, since our game's gameplay doesn't lend itself well to joining someone else's game in progress. It looks like a cool feature, though - thanks for pointing it out.

0 Likes 0 ·
brandon@uprootstudios.com avatar image brandon@uprootstudios.com Brent Batas (Lisk) commented ·

We use a similar strategy, although instead of waiting 90 seconds we wait the average time it takes to find a match (i.e. around 15 seconds), and if not all players have connected in time we discard the match (although we'll probably switch to backfill tickets later on).

I think having a timeout of about 30-120 seconds will be best since the worst case scenario is a player leaves during matchmaking and so they never connect to the server. If a player leaves after connecting but before the game starts, that should count as a win for the opponent(s) maybe?

0 Likes 0 ·
Brent Batas (Lisk) avatar image Brent Batas (Lisk) brandon@uprootstudios.com commented ·

Hi Brandon, just to clarify, for your case if after 15 seconds, a match isn't found, do you have the waiting player cancel its ticket & create a new one? I think I can adopt your strategy - it will just require some medium sized changes to my flow because I currently assume that when a match is found, it should always start a game server (in my current setup, players are instantly removed from matchmaking if they disconnect).

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.