Course:CPSC312-2023/TFT Team Recommender

From UBC Wiki

Authors: Al Yu, Sarah Gu

What is the problem?

Teamfight Tactics (TFT) is an online multiplayer strategy game by Riot Games, in which each player must build a team of characters to automatically compete against other every round. There is a significant amount of luck involved with this game, with what items, characters and game modifying augments the player is given, and the skill part comes in with how these random elements are handled. Our goal is to create a recommender system that can suggest an optimal team composition, given the current state of the player's board.

What is the something extra?

We'll develop a script that will allow us to take data off of TFT team builder websites (such as Mobalytics and TFTACTICS.GG), and be converted to a format that is compatible with Prolog. Using this data, we'll allow the user to answer questions about their desired team comp or initial board state, and pick out the optimal choices for them:

What did we learn from doing this?

(This should be written after you have done the work.) What is the bottom-line? Is functional programming suitable for (part-of) the task? Make sure you include the evidence for your claims.


We found that because Prolog is a language based on logical programming, it was well suited for the task of implementing a recommendation system, and allowed us to focus more on the relationships between different entities. This was particularly useful in the context of our project, due to the amount of relations between different teams, items, units, and other attributes that needed to be taken into account.

While implementing a way to convert csv data to a format that is readable in prolog, we actually found it easy to refactor code to be simpler and reusable for different situations. However, modifying specific columns could be difficult without copy-pasting the code. Additionally, Prolog does not allow spaces or special characters in atoms, which requires replacing them with underscores or other symbols. The lack of control over the CSV data extracted from the source websites also lead to some inconsistencies, along with the need to hardcode behaviors to handle them.

We also encounter some difficulties in other aspects, particularly when we were debugging. As Prolog does not often provide explicit error messages, it is sometimes difficult to find the source of the error, or in some cases, if there is an error at all. This lead to a good amount of time put into meticulously testing our code, though Prolog's debugger definitely helped to smooth out the process.

Links to code etc.

https://github.com/hmqyu/prolog-tft-team-recommender