Coder Social home page Coder Social logo

warrobots-player-stats's Introduction

warrobots-player-stats

Analysis of player statistics in the mobile app game 'War Robots'. The data is acquired from game screenshots (iOS) and OCR in python. The analysis reveals the most popular and possibly best in-game equipment.

Installation

$ git clone https://github.com/andibarg/warrobots-player-stats.git
$ cd warrobots-player-stats

Required python 3 packages: os, matplotlib, numpy, opencv, pytesseract, pandas, re, tqdm.

Usage

The script '1_run_ocr.py' acquires data via OCR (pytesseract) from in-game screenshots of player statistics. These screenshots are stored in a subfolder under '/data'. As an example, 97 screenshots of Legend League players taken on 2019-01-16 are included. To run '1_run_ocr.py' you first have to specify the subfolder that includes the screenshots. The script crops the screenshots tightly around text labels whose coordinates are given in the file 'other/text_pos.csv' (use 'show_screenshot=True' to see whay is going on). Subsequently, the OCR is run. If 'savetofile=True', all OCR outputs are saved as a csv file in '/data'. You might want to check the csv file while running '1_run_ocr.py' to see if things work properly.

The following figure shows what you might see when you run '1_run_ocr.py'. The white rectangle indicates the label currently read by the OCR. On the right a preview of the csv file generated by the script is shown.

Screenshot

Next, open '2_analyze_ocr.py' and specify the name of the csv file including the OCR outputs. Afterwards, you can run the script. It will first try to clean the dataframe by identifying the 'MK2' labels and by going through the equipment list provided in the file 'other/equip_list.csv'. Note that regular expressions are used, mostly to correct the fact that the OCR often confuses the letters 'o' and 'a'. The cleaned data frame is saved as a csv file in the folder '/plots' together with the plots generated by the analysis.

Examples

The following two figures show overviews of robots and weapons most commonly used by the top 100 players (Legend League). The white and green bars indicate the MK1 and MK2 equipment, respectively.

Screenshot Screenshot

Suggestions for improvements

  • Read out more data from the screenshots such as player ID, rating, and percentage of victories.
  • Account for multiple hangars per player.
  • Collect new data every month to observe how the numbers change over time, specifically after buffs and nerfs.
  • Include data from other plattforms.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.