Resource Swiss Bracket Manager

shiny finder

forever searching
is a Community Leaderis a Programmeris a Smogon Discord Contributoris a Site Content Manager Alumnusis a Top Social Media Contributor Alumnusis a Senior Staff Member Alumnusis a Community Contributor Alumnusis a Contributor Alumnus
Chatot Wrangler
Disclaimer: The bracket manager has not yet been approved by the TD staff for official use in tournaments. If applicable, obtain permission from the TD staff before using. It is provided as is as a tool to help tournament managers. While attempts have been made to work out the bugs, ultimately it is the responsibility of the user to verify the output for their tournament.

By request, the site linked in this thread is a tool to help manage Swiss tournaments. What is a Swiss tournament? Although there are many variations on this style of bracket, Swiss tournaments group users based on their win/loss ratios each round. Players cannot be matched up against the same opponent twice, and each round is non-eliminating.

The tool contains 2 modes: a full manager and a validator (switch modes via the link in the top left of the page). The manager can be used to create and track Swiss tournaments as a standalone tool. The validator works in conjunction with the Smogon's bracket maker to check for any duplicate matchups and help you organize the players into groups. The validator requires the output from the bracket maker and a list of the winners of each matchup, which managers should already have on hand.

As the disclaimer says, this bracket manager has not yet been approved by the TD staff, mostly cuz I've yet to clear it with them and it's not on the Smogon domain. Ideally, a watered-down version can be added to the site at a later time. Getting it added is much more complicated than hosting it myself, and I needed a place to sandbox the tool while I figured out how to go about it. But until then, hope it gets some use.

Features
Manager
  • A fully integrated management system for a Swiss-style tournament.​
    • Each bracket (2:0, 1:1, 0:1, etc etc) is managed within the client so that there is no need to make separate brackets for each W/L ratio.​
  • Persistent storage​
    • As you make edits to the page (choose winners, advance the round), changes are saved on your computer via local storage. Local storage is kinda like a cookie, but it's never sent to the server, so no one else can see it. That means you can refresh or close your browser and reload the tournament later and have the info saved​
  • Support for multiple ongoing tournaments at once​
    • Each bracket is saved individually under the name you provide, which means you can manage multiple tournaments at once! You can reload an old bracket any time you'd like. I...have no idea what the limit is on how many you can hold, but it's probably a lot. Like 200 by my calculations? Yeah, that's fine.​
  • Supports match extensions​
    • Extensions are limited to 1 round. They are inherently incompatible with Swiss-style brackets, but I tried to support it anyway. There is a small chance that extensions will cause users to face the same opponent they have in the past (more apparent in very small brackets or tournaments that have been going on for many rounds), but there's really no great way around that. The best solution is don't use them.​
  • Load/delete brackets on the fly​
    • Deleting a bracket requires you to confirm the deletion in a popup. As always, this can't be undone.​
  • Ability to set the number of rounds.​
    • The theoretical max number of rounds for a Swiss tournament is half the number of participants. So for a tournament with 64 participants, you could do 32 rounds...But don't.​
    • As the number of rounds approaches this halfway point, there's an increased chance that you won't be able to find a viable grouping of players (i.e. you're stuck with repeat matchups). At this point to tool warns you and spits out the current records and pairs, because it it strict with this requirement of no repeats. So only go a few rounds with a decent sized pool, and you'll probably be fine.​
  • Supports byes​
    • Leftover players in an odd group are given byes for that round. Players cannot receive a bye twice. See commentary on extensions and rounds above.​
  • Smogon-friendly output​
    • The results for the previous round and the pairings for the current round are printed out for each round. Winners are highlighted bold (in bbcode) and each username is preceded with an @​
  • Bracket-maker friendly input​
    • Supports importing the output from the bracket maker to parse the user list. Note that pairings will be remade.​
  • Tracks winners as you go​
    • Each matchup results in a form where you can check the winner of the matchup. These boxes are saved across sessions.​
  • Dark mode!​
    • Dark mode can be toggled and your choice is saved across browser sessions. Which means you only have to burn your eyes once.​
    • I didn't spend a lot of time on css...​
  • Mobile and offline friendly​
    • Idk why you'd want to do that, but it is.​
    • Stuff is saved on your computer, not a server. Which means there's no cross-browser/cross-device syncing. That's not gonna happen.​
  • Users are randomized via a Fisher-Yates shuffle algorithm​
  • Calculates player resistance after the final around​
    • Resistance is determined using the average overall Op Win % and Op Op Win %, as per VGC rules.​
  • Open source​
  • Written in pure HTML/JavaScript​
  • Experimental: quits and subs​
    • These features allow you to specify that a user has been subbed or left the tournament.​
    • There are still experimental in nature, so use at your own risk.​

Validator

(mostly same as above)
  • Persistent storage via local storage.
  • Support for multiple on-going tournaments at once
  • Load/delete tournaments on the fly
  • Loads matchups directly from the bracket maker output (does not support providing a URL. You must copy/paste the output into the appropriate field)
  • Minimal additional work to check for duplicated matchups by integrating into the tournament management workflow.
  • Automatically keeps track of matchups, wins, and losses and groups users into brackets that can be re-entered into the bracket maker.
  • Keeps running total of player resistance
    • Resistance is determined using the average overall Op Win % and Op Op Win %, as per VGC rules.
  • Dark mode
  • Mobile and offline friendly
  • Open source
  • Written in pure HTML/JavaScript

Usage

Manager


Usage should hopefully be pretty straight forward:
  1. Specify a name and number of rounds for your tournament
  2. Click the Create New Bracket button
  3. Alternatively, select an old bracket from the dropdown and click the load button. (Should be step 1b or something but meh.)
  4. In the text field at appears, enter the names of the participants.
    1. Each entrant should go on their own line.
    2. OR, to save some time, you could make a new bracket in the current bracket maker and enter the thread URL to quickly get the list of users. Copy the mathups from the bracket maker, and paste them into the username field on this manager. Click the appropriate box to indicate it should parse the output. Pairs will be remade. (Side note: I can't do this provide-a-url functionality since it is on a different domain).
  5. Click Make Bracket.
  6. Choose a winner in each matchup at the bottom of the page. Or, don't choose any winners in a matchup to grant an extension for 1 round.
  7. Click the Advance button
  8. Repeat steps 6-7 until there are no rounds remaining
  9. The results of the previous round, the current round, and final round will be printed in the section above.
  10. When you're ready to make a new bracket, start back at step 1.

Validator

1. Create a new bracket
- Specify a name for your tournament
- Click the Create New Bracket button
1. Alternatively, select an old bracket from the dropdown and click the load button.
2. Paste the output from the bracket maker into the appropriate field.
3. Click Check for duplicates.
4. Enter the names of the winners of each round in the appropriate field
- Each name must be entered on a new line
5. Make sure you have entered the matchups exactly as they occurred. Make sure the matchups field contains any played extension games, and the winners field includes any extension winners. See discussion below.
6. Click Store matches and update.
7. Repeat for how many rounds and brackets you have.


A Discussion on Extensions

As I said before, extensions are inherently incompatible with Swiss tournaments. Future rounds depend on the results of the previous rounds, so if those are inconclusive, then it's really hard to do a proper Swiss tournament. But it happens and this is all causal anyway, so I've tried to include that functionality.

Manager

The bracket manager has extension support built in. Extensions are grouped separately and the text is automatically formatted as (Winner of A vs B) and (Loser of A vs B). It is possible that as a result some users may face each other again because the manager only checks 1 of the two combinations. This mimics the current protocol when using the bracket maker. So if it happens that the next round ends up being a duplicate based on the results of the extension, you may have to take over and not use the tool. For good sized tournaments with only a few rounds of play this shouldn't be an issue, but I guess we'll find out.

Validator

The validator adds functionality to extension management by checking for duplicate matchups. It's up to the tournament manager to track extensions, as they have to do with the current bracket maker. You can check for duplicate matchups at any time by clicking the appropriate button. However, to get the tool to advance the round, there cannot be any duplicate matchups entered. When advancing the round, make sure you've entered the matches exactly as they were played, and only the matches that had results. In other words, only store results that actually happened. Please refer to the following example for proper usage in the case of an extension.
Let's say you're hosing a tournament with the following 8 participants: sf, aeo, mari, chaos, kala, lily, theia, blitz. And the bracket maker results in these pairings for round 1:

Round 1 said:
sf vs aeo
mari vs chaos
kala vs lily
theia vs blitz
You could paste those pairs into the validator and everything would check out since this is round 1. I've bolded the names of the winners. Aeo and I couldn't settle on a time to play, so we need an extension. No one wants to wait around for that tho, so we want to advance the round. In the bracket maker, protocol is to arbitrarily choose a winner (let's choose me for that nice symmetry). However, for the validator when storing input (advancing the round)...don't do that. Only enter the matches that have results. So in box one you'd enter:

Box 1 (Matches) said:
mari vs chaos
kala vs lily
theia vs blitz
* Note you'd paste the output of the bracket maker here, which has a different format than what I'm typing.
* Also note I've left off the extension game (sf vs aeo)

And in box 2...
Box 2 (Winners) said:
mari
kala
theia
* Enter their usernames exactly as they are and each on their each line. Case matters; it should match their username as it appears in box 1 exactly.

You'd now click the "store and update" button, which would post the following:

[1, 0] Bracket
mari
kala
theia

[0,1] Bracket
chaos
lily
blitz
The groupings here are just to help you group the names for the Swiss style. So now you'd go back to the bracket maker and now have to make 2 brackets (or however you guys normally do this). We said that I arbitrarily won, so let's say you now make 2 brackets and the bracket maker results in the following

bracket 1 said:
sf* vs mari
kala vs theia
bracket 2 said:
aeo* vs chaos
lily vs blitz
* Remember, aeo and I haven't actually played yet

Before posting the announcement, you'd like to make sure these pairs are valid. To do that, again paste the output of the bracket maker into my tool in the matches box and click the button to check for duplicates.

Box 1 (Matches) said:
sf vs mari
kala vs theia
aeo vs chaos
lily vs blitz
sf vs aeo
sf vs chaos
aeo vs mari
* You can combine the brackets if you'd like or keep them separate when checking for duplicates; it really doesn't matter.
* sf vs mari and aeo vs chaos are technically undetermined cuz aeo and I haven't played yet. So, you'd want to check sf vs mari, aeo vs chaos, aeo vs mari, and sf vs chaos for duplicates. You're free to put all of those options in at once like I did here, or edit the matches and reclick the button each time. Clicking the check for duplicates button doesn't actually store anything, so feel free to spam it.

You check for duplicates, and everything checks out. So now you're free to post the announcement of the next round. Remember in your post to use Winner of/Loser of for me and aeo since it's an extension! For the sake of simplicity, let's say I eventually did beat aeo, and again all the players on the left won. To store the matches played so you can compare the previous games in round 3, you'd post the following in the tool:

Box 1 (Matches) said:
sf vs mari
kala vs theia
aeo vs chaos
lily vs blitz
sf vs aeo
* The extended sf vs aeo match finally shows up because we finally played and determined a winner.

Box 2 (Winners) said:
sf
kala
aeo
lily
sf
* My name is twice because I played 2 games this round: my extension vs aeo, and my subsequent match vs mari.
* The number of winners should match the number of matches played.

The tool would post the following

[2,0] Bracket
sf
kala

[1,1] Bracket
mari
theia
aeo
lily

[0,2] Bracket
chaos
blitz
Repeat for any remaining rounds. The tool stores the matches that actually happened, since those are the ones that need to be compared against in future rounds. That is why you should only ever save matches that you have results for!

It seems complicated in text, but once you play around with it a bit I'm sure you'll find it's not too difficult.


Lmk here if you have any thoughts/questions/comments/concerns. Enjoy!
 
Last edited:

shiny finder

forever searching
is a Community Leaderis a Programmeris a Smogon Discord Contributoris a Site Content Manager Alumnusis a Top Social Media Contributor Alumnusis a Senior Staff Member Alumnusis a Community Contributor Alumnusis a Contributor Alumnus
Chatot Wrangler
Added resistance calc on request (cc: TPP) to help with tiebreaks. The manager will output the average opponents' win % and average opponents' opponents' win % (based on overall record, as per VGC rules) after the final round. For example, assuming a 1 round tournament with 4 players:

1685657245488.png

The validator will also output this each time the "store matches and update" button is pressed. With this you can keep a running total.
1685657558325.png

Been a hot minute since I've thought about this, so lmk if something is off. Hopefully this improves UX!
 

a fairy

is a Tournament Directoris a Site Content Manageris a Community Leaderis a Community Contributoris a Smogon Discord Contributoris a Contributor to Smogonis a Top Smogon Media Contributoris a Dedicated Tournament Hostis a Social Media Contributor Alumnus
Community Leader
minor request if it all possible: when importing from a previously made swiss tournament, can you make it so i can manually input additional players/matches? for example, in the spotlight tours ROA does, sometimes folk sign up after i make r1 and i've been told to put em against each other, but that really messes up my ability to make future rounds using the system
 

shiny finder

forever searching
is a Community Leaderis a Programmeris a Smogon Discord Contributoris a Site Content Manager Alumnusis a Top Social Media Contributor Alumnusis a Senior Staff Member Alumnusis a Community Contributor Alumnusis a Contributor Alumnus
Chatot Wrangler
minor request if it all possible: when importing from a previously made swiss tournament, can you make it so i can manually input additional players/matches? for example, in the spotlight tours ROA does, sometimes folk sign up after i make r1 and i've been told to put em against each other, but that really messes up my ability to make future rounds using the system
This should be possible by default if you use the validator mode, wherein you paste the output from the bracket maker to ensure there are no duplicate matchups. You'd just need to manually enter a couple extra matches. I can look into adding this functionality for the manager.
 

shiny finder

forever searching
is a Community Leaderis a Programmeris a Smogon Discord Contributoris a Site Content Manager Alumnusis a Top Social Media Contributor Alumnusis a Senior Staff Member Alumnusis a Community Contributor Alumnusis a Contributor Alumnus
Chatot Wrangler
minor request if it all possible: when importing from a previously made swiss tournament, can you make it so i can manually input additional players/matches? for example, in the spotlight tours ROA does, sometimes folk sign up after i make r1 and i've been told to put em against each other, but that really messes up my ability to make future rounds using the system
Added something to the manager which hopefully approximates this scenario. I added in a place under the Manage Users/experimental section where you can enter in a matchup and select a winner to inject it into the tournament (one game at a time). I'd recommend adding the extra games before advancing the round so that the matchups in the next round include the new additions. I left it in the experimental section because it's just that and you need to be careful about what you do with it.
 

a fairy

is a Tournament Directoris a Site Content Manageris a Community Leaderis a Community Contributoris a Smogon Discord Contributoris a Contributor to Smogonis a Top Smogon Media Contributoris a Dedicated Tournament Hostis a Social Media Contributor Alumnus
Community Leader
Is the ? character supposed to act like a linebreak/seperator between participants?

See in the bottom right, match 1 is the #4836 vs pokefanjosh, yet at the bottom of the image, why.. faces glimmerrdust. I can confirm that there is no equivalent for the usernames in the matchups, but it appears that why..?#4863 (line 7 in the username input box) is being split into two names on the ? character. Other usernames have the Discord discriminator still, but their names did not separate.

1688849332418.png
 

shiny finder

forever searching
is a Community Leaderis a Programmeris a Smogon Discord Contributoris a Site Content Manager Alumnusis a Top Social Media Contributor Alumnusis a Senior Staff Member Alumnusis a Community Contributor Alumnusis a Contributor Alumnus
Chatot Wrangler
Is the ? character supposed to act like a linebreak/seperator between participants?

See in the bottom right, match 1 is the #4836 vs pokefanjosh, yet at the bottom of the image, why.. faces glimmerrdust. I can confirm that there is no equivalent for the usernames in the matchups, but it appears that why..?#4863 (line 7 in the username input box) is being split into two names on the ? character. Other usernames have the Discord discriminator still, but their names did not separate.

View attachment 532807
Nope, it was a bug as you thought. Fixed, thanks!
 

shiny finder

forever searching
is a Community Leaderis a Programmeris a Smogon Discord Contributoris a Site Content Manager Alumnusis a Top Social Media Contributor Alumnusis a Senior Staff Member Alumnusis a Community Contributor Alumnusis a Contributor Alumnus
Chatot Wrangler
To facilitate bug reports and give you guys a bit more flexibility, I added the ability to import/export brackets.

Clicking the "export" button saves a txt file to your computer of the selected bracket. The default file name is bracketname-export.txt. Subsequent exports of the same bracket automatically creates new copies, rather than overwriting it (i.e. clicking it twice will result in bracketname-export.txt and bracketname-export (1).txt). Unsurprisingly, importing a bracket from file adds the bracket to the dropdown, allowing you to load it in the normal workflow. The filename is used as the imported bracket name. If the filename is the same as a bracket, the bracket will be overwritten.

Maybe you want backups in case you screw up, maybe you want to pass off managing the bracket to someone else midway, or maybe you want to swap computers. If nothing else, it's easier to give me the info I need to debug over having you poke around in localstorage or the console lol.

If this is conceptually a problem, or if you find any problems with the functionality, please let me know.
 

shiny finder

forever searching
is a Community Leaderis a Programmeris a Smogon Discord Contributoris a Site Content Manager Alumnusis a Top Social Media Contributor Alumnusis a Senior Staff Member Alumnusis a Community Contributor Alumnusis a Contributor Alumnus
Chatot Wrangler
To clean up my sig keep things in 1 place for me, I've setup a redirect on the page to go to my GitHub website. All of your brackets should be moved over automatically, the only difference being aesthetics. Which means you also now have more theme choices! If this creates problems for anyone, let me know and I can put it back.
 

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top