Skip to content
ChrisOelmueller edited this page Apr 4, 2013 · 1 revision

This page serves as a basic outline of how the statistics collection in Unknown Horizons is done. Basically the game collects all sorts of stats and submits it to a central server. This server can then analyze and visualize the statistics as we see fit.

In-game Statistics

The game collects all sorts of statistics:

  • Game is started
  • Map is loaded
  • Map is quit
    • How long was the played session
  • How many resources has the player collected
  • Which buildings has the player built and how many
  • Multiplayer games played
    • Number of players
    • length of game
  • Anything else that could be of interest.

Besides simple statistics I would like to be able to make connections between as many stats as possible:

  • It should be possible which map was played how long in average
  • How many players does a typical multiplayer game have on which map
  • after what time does a player reach the next tier on map x
  • How many game starts did a player do on average
  • How many maps are played in one session on average

The game uses a central StatisticsManager to collect statistics and store them locally or send them to a server. Of course these statistics can also be used in-game. Features:

  • Collect statistics over a simple API
  • Store stats to a file in case no online upload is possible or if they should be permanently available
  • Upload stats to the server

Server

Stores the statistics in a database, so they can later be used for analysis or visualization. Server is built on top of [flask] (http://flask.pocoo.org/). Data is submitted to the server in the JSON format.

Visualization

Legend:

  • Game start: run_uh.py started
  • map start: load map inside a running game

First iteration

For the first iteration I would like to be able to display the following:

  • Number of gamestarts per day
    • Graph
    • Table
  • Number of gamestarts on average
  • Game starts per unique player (+on average)
    • Graph
    • Table
  • Which map has been started/loaded
    • How long did the player play on that map before quitting (on average)
  • Number of map starts per game start

Open Questions

  • Can we use the unique client id to map data to it? This would allow the tracking of data over a longer period of time and multiple game starts. Is this too invasive?
  • Can we generate a unique session id for every map played so that we can map stats to a single session over a longer period of time, possibly even multiple loads?
Clone this wiki locally