Optimizing Overwatch Team Composition by Player Hero Preference

352 Views Asked by At

I am wordy by nature - my apologies. My attempt at a TL;DR - I want to design a small tool that optimizes the team composition of a video game based on minimizing the sum of provided player preference numbers, and I don't know where to start. Can you please point me in the right direction in terms of what language and/or tools to use?

You might be familiar with the game Overwatch, recently released by Blizzard. It is pretty good! Just for fun, some friends and I are playing together, but we like to do things as efficiently as possible when possible, which led me down the path I am now on.

A core piece of strategy in Overwatch is to be constantly switching which hero you are playing to adapt to the task at hand. I want to build a small tool to allow us to see which of our team members should be playing which hero given a specified composition of heroes. This choice would be based on a hero preference number assigned by each player for each hero, numbering 1 (most preferred) to 21 (least preferred).

There are 21 total heroes, and 6 players on a team. Here is a sample dataset:

Hero        Role    P1  P2  P3  P4  P5  P6
Bastion     Defense 13  5   1   11  21  12
D.Va        Tank    9   12  7   17  10  13
Genji       Offense 19  16  18  7   4   1
Hanzo       Defense 20  19  3   4   11  2
Junkrat     Defense 15  21  12  5   19  3
Lúcio       Support 1   9   8   21  3   4
McCree      Offense 16  3   5   13  9   17
Mei         Defense 4   15  16  14  18  20
Mercy       Support 5   4   10  9   6   8
Pharah      Offense 17  1   21  18  13  19
Reaper      Offense 14  10  17  2   15  18
Reinhardt   Tank    6   2   11  20  12  5
Roadhog     Tank    7   14  19  15  20  21
Solider:76  Offense 2   7   13  6   14  9
Symmetra    Support 11  20  2   10  5   16
Torbjörn    Defense 12  18  6   19  8   15
Tracer      Offense 10  11  9   8   1   6
Widowmaker  Defense 21  6   20  3   17  14
Winston     Tank    8   13  15  1   2   11
Zarya       Tank    3   8   4   16  7   10
Zenyatta    Support 18  17  14  12  16  7

Basically, given an input of six hero names, I am looking for an output of which players should play which hero, based on whichever combination of players and heroes that result in the smallest possible sum of player preference numbers.

For example, if the input heroes are Bastion, D.Va, Genji, Hanzo, Junkrat, and Lúcio, one potential output would be: Player 1 would play Lúcio for a value of 1, Player 2 would play Bastion for a value of 5, Player 3 would play D.Va for a value of 7, Player 4 would play Junkrat for a value of 5, Player 5 would play Genji for a value of 4, and Player 6 would play Hanzo for a value of 2 for a total value of 24. Please note that I did that manually, so there may be a more efficient solution, or there may be other solutions that also reach a value of 24.

Some notes:

  1. Duplicate heroes are allowed to be played on one team, but for the purposes of this exercise, our personal preference is for team compositions with no duplicate heroes, so that fact does not need to be considered.

  2. There are no duplicate player preference numbers for any hero in the sample above. In reality, these could definitely occur, but they will be managed around by working with the players to come to new, non-duplicate values. For the purposes of this exercise we can assume that there will be no duplicate player preference numbers for any hero.

  3. Just so it is clear, a player can only play one hero at a time.

  4. I am not extremely technical by nature, but I've played around here and there. I look at this as a small project to teach me some new skills. I am anticipating that there is a tool or program that will make this task much easier, but I have failed to find it on my own, so an acceptable answer is definitely to just point me in that direction.

  5. Relatedly, this is something I want to create and maintain myself, rather than have built for me, because there is no doubt that changes will need to be made and I'll want an intimate understanding of how it works in order to make those changes.

  6. I am not sure if it would be best to build a tool that does this on the fly based on input of heroes, or if it would be best to calculate out all possibilities and store them in a database to be accessed later. Either way, the number of combinations that will be used in practice is likely to be small - a few dozen at most, if I had to guess.

  7. I also acknowledge the possibility that this may be too complicated to be worthwhile for what it would actually be used for, so if you think so you should let me know, and why!

  8. A stretch goal would be to have some sort of On Screen Display integration, be it via something like a Discord bot or some other program, such that a list of six heroes could be passed and a list of which players should play which hero returned without having to alt+tab. Only included for informational purposes, doubt it has impact on any answers.

  9. I always come to Stack Exchange and find answers, but usually don't ask them. If this should be placed elsewhere or with different tags, please let me know, and my apologies for not getting it right!

I am happy to answer any questions you may have or provide any additional detail you may require. Thank you for your time! My apologies again for being wordy.

TL;DR - I want to design a small tool that optimizes the team composition of a video game based on minimizing the sum of provided player preference numbers, and I don't know where to start. Can you please point me in the right direction in terms of what language and/or tools to use?