SPEEDstats

SPEEDstats by Erik ``>V< SPEEDenator`` Selberg

A Perl5 based Quake / Quake2 Console Log Parser


SYNOPSIS

speedstats.pl [-obits <obitfile>] [-log <logfile>] [-mode <mode>] [-out outfile] [-quiet | -q] [-maketable <maketable.js url>] [-serverlog] [-nofilter] [-nospec]

Windows people will need to run it from a DOS prompt as:

D:\Quake < perl speedstats.pl ...


INSTALLATION

  1. Get SPEEDstats Grab it here: http://huskysearch.cs.washington.edu/fifth/speedstats/speedstats.zip

  2. Get and Install Perl If you're on UNIX, you should already have this. Otherwise, grab it here: http://www.activestate.com

    Installation of Perl is trivial, so go ahead and install it somewhere.

  3. Unzip SPEEDstats You can put it anywhere; I have it in my Quake directory (D:\Games\Quake\SPEEDstats).

  4. That's it!


DESCRIPTION

speedstats.pl is a Quake / Quake2 console log parser. It supports Team Fortress, common flavors of CTF, CTF2, BotS, and regular ol' Deathmatch. It takes a Quake console log and creates statistics for each match that was played in the log. A match is defined as play on a single map where at least 50 kills were recording (although this threshold is adjustable). The output file contains a myriad of statistics from the match, including who played, what they played as, who they killed, who they were killed by, etc.

For each match, a directory is created. In this directory are three HTML files: index.html, navframe.html, and dataframe.html. The interesting stats are in dataframe; navframe.html is a navigation frame for easy access, and index.html is just the frameset. In addition, a copy of the logfile that was used to generate the stats is placed in the directory. This is so you can re-run speedstats.pl later on and not worry about which match in this huge logfile created the appropriate stats.

NOTE This is not a fraglog parser! A fraglog is something the server cranks out which looks like ``frag_X.log'' and is just a list of who killed whom. A console log looks like ``qconsole.log'' and contains all the messages you see in the console, like ``ZORG ate 2 loads of BUZZ LIGHTYEAR's boomstick'' or some such.


Tutorial

Included in the SPEEDstats distribution is a file called qconsole-sample.log, which is a console log of a Team Fortress match between Fifth Element, >V< and Bitch Killas, ]BK[.

Assume for now you've installed SPEEDstats in your Quake directory, D:\Games\Quake\SPEEDstats.

D:\Games\Quake\SPEEDstats> perl speedstats.pl -log qconsole-sample.log

You should then see the following (although there will be a lot more .....'s ):

Parsed 25 regexps
....
.............................................
.......................................................................
Renaming qconsole-sample.log to qconsole-sample.log.bak
Parsed 1289 lines, 1410 successfully
Writing stats-bk-v-BaMbyMidori-3_3_31_98...

The file qconsole-sample.log is now qconsole-sample.log.bak. Also, there is a new directory: stats-bk-v-BaMbyMidori-3_3_31_98. Just a word on how to decode that: all directories created by SPEEDstats will start with stats-. If SPEEDstats can determine that it was a clan match, it will put the clan identifiers there, in this case, bk and v. It then puts the map name, BaMbyMidori, the sequence number, 3, and the date of the logfile, 3_31_98.

CD into that directory and examine the files there.

D:\Games\Quake\SPEEDstats> cd stats-bk-v-BaMbyMidori-3_3_31_98 D:\Games\Quake\SPEEDstats\stats-bk-v-BaMbyMidori-3_3_31_98> dir

You'll see three files:

BaMbyMidori-3_qconsole-sample.log, index.html, dataframe.html, navframe.html

Open index.html in your browser (Select ``Open File'' from the File Menu).

Voila! Your very own SPEEDstats recording of a log!


Standard Format and Features

speedstats.pl currently creates HTML on the cutting edge of Web technology. Rather than generating gobs and gobs of tables, speedstats.pl creates one table and allows you to click on the table headers to sort the table by column, either ascending or descending. This works the same way as in GameSpy and most other tabular interfaces out there nowadays. In order to do this, speedstats.pl makes use of JavaScript and Layers, which are found in Netscape Navigator 4.0. Unfortunately, Internet Exploder and Netscape 3.0 users won't be able to use this functionality, and will just see a plain old table.


Obtaining A Quake Console Log


QuakeWorld Client, WinQuake

Run qwcl with the -condebug option and it will generate a file called qconsole.log. This is what is used for parsing. This file will be in the game directory; e.g. if you play Team Fortress, look for it in your quake/fortress directory. If you play CTF, look for it in quake/ctf.

Note that qwcl will append to the file, so it can get quite big. Luckily, when you run speedstats.pl, it moves it (so subsequent runs don't keep running over the same stuff) to qconsole.log.bak.


From a demo (.qwd) file

You are able to get logs if you have a demo; just run qwcl with the -condebug option and then run the demo, and your qconsole.log will have the output from the demo! Cool, huh?


QuakeWorld Server

NOTE Because the QW Server output escapes the fancy characters differently, you have to run speedstats.pl with the -serverlog option, otherwise your names will look messed up.

There are a couple different ways to get this, however all of these are UNIX-centric. Windows admins who do this: send me mail on how better to do this and you'll get a credit in the acknowledgments! :)

% nohup qwsv <args>...

This will store the console output in ``nohup.out.'' You can then use this file as a normal logfile.

% qwsv <args> | tee serverlog.log

Again, this just pipes the console output to serverlog.log.

Folks that run multiple hosts from the same directory: You might want to do something like this:

% qwsv <args> | tee serverlog-${HOST}.log

It's what I do. Check to make sure $HOST gives you what you want on your machine.


Quake2

Support for Quake2 is very preliminary.... which is a euphemism for ``expect a lot of bugs.'' However, it is working reasonably well.

In some config file (like base2q/config.cfg or any of your custom ones :), put in the following:

logfile 1

This will create the qconsole.log file. Luckily, you don't have to hunt for it; it's always in base2q. Unluckily, Quake2 doesn't append... every time you launch Quake2, it clears out the logfile and starts a new one. This can be pretty annoying, especially if you get disconnected in mid-match.

Here's a _really_ simply DOS batchfile that kindof works:

type baseq2\qconsole.log E<gt>E<gt> bigqconsole.log
@quake2.exe %1 %2 %3 %4 %5 %6 %7 %8 %9

and a UNIX batchfile:

#!/bin/sh
cat baseq2/qconsole.log E<gt>E<gt> bigconsole.log
quake2 $*

Just put them in a file in your Quake directory, such as q2log.bat or q2log.sh and link them up in GameSpy or whatever.

These should do the trick, but as always, there may be some problems. Please keep me posted on any you find!


Altering The Output

There are two ways to alter the output (and I'm working to make it one!). speedstats.pl uses templates to create its output. These templates are normal HTML except for variable markers, denoted as $something. You can see what variable markers are in each template. Note that variables are NOT transportable across templates; i.e. if you have a marker $playerlist in playerlist_template.html, then don't assume that you can use $playerlist in any other template!

If you want to alter the overall layout of the page, or add things things and such, at present you'll need to hack the perl code. If you know perl, this is not only easy and trivial but a joy! If you don't, you should learn, because perl is just amazing. But you may hit bugs, so work on a backup copy. :)


AUTHOR

Erik Selberg (>V< SPEEDenator)

with inspiration from Richard Maxwell and LibTech[OSKI] & KingPard[OSKI]

Thanks to Jon ``>V< Sacrifice`` Graehl for ideas relating to clan heuristics.

Thanks to Brad ``Lobotomy-Boy'' Rembielak for code (real live code! woot!) that tracked infections and medic healings.


Version

1.3a 6/1/1998

The latest version should always be available at: http://huskysearch.cs.washington.edu/fifth/speedstats/speedstats.zip


FILES

speedstats.pl uses some main files to deal with output. These can be found in the templates sub-directory.

speedstats.pl uses several template files to produce output. Here are the current ones:


BUGS & TODO

- I'm sure I'm missing some standard lines for the standard obits.txt
- Perhaps the fancy name strings could be better?
- Rely more on templates, and get rid of as much HTML in the perl as possible.
- Serverlogs seem not to display ANY flag info, regardless of whether or not you see it in the match.
- Some maps won't display flag info if you're a spectator or if you're the guy touching / capping the flag (32smooth comes to mind).
- Clan mode
Perhaps create team-centric stats instead of just player-centric ones?

- Mod parsing
Some of the obits for Quake2 don't seem quite right, and the separator is used all too often... should probably address that.