Heroes of the Storm

I wrote a basic aram matchmaker. It took about 5 minutes. Can we maybe have something like it?

HeroesoftheStorm 10 - I wrote a basic aram matchmaker. It took about 5 minutes. Can we maybe have something like it?
Loading...

Ok it was more like 15 minutes but 10 of those were making it fit in this stupid 80 character format

Long live 120 character line limits!

import random from blizzard import blizzard_can_write_this as bcwt class REALLYSIMPLEMATCHMAKER(): def __init__(self): self.db, self.game_options = bcwt.get_it_together() self.hero_list = {"team_1": , "team_2": } #all heroes on a team self.player_choices = {"team_1": , "team_2": } #heroes per player def ready(self): """readies things""" # if there are cuts desired, handle them here # ex: MMR between 1234 and 1645, bronze rating # (whatever that means, this is all made up) self.winrates = bcwt.get_winrates( self.db, cuts = {"mmr_lo": 1234, "mmr_hi": 1645, "rank": "bronze", "region": "NA"}) # break winrates into buckets; ex: quintiles self.buckets = bcwt.split_to_buckets( winrates, n_buckets=self.game_settings("n_buckets", 5), split_param="median", split_method="uniform") def set(self): """sets things""" # is there a do while loop in python? self.build_full_rosters() while (bcwt.count_heals(self.hero_list) != bcwt.count_heals(self.hero_list)): self.build_full_rosters() # Shuffle and give n_choices_per_players to each player # This has the RNG where one person _could_ get all the # tier 1 or tier 5 heroes, but yolo heart of the cards random.shuffle(self.hero_list) # is this inplace? sure why not, Im not actually going to check random.shuffle(self.hero_list) for i in self.game_options: # yay python list comprehension tricks self.player_choices.append( self.hero_list<:self.game_options>>) self.player_choices.append( self.hero_list<:self.game_options>>) def go(self): """makes go""" bcwt.START_MORE_BALANCED_GAME(self) # and here is where all this dies, I am sure def build_full_rosters(self): """Get 15 heros on each team in a somewhat fair fashion """ self.hero_list, self.hero_list = ,  how_many_we_need = (self.game_options.get("n_players", 5) *self.game_options.get("n_choices_per_player", 3)) for i in range(how_many_we_need): # decide what quality of hero we want # get a random number 0-1, multiply by number of buckets, # floor-cast as int idx = int(self.n_buckets*random.random()) this_bucket = self.buckets # add one hero from this bucket to each team with replacement self.hero_list.append( random.choice(list(this_bucket.values()))) self.hero_list.append( random.choice(list(this_bucket.values()))) if __name__ == "__main__": print("You know this won't work right?") pls = REALLYSIMPLEMATCHMAKER() pls.ready() pls.set() pls.go() 

tl;dr: Coarsely group the heroes by win rate, and then make sure the same number of heroes from a given win rate are available to both teams. Also make sure there are the same number of healers available on each team (AFAIK thats all the current matchmaker does). ????. Profit.

Загрузка...

Source: Original link


Loading...
© Post "I wrote a basic aram matchmaker. It took about 5 minutes. Can we maybe have something like it?" for game Heroes of the Storm.


Top 10 Most Anticipated Video Games of 2020

2020 will have something to satisfy classic and modern gamers alike. To be eligible for the list, the game must be confirmed for 2020, or there should be good reason to expect its release in that year. Therefore, upcoming games with a mere announcement and no discernible release date will not be included.

Top 15 NEW Games of 2020 [FIRST HALF]

2020 has a ton to look forward to...in the video gaming world. Here are fifteen games we're looking forward to in the first half of 2020.

You Might Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *