Graph of Legends — Team Fight Tactics

Ryan Nguyen
4 min readAug 12, 2019

--

Created by Scarra

Over the past few weeks, I have been actively playing League of Legend’s new play mode, Team Fight Tactics (TFT). TFT is a round-based strategy game that pits you against seven opponents in a free-for-all race to build a powerful team that fights on your behalf. Your goal is to be the last person standing. RIOT games have really outdone themselves in this auto chess formula. It is strategic, enjoyable, and competitive all at the same time.

Throughout my journey playing TFT, there is one mechanic in the game that has not fully wrapped around my head. The item system for the champions can be overwhelming for myself at times.

I thought to myself as I was taking a course on Graph Theory, is there a way I can relate the items to the best champions to give me the best result in every fight? For my final project for the class, I constructed a Graph ADT to model out the relationships between the items to the recommenced champions it should be placed on.

Graph Structure

The first step for me to start this project is determining how the graph is formed. I decided to go with a directed graph where all of the champions and items are vertices while the edges are based on which item goes best for a champion.

Directed Graph:

VerticesChampions & Items

EdgesRecommended Item

Small Model of my Directed Graph

With my graph, I am going to take on these three problems:

  1. The most versatile item in the game.
  2. Which champion has an item that is the least shared recommendation to any other champion?
  3. Based on an item you have, outputs which champions can you give it to.

Most Versatile Item and Least Versatile Item

The first two problems are similar in contrasting ways. We are simply going to find the most versatile item and the least versatile item in the game based on how many champions the graph recommends. I wanted to see which item I should almost always pick up because it could be used with most of the champions effectively. As well as an item I want to stray away from due to its limitation to effectively work with the roster of champions.

The core logic I followed to solve both these problems with a Directed Graph goes as follows:

 # Create a dictionary to hold all the counts of the item's edge to a champion, a histogram if you will.  # Iterate through all the neighbors of the graph and store what we      find in the dictionary. # Determine the highest and lowest frequency of a certain item.Most Versatile Item: (15, 'Morellonomicon')
Least Shared Item: (1, 'Redemption')

I can now output the most and least versatile item. The most versatile item in the graph is the Morellonomicon item, while Redemption is the least versatile item.

Building a Carry Unit

The final problem I wanted to solve with my graph was, given an item which champions does it pair best with? When I started playing the game, it was really frustrating to put an important item on a champion only to learn that the champion will not be able to use it to its full potential.

The core logic goes as following to solve this issue:

 # Iterate through all of the item vertices 
# Add all the neighbors for the given item
# Append those neighbors in a list
# Now the list will be full of recommended champions for that given item.
Which Item are you trying to pair to a Champion? Dragon's Claw
Champions that can use this item are: ['Darius', 'Garen', 'Braum', 'Kassadin', 'Shen', 'Aatrox', 'Poppy', 'Akali', 'Sejuani']

Now I am able to input any item that is given to me and generate a list of champions that it would work optimally with.

A Little Legends Dream

I can confidently say that I have critically advanced my knowledge of the item system of TFT through the process of creating this graph and solving my three problems.

I can only hope for other individuals who shared the same conflict as I did you use this and help them improve their TFT skills

A few future steps that I would like to transition into a real-world application would be:

  1. Generate a graph that auto-updates with every new game patch.

2. Integrating this graph to a mobile app or website would be a neat project to have and can benefit all the new players of TFT.

~Check out my GitHub repo containing the project~

--

--