Late Joining Game Center Matches

Posted on Jan 13, 2015 in Code
james portrait
James Jacoby
Chief Technology Officer, Founder

During a concept discussion for a multiplayer game, the topic of matchmaking came up. Our goal from the start of the project was to architect the game so it relied 100% on Game Center and did not require its own server to coordinate matches or gameplay. Unfortunately, Game Center’s black-box matchmaking logic was a huge issue for us and we ended up having to move forward with a hybrid. However, I’d like to point out how the addition of a simple Game Center feature could greatly improve its usefulness to developers.

Realtime multiplayer games are only fun if you have other people to play with. It’s not fun to sit and wait for players, nor is it enjoyable to go to all the trouble to establish a match, only to have a player drop and end it. In a mobile game, where players are likely firing up the game for a quick fix while standing in line, the matchmaking process needs to be fast and seamless. Furthermore, players are likely to drop out, leaving the game in an unplayable state.

Currently, Game Center focuses on creating rigid matches which start and end in a very deliberate manner. There is no concept of filling seats in existing games. Therefore every game and player combo needs to be join together at the start, and if a single user abandons a game that requires a minimum amount of players the game is ended.

This model is suitable for games with long playing durations between friends. However, what if the individual player wants to press a single button to join with one or more other players — they don’t necessarily care who or how many? Currently the system would not match the individual to an empty seat in an existing game. Thus making it much harder for players to flow in and out of game sessions.

The counter argument against allowing this type of matchmaking is that given a sufficiently large pool of players, it doesn’t matter because there will always be enough people searching for games to keep everyone happy. However, this doesn’t hold up for several reasons:

  • When a game is first launched in the store, a large player base will not exist and players’ initial impression will be negative, making it very difficult for the game to become popular
  • Even popular games have “quiet times” which results in a poor user experience
  • Don’t forget about the plight of the players left in a partial match — they are forced to start a new game, but are more likely to just leave, lowering engagement

This issue could be remedied if Game Center added the ability to match players with games that are in progress but need additional players. When setting up a match, the developer could specify that players should be matched to games in progress which are low on players. An example of what this might look like:

#swift
class MatchViewController: UIViewController, GKMatchmakerViewControllerDelegate, GKMatchDelegate {
  var currentMatch: GKMatch!
  
  func startMatch() {
    var request = GKMatchRequest()
    request.minPlayers = 3
    request.maxPlayers = 8
    request.defaultNumberOfPlayers = 4
    
    // Hypothetical new parameter to allow joining matches in progress
    request.joinMatchesInProgress = true
    
    var matchmakerViewController = GKMatchmakerViewController(matchRequest: request)
    matchmakerViewController.matchmakerDelegate = self
    
    presentViewController(matchmakerViewController, animated: true, completion: nil)
  }
  
  func matchmakerViewController(viewController: GKMatchmakerViewController!, didFindMatch match: GKMatch!) {
    
    currentMatch = match
    currentMatch.delegate = self
    
    if currentMatch.inProgress {
      // insert game-specific code to handle joining a match already in progress
    }
  }
}

From here, everything else would be the same as a normal Game Center integration. The developer could implement specific game rules that dictate how players joining late in a game are treated, what to tell players in a match while they are waiting for another user to join, or the addition of bots to fill empty player positions.

Save Squarespace Forms to Salesforce