Few weeks ago I learned python, so I decided to use my new skill to code something interesting and useful. Idea for a cool script got me, while I was looking in Wielki Mistrz downloads log. Of course it’s simple text file, each line represents one download. Format of this file is completely straightforward, let’s look at few lines.
Sun Nov 1 13:57:52 CET 2009 wm_win32_r932_2009-10-31_09-43-46.zip 79.184.113.176 forum_gamedev_pl
Sun Nov 1 13:59:52 CET 2009 wm_linux_r930_2009-10-30_18-54-31.tar.gz 81.219.158.60 blog_scentrica
Sun Nov 1 14:12:01 CET 2009 wm_linux_r930_2009-10-30_18-54-31.tar.gz 89.74.178.187 forum_gamedev_pl
Sun Nov 1 14:41:51 CET 2009 wm_linux_r930_2009-10-30_18-54-31.tar.gz 89.74.178.187 forum_gamedev_pl
Sun Nov 1 14:50:21 CET 2009 wm_linux_r930_2009-10-30_18-54-31.tar.gz 212.122.223.77 forum_roku_scentrica
Starting from the left hand side we got : download time, file name, user ip and finally the place where user found our game. At first, I wrote script, which analised entire log file and write simple summary in text format.
Logfile : grimmar_release.log
Number of downloads : 1057
Number of unique ip's : 615
Source Count
gamedev_projekt 375
forum_gamedev_pl 217
blog_scentrica 152
wikispacja_download 130
unknown 83
gamedev_forum_ukonczone 32
forum_roku_scentrica 29
txgg 20
yari-blog 17
jrgg 1
gamedev_projek 1
This was cool, we could easily compare the popularity of distribution channels. Nevertheless, we also wanted to be able to easily analise if some of our “marketing” work is worth anything. For example, we wanted to know, if posting a information about new release on forum, has any effect. Ideally, there should be a tool, which would automatically get latest log file, analise it and print appropriate chart. I thougth, that it should’t be very hard, and decided to create such tool. Effects can be found in svn repository of Wielki Mistrz :
http://krajek.vipserv.org/mistrz/tools/statystyki_sciagniec/.
One will find four python scripts there. First one generates a text summary. The others are creating graphical charts of downloads by source, downloads by date and downloads by OS. In my opinion, second one is especially worth checking out. I added most important publication dates for Wielki Mistrz, for example the date of final relase ( called ‘Grimmar release’ ).
To create such graphs, I used python and few libraries : matplotlib, numpy and urllib. All in all, coding such simple tools in python is really convenient. Matplotlib has matlab-like api, so it is really easy to learn, yet it is still really powerful tool.
Now for simple calculations, graphs etc. I will sure use python instead of matlab, as it is so much flexible (not to mention it’s completely free).
By the way, thanks to Bartłomiej “tarrilkir” Potrawa, there’s a new character model in Wielki Mistrz.
EDIT: Added third graph which shows percentage of downloads for windows and linux version of the game.