#!/usr/bin/perl -W $ploticus_chron = 'ploticus png -prefab chron data=- x=1 y=2 xgrid=color=0.3 ygrid=color=0.3 datefmt=yyyymmdd mode=line gapmissing=yes yrange=0 -font Arial -diagfile /dev/null -backcolor black -color brightgreen'; $bar_width = 600; ################################################################################ use Time::Local; %capacity_day = (); %players_day = (); %capacity_hour = (); %players_hour = (); %capacity_10m = (); %players_10m = (); %map = (); %game = (); %map7 = (); %game7 = (); $grand_total = 0; $grand_total7 = 0; $now = time; while ($line = <>) { chomp $line; ($datetime, $game, $mission, $map, $maxplayers, $players) = split /\t/, $line; next if $map eq ''; $datetime =~ m|(....)(..)(..)/(..)(..)| or die 'match failed'; $year = $1; $month = $2; $day = $3; $date = "$year$month$day"; $hour = $4; $min = $5; $time = timegm(0, $min, $hour, $day, $month - 1, $year); # $gmm = "$game: $mission: $map"; $gmm = $map; $gm = "$game: $mission"; $players = 0 if ($players < 0); $maxplayers = 0 if ($maxplayers < 0); $grand_total += $players; # all time stats if (exists $players_day{$date}) { $players_day{$date} += $players; $capacity_day{$date} += $maxplayers; } else { $players_day{$date} = $players; $capacity_day{$date} = $maxplayers; } if ($players != 0) { if (exists $map{$gmm}) { $map{$gmm} += $players; } else { $map{$gmm} = $players; } if (exists $game{$gm}) { $game{$gm} += $players; } else { $game{$gm} = $players; } } # last 100 days next unless ($now - 100 * 24 * 60 * 60 < $time); $grand_total100 += $players; if ($players != 0) { if (exists $map100{$gmm}) { $map100{$gmm} += $players; } else { $map100{$gmm} = $players; } if (exists $game100{$gm}) { $game100{$gm} += $players; } else { $game100{$gm} = $players; } } # last 7 days next unless ($now - 7 * 24 * 60 * 60 < $time); $grand_total7 += $players; if (exists $players_hour{"$date.$hour"}) { $players_hour{"$date.$hour"} += $players; $capacity_hour{"$date.$hour"} += $maxplayers; } else { $players_hour{"$date.$hour"} = $players; $capacity_hour{"$date.$hour"} = $maxplayers; } if ($players != 0) { if (exists $map7{$gmm}) { $map7{$gmm} += $players; } else { $map7{$gmm} = $players; } if (exists $game7{$gm}) { $game7{$gm} += $players; } else { $game7{$gm} = $players; } } # last 24 hours next unless ($now - 24 * 60 * 60 < $time); if (exists $players_10m{"$date.$hour:$min"}) { $players_10m{"$date.$hour:$min"} += $players; $capacity_10m{"$date.$hour:$min"} += $maxplayers; } else { $players_10m{"$date.$hour:$min"} = $players; $capacity_10m{"$date.$hour:$min"} = $maxplayers; } } ################################################################################ undef $/; open HEADER, '< header' or die "Failed to open header: $!"; $header =
; $menu = <Home | Graphs | Game types | Map popularity

END $now = gmtime; open INDEX, '>', 'index'; open GRAPHS, '>', 'graphs'; open GAMES, '>', 'games'; open MAPS, '>', 'maps'; print INDEX $header; print GRAPHS $header; print GAMES $header; print MAPS $header; print INDEX <Tribes 2 Europe Statistics $menu

Updated every hour, last update $now UTC. All times in UTC. Data collected every 10 minutes by QStat, processed by a script, and graphs plotted with ploticus. Created by James Bursa.

END ################################################################################ open PLOTA1, "|$ploticus_chron xinc='60 days' stubfmt='Mmmdd' -o images/players_full.png"; open PLOTA2, "|$ploticus_chron xinc='60 days' stubfmt='Mmmdd' -o images/capacity_full.png"; open PLOTA3, "|$ploticus_chron xinc='60 days' stubfmt='Mmmdd' -o images/usage_full.png"; foreach $date (sort keys %players_day) { $meanplayer = $players_day{$date} / (6.0 * 24.0); $meancapacity = $capacity_day{$date} / (6.0 * 24.0); $usage = $meanplayer / $meancapacity * 100.0; print PLOTA1 "$date\t$meanplayer\n"; print PLOTA2 "$date\t$meancapacity\n"; print PLOTA3 "$date\t$usage\n"; } close PLOTA1; close PLOTA2; close PLOTA3; open PLOTB1, "|$ploticus_chron unittype=datetime xinc='1 day' stubfmt='Www' -o images/players_week.png"; open PLOTB2, "|$ploticus_chron unittype=datetime xinc='1 day' stubfmt='Www' -o images/capacity_week.png"; open PLOTB3, "|$ploticus_chron unittype=datetime xinc='1 day' stubfmt='Www' -o images/usage_week.png"; foreach $date (sort keys %players_hour) { $meanplayer = $players_hour{$date} / 6.0; $meancapacity = $capacity_hour{$date} / 6.0; $usage = $meanplayer / $meancapacity * 100.0; print PLOTB1 "$date:00\t$meanplayer\n"; print PLOTB2 "$date:00\t$meancapacity\n"; print PLOTB3 "$date:00\t$usage\n"; } close PLOTB1; close PLOTB2; close PLOTB3; open PLOTC1, "|$ploticus_chron unittype=datetime xinc='2 hours' stubfmt='hh' -o images/players_day.png"; open PLOTC2, "|$ploticus_chron unittype=datetime xinc='2 hours' stubfmt='hh' -o images/capacity_day.png"; open PLOTC3, "|$ploticus_chron unittype=datetime xinc='2 hours' stubfmt='hh' -o images/usage_day.png"; foreach $date (sort keys %players_10m) { $meanplayer = $players_10m{$date}; $meancapacity = $capacity_10m{$date}; $usage = $meanplayer / $meancapacity * 100.0; print PLOTC1 "$date\t$meanplayer\n"; print PLOTC2 "$date\t$meancapacity\n"; print PLOTC3 "$date\t$usage\n"; } close PLOTC1; close PLOTC2; close PLOTC3; print INDEX <Players online

All available data, averaged over each day. More graphs.
Graph

END print GRAPHS <Tribes 2 Europe Statistics $menu

Graphs plotted with ploticus.

Average players online

All available data, averaged over each day:
Graph

Last 7 days, averaged over each hour:
Graph

Last 24 hours, sampled every 10 minutes:
Graph

Average server places available

Graph

Graph

Graph

Percentage server places used

Graph

Graph

Graph

END ################################################################################ $game_types = keys %game; $key = <First value last 7 days, second value last 100 days. $game_types game types. END print INDEX '

Top 10 game types

', $key, "Full game type table.

"; print GAMES '

Game type popularity

', $menu, $key, "

"; $i = 0; foreach $gm (sort { $game7{$b} <=> $game7{$a} } keys %game7) { $players100 = $game100{$gm}; $players7 = $game7{$gm}; $propn100 = $players100 / $grand_total100; $propn7 = $players7 / $grand_total7; $max = $propn7 if $i == 0; $width100 = int($propn100 / $max * $bar_width); $width7 = int($propn7 / $max * $bar_width); $pct100 = sprintf "%.3g", $propn100 * 100; $pct7 = sprintf "%.3g", $propn7 * 100; $class = $i % 2; $line = <$gm
$pct7%
$pct100%

END print INDEX $line if $i < 10; print GAMES $line; $i++; } ################################################################################ $maps = keys %map; $key = <First value last 7 days, second value last 100 days. $maps maps. Follow the link to search for a map on Tribes2Maps. END print INDEX '

Top 10 maps

', $key, "Full map popularity table.

"; print MAPS '

Map popularity

', $menu, $key, "

"; $i = 0; foreach $gmm (sort { $map7{$b} <=> $map7{$a} } keys %map7) { $players100 = $map100{$gmm}; $players7 = $map7{$gmm}; $propn100 = $players100 / $grand_total100; $propn7 = $players7 / $grand_total7; $max = $propn7 if $i == 0; $width100 = int($propn100 / $max * $bar_width); $width7 = int($propn7 / $max * $bar_width); $pct100 = sprintf "%.3g", $propn100 * 100; $pct7 = sprintf "%.3g", $propn7 * 100; $class = $i % 2; $search = $gmm; $search =~ s/^Euro2_//; $search =~ s/^TL_//; $search =~ s/ \(x2\)$//; $search =~ s/^Cluster_//; $search =~ s/([^\w()'*~!.-])/sprintf '%%%02x', ord $1/eg; $line = <$gmm
$pct7%
$pct100%

END print INDEX $line if $i < 10; print MAPS $line; $i++; } ################################################################################ $footer = <Omroth » Tribes 2 Europe Statistics

END print INDEX $footer; print GRAPHS $footer; print GAMES $footer; print MAPS $footer; close INDEX; close GRAPHS; close GAMES; close MAPS; system 'gzip --best -c index > index.gz'; system 'gzip --best -c graphs > graphs.gz'; system 'gzip --best -c games > games.gz'; system 'gzip --best -c maps > maps.gz'; ################################################################################