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?

asked 3 years ago12 views
1 Answer
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.

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions