League of Legends Statistics Application
Posted on: October 16, 2021When the pandemic hit, I set out to build a slightly more complex system than usual as a personal project. The first thing I aimed for was to create an assistant for League of Legends, a game I frequent. There are plenty of applications that do the same, but the focus was on going through the entire process and learning whatever was needed along the way.
To understand the application, a bit of context about the game is needed
League of Legends is a 5vs5 multiplayer game, where each player controls one of over 150 characters.
The objective of the game is to destroy the enemy base.
The vast amount of content in the game, combined with the frequency of patches that modify the power level of the characters, makes it very difficult to stay up-to-date on which champion is stronger, which ones are not advisable to play, etc.
App’s objective
The goal for the application was twofold. On one hand, it was supposed to provide reliable statistics about the current state of the characters in terms of which are stronger/weaker, as well as the correct equipment for each one. On the other hand, it should also provide assistance during the game and character selection, making recommendations, interacting directly with the game and providing information about allied and rival players.
Architecture and technologies
The technologies used were Python for the backend, and JavaScript for the frontend. Python makes it easy to assemble an API using the Django library and also facilitates the generation of statistics thanks to the Pandas library.
The architecture will be broken down in several blogs, where I will explain how the RiotGames API works and how I obtained the statistics and interacted later from the frontend with the game Launcher, as well as some algorithms I developed along the way.
In a nutshell, the backend uses Celery to obtain information about players’ matches (which is stored in PostgreSQL), prioritizing those players in a high league as they are the ones who play best and therefore are the most reliable source of information.
Based on these matches, a series of statistics are made for each character (which are calculated with Pandas and stored in MongoDB due to the complexity of the documents), these statistics are requested from the frontend using a Django API. The frontend (Electron + ReactJS) uses these statistics to make recommendations, and obtains real-time information about the ongoing match through a WebSocket that connects the app with the game process, which in turn allows it to interact with it, automating actions such as selecting equipment, position, accepting match, etc.
Development Details
The application can be downloaded and installed on Windows, the app code and installer are available on Github, accessible via the following links: Frontend and Backend
I will be adding links to the blogs where I write about the app’s architecture and the various algorithms I used during the development.