TFT League of Legends Cheat using Graph Theory

Timo Makhlay
5 min readAug 13, 2019

--

Hey! Hi, and welcome to my journey and code in making a Team Fight Tactics Cheat or more like a Cheat Sheet, using the graphs abstract data type.

What is Team Fight Tactics?

TFT (Team Fight Tactics) is a LoL (League of Legends) game mode that is still, to the date of this article’s publication date, in open beta. As the creators describe it: “Set in the fractured, dream-like Convergence, Teamfight Tactics is a new game mode in League that pits you against seven opponents in a free-for-all war for supremacy. Build the ultimate team, power-up your forces, then watch the battle unfold.” — BY AETHER, SHIO SHOUJO

What do your ‘really’ need to know about it?

You simply need to undestand that the biggest componet that leads to victory is utilizing your champions slots deligenlty to get the most class bonuses.

Champion Slots - You can only have up-to a maximum of 9 Champions

Champions - Are the pawns you use to fight against the enemy pawns to be the last one remaining out of the 8 players.

Class Bonuses - “Deploy multiple unique champions with the same origin to unlock powerful trait bonuses! Copies of the same champion all benefit from their origin bonus, but only the first counts for determining how many unique champions you have deployed” — League of Legends Gameplay Guide

As best reppresented in the picture below:

Scarra (LoL Employee) on Twitter (https://twitter.com/scarra/status/1141051231265120256)

Now, don’t be confused by their separation of the Classes in Origins/Classes, because franckly they don’t differ in their funtion but only in videogame lore.

What is my “Cheat Sheet” do that is so different?

Well, first of all…What’s with that attitude? Calm down, take a breather, I was getting to the good stuff.

Yes, as you might’ve guessed, I can make the best Champion Selection recommendation for you to get the most bonuses and higher your chances of victory by giving you the infomation needed to make a well thought out plan. Your alternative would be to memorize all the classes, their required slot counts for bonuses and the bonuses’ abilities among other things. I of course have done all that, but I don’t expect everyone to be a pale indoors computer scientist with a passion for videogames. But I used my knowledge, put it into algorithms and made it so that anyone can use at least part of the thinking process that players go through when making decisions in TFT. So this script can only help you if you’re a beginner or just someone who’s is trying to actively get better at the game.

What does the script run line?

Here’s an example:

Run

python graph_tft.py

input

Gnar

output

First Champ:gnarGNAR's classes are: ['wild', 'yordle', 'shapeshifter']For WILD class:['warwick', 'ahri', 'gnar', 'nidalee', 'rengar']For YORDLE class:['tristana', 'gnar', 'poppy', 'veigar', 'lulu', 'kennen']For SHAPESHIFTER class:['elise', 'shyvana', 'gnar', 'nidalee', 'swain']MUST GET: ['nidalee']Best Item Combination for GNAR: ['frozenheart', 'warmogsarmor', 'phantomdancer']

What just happened? Or how did it happen?

I first found all the classes that Champion pertains in. For this example with Gnar:

GNAR’s classes are: [‘wild’, ‘yordle’, ‘shapeshifter’]

There’s Gnar! He’s a Wild, a Yordle and a Shapeshifter! Next I had to find all the Champions of the same Class.

For WILD class:[‘warwick’, ‘ahri’, ‘gnar’, ‘nidalee’, ‘rengar’], For YORDLE class:[‘tristana’, ‘gnar’, ‘poppy’, ‘veigar’, ‘lulu’, ‘kennen’], For SHAPESHIFTER class:[‘elise’, ‘shyvana’, ‘gnar’, ‘nidalee’, ‘swain’]

Now all of these characters are possible compatible bulids that the script outputs.

Next I check for any reoccurring characters to point them out.

MUST GET: [‘nidalee’]

Oh..Look at that user, Nidalee is also both a Wild and a Shapeshifter just like Gnar, minus the Yorlde. Lastly I also print the best items to build for Gnar, frozenheart, warmogsarmor, phantomdancer.

What does the graph look like?

It would have Champions as vertices on the graph and they connect to each person of the same class.

What does my code look like?

Frankly, it’s too much for me to talk about it all here. So here’s my github repo, feel free to check it out there if you’d like to see and learn more about it:

But here are the highlights

Parsing champion JSON to make Champion Object (JSON)

After having made a graph with all the Champions as Vertices, I began adding the Edges

Lastly, I made cliques for each of the Champion’s classes and used that data in the final output.

What now?

Well the journey is just beginning for this project. I plan to make a mobile app to make it easier to utilize and visualize the infomation that this script provides. I plan to work with Ryan Nguyen and also add the TFT Item Cheat Sheet Graph to the app as well.

Resources:

--

--