google玩游戏支持排位匹配和排行榜吗?

Does google play games support ranked matchmaking and leaderboards?

我几乎决定使用 google 游戏服务来实现 android 和 ios 的实时多人游戏。

  1. 我想弄清楚我是否能够通过在每场比赛结束时根据游戏状态信息增加和减少他们的等级来管理玩家等级。这可以使用他们拥有的 XP 系统吗?
  2. 我需要能够根据等级进行配对。 (创建有资格互相比赛的玩家子集)
  3. 我需要能够显示具有所有排名和相应用户名的全球排行榜

使用 google 玩游戏可以实现这三件事吗?

是的,支持!

您需要的一切都在这里记录了吗?

Coexisting with Game Center and Play Games Services

I'm trying to figure out if I'll be able to manage player rank by increasing and decreasing their rank depending on game state information at the end of each game. Is this possible using the XP system they have?

您可以使用他们的排行榜来实现 xp 系统。只需将当前值作为分数保存到排行榜中即可。在下一次 xp 增加时,您可以加载玩家得分并更新该值。这是此任务的示例代码:

    private int myScore; // collect the new xp in a variable        

    ....

    // save it a specific time, e.g. game end
    if (mGoogleApiClient != null && mGoogleApiClient.isConnected()) {
        PendingResult<Leaderboards.LoadPlayerScoreResult> result = Games.Leaderboards.loadCurrentPlayerLeaderboardScore(mGoogleApiClient,leaderboardId,LeaderboardVariant.TIME_SPAN_ALL_TIME, LeaderboardVariant.COLLECTION_PUBLIC);        
        result.setResultCallback(new ResultCallback<Leaderboards.LoadPlayerScoreResult>() {
            @Override
            public void onResult(Leaderboards.LoadPlayerScoreResult loadPlayerScoreResult) {
                if(loadPlayerScoreResult != null && loadPlayerScoreResult.getScore() != null){
                    // update the xp value
                    Games.Leaderboards.submitScore(mGoogleApiClient, leaderboardId, loadPlayerScoreResult.getScore().getRawScore()+myScore);
                }
                else {
                    // never submited xp, do it a first time
                    Games.Leaderboards.submitScore(mGoogleApiClient, leaderboardId, myScore);
                }
            }
        });
    }

I need to be able to do matchmaking based on rank. (Create subsets of players that are eligible to play against one another)

您可以使用 RoomConfig Builder 中的 setVariant() 方法实现您的目标。假设我们用数字 1 标记 XP 小于 100 的玩家。对于这些人,您将在新游戏开始时调用 roomConfigBuilder.setVariant(1)。只有相同号码的玩家才能相互连接。

Further information: developers google

I need to ability to show the global leaderboard with all rankings and the corresponding usernames

排行榜系统提供 public 和社交(仅限好友)列表。