ルールのサンプル
Apply example matching rules for common game scenarios like one-versus-one, team-based, and asymmetrical matches.
読み終わるまでの所要時間 4 分最終更新 25日前
以下は、さまざまなタイプのマッチを作成するために使用できるルールの例です。
1 対 1
以下のコードは、チケットとプレイヤーデータの例です。{ "Name": "1v1", "BackfillEnabled": false, "MatchDefinition": { "Teams": [ { "Name": "Teams", "TeamCount": { "Min": 2, "Max": 2 }, "PlayerCount": { "Min": 1, "Max": 1 } } ] }}
{ "queueName": "Default", "attributes": {}, "players": [{ "id": "swsqozxo6qxm9fmm38khh3tddv35", "customData": {} }]}
QoS はマッチ内のすべてのプレイヤーに対して同等
以下のコードは、チケットとプレイヤーデータの例です。{ "Name": "1v1", "MatchDefinition": { "Teams": [ { "Name": "Teams", "TeamCount": { "Min": 2, "Max": 2 }, "PlayerCount": { "Min": 1, "Max": 1 } } ], "MatchRules": [ { "Name": "QoS", "Type": "Difference", "Source": "Players.QosResults.Latency", "Reference": 20, "Not": false, "EnableRule": true } ] }, "BackfillEnabled": false}
{ "queueName": "Default", "attributes": {}, "players": [{ "id": "w4505uhp7ohr27di0ob9qdncaq5b", "customData": {}, "qosResults:":[ // list the regions supported by the fleet where the match will be allocated { "regionId": "61dd5b48-d24c-11ed-afa1-0242ac120002", "packetLoss": 0.8, "latency": 50 }, { "regionId": "cf32c6e1-46ff-4904-9a37-359fc66bf382", "packetLoss": 0.0, "latency": 10 } ] } ]}
5 対 5、Red チーム対 Blue チーム
以下は、2 つの異なるチームが含まれるコードです。プレイヤーは、自分がプレイしたいチームを選択する必要があります。以下のコードは、互換性のあるチケットとプレイヤーデータの例です。{ "Name": "5v5 - Red vs Blue", "MatchDefinition": { "Teams": [ { "Name": "Team Red", "TeamCount": { "Min": 1, "Max": 1 }, "PlayerCount": { "Min": 5, "Max": 5 }, "TeamRules": [ { "Name": "Team Red", "Type": "Equality", "Source": "Players.CustomData.Team", "Reference": "Red", "Not": false, "EnableRule": true } ] }, { "Name": "Team Blue", "TeamCount": { "Min": 1, "Max": 1 }, "PlayerCount": { "Min": 5, "Max": 5 }, "TeamRules": [ { "Name": "Team Blue", "Type": "Equality", "Source": "Players.CustomData.Team", "Reference": "Blue", "Not": false, "EnableRule": true } ] } ], "MatchRules": [] }, "BackfillEnabled": false}
{ "queueName": "Default", "attributes": {}, "players": [{ "id": "e16naw0e6cgm8kw3vimtxt9qmhva", "customData": { "Team": "Blue" } } ]}
60 人のプレイヤー
バトルロイヤルのような、60 人のプレイヤーによるマッチです。チームはありません。 ゲームを開始するための最小プレイヤー数は、マッチ内の最も古いチケットが 15 秒経過した後、30 人に緩和されます。 バックフィル が有効になっているので、プレイヤーはマッチが作成された後に参加できます。以下のコードは、互換性のあるチケットとプレイヤーデータの例です。{ "Name": "60 Players", "MatchDefinition": { "Teams": [ { "Name": "Team", "TeamCount": { "Min": 1, "Max": 1 }, "PlayerCount": { "Min": 60, "Max": 60, "Relaxations": [ { "Type": "RangeControl.ReplaceMin", "AgeType": "Oldest", "Value": 30, "AtSeconds": 15 } ] }, "TeamRules": [] } ], "MatchRules": [] }, "BackfillEnabled": true}
{ "queueName": "Default", "attributes": {}, "players": [{ "id": "x7e9zb9t1928r0zw8x5j1sxhowkl", "customData": {} } ]}
20 チーム、各 3 プレイヤー
以下のサンプルには、3 人のプレイヤーによるチームが 20 チームが含まれています。ゲームを開始するための最小チーム数は、マッチ内の最も新しいチケットが 15 秒経過した後に緩和されます。チーム内のプレイヤー数は常に 3 人です。以下のコードは、互換性のあるチケットとプレイヤーデータの例です。{ "Name": "20 teams of 3 players", "MatchDefinition": { "Teams": [ { "Name": "Team", "TeamCount": { "Min": 20, "Max": 20, "Relaxations": [ { "Type": "RangeControl.ReplaceMin", "AgeType": "Youngest", "Value": 10, "AtSeconds": 15 } ] }, "PlayerCount": { "Min": 3, "Max": 3, "Relaxations": [] }, "TeamRules": [] } ], "MatchRules": [] }, "BackfillEnabled": true}
{ "queueName": "Default", "attributes": {}, "players": [{ "id": "91isf42z1n95lpv52upxrjc4ttvj", "customData": {} } ]}
チーム内のすべてのプレイヤーがそれぞれ異なるキャラクターを選択している
以下のコードは、互換性のあるチケットとプレイヤーデータの例です。{ "Name": "20 teams of 3 players", "MatchDefinition": { "Teams": [ { "Name": "Team", "TeamCount": { "Min": 20, "Max": 20, "Relaxations": [] }, "PlayerCount": { "Min": 3, "Max": 3, "Relaxations": [] }, "TeamRules": [ { "Name": "Different characters", "Type": "Equality", "Source": "Players.CustomData.Character", "Not": true, "EnableRule": true } ] } ], "MatchRules": [] }, "BackfillEnabled": true}
{ "queueName": "Default", "attributes": {}, "players": [{ "id": "1v0wykm1d3edny8mcdnx53yr7wrg", "customData": { "Character":"Cloud" } } ]}
非対称の 5 対 1 - 人間対モンスター
Human (人間) チームのすべてのプレイヤーは、Human の値がtruetrue以下のコードは、互換性のあるチケットとプレイヤーデータの例です。{ "Name": "Asymmetrical 5v1", "MatchDefinition": { "Teams": [ { "Name": "Human", "TeamCount": { "Min": 1, "Max": 1, "Relaxations": [] }, "PlayerCount": { "Min": 5, "Max": 5, "Relaxations": [] }, "TeamRules": [ { "Name": "Human", "Type": "Equality", "Source": "Players.CustomData.Human", "Reference": "true", "Not": false, "EnableRule": true } ] }, { "Name": "Monster", "TeamCount": { "Min": 1, "Max": 1 }, "PlayerCount": { "Min": 1, "Max": 1 }, "TeamRules": [ { "Name": "Monster", "Type": "Equality", "Source": "Players.CustomData.Monster", "Reference": "true", "Not": false, "EnableRule": true } ] } ], "MatchRules": [] }, "BackfillEnabled": false}
{ "queueName": "Default", "attributes": {}, "players": [{ "id": "ngbbufcpbph227f42rpdv0v8zs75", "customData": { "Human": "true", "Monster": "false" } } ]}
いくつかの役割をマッチに含む必要がある
これらのルールにより、Human チームに以下の役割を持つプレイヤーを加えることが必須です。- Medic 1 人
- Tank 2 人
- DPS 2 人
以下のコードは、互換性のあるチケットとプレイヤーデータの例です。{ "Name": "Asymmetrical 5v1", "MatchDefinition": { "Teams": [ { "Name": "Human", "TeamCount": { "Min": 1, "Max": 1, "Relaxations": [] }, "PlayerCount": { "Min": 5, "Max": 5, "Relaxations": [] }, "TeamRules": [ { "Name": "Human", "Type": "Equality", "Source": "Players.CustomData.Human", "Reference": "true", "Not": false, "EnableRule": true }, { "Name": "Medic", "Type": "GreaterThanEqual", "Source": "Players.CustomData.Medic.Sum", "Reference": 1, "Not": false, "EnableRule": true }, { "Name": "Tank", "Type": "GreaterThanEqual", "Source": "Players.CustomData.Tank.Sum", "Reference": 2, "Not": false, "EnableRule": true }, { "Name": "DPS", "Type": "GreaterThanEqual", "Source": "Players.CustomData.DPS.Sum", "Reference": 2, "Not": false, "EnableRule": true } ] }, { "Name": "Monster", "TeamCount": { "Min": 1, "Max": 1 }, "PlayerCount": { "Min": 1, "Max": 1 }, "TeamRules": [ { "Name": "Monster", "Type": "Equality", "Source": "Players.CustomData.Monster", "Reference": "true", "Not": false, "EnableRule": true } ] } ], "MatchRules": [] }, "BackfillEnabled": false}
{ "queueName": "Default", "attributes": {}, "players": [{ "id": "l142lvdrbuyox8lwxs5sfyt8lshv", "customData": { "Human": "true", "Monster": "false", "Medic": 1, // the role the player chose "Tank": 0, "DPS": 0 } } ]}
ロビーライクなゲームサーバー
これらのルールは、実行中のサーバーがない場合に、誰かがチケットを作成したらすぐにゲームサーバーをリクエストするというものです。それ以外の場合は、バックフィルによって実行中のサーバーを補充します。{ "Name": "City", "MatchDefinition": { "Teams": [ { "Name": "City", "TeamCount": { "Min": 1, "Max": 1, "Relaxations": [] }, "PlayerCount": { "Min": 1, "Max": 100, "Relaxations": [] }, "TeamRules": [] } ], "MatchRules": [] }, "BackfillEnabled": true}
{ "queueName": "Default", "attributes": {}, "players": [{ "id": "cb108q26yxt3lldyjfg54p8uuayk", "customData": {} } ]}
プレイヤーが自分のいる都市を選択できる
マッチ内のすべてのプレイヤーは、都市が同じでなければなりません。その都市でマッチが見つからない場合、Matchmaker はその都市のための新しい割り当てをリクエストします。以下のコードは、互換性のあるチケットとプレイヤーデータの例です。{ "Name": "City", "MatchDefinition": { "Teams": [ { "Name": "City", "TeamCount": { "Min": 1, "Max": 1, "Relaxations": [] }, "PlayerCount": { "Min": 1, "Max": 100, "Relaxations": [] }, "TeamRules": [] } ], "MatchRules": [ { "Name": "City", "Type": "Equality", "Source": "Players.CustomData.City", "Not": false, "EnableRule": true } ] }, "BackfillEnabled": true}
{ "queueName": "Default", "attributes": {}, "players": [{ "id": "cb108q26yxt3lldyjfg54p8uuayk", "customData": { "City": "Azarel" } } ]}