Can one team start a game with this set of rules?

0

Hello!

Match in our game has two teams from 0 to 3 players (we add bots to fill both teams if there are no enough players) Here is an example of the flexmatch rule set:

    {
"name": "Team Battle",
"ruleLanguageVersion": "1.0",
"playerAttributes": [{
"name": "rating",
"type": "number"
}],
"teams": [{
"name": "black",
"maxPlayers": 3,
"minPlayers": 3
},{
"name": "white",
"maxPlayers": 3,
"minPlayers": 3
}],
"rules": [{
"name": "FairTeamRating",
"description": "Average team rating should be equal",
"type": "distance",
"measurements": ["avg(teams[*].players.attributes[rating])"],
"referenceValue": "avg(flatten(teams[*].players.attributes[rating]))",
"maxDistance": 100
}],
"expansions": [{
"target": "rules[FairTeamRating].maxDistance",
"steps": [{
"waitTimeSeconds": 10,
"value": 200
},{
"waitTimeSeconds": 15,
"value": 300
},{
"waitTimeSeconds": 20,
"value": 400
}]
},{
"target": "teams[*].minPlayers",
"steps": [{
"waitTimeSeconds": 30,
"value": 2
},{
"waitTimeSeconds": 35,
"value": 1
},{
"waitTimeSeconds": 40,
"value": 0
}]
}]
}

How to write rule FairTeamRating so that one player can start the game against bots?

已提问 5 年前172 查看次数
1 回答
0

Your sample looks close, but you can't use wildcards on expansions at the moment. So you'd have to expand white and black separately. Presumably one of those wouldn't go below 1 so that you ensure the game has at least one player.

已回答 5 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则