Video Game Network Analysis a Study on Tooling Design
Total Page:16
File Type:pdf, Size:1020Kb
EXAMENSARBETE INOM TEKNIK, GRUNDNIVÅ, 15 HP STOCKHOLM, SVERIGE 2020 Video Game Network Analysis A Study on Tooling Design MURAT EKSI MARKUS PIHL KTH SKOLAN FÖR ELEKTROTEKNIK OCH DATAVETENSKAP Video Game Network Analysis A Study on Tooling Design MURAT EKSI MARKUS PIHL Bachelor’s Programme in Information and Communication Technology Date: April 23, 2020 Supervisor: Thomas Sjöland Examiner: Johan Montelius School of Electrical Engineering and Computer Science Host company: Crackshell AB Swedish title: Nätverksanalys för Videospel Swedish subtitle: En Studie om Verktygsdesign Video Game Network Analysis / Nätverksanalys för Videospel c 2020 Murat Eksi and Markus Pihl Abstract | i Abstract Crackshell is an indie game studio situated in Stockholm. They released particular iterations of a game called Hammerwatch, which is developed with their in-house game engine and they are still working to extend both the Hammerwatch and the game engine. Hammerwatch is a rogue-like multiplayer game played by up to four players in a single session by using peer- to-peer network topology. These days, Hammerwatch has gotten significantly popular and the planned features have led the team to question of whether their network utilization is performant and in what ways they can improve this utilization. Even though they the are ones who implemented the network part of Hammerwatch, they don’t exactly have an understanding of the underlying behavior of the utilization, nor they have any way to analyze it currently. This project is aimed to design and implement a proper tooling implementa- tion for their data analysis needs by identifying the network topology, data structures, extraction, storage and providing an environment that is easy to analyze the network utilization. In order to achieve this aim, an iterative approach through design thinking has been conducted with Crackshell. In this regard, there were certain decisions to be made in accordance with the constraints and the purpose of the tooling, which is defined with the help of Crackshell by the conducted workshops as a module of the design thinking approach. The above-mentioned strategy allowed a swift understanding of the problem that led the tooling to be approved as both helpful and easy-to-use by Crackshell. The data analysis tool was implemented by using a local data extraction solution, MongoDB and Jupyter Notebook in Python together with extensions that helped further with the analysis of the collected data. The results of the data analysis deemed itself as a significant success, where problems such as the game events being sent unnecessarily frequently, stale data issues, caching opportunities, and potential data clustering issues in network packets were pointed out. Crackshell was happy with the provided ability to look at their network utilization in a detailed manner, which led them to use the implemented tooling for further analysis as Hammerwatch is kept developing. Keywords Video Games, Network Analysis, Data Analysis, Tooling Design, Design Thinking, Network Packets, Data Extraction, Database Design ii | Sammanfattning Sammanfattning Crackshell är en indie-spelstudio belägen i Stockholm. De har släppt ett antal spel som heter Hammerwatch, vilket är utvecklat med sin egen spelmotor. Hammerwatch och dess spelmotor utvecklas fortfarande kontinuerligt. Det är ett rogue-liknande multiplayer-spel som spelas av upp till fyra spelare i en enda session med hjälp av peer-to-peer-nätverkstopologi. Hammerwatch blev snabbt populärt och de planerade funktionerna har lett teamet till en fråga om deras nätverksanvändning är effektiv ur prestandasynpunkt och på vilka sätt de kan förbättra den. Även om det är de som implementerade nätverksdelen av Hammerwatch, har de inte exakt en förståelse för det underliggande beteendet hos nätverkskommunikationen, och de har inte heller något sätt att analysera det för närvarande. Detta projekt syftade till att utforma och implementera verktyg för att dataanalys genom att identifiera nätverkstopologi, datastrukturer, extraktion, lagring och tillhandahålla en miljö som gör det lätt att analysera nätverks- användningen. För att uppnå detta mål valdes en iterativ metod baserad på “design thinking” denna genomfördes tillsammans med Crackshell. Under designfasen fattades beslut kring begränsningar och syfte med verktyget. Ovan nämnda strategi möjliggjorde en snabb förståelse av problemet som ledde till utvecklandet av ett verktyg som både godkänts som användbart och lätt att använda av Crackshell. Dataanalysverktyget implementerades med hjälp av en lokal lösning för utvinning av data, MongoDB och Jupyter Notebook i Python tillsammans med tillägg som hjälpte till vidare med analysen av insamlade data. Resultaten av dataanalysen löste in sig som en betydande framgång, där problem som spelhändelser som skickades onödigt ofta, data som var gammal när den nådde fram, cachemöjligheter och potentiella problem med datakluster i nätverkspaket kunde hittas. Crackshell var nöjd med resultatet och nya förmågan att titta på deras nätverksanvändning på ett detaljerat sätt. De kommer kunna använda det utvecklade verktyget till framtida analyser vid fortsatt vidareutveckling av spelmotorn. Keywords Videospel, Nätverkanalysen, Dataanalysen, Verktygsdesign, Design Thinking, Nätverkspaketer, Data exktration, Databasdesign Acknowledgments | iii Acknowledgments We would like to thank Johan Montelius for his contributions as he helped us throughout the whole thesis work by both providing the needed support, knowledge and also by helping with the direction the thesis work took. In this regard, we believe that we are pretty lucky to have such an experience and we are also very grateful for his help throughout the whole thesis work. We are also really happy and thankful to Thomas Sjöland for his help throughout the thesis report and supervision sessions where we got to learn a lot. We would also like to thank Niklas Myström for all the help and patience throughout the process. Stockholm, April 2020 Murat Eksi and Markus Pihl iv | Acknowledgments CONTENTS | v Contents 1 Introduction1 1.1 Background...........................1 1.2 Problem.............................2 1.3 Purpose.............................3 1.4 Goals..............................4 1.5 Challenges............................4 1.6 Delimitation...........................5 1.7 Methodology..........................5 1.8 Structure.............................6 2 Background7 2.1 Game Engine..........................7 2.2 Case Study...........................8 2.3 Network and Transport Layers.................9 2.4 Network providers........................ 10 2.5 Database Design........................ 11 2.6 Data Analysis.......................... 11 2.7 Software Environment..................... 12 2.8 Virtualisation and Containers.................. 13 3 Methods 15 3.1 Design Thinking........................ 15 3.1.1 Story-telling...................... 16 3.1.2 Continuous Delivery.................. 16 3.2 Preparation for Data Analysis.................. 17 3.2.1 Collection of data.................... 17 3.2.2 Analysis and optimization............... 18 3.3 Designing the tool........................ 19 3.3.1 Implementation..................... 19 vi | CONTENTS 3.3.2 Maintenance...................... 19 3.3.3 Utilization....................... 20 4 Implementation of Tooling 21 4.1 Data Import........................... 21 4.1.1 Current Design..................... 22 4.1.2 Cloud Solution..................... 23 4.1.3 Local Solution..................... 24 4.2 Parsing............................. 25 4.2.1 Workshops of Data................... 25 4.2.2 Network Packet..................... 26 4.2.3 Game Message..................... 27 4.2.4 Solution......................... 28 4.3 Data Storage........................... 28 4.3.1 SQL........................... 28 4.3.2 NoSQL......................... 29 4.3.3 MongoDB....................... 30 4.4 Environment........................... 33 4.4.1 SQL Analysis...................... 33 4.4.2 Apache Kafka...................... 34 4.4.3 R............................ 34 4.4.4 Python......................... 35 4.4.5 Jupyter Notebook.................... 36 4.5 Extensions............................ 37 4.5.1 Pandas......................... 37 4.5.2 Qgrid.......................... 38 4.5.3 Pivottablejs....................... 38 4.6 Distribution and Portability................... 39 4.6.1 Virtualization...................... 39 4.6.2 Containers....................... 40 4.6.3 Docker......................... 40 5 Results 42 5.1 Workflow............................ 42 5.2 Data Insights.......................... 43 6 Conclusion 48 6.1 Limitations........................... 48 6.2 Future work........................... 48 6.3 Ethics and Sustainability.................... 49 Contents | vii 6.4 Reflections........................... 49 6.5 Verdict.............................. 50 References 50 viii | LIST OF FIGURES List of Figures 2.1 Example of a Simplified Game Engine Structure with Respective Modules.............................7 2.2 OSI Model Standard......................9 2.3 Example Network Flow through a Provider.......... 10 2.4 Differences between Virtualisation and Containerisation... 13 4.1 Current Topology of the Network for a Single Game Session. 22 4.2 Respective Topology of the Network for a Possible Cloud Solution............................. 23 4.3 Respective Topology of the Network for a Possible Local Solution............................. 24 4.4 The Structure of a Typical Outgoing Network Packet....