scieee AI-readable full text Open interactive document viewer

Auto-generated eSports natural language narrative

Rueda Martínez, Esteban

Abstract

The e-Sports, also known as electronic Sports, is a world that is growing at a really fast pace. League of Legends is the most played video game in the world with approximately 115 million active players each month. The games between professional teams are broadcasted on platforms such as YouTube, Twitch and other smaller platforms. That is why not everyone can be informed of the results, this is due to the amount of time it takes to watch these games of approximately 30-40 minutes. The objective of this application is to create a program that automatically writes a summary written in natural language of the games played in professional tournaments or leagues. This way, every user will have the option of being informed about what has happened during the course of the game and the final result without the need to spend so much time watching a video. To carry out this project I will use a natural language generation technique called "corpus-based". This technique consists of creating a series of different designs or "objective texts" to analyze the information I want to use, and thus, perform the data analysis according to the information we want to include in the text.In these sketches or objective texts we will introduce the most important events of a League of Legends game, this information will be obtained from the Riot Games API. The purpose of these designs is to obtain a text with a structure and language similar to one created by a human. The results obtained enable the user to understand the main events of the game. Furthermore, the resulting texts have an acceptable degree of naturalness.

Full text

Narración sobre eSports generada automáticamente en lenguaje natural Auto-generated eSports natural language narrative Trabajo de Fin de Grado Curso 20202021 Autor Esteban Rueda Martínez Director Gonzalo Méndez Pozo Pablo Gervás Gómez-Navarro Grado en Ingeniería Informática bilingüe Facultad de Informática Universidad Complutense de Madrid Narración sobre eSports generada automáticamente en lenguaje natural Auto-generated eSports natural language narrative Trabajo de Fin de Grado en Ingeniería Informática Autor Esteban Rueda Martínez Director Gonzalo Méndez Pozo Pablo Gervás Gómez-Navarro Grado en Ingeniería Informática bilingüe Facultad de Informática Universidad Complutense de Madrid 21 de septiembre de 2021 Acknowledgements I would like to thank my two tutors Gonzalo and Pablo for their kindness, their help and for giving me the chance of making an end of degree project about something I would never think I would be able to. I would like to thank my family for giving me the chance of having an education, and a great one. I would also like to thank my friends and my girlfriend for their encouragement and for supporting me through all these years. But most importantly, I would like to thank Alex with all my heart, I'm really greatful of meeting him around 6 years ago. Thank you for being my partner and my friend every single day. Without you none of this would have been possible. As I've been told since I was little: Es de bien nacido ser agradecido. Translated into english: Gratitude is the sign of noble souls. Thank you. v Resumen Los e-Sports, también conocidos como electronic Sports, pertenecen a un mundo que está creciendo a un ritmo muy alto. League of Legends es el videojuego más jugado en el mundo con aproximadamente 115 millones de jugadores activos mensualmente. Las partidas entre equipos profesionales son retransmitidas en plataformas como YouTube, Twitch y otras menos conocidas. Es por ello que no cualquier persona puede informarse de los resultados, debido a la cantidad de tiempo que requiere ver estas partidas de aproximadamente 30-40 minutos. Mi objetivo en este proyecto es crear un programa que redacte un resumen escrito en lenguaje natural y de forma automática de las partidas que son jugadas en los torneos o ligas profesionales. De esta manera, todo usuario tendrá la opción de informarse de lo que ha ocurrido durante el transcurso de la partida y del resultado nal sin la necesidad de invertir tanto tiempo en ver un vídeo. Para llevar a cabo este proyecto utilizaré una técnica de generación de lenguaje natural llamada corpus-based.Esta técnica consiste en crear una serie de bocetos o textos objetivo para analizar la información que se quiere poner y así realizar el análisis de datos acorde a la información que queremos incluir en el texto. En estos bocetos o textos objetivos introduciremos los eventos mas importantes de una partida de League of Legends, esta información la obtendremos de la API de Riot Games. El n de estos bocetos es obtener un texto con una estructura y lenguaje similar a un texto creado por un ser humano. El resultado obtenido permite entender los eventos principales de la partida elegida por el usuario. Además, los textos resultantes tiene un grado de naturalidad aceptable. Palabras clave Riot Games, Riot API, Java, Natural Language, e-Sports, League of Legends. vii Abstract The e-Sports, also known as electronic Sports, is a world that is growing at a really fast pace. League of Legends is the most played video game in the world with approximately 115 million active players each month. The games between professional teams are broadcasted on platforms such as YouTube, Twitch and other smaller platforms. That is why not everyone can be informed of the results, this is due to the amount of time it takes to watch these games of approximately 30-40 minutes. The objective of this application is to create a program that automatically writes a summary written in natural language of the games played in professional tournaments or leagues. This way, every user will have the option of being informed about what has happened during the course of the game and the nal result without the need to spend so much time watching a video. To carry out this project I will use a natural language generation technique called "corpus-based". This technique consists of creating a series of dierent designs or "objective texts" to analyze the information I want to use, and thus, perform the data analysis according to the information we want to include in the text.In these sketches or objective texts we will introduce the most important events of a League of Legends game, this information will be obtained from the Riot Games API. The purpose of these designs is to obtain a text with a structure and language similar to one created by a human. The results obtained enable the user to understand the main events of the game. Furthermore, the resulting texts have an acceptable degree of naturalness. Keywords Riot Games, Riot API, Java, Natural Language, e-Sports, League of Legends. ix 6.2. First iteration Mockup . . . . . . . . . . . . . . . . . . . . . . 39 6.3. First iteration Diagram . . . . . . . . . . . . . . . . . . . . . 40 6.4. First iteration Mockup . . . . . . . . . . . . . . . . . . . . . . 43 6.5. Second iteration Diagram . . . . . . . . . . . . . . . . . . . . 44 6.6. LaTeXmockup.......................... 45 6.7. UseCase1 ............................ 46 6.8. UseCase2 ............................ 46 6.9. FluxDiagram........................... 47 7.1. Resultsofgame1......................... 49 7.2. Resultsofgame2......................... 50 7.3. Resultsofgame3......................... 51 8.1. Second iteration UI result . . . . . . . . . . . . . . . . . . . . 54 8.2. Resultsofgame1......................... 55 8.3. Resultsofgame2......................... 55 8.4. Resultsofgame3......................... 56 8.5. LaTeXresults1.......................... 56 8.6. LaTeXresults2.......................... 57 A.1.ResponseBody1......................... 60 A.2.Listofmatches .......................... 61 A.3.Listofmatches .......................... 61 A.4.Matchdata ............................ 61 A.5.Listofmatches .......................... 62 A.6.Matchdata ............................ 62 Chapter 1 Introduction In this chapter I will explain my motivation behind this project and describe League of Legends and how it works. I will also dene my objectives and make a small description of each part of the document. 1.1. Motivation I have been playing League of Legends since its beta release back in 2009. I am pretty condent when I say League of Legends is my favourite videogame. It has given me so many hours of fun, playing both the casual and the competitive mode. These past few years I have developed an interest in data analysis and software development and this project felt like a great chance to combine them together with my favourite game. During all these years, the only way to nd out the results of a game has been either to watch the game in a streaming platform or to check the after-game statistics in various webpages, either if it's a professional game or a normal game. The main idea is to create an auto-generated narrative with the aim of making it as human like as possible. This will create the possibility for any user to be able to check what happened in the game without having to look at raw statistics or graphs. All the information of the games will be obtained through the riot API (Games, 2021). Programming in Java I will be requesting the data from the API, parsing and using it to create the natural language narrative of the played match. With the software developed in this project, the user will have the possibility to lter which parts of the match or which players the user wants to obtain the summary of. 1 2 Chapter 1. Introduction The software will create a summary of all the ltered sections and save it into a .tex le. Once this process is nished, the le will be compiled and transformed into a PDF le with its own structure. 1.2. Context League of Legends, also known as "LOL" or "League", is a videogame of the genre "MOBA", which acronyms mean Multiplayer Online Battle Arena. It consists on two teams of ve players who battle each other in a map.(Wiki, 2021) Each team has a base they have to deend and whoever destroys the enemy nexus, wins. Each player will control a character with unique abilities and they will be evolving during the game. Obtaining experience points and gold. Figure 1.1: League of Legends Match League of Legends is the world's largest eSport, in the 2019 championship, League of Legends had over 100 million unique viewers. This shows the insane amount of followers this game has. 1.3. Objectives Here I will mention the main objectives I want to accomplish in this project. The main objective is to create a program that will automatically generate a natural language summary of the most relevant events in a League of Legends match. 1.4. Structure of the document 3 The summary should present the most important events in the game separated in dierent. The text generated should take less time to read than to watch the highlights of a match. The summary should be grammatically correct and easy to understand. 1.4. Structure of the document Chapter 2 includes the State of the Art applied to the project. It is divided into four dierent sections: League of Legends (2.1): There is an introduction to the game, what it is, how it works and its mechanics and features. Riot Api (2.2): Brief explanation of how the Riot Api works. There is a user's manual in the appendix (A). Data Analysis (2.3): The Orianna library and its features are explained. In chapter 3 there is a more detailed explanation of the Orianna library and how I use it for the project. Similar Applications (2.8): A set of the applications with similarities to the one we develop in this project. In chapter 4 I go through the method used to generate natural language. This chapter includes the details of the method used next to some images used as a graphical demonstration. Chapter 3 documents all the information used in the development of the program, accompanied with some UML diagrams. In the chapter 6, I describe the implementation of the two iterations of the program and I document it with images and UML diagrams of the code structure. In chapter 5 I will be explaining all the tools and technologies I used for this project. The conclusions 7 chapter is made of the Results and Conclusions section 7.2 which contains the results of the program and the conclusions made after the realization of the project. The other section 7.3 has the possible future applications or changes that could be made to the project in the future. In the Appendix (A), there is a complex documentation of the usage of the Riot Api. Appendix B has a glossary with all the words which need an extra description or a more detailed denition. At last, C provides instructions for running the program, including the software and system requirements. Chapter 2 State of the art In this chapter I will describe in detail some of the dierent aspects included in the project and their current technology state. 2.1. League of Legends League of legends is a team-oriented strategy game where the goal is to work together with your teammates to bring down the enemy nexus, located in the middle of their base, before your opponents take down yours. First of all, before entering a game, you will have to choose one out of more than 140 dierent characters all of whom have their own unique strengths and weaknesses.(Champions, 2021) Five players will be faced o against their ve opponents, and all of them will have to complete many tasks and objectives. Each character or champion has a set of abilities consisting of three basic abilities and an ultimate ability which is supposed to be a stronger one. The main task of the game will be to take down enemy minions. These minions are AI controlled and will try to destroy your base, advancing slowly and ghting the opponent minions and the player's champions. Taking down these minions will grant the player gold and experience points. By earning gold you will be able to buy items at your base, which will increase the statistics of your character. Also when gaining experience points, your champion will level up, which will give the player the choice of leveling up one of the abilities of his character, making it more powerful. Another one of the tasks is taking down the opponent towers, which will grant gold to all the team, and help the team advance to the enemy nexus. Each side of the map has a jungle with some neutral AI minions in it. Between all of them you can nd the dragons, which spawn every ve minutes after being taken down. These elemental dragons provide dierent bus or positive stats depending on which element the dragon is to the team who 5 6 Chapter 2. State of the art Figure 2.1: Jungle of the map with its neutral monsters takes it down. The rst team to defeat a total amount of four dragons, recieves the dragon soul, which is a powerful permanent bu. This soul also has dierent bus depending on which element the last dragon taken down was. (Jungle, 2021) After the soul has been claimed by one of the two teams, the Elder dragon will spawn, granting a temporary bu to the team that takes it down. On the other side of the jungle, a powerful monster called Baron Nashor will spawn after minute 20. When a team defeats this monster, they obtain a big amount of gold, experience and a powerful bu. This bu will empower the ally minions of the team who defeated it and it will also increase the damage the champions will deal. The map called Summoner's Rift is divided into three dierent lanes (Map, 2021), top lane, mid lane and bot lane. Normally one player of each team will confront each other in the top lane, the same goes for the mid lane and in the bot lane two players will confront each other. Both teams will have one player in the jungle whose objective is to assist their teammates. Each lane has three dierent layers of defenses, composed of a tower. This tower will attack any enemy around it and deal a huge amount of damage. When a team destroys the three layers of towers from the opposing team, they will have access to take down the inhibitor. Unlike the towers, the inhibitors do respawn after some time, and during the time an inhibitor is down, it will constantly spawn powerful minions in the map to march with 2.1. League of Legends 7 Figure 2.2: Summoner's Rift, map where the game is played the rest of the minions. After taking down an inhibitor, the last defenses the enemy has are two towers right next to the nexus, and the nexus. Once the two towers are taken down and the nexus is destroyed, the team who achieves this wins. The games average length is around 25 to 30 minutes long, and teams can agree to surrender after 15 minutes if they feel like the game is unwinnable. League of legends has a competitive scene composed of 12 dierent professional leagues around the world with hundreds of sub-professional leagues and tournaments. Every year a world championship tournament is played by the best teams all over the world, similar to how a soccer's world cup would work. 2020's world championship was located in Shanghai, China, and had a prize pool of 2.34 millions of dollars. The nals of the world championship were broadcasted in 16 dierent languages and across 21 platforms, hitting 23.04 million Average Minute Audience (AMA) and a 45.95 million peak of concurrent users. For understanding a given game, the most important elements that a summary should cover are: The players and their performance during the match. The most relevant events happening during the match. 8 Chapter 2. State of the art 2.2. Riot Api The Riot's Api provides an immense amount of data. It has been made to provide the League of Legends developer community the tools to build applications to contribute to the player's experience.(Games, 2021) Figure 2.3: Riot developer portal In the API, you can nd information about the games being played, the match history and statistics of a player, the statistics of a given match, and many more things. Figure 2.4: Details of an API method In my case I need the information of a given match. To be able to request the information of a given match I need to know the "matchId". To obtain the matchId I would have to request data from: 2.3. Data Analysis 9 GET /lol/summoner/v4/summoners/by-name/{summonerName} In this request I would use the Summoner's Name of the player I want to get the match from. Once I make that request I can obtain the encryptedAccountId, which I will use to request the matchId from: GET /lol/match/v4/matchlists/by-account/{encryptedAccountId} Once I have the matchId, I can obtain the information of a given match using the request: GET /lol/match/v4/matches/{matchId} 2.3. Data Analysis This project involves a lot of data analysis, since I'm obtaining a huge amount of data, I have to analyze it and organize it before I can make any use of it. I will be using Orianna (Rua and Maldonis, 2020), which is a Java adaptation of the Riot Game's API. It's a library designed with usability in mind. It includes: An enhanced user interface that makes using the Riot API easy and fun Rate limits handled automatically with optimal usage of your API key Congurable handling of API errors (e.g. automatic retry on 500 errors) Built-in automatic caching, ready out of the box DataDragon support 2.4. Natural Language Generation Natural language generation is the process of deliberately constructing a natural language text in order to meet specied comunicative goals. Automated NLG can be compared to the process humans use when they turn ideas intro writing or speeches. Natural language generation can also be compared to translators of articial computer languages. GOAL: The goal is to produce understandable text using computer software. INPUT: The input is usually some non-linguistic data we need to translate into human-like text. 16 Chapter 2. State of the art champion, what build of items works well against each dierent enemy champion. You can also ask information about a certain player and it will give you all kinds of statistics and graphs about his games. This application has been in development since 2013. U.GG 2 : This application does not provide as much general information as League of Graphs but you can nd all kinds of statistics of a specic player, Rankings of what champions are the most played, Leaderboards of players, etc. The most remarkable use of this application is its "Live game" tool. When you enter a match, it will track every player in your team and the enemy team and provide you all types of information to help you. Figure 2.12: Main screen of the application U.GG Blitz 3 : The highlight feature of this application is the in-Game integration. When you are inside a match, this application can work as an overlay of the game and it will give you information in real time, e.g., it can suggest what ability you should upgrade rst, if your performance is under or above the average, the timers of the neutral minions in the map and how you are farming compared to the average player. There are many other applications such as Porofesor, Lolskill, Lolking.net, champion.gg, lolalytics.com and more. They all have practically the same use and tools, giving you all types of statistics and graphs or in- Game utilities. They all have in common the same things but visually they are slightly dierent from each other. After analyzing each of these applications I reached to the conclusion that none of these websites or apps provide 2 https://u.gg/ 3 https://blitz.gg/ 2.8. Similar Applications 17 Figure 2.13: Tools of the Blitz app you the information in a text format with natural language. Sometimes a summary is better to look at than some complicated graphs, and that is what I want to accomplish with this project. Some numbers or graphs are not always the best way to provide information to a user. Sometimes the user wants to be told a story of what happened and not just look at some stats in a screen. Chapter 3 Data Analysis In this chapter I will go through the implementation of the application. First of all I will be explaining the Analysis of the data obtained from the Riot Api. Next, I will explain how each of the classes and methods work, the design and extructure of the program. The source code can be found in the following GitHub: https://github.com/NILGroup/ TFG-2021-NarradorESports 3.1. Data Analysis Implementation Before going through the classes and methods of the application, we need to analyze and understand what information can be used for the generation of the natural language text. 3.1.1. Project's Data Analysis There are many dierent data sets we have to work with in order to get the information we need. The class Participants will provide us with a huge amount of data about the participants of the match, here we need to lter which parts of the data are the most relevant and which of them are not. As we can see in the UML of the gure 3.1, we obtain a lot of data we don't need in order to create the text. Only the following methods will be used to obtain the data we need: getChampion().getName() will provide us with the name of the champion of the player we want. getLane() gives us what lane the player is playing in. The possible outputs of the class getLane() are: Lane[BOT, BOTTOM, JUNGLE, MID, MIDDLE, NONE, TOP]. 19 20 Chapter 3. Data Analysis Figure 3.1: Participants class Information getStats() , this class provides general statistics of the player in the match, from this method we have access to data about the number of assistances, deaths and kills of the player as well as the gold obtained by the player and many other not so relevant data. getTeam() , at last, this class will give us the data about which team the player belongs to, we can also obtain if the team is from the Red or Blue side and which team is the winner. In the Events class, we will gather information about the dierent events happening in the match, the upcoming methods are the most important: getBuildingType() provides the building type, the data comes in this format: [INHIBITOR-BUILDING,TOWER-BUILDING] getMonsterType() for obtaining which monster was killed. getType() will give us data about the dierent event types happening throughout the game, its format is:[ASCENDED-EVENT,BUILDINGKILL,CAPTURE-POINT,CHAMPION-KILL,ELITE-MONSTER-KILL,ITEMDESTROYED,ITEM-PURCHASED,ITEM-SOLD,ITEM-UNDO,POROKING-SUMMON,SKILL-LEVEL-UP,WARD-KILL,WARD-PLACED] In the Match class, as seen in the gure 3.2, we have the data about the match, its teams, the duration, the participants and many more. For this project I will be obtaining data mainly from the next methods: 3.1. Data Analysis Implementation 21 Figure 3.2: Match class Information getBlueTeam() for information about the blue team. getRedTeam() for information about the red team. getDuration() provides the duration of the match, it can be obtained as seconds or minutes. getParticipants() provides all the information about the players in the match, as seen in the gure 3.1. Another class worth mentioning is the Player class, this method will give us a lot of data about the player we choose, such as the name of the player, the level of the account, which server the player plays in and a lot more data. It can be observed in the gure 3.3. 3.1.2. Data selection After analyzing all of the data mentioned in the previous sections, a ranking of the relevance of the information must be made in order to decide what parts of the information will be used when creating the text. In this case, as mentioned in the 1.1 section of the Chapter 1, I've been playing this game for over 10 years and I know exactly which parts of a match are more or less important. These events are ranked depending on the amount 22 Chapter 3. Data Analysis Figure 3.3: Player class Information of times it happens and how much impact they make in the course of the game. For example kills are an important event but they happen a lot of times during the match. In the other hand, tower takedowns dont happen that often but they are more impactful to the match. There are many other events that happen a lot throughout the game which don't aect the game much like minion kills, a player using an ability, a player moving from point A to point B and a large etcetera. These events are ranked irrelevant, not very relevant, relevant or very relevant. I will rank the dierent events happening in a match and sort it by relevance. Irrelevant events dominion Score position(x,y) currentGold teamScore timeStamp.item jungleMinionsKilled dominionScore itemId wardType SkillSlot Skilllevel.up Item.destroyed 3.1. Data Analysis Implementation 23 Item.Undo LargestCriticalStrike timeCCingOthers combatPlayerScore csDifPerMinDeltas xpDiPerMinDeltas damageTakenPerMinDeltas Not very relevant events Match.duration killingSprees championLevel wardsPlaced creepScore wardsKilled damageToTurrets damageToObjectives damageTaken damageDealt damageHealed match.queue match.season match.timeStramp mapId gameMode gameType totalGold minionsKilled Relevant events Kills Deaths Assists Gold.earned Items Damage Vision.score Player name Building.Destroyed Bans Champion.picked teamID player.name Epic.Monster.Kill Very Relevant events Winner Chapter 4 Natural Language Generation In this chapter, I will document the dierent parts of the natural language generated text in this project, their contents, how and why they were chosen. I will also describe the process of obtaining the Natural Language generated text. 4.1. Text Generation As described in the section 2.5 in the chapter 2, I will be using a corpus based method to create the natural language summary of a League of Legends match. To do so, there are a couple of steps I need to follow in order to obtain the nal text. 4.1.1. Creating an Initial corpus First of all, I need to collect a corpus of input data and human-authored output texts, these corpus texts should cover almost the full range of texts expected to be produced by the NLG system. A quick scan of the corpus Figure 4.1: Corpus Texts collected may reveal that it is not possible to generate some of the texts in the initial corpus, that the corpus texts appear to not be the most optimal and they could be improved with some extra information. The most important part 25 Chapter 5 Technologies and Tools In this chapter I will name and describe all the dierent tools and technologies I used to carry out this project. 5.1. Coding tools and technologies 5.1.1. Java Java is one of the most used programming languages in the world. It is also one of the main coding languages learnt in the university at a basic level, this knowledge helped with the development of the project. 5.1.2. Java Swing Swing is a graphic library for Java, it includes widgets for a graphical user interface (GUI) such as buttons, tables, text boxes and many other utilities. Java Swing was used to create a graphic interface for the program, consisting in a panel with a big text box for the generation of the match summary, a button to generate the text and a text eld where the user is able to type in the matchId. 5.1.3. Eclipse IDE The IDE(Integrated Development Environment) Eclipse is also one of the IDE's we learn how to use at the university. Being familiar with the Eclipse IDE helped me to build a well structured project and to be able to debug the code with Eclipse debugging features. 33 34 Chapter 5. Technologies and Tools 5.1.4. Riot Api In the Riot Api we can nd a huge amount of data created by the League of Legends game. From match data, player's information, rankings and leaderboards to in-game items, monsters and spells. This information was extracted to be used in the dierent implementation processes. 5.1.5. Orianna Library The Orianna library is a Java adaptation of the Riot Games League of Legends API, the use of this library was key for accessing the data from the Riot Api. 5.1.6. Gradle Project Creating a Gradle Project in Java was necessary in order to use the Orianna Library. In order to add the Orianna Library I had to add the Maven Central reposityory to the gradle repositories section. 5.2. Memory tools and technologies 5.2.1. LaTeX LaTeX it a software system for document preparation. The reason why I chose LaTeX over other document creators like Word or google docs is because LaTeX provides a really well structured document, with many tools and possibilities between its features. It took some time to get used to it and to learn its coding but once learnt, this program helps by creating really good quality documents. 5.2.2. TeXiS TeXiS is a template of LaTeX made for Thesis, end of degree projects and end of master degrees. I used this template to build the document and it has been very helpful with the structure of the Memory. 5.3. Organization 5.3.1. Github GitHub was the application I chose for uploading the memory and the code of the project. It's features helped me update the code and the memory in order to show it to my project Directors. 5.4. Design tools and technologies 35 5.3.2. Google Drive I used this application for uploading all of my les so I could access all of them from any place and download them when necessary. 5.3.3. Google Meet Google Meet was the application I used to keep in contact with my project Directors. We used the videoconferences to keep updated of the project and with the sharing screen feature I was able to show my work in order to get some feedback and help. 5.4. Design tools and technologies 5.4.1. WireFramePro Application I used to create the mockups for the User Interface of my project. It was a very useful tool since it was both free and very simple to use. It helped me get a great view of how I wanted my app to look like. 5.4.2. Online.Visual-Paradigm This tool was very useful for creating all the UML diagrams and Class diagrams of the application. Chapter 6 Application Design 6.1. Application Introduction To develop this project I decided to use an Iterative design , iterative development is based on a cyclic process of prototyping, analyzing, testing and rening a product. The main idea I had for the project was to create an app with Java which would ask the user for a matchId as an input, the program would create an automatically generated text and display it. I could have made the project in a Front End technology and make it a lot more simple but I decided to make it with Java completly so I could develop my coding skills with this language. Making both the Back End functionality and the graphic user interface with Java Swing would make the project more challenging and more enriching. Because I chose to follow an iterative development design, I decided to create a rst prototype of the application that would evolve into the second and nal iteration of the application. 6.2. Design Pattern For this application I decided to use the MVC Pattern, which stands for Model-View-Controller Pattern. This pattern is used to separate application's concerns. The model package takes care of the data structure and it manages the data and the logic of the application. The Viewer package includes the dierent views containing the data. Finally the controller acts on both model and view, it controls the data ow into the model package and updates de Viewer whenever the data changes. The diagram in the gure 6.1 shows how the packages and classes are organized and connected. The gures 6.3 and 6.5 show how the MVC pattern was applied to the project. The dierent parts of the text are created inside the Model package. The 37 38 Chapter 6. Application Design controller will comunicate with the Model classes to provide information to the user interface made in Java Swing situated in the Viewer package. Figure 6.1: MVC Pattern 6.3. First iteration The rst iteration will obtain an input "matchId" from the user and it will automatically generate a summary of the match, structured in: Introduction Early Game Mid Game Late Game Conclusion Each of these parts are described in detail in the section 4.2. This iteration consists on a simple UI with a text input for the user to write the matchId he wants the text to be made of and a button to generate the text. The text is generated and displayed in an uneditable JTextArea. 6.3. First iteration 39 6.3.1. UI Design For this rst iteration I created a mockup with the free tool WireFrame- Pro. in the gure 6.2 there is a mockup of the rst iteration of the application. Figure 6.2: First iteration Mockup 6.3.2. Architecture Once the design Pattern was chosen, I created the packages inside the project and all the classes inside each of their packages following the MVC design, the diagram of the rst iteration can be seen in the gure 6.3. The model package will contain: Introduction.java EarlyGame.java MidGame.java LateGame.java Conclussion.java 40 Chapter 6. Application Design Figure 6.3: First iteration Diagram In the viewer package we will have the MainWindow.java class, in the controller package we have the Controller.java class and in the Main package we have the Main.java class. 6.3.2.1. Introduction Implementation In the introduction class I will be creating the rst part of the text.. This class will include the presentation of both teams, their picks, their bans and what position they will be playing in. To create a variety of dierent introductions, I used the Random() method which creates a random number, and then used the method nextInt(5) to create a number between 0-4. There will be 5 dierent introduction formats and each one of them will follow a similar but dierent order for displaying the information. In order to obtain the information from the match we must initialize the information of the match into a match Object. To do this we need a matchId passed as a parameter in the introduction() method. The parameters of the introduction class are the matchId and the JTextArea from the viewer class. We need the matchId in order to obtain the data from the given match, otherwise no data will be recieved when we make a request. We also need the JTextArea from the viewer class to be able to add all of the text to the text area in the user interface. 6.3. First iteration 41 6.3.2.2. Complications with Introduction class The main problem I encountered with the model package was when I wanted to change the content of the JTextArea. I tried initializing the MainWindow class from the Viewer package but I was only creating another instance of the JTextArea, therefore, it didnt work. The way I xed it was by passing the JTextArea by parameter in the introduction class. The other mistake I was making was to use the setText() method to add the text to the JTextArea but it was not working, so instead I decided to use the append() method and it worked perfectly. Every time append() was used, the text was included in the JTextArea in the order of the execution. 6.3.2.3. EarlyGame Implementation The EarlyGame has a summary of the main events that happened in the rst 10 minutes of the game. To be able to obtain the data, we need a matchId we are passing as a parameter in the earlyGame() method. Once we have the match information saved in an object, we will be obtaining the list of participants and the match timeline. The rest of the functionality in the EarlyGame class is to display the information happening in the rst 10 minutes of the game. It will display which Epic Monsters were killed in which moment of the early game. It will also display the amount of kills made by each one of the two teams during this period of time. Finally it will show which buildings were destroyed during the early game, separating them between towers and inhibitors. 6.3.2.4. Complications with EarlyGame class The only problem I encountered when making the earlyGame class was learning how to handle the events. After extensive research I learnt how to make use of the stream() method and the atMap(). With this I was able to obtain the data about the events happening during the game. 6.3.2.5. MidGame and LateGame implementation The implementation of the MidGame and the LateGame are very similar to the EarlyGame. There were no complications with the MidGame or LateGame since they follow the same structure as the EarlyGame. 6.3.2.6. Conclusion implementation The conclusion is in charge of giving the end of the game information. The rst information we will be displaying is the length of the match. After the length of the game, the winner of the match is announced. Once the winner is announced, it will display the total amount of towers and inhibitors Chapter 7 Conclusions and Future Work 7.1. Conclusions After concluding my work with the project, I can say with condence that all the main objectives have been accomplished. The program automatically generates a summary of the main events and actions happening in a game. This summary follows the fundamentals of natural language, making it easy to understand for the users. The text generated takes less time to read than watching a match online, meaning the program optimizes the usage of time for the user. The program uses an interface that facilitates the user to lter which parts of the text he/she wants to generate. Figure 7.1: Results of game 1 49 50 Chapter 7. Conclusions and Future Work Figure 7.2: Results of game 2 7.2. Results The results of the rst iteration can be seen in the gures 7.1, 7.2, 7.3. The output text was separated into ve dierent sections. In the introduction there's a brief summary of the players, their picks and bans and a small transition to the next part of the text. The early-game, mid-game and lategame follow a similar structure, they give information about three dierent types of events, being player kills, structures destroyed and epic monster kills. These are the events I believe are the most transcendent since they dictate how good or bad a team is doing. For the conclusion of the text, the winner of the match is shown, some general statistics about the end of the game are shown, such as the KDA of each player, the total number of structures destroyed by each team and the gold dierence between both teams. For the second iteration of the application, the results were great, they look very similar to the mockup in the gure 6.4. In the gures 8.1, 8.2, 8.3 and 8.4 the results of the second iteration can be observed. The obtained PDF document ended up being very similar to its mockup too. The result of the document with the cover, the index and the dierent parts of the text are shown in the next gures 8.5 and 8.5. 7.3. Future Work Due to how extensive the Riot API is, the possibilities are limitless. The amount of data produced by the API means you can develop applications 7.3. Future Work 51 Figure 7.3: Results of game 3 like the ones mentioned in the section 2.8. Since my project is focused on the generation of natural language, a good idea of future work could be the implementation of Data Analysis with Machine learning. The application of Machine learning would be using all the data Analyzed from the API and creating automatically generated text by the machine, learnt from running the algorithm over and over multiple times. Another future application could be to do this using cloud computing, this way, the application would be a lot more accessible for any user who wanted to create an automatically generated text of a League of Legends match. Chapter 8 Conclusiones y Trabajo Futuro 8.1. Conclusiones Después de concluir mi trabajo con el proyecto, puedo decir con conanza que se han cumplido todos los objetivos principales. El programa genera automáticamente un resumen de los principales eventos y acciones que ocurren en una partida. Este resumen generado sigue los fundamentos del lenguaje natural, haciéndolo fácil de entender para los usuarios. El texto generado requiere menos tiempo para leer que ver una partida en internet, lo que signica que el programa optimiza el uso del tiempo del usuario. El programa utiliza una interfaz que facilita al usuario poder ltrar qué partes del texto desea generar. 8.2. Resultados Los resultados de la primera iteración se pueden ver en las guras 7.1, 7.2, 7.3. El texto de salida se separó en cinco secciones diferentes. En la introducción hay un breve resumen de los jugadores, sus selecciones y bans y una pequeña transición a la siguiente parte del texto. El early game, el mid game y el late game siguen una estructura similar, dan información sobre tres tipos diferentes de eventos, que son las muertes de jugadores, las estructuras destruidas y las muertes de monstruos épicos. Estos son los eventos que creo son los más trascendentes, ya que dictan lo bien o mal que está haciendo un equipo. Para la conclusión del texto, se muestra el ganador del partido, se muestran algunas estadísticas generales sobre el nal del juego, como el KDA de cada jugador, el número total de estructuras destruidas por cada equipo y la diferencia de oro entre ambos. equipos. 53 54 Chapter 8. Conclusiones y Trabajo Futuro Figure 8.1: Second iteration UI result Para la segunda iteración de la aplicación, los resultados han sido excelentes, se ven muy similares a el boceto en la gura 6.4. En las guras 8.1, 8.2, 8.3 y 8.4 se pueden observar los resultados de la segunda iteración. El documento PDF obtenido también terminó siendo muy similar a su maqueta. El resultado del documento con la portada, el índice y diferentes partes del texto se muestran en las guras 8.5 y 8.6. 8.3. Trabajo Futuro Debido a lo extensa que es la API de Riot, las posibilidades serían ilimitadas. Gracias a la inmensa cantidad de datos producidos por la API hay aplicaciones como las mencionadas en la sección 2.8. Dado que mi proyecto está enfocado a la generación de lenguaje natural, una buena idea de trabajo futuro podría ser la implementación de Análisis de Datos con Machine Learning. La aplicación del aprendizaje automático utilizaría todos los datos analizados de la API y crearía texto generado automáticamente por la maquina, aprendiendo gracias a la ejecucción del algoritmo una y otra vez. Otra aplicación futura podría ser hacer esto usando la computación en la nube, de esta manera, la aplicación sería mucho más accesible para cualquier usuario que quisiera crear un texto generado automáticamente de una partida de League of Legends. 8.3. Trabajo Futuro 55 Figure 8.2: Results of game 1 Figure 8.3: Results of game 2 56 Chapter 8. Conclusiones y Trabajo Futuro Figure 8.4: Results of game 3 (a) LaTeX Cover (b) LaTeX Index Figure 8.5: LaTeX results 1 8.3. Trabajo Futuro 57 (a) LaTeX Player (b) LaTeX Introduction Figure 8.6: LaTeX results 2 64 Appendix B. Glossary Minions: They are units that comprise the main force sent by the nexus. They spawn periodically from their nexus and advance along a lane towards the enemy nexus. Bu: Its a status eect given to a champion or a minion that gives them a benecial boost to their performance. Dragon soul: The dragon soul is a bu a team obtains after slaying 4 dragons. Summoners Rift: Most common map in the League of Legends video game. Its the battleeld where 10 players battle against each other in two teams of 5. Nexus: Its a structure that serves as the primary objective in all game modes in League of Legends. The team that destroys the opposing team's nexus wins the match. Inhibitor: They are structures that prevent super minions from spawning in the respective same lane. Worlds Championship: Its an annual professional League of Legends world championship tournament hosted by Riot Games and is the culmination of each season. Teams compete for the champion title, a 32 kilograms Summoner's Cup, and a multi-million-dollar championship prize. Appendix C Installation guide The execution of the software is made in the Eclipse IDE, Version: 2020- 09 (4.17.0) and Build id: 20200910-1200. To create the project, a Gradle project has to be created for the Orianna library to work. In order for the compilation of the document to be made correctly, the computer must have installed the program PdfLatex or Xelatex. 65 Bibliography Champions, L. League of legends champions. 2021. Games, R. Riot games developer portal. 2021. Jungle, L. League of legends jungle. 2021. Map, L. League of legends map. 2021. Reiter, E. and Dale, R. Building applied natural language generation systems. Nat. Lang. Eng. , Vol. 3, 5787, 1997. Rua, R. and Maldonis, J. J. Orianna. 2020. Wiki, L. League of legends. 2021. 67