Saturday, July 4, 2020

The Logic Behind: Race Anyone

Plates Across America's(TM) new two-person race feature allows you to select opponents in one of two ways: 
  1. you can either locate a particular user and challenge them to a race, or 
  2. you can choose to race "anyone" and allow the game to find a matching opponent.  

This article is about how we automatically find matching players.


Plates Across America race anyone

Plates Across America(TM) attracts a broad spectrum of people and skill levels. Playing against someone that is far less or far more skilled than you are is usually not very enjoyable. To add a more competitive nature to the game, we want to match up people with the same relative skill level. 

Matching Algorithm

While designing the matching feature, the first tricky design decision we faced was how to trade-off the precision of skill level matching with how long a player would want to wait to begin playing a game. Most times, people would prefer to play sooner rather than waiting a long time for the perfect match.  We achieved this balance using an iterative solution that starts with a narrow band of skill ranges and broadens the search when no matches are found. It stops when a match is found or if the skill differential becomes too great.

Skill level

When we do the matching, we first need to assign each user a "skill level" based upon their game play history. The main attributes we look at are the quality of answers and the percentage of correct answers. Each puzzle answer get a "strength" score which translates into miles traveled. Further, each incorrect answer results in a loss of miles traveled. These two stats tend to be a good indicator of how many puzzles it will take to complete a race: the player with the fewest puzzles wins the race.

We will look at a player's stats over their previous races, though we use their single-person game stats if they have not yet completed in many races. For a brand new user, with no game play stats would have a skill level of "0".  A very good player, averaging 2.5 miles per puzzle, would have a skill level near "25".

As of this writing, we only have experience with this matching algorithm using a relatively small player base. There's plenty of more sophisticated approaches we could have used, but we've opted to start with something simple and we'll refine it when needed. If you have any feedback on how this algorithm is working, good or bad, please let us know.

Sign in to Play the Race Game

Happy travels!

No comments:

Post a Comment