iosgame-centergamekitgkmatchmaker

Matching ranked or similar opponent


Is it possible in iOS Game Center to match an opponent with similar skills or ranking? I want to match an opponent with some ranged value such as experience or total score. I'm new with iOS matchmaking system. Thanks for any advice.

I did some research and found playerGroup and playerAttribute properties for match requests. Can these properties be helpful to me for what I want to do?


Solution

  • GKMatchRequest's playerGroup property is exactly what you are looking for. It's an unsigned 32-bit integer that you can set to player level (or a range of levels like 1-5, 6-10 etc. to increase number of potential players to match) for example and you will only get back a GKMatch with two players of that level (or level range).

    More info: Game Center Programming Guide / Player Groups