ThunderLeague Bracket Generator


The map pools were constructed, and I had enough players to fill out my tournament. It was time to create the bracket.

Professional gamers make large sacrifices to become exceedingly good at this game, and there is real money as well as, perhaps more importantly, posterity on the line. The last thing a professional gamer wants is an unfairly arrived-to bracket. So, I created a script that would not only randomize the bracket, but randomize the bracket one million times, and select the bracket that was arrived to by this randomization process most often.

With this number of repetitions, a nice normal distrubtion of bracket selections was generated. I took the bracket with the highest count, which is the bracket at the right tail of the distribution.

Next, check out the Map Selector UI .


App.py File



        #!/usr/bin/env python
        # coding: utf-8
        
        # 

Rationale

# These professional players have been working tirelessly to improve their skills at this game. Their real life fates hang on getting favorable matchups # in the earlier rounds, so they can get better payouts later. I want to give them the nearest approximation to a completely objectively random bracket as # possible. That is to say, I want no control over what is chosen, but I also want what is chosen to be result of a fair multiple-samples process. Theoretically, # there shouldn't really be a benefit to increasing the number of interations of the randomization method. However, by increasing the number of iterations, # the players can feel safer in knowing that their bracket was the one most heavily chosen by the algorithm, and so can attribute the selection to the will of # some higher power, thereby keeping me safe from backlash. Let the God of RNG reign. # In[1]: import random from collections import Counter # In[2]: player_list = ["SpeCial", "PuCK", "Jason", "Future", "Starkiller", "Vindicta", "Astrea", "DisK"] # In[3]: # SpeCial = A # PuCK = B # Jason = C # Future = D # Starkiller = E # Vindicta = F # Astrea = G # Disk = H players3 = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'] #EHACBFGD #Starkiller vs Disk #SpeCial vs Jason #PuCK vs Vindicta #Astrea vs Future # In[4]: list2=[] for x in range(1000000): players2 = players3.copy() random.shuffle(players2) list2.append(players2) # In[5]: player_list # In[6]: list2 # In[7]: list3 = [] for x in list2: item = "".join(x) list3.append(item) # In[8]: Counter(list3).most_common() #

Tiebreaker

# In[4]: list4 = ['GBDEFCAH', 'FACDBEGH', 'HDFBECGA'] list5 = random.choices(list4, k=300) Counter(list5).most_common() #

Bonus: Plot the distribution of counted permutations

# In[9]: import matplotlib.pyplot as plt # In[10]: counts = Counter(list3).most_common() #Returns a list of tuples, with the key as the first value, and the count as the 2nd in each # In[11]: counts_just = [x[1] for x in counts] #Returns just a list of counts, which we can plot with the histogram # In[12]: plt.hist(counts_just) # In[13]: plt.hist(counts_just, bins=[0,5,10,15,20,25,30,35,40,45,50]) # In[ ]: #Basically a perfect distribution. There's machine random for ya.