Swiss Tournament Manager

This is a post about a coding project which you can view here on my GitHub

Swiss Tournament Variation

A few weeks ago, I had a problem. I was to hold a 1-on-1 Smash tournament in which I did not know when all people would arrive.
I knew that a good amount of people would be there at the start and that more people would probably arrive regularly after that, but this is not a great setup for an elimination tournament where nearly everyone needs to be present at the start of the event.

In the end, I used a variation of a Swiss Tournament! Instead of using a rigid bracket, this format matches people who have the same (or similar) win records in the tournament so far (so two players who have 2 wins and 1 loss or 2-1 would be matched together). This means the matchups can be generated on the fly, and easily be changed if someone is not available.

A typical Swiss Tournament has every player play a set number of rounds regardless of how well they perform. Since I was limited by the number of setups I had and since not everyone would be present at the start of the event, I opted to create a variation on the Swiss Tournament. I incorporated a Lives system. You start with a set number of lives. Each time you lose a match, you lose a life. If you lose all your lives, then you are out of the tournament.

You can see roughly how this would work below for 3 lives:

I settled on 2 lives for each player so that you could not be eliminated due to one bad match but the tournament would not take forever. This makes the number of matches required roughly equal to that of a double-elimination tournament but without a set-in-stone bracket

Matchup Generation

There are a lot of considerations which go into selecting who should face each other next in the tournament. Sure, you want players to face others with similar records, but what if no other players with the same record exist? Also, should players be able to face each other multiple times?

These questions motivated me to define the idea of a Prime Player or the player who is most ‘ready’ to play in another match. The most primed player is the one who has played the fewest matches, with ties broken by who has the fewest lives. We want players with few lives to play earlier since that could decrease the total number of players in the tournament and thus simplify things

A list of players from most to least primed. Dead players in red obviously are not eligible, so they are at the end of the list

As for the second question above, it makes sense to disincentivize repeat matches from occurring because if one player has some kind of specific advantage over another player, then they are likely to win every time they face. And example of this in Smash Bros might be character matchups. We want each player’s win record to represent how they stack up against the field of players as a whole, so we don’t want to have repeat matchups if they can be avoided.

So, roughly, the algorithm to find the optimal matchup is to

  • Find the most primed player (choose randomly if there is a tie)
  • Find the most primed player from the remaining list who has faced the first player the fewest times

My program has the ability to determine an optimal matchup and ask you if you’d like to add it right away. It also stores which players are currently in a match, so it knows not to choose an occupied player.

The Project

Originally, I was only planning on coding the matchup generation to help me out with hosting the tournament, but I continued to add features until it could keep track of just about everything! I added the ability to store ongoing matches and finished matches, some nice colored printing capabilities, and my favorite, the ability to export the results of the tournament to a text file!

This thing was made quickly for myself without regard to readability and is pretty bare bones, but if you are interested in trying this program for yourself, check it out on my GitHub at https://github.com/WrapperCrab/Swiss-Tournament-Matchup-Generator. The README has instructions. I hope this tournament format or my code can be useful to you

Thanks for Reading!

… There is also a Secret Menu where you can change the number of lives and the results of past matches directly. You access it by typing ’91’ on the main menu. You can use it for good (use it to fix a mistake) or you can use it to give yourself a secret advantage!

Use this power wisely

Leave a Comment

Scroll to Top