I found that it’s impossible (at least with my knowledge about FlexMatch rule sets) to build such rule set which meets these requirements:
Average rating of players in each team should be relatively close to each other (no team should be much stronger than another).
Team can have 0 players if there is no many players online at that time.
I see two problems here:
All rules that I could create for this purpose are using
avgon the collection that can be empty. And my tests show that in this case the rule can’t match at all. It’s quite logical - there is no “right” value for the average of an empty collection.
Even if we assume that
avgon empty collection will return 0 it doesn’t solve our problem. Let’s assume that there is a single very high-rated player to match him with bots we should raise max distance of team ratings to at least his rating. But when where are many players raising this distance too high will just ruine the purpose of this rule at all.
For now I’ve decided to remove this rule from rule set, ignore teams built by FlexMatch and assign players to teams myself minimizing difference between team ratings. I think it should work but it’s not very elegant
If somebody could help me figure out how to build such rule set I will be very happy. But if it’s really that hard then at least FlexMatch team will get one more use case story and perhaps make such scenarios more approachable in the future.
Thank you in advance!