Heroes of the Storm

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

Content of the article: "I wrote a basic aram matchmaker. It took about 5 minutes. Can we maybe have something like it?"

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<"team_1">) != bcwt.count_heals(self.hero_list<"team_2">)): 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<"team_1">) # is this inplace? sure why not, Im not actually going to check random.shuffle(self.hero_list<"team_2">) for i in self.game_options<"n_players">: # yay python list comprehension tricks self.player_choices<'team_1'>.append( self.hero_list<"team_1">>) self.player_choices<'team_2'>.append( self.hero_list<"team_2">>) 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<"team_1">, self.hero_list<"team_2"> = <>, <> 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<"team_1">.append( random.choice(list(this_bucket.values()))) self.hero_list<"team_2">.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: reddit.com

Similar Guides

© 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 7 NEW Games of June 2020

Quite a few exciting games are releasing for PC, PS4, Xbox One, and Nintendo in June. Here's what to keep an eye on.

Top 10 NEW Open World Games of 2020

Video games with open worlds continue to roll out in 2020 on PC, PS4, Xbox One, Nintendo Switch, and beyond. Here are some to look forward to!

Top 10 Best New Upcoming Games 2020-2021

The best selection of games which will be released in 2020 and 2021 for PS4, PS5, Xbox One, Xbox Series X, Google Stadia and PC - and you can watch in amazing UHD 4K and 60FPS with latest updates about all of the games in this list!

You Might Also Like

Leave a Reply

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