Amazon GameLift
开发人员指南 (版本 )
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 AWS 服务入门

FlexMatch 规则集架构

本主题记录了小型对战规则集和大型对战规则集的标准架构。使用规则语言( 中有详细介绍)来开发您的自定义值。

小型对战的规则集架构

在创建规则集时使用此架构来构建最多有 40 位玩家的对战。

{ "name": <descriptive label, string>, "ruleLanguageVersion": <must be "1.0">, "playerAttributes":[{ "name": <unique name for player attribute to be used by matchmaker, string>, "type": <attribute data type, allowed values are "string", "number", "string_list", "string_number_map">, "default": <value to use when no player-specific value is provided> }], "teams": [{ "name": <unique label, string>, "maxPlayers": <max players allowed in team>, "minPlayers": <min players required in team>, "quantity": <number of teams to create with this definition> }], "rules": [{ "name": <unique label, string>, "description": <descriptive label, string>, "type": <rule type, string>, "<type-specific property>": <property expression> }], "expansions": [{ "target": <rule/team and property to adjust value for, example: "rules[<minSkill>].referenceValue">, "steps": [{ "waitTimeSeconds": <length of 1st wait period before relaxing rule>, "value": <new value> }, { "waitTimeSeconds": <length of 2nd wait period before further relaxing rule>, "value": <new value> }] }] }

大型对战的规则集架构

在创建规则集时使用此架构来构建有 40 位以上玩家的对战。如果规则集中定义的所有团队的 maxPlayers 值超过 40,GameLift 将按照大型对战指南处理使用此规则集的所有请求。

{ "name": <descriptive label, string>, "ruleLanguageVersion": <must be "1.0">, "playerAttributes":[{ "name": <unique name for player attribute to be used by matchmaker, string>, "type": <attribute data type, allowed values are "string", "number", "string_list", "string_number_map">, "default": <value to use when no player-specific value is provided> }], "teams": [{ "name": <unique label, string>, "maxPlayers": <max players allowed in team>, "minPlayers": <min players required in team>, "quantity": <number of teams to create with this team definition> }], "algorithm": { "balancedAttribute": <name of player attribute, data type "number", to use when grouping players >, "strategy": <must be "balanced">, "batchingPreference": <choose between "largestPopulation" (default) or "fastestRegion"> }, "rules": [{ "name": <unique label, string>, "description": <descriptive label, string>, "type": <rule type, must be "latency">, "<type-specific property>": <property expression, must set value for "maxLatency"> }], "expansions": [{ "target": <rule/team and property to adjust value for, example: "rules[<rule name>].maxLatency">, "steps": [{ "waitTimeSeconds": <length of 1st wait period before relaxing rule>, "value": <new value> }, { "waitTimeSeconds": <length of 2nd wait period before further relaxing rule>, "value": <new value> }] }] }