beyond-all-reason / bar-lobby

BAR Lobby Client
https://beyond-all-reason.github.io/bar-lobby/
MIT License
32 stars 28 forks source link

Custom battle match scoring & sorting #237

Closed kozak-codes closed 1 year ago

kozak-codes commented 1 year ago

The current custom battle sorting is a little simplistic, and doesn't take into account all the factors that I manually use when selecting a battle. Rather than sorting custom battles based on players, we should sort them based on how much of a match that battle is. For example, an ideal match that I look for when selecting a lobby is as follows:

  1. Not locked or passworded
  2. Has at least 1 player
  3. Is almost full
  4. Is not full (if it is full, has a small join queue)
  5. is within my skill range
  6. The median skill is close to my own

Other potential factors for sorting could include:

What I propose is a scoring system that, based on all the above factors, assigns a score to each battle and then sorts the battles based on that score. That score can be shown on the right side in the form of a summary of why it's a good match and color coded to visually distinguish that matches potential to jump into a battle. This way, we can still sort by individual headers such as title, map, runtime, or you can just sort by what the game thinks is the best match for you.

The way it would work is simple. Each battle would have the following "factor" checks done to them. If they pass the check, then "points" are added to that battle. We then sort custom battles by these "points" in descending order. The most notable factor is then indicated in the "match" section which visually distinguishes the sort.

Here is an example factor chart, that would need to be tweaked as we gain more data on the potential factors:

Factor Points Description
Locked -5
Passworded -5
Has no players -10 0/x players
Is almost full (-5 / half of required players) * remaining players + 5 Only applied when lobby is at least half full, not applied when full
Full -5 - queueSize * 5
Within Skill Range +10
Median Skill Close to own 1 / ( standard deviations away from median + 1/5 )
Already in lobby +50
A friend is in this lobby +5 * friends in lobby
Match ending soon Standard deviation from this match type median duration * 10 Only applied if duration > median duration
Someone I've blocked is in this lobby -5 * blocked in lobby
A map that I've rated highly is being played +map rating out of 5
The map that is being played has been downloaded +3
The number of spectators log(x) * 5
Is it a noob lobby, and am I a noob? +15

The item that is highest in this list is noted to the user. That is what is sorted, perhaps visually shown on the right hand side of the table. We can choose to visually distinguish (eg, set tag color) by the top items or only items that match a certain score.

Gonna work on a quick little demo PR to show how this can improve selecting a match significantly.