參考:與具有類似屬性的玩家建立大型比對 - Amazon GameLift

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

參考:與具有類似屬性的玩家建立大型比對

此範例說明如何使用 設定兩個團隊相符的規則集batchDistance。在 範例中:

  • SimilarLeague規則可確保比賽中的所有玩家在其他玩家中都有 2 league 個內的 。

  • SimilarSkill規則可確保比賽中的所有玩家在其他玩家中都有 10 個skill以內的 。如果播放器正在等待 10 秒,則距離會擴展為 20 秒。如果播放器正在等待 20 秒,則距離會擴展為 40 秒。

  • SameMap規則可確保相符的所有玩家都要求相同的 map

  • SameMode規則可確保相符的所有玩家都要求相同的 mode

{ "ruleLanguageVersion": "1.0", "teams": [{ "name": "red", "minPlayers": 100, "maxPlayers": 100 }, { "name": "blue", "minPlayers": 100, "maxPlayers": 100 }], "algorithm": { "strategy":"balanced", "balancedAttribute": "skill", "batchingPreference":"fastestRegion" }, "playerAttributes": [{ "name": "league", "type": "number" },{ "name": "skill", "type": "number" },{ "name": "map", "type": "string" },{ "name": "mode", "type": "string" }], "rules": [{ "name": "SimilarLeague", "type": "batchDistance", "batchAttribute": "league", "maxDistance": 2 }, { "name": "SimilarSkill", "type": "batchDistance", "batchAttribute": "skill", "maxDistance": 10 }, { "name": "SameMap", "type": "batchDistance", "batchAttribute": "map" }, { "name": "SameMode", "type": "batchDistance", "batchAttribute": "mode" }], "expansions": [{ "target": "rules[SimilarSkill].maxDistance", "steps": [{ "waitTimeSeconds": 10, "value": 20 }, { "waitTimeSeconds": 20, "value": 40 }] }] }