cardstories statistics

An analysis of the last five weeks of logs from cardstories showed the area where improvement would be most needed. The first is to improve the recurring users ratio (currently 1/100), the second is to ensure that new players always get an opportunity to play and the third is to reduce the number of games that are not completed after being started.

New players arrived October 12th, 2011.
The logs are found in /var/logs/www. The lines related to game actions are extracted with the following:

cat $(for i in $(seq 594 -1 1) ; do echo cardstories.org_twisted.log.$i ; done) | grep ' /resource?' | grep -v SMTPSender | egrep -v 'action=(state|poll|message)' | sed -e 's/.* 127\.0\.0\.1 - - \(.*\) HTTP\/1\..*/\1/' -e 's/"\(GET\|POST\) \/resource?//' -e 's/\&modified=[0-9][0-9]*//' -e 's/\&_=[0-9][0-9]*//' > game.logs

1464 games were created ( grep -c action=create ) and 958 were completed ( grep -c action=complete ) which is 65%. The games were created by 548 different players ( grep action=create game.logs | sed -e ‘s/.*owner_id=\([^&]*\)&.*/\1/’ | sort -u | wc -l ) but only 216 different players completed games ( grep action=complete game.logs | sed -e ‘s/.*owner_id=\([^&]*\)&.*/\1/’ | sort -u | wc -l ) which is 40%. The number of players at the voting phase is only slightly different ( 218 as calculated by grep action=voting < game.logs | sed -e 's/.*owner_id=\([^&]*\)&.*/\1/' | sort -u | wc -l ) than the number of players completing the game. The distribution of players is calculated with

grep action=create game.logs | sed -e ‘s/.*owner_id=\([^&]*\)&.*/\1/’ | sort | uniq -c | sort -n

which gives a median number of games per player of one game per player. It is significantly different from the mean games per player ( 1464 / 548 = 2.67 ) because ten players created a total of 520 games that is rouhgly 30% of all created games.
The total number of players or lurkers is 919, calculated as follows:

cat $(for i in $(seq 594 -1 1) ; do echo cardstories.org_twisted.log.$i ; done) | grep ' /resource?action=state' | sed -e 's/.*player_id=\([^& ]*\).*/\1/' | grep -v /resource | sort -u | wc -l

This includes users who never played a game but watched the action ( lurkers ).
The total number of players who played at least a game (i.e. picked a card or proceeded to the voting phase), either as an author or as a player is 393, calculated as follows:

cat $(for i in $(seq 594 -1 1) ; do echo cardstories.org_twisted.log.$i ; done) | egrep ' /resource\?action=(pick|voting)' | sed -e 's/.*\(player\|owner\)_id=\([^& ]*\).*/\2/' | sort -u | wc -l

The difference ( 919 – 363 = 556 ) can be explained by the fact that a) players are required to create a game before doing anything else and they give up, b) there are times when no game is going on or there are not enough players to play a game. The conversion rate between users who successfully registered and users who actually played a game is 39% ( 363 / 919 * 100 ).
A significant number of players created a game ( 548 as calculated above ) but never played any ( 548 – 363 = 185 i.e. 33% ) which is consistent with the fact that over the period the first action proposed to a player after registering is to create a game.
No player actually start completing a game as an author. Their first game action is always pick (indicating a player) and not vote (indicating a game author moving to the vote phase). This is verified by extracting all the pick and vote actions for each players

cat $(for i in $(seq 594 -1 1) ; do echo cardstories.org_twisted.log.$i ; done) | egrep ' /resource\?action=(pick|vote)' | sed -e 's/.*action=\(pick\|vote\).*player_id=\([^& ]*\).*/\2 \1/'

The actions for each unique player are concatenated with:

while(<>) {
    if(/(.*) (.*)/) {
        $action{$1} .= "$2 ";
    }
}
while ( my ($key, $value) = each(%action) ) {
    print "$key\t$value\n";
}

and the result shows that no players started by a vote:

grep -c '        vote'

The age.pl perl script displays the evolution of the player base over time, using the games.log file created as explained above. The results display one line per day. It show that the user base grew by 600 new players between october 12th 2011 and november 22nd 2011. The first column (CUMUL) shows this progression. The next column (NEW) shows the number of new users who first played a game this day : they are counted as new users. The next column (RETURNING) shows the number of users who played a game this day and who already played at least one game before this day.
The less selective report was built taking into account all users, including lurkers, instead of just players who actually participated (as an author or as a player) to a game.
The period around october 27th shows more returning users because there was an event organized for cardstories.
The recurring users (including lurkers) are measured by counting the number of days when a given user visited the game (first column DAY) and by making the difference, in days, between the first day they visited the game and the last day they visited the game (second column SPAN). 42 players visited 3 days or more. 10 players visited 10 days or more. 40 players visited 2 days. Most players who visited two days did so in consecutive days ( the next day or the day after ). The same pattern is found for players who returned 3, 4 or 5 days. The span becomes wider for players who played over five days. The majority of players (775) are not recurring players.
The weekly cohorts are calculated by cohorts and defined as segmenting the population by week of registration to the game. For each weekly cohort, give the number of active players for that cohort for each of the weeks that followed. Here active player = player who played the week considered.

41      81
42      92      15
43      130     8       10
44      127     6       5       7
45      112     4       3       3       7
46      201     5       1       3       3       7
47      114     3       1       2       4