The Best Weapon Combinations for The Legend of Zelda BOTW | by Vijini Mallawaarachchi | Towards Data Science

Recently, I came across an article titled Which PUBG Weapon Combination Should You Pick? by Meredith Wan that I found very interesting. This article gave me the idea to write about selecting weapon combinations for one of my favourite games, The Legend of Zelda: Breath Of The Wild using Python and Pareto optimisation. So, let’s get started.
Disclaimer: This article is based on my analysis of a public dataset available on BOTW weapons which may not be complete with all the information and is only intended for adaptation, learning and understanding of concepts of Pareto optimisation. This is not a part of any official research and results may contradict with real-world applications and different personal opinions.
The weapons found in Zelda BOTW have 2 important features which I have considered for this article. They are durability and strength. I have defined these terms with some research and my own experience playing Zelda BOTW.
Durability refers to the number of times you can use the weapon, i.e. the number of times you can hit/shoot an enemy with the weapon. After that, the weapon breaks. The higher the durability, the more number of times you can use the weapon.
Strength (or Attack Power) is the amount of damage you can do to an enemy with one hit. When you hit an enemy, this amount will be lost from the enemy’s health. The higher the strength, the more damage you can do to enemies.
When I was searching for a dataset of the weapons found in Zelda BOTW, I came across a Reddit thread titled A complete database + search for BotW where they provide a link to an amazing database of all the weapons, shields, bows, armour, materials and food items. You can download the dataset in .csv format.
For our analysis, we will need the following imports.
import numpy as npimport pandas as pdimport seaborn as snsimport matplotlib.pyplot as pltfrom itertools import combinations
I have loaded the data into a pandas dataframe using the code given below.
dataframe = pd.read_csv(“Zelda-data.csv”)
You can see there are many unnecessary columns and unspecified values. I had to do a bit of preprocessing to clean the dataset. First of all, I removed all the unnecessary columns and retained the columns name, class, subclass, durability and strength.
columns_to_remove = ["image", "tags", "range", "arrows", "defense", "selling_price", "bonus_set", "upgrade_1", "upgrade_2", "upgrade_3", "upgrade_4", "armor_upgrade", "where_to_find", "notes", "defense_upgrade_lvl1", "defense_upgrade_lvl2", "defense_upgrade_lvl3", "defense_upgrade_lvl4", "bonus", "description"]for col in columns_to_remove:    dataframe = dataframe.drop(col, axis=1)
The Master Sword is one of the most powerful weapons found in Zelda BOTW. Its durability is infinite as it never breaks. So we will see that the durability of the Master Sword is not specified. So I added a value larger than the maximum value present in the dataset for its durability. The maximum value available was 80 and I have used 200 for its durability as tests (according to a link found here) have shown that on the fully powered up version the Master Sword has nearly 200 strikes before needing to recharge.
I replaced the unspecified values with 0 or “None” accordingly. Furthermore, I removed all the types of arrows from the dataset as they did not have any durability or strength values specified.
I removed the Bow of Light from the dataset as this weapon becomes available only after defeating Calamity Ganon and when you come to defeat Ganon’s final form, Dark Beat Ganon.
Now, I separately store weapons, shields and bows as follows.
weapons = dataframe[dataframe["class"] == "Weapon"]shileds = dataframe[dataframe["class"] == "Shield"]bows = dataframe[dataframe["class"] == "Bow"]
Before getting into details of the analysis, I will introduce some terms and concepts that we will be using for our analysis.
Correlation is a technique that is used to show how strongly two variables are related to each other. We denote this in a correlation matrix which denotes the correlation coefficients between pairs of variables.
We will be using the correlation matrix for durability and strength of weapons and their combinations to see how they are related.
weapons = dataframe[dataframe["class"] == "Weapon"]fig, ax = plt.subplots(1,1, figsize=(10,5))my_cols = ['durability', 'strength']all_cor = sns.heatmap(weapons[my_cols].corr(), fmt=".3f", annot=True)
The following figures denote the correlation matrix for durability and strength of weapons, shields and bows.
You can see that there is a perfect positive correlation for durability and strength individually as expected. We can also see that bows show a stronger linear relationship between durability and strength as the correlation value is closer to 1 than for shields and bows. Weapons show the weakest linear relationship between durability and strength.
According to Wikipedia,
Multi-objective optimization (also known as multi-objective programming, vector optimization, multicriteria optimization, multiattribute optimization or Pareto optimization) is an area of multiple criteria decision making that is concerned with mathematical optimization problems involving more than one objective function to be optimized simultaneously.
In multi-objective optimization, we have multiple objectives (for example, durability and strength in our case) which we have to maximise and determine different optimal combinations. We get a Pareto-efficient (or Pareto-optimal) solution when this solution is not dominated by any other feasible solutions. In simpler terms, this solution cannot be modified to make one objective better off without making at least one objective worse off. There can be more than one Pareto-efficient solution and this set of Pareto-efficient solutions is defined as the Pareto frontier.
In this article, I will be using a Pareto-based approach to determine the best weapon combinations where our objective function is a vector that consists of durability and strength values of weapons as [durability, strength]. Let’s see what are the best Pareto-efficient combinations of weapons we can obtain for Zelda BOTW.
At a given instance, Link can equip one weapon and one shield. Let us see what optimum combinations we can have. After preprocessing, we have 127 weapons and 33 shields. We will get 4191 combinations of weapons and shields. For each combination, I have considered the mean durability and mean strength.
weapons_shields = pd.concat([weapons, shields], ignore_index=True)df2 = weapons_shields.set_index("name", drop = False)my_data = []my_combinations = list(combinations(df2.index,2))valid_combinations = []for comb in my_combinations:    if df2.loc[comb[0],"class"] != df2.loc[comb[1],"class"]:        valid_combinations.append(comb)        data_line = []        data_line.append(np.mean([df2.loc[comb[0],"durability"], df2.loc[comb[1],"durability"]]))        data_line.append(np.mean([df2.loc[comb[0],"strength"], df2.loc[comb[1],"strength"]]))        my_data.append(data_line)    my_combinations = pd.DataFrame(my_data, columns = ['durability', 'strength'], index=valid_combinations)
I won’t be drawing the heatmap to show the different combinations of weapons with their durability and strength as there is a huge set of combinations. Instead, I will plot a correlation matrix showing the mean durability and mean strength of combinations as shown below.
Let’s see how our Pareto frontier looks like.
You can see that Pareto-efficient combinations are as follows,
Master Sword + Hylian ShieldBoulder Breaker + Hylian ShieldSavage Lynel Crusher + Hylian Shield
Master Sword + Hylian Shield
Boulder Breaker + Hylian Shield
Savage Lynel Crusher + Hylian Shield
We cannot say that one of these combinations is better in terms of both strength and durability. However, if I want my weapons to last longer, then I will use the combination Master Sword + Hylian Shield. On the other hand, if I want to do more damage to enemies, then I will use the combination Savage Lynel Crusher + Hylian Shield.
At a given instance, Link can equip one weapon, one shield and one bow. Let us see what optimum combinations we can have. After preprocessing, we have 127 weapons, 33 shields and 25 bows. We will get 104,775 combinations of weapons and shields.
Similar to weapon+shield combinations, I will plot a correlation matrix showing the mean durability and mean strength of weapon+shield+bow combinations as shown below.
Let’s see how our Pareto frontier looks like.
You can see that Pareto-efficient combinations are as follows,
Master Sword + Hylian Shield + Ancient BowMaster Sword + Hylian Shield + Royal Guard’s BowBoulder Breaker + Hylian Shield + Ancient BowSavage Lynel Crusher + Hylian Shield + Ancient BowSavage Lynel Crusher + Hylian Shield + Royal Guard’s Bow
Master Sword + Hylian Shield + Ancient Bow
Master Sword + Hylian Shield + Royal Guard’s Bow
Boulder Breaker + Hylian Shield + Ancient Bow
Savage Lynel Crusher + Hylian Shield + Ancient Bow
Savage Lynel Crusher + Hylian Shield + Royal Guard’s Bow
Note that we have the 3 weapon+shiled combinations that we found before within these combinations as well. Additionally, we have Ancient Bow and Royal Guard’s Bow within the combinations.
Similar to weapon+shiled combinations, we cannot say that one of these combinations is better in terms of both strength and durability. However, if I want my weapons to last longer, then I will use the combination Master Sword + Hylian Shield + Ancient Bow. On the other hand, if I want to do more damage to enemies, then I will use the combination Savage Lynel Crusher + Hylian Shield + Royal Guard’s Bow. The choice is totally up to you!
You might have already figured out these combinations while playing the game. However, I was curious whether the most powerful weapons would be found by the Pareto-based analysis, and of course, it actually did!
One thing to note is during this analysis, that I have not considered the fact that the Master Sword may run out of energy and take some time to recharge. In that sense, the Master Sword has its limits. Moreover, I have not considered facts such as attack speed, boost in attack speeds after eating certain meals, whether the weapon can be used together with a shield, armour set bonuses and amiibo upgrades in this analysis. These factors can affect the optimal weapon combinations when considering the rate of damage the combination can do.
Special thank goes to Meredith Wan for sharing her analysis code which was very helpful for me to analyse the BOTW dataset.
You can find the Jupyter notebook with the code from here.
Hope you all found this article interesting and I would love to hear your thoughts. Don’t forget to share these weapon combinations with your BOTW friends.
Cheers!
[1] Y. Jin and B. Sendhoff, “Pareto-Based Multiobjective Machine Learning: An Overview and Case Studies,” in IEEE Transactions on Systems, Man, and Cybernetics, Part C (Applications and Reviews), vol. 38, no. 3, pp. 397–415, May 2008, doi: 10.1109/TSMCC.2008.919172.
[2] Multi-objective optimization — Wikipedia (https://en.wikipedia.org/wiki/Multi-objective_optimization)
[3] Pareto front — Python for healthcare modelling and data science (https://pythonhealthcare.org/tag/pareto-front/)