A Perl5 based Quake / Quake2 Console Log Parser
Windows people will need to run it from a DOS prompt as:
D:\Quake < perl speedstats.pl ...
Installation of Perl is trivial, so go ahead and install it somewhere.
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.
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!
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.
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.
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!
$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. :)
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.
The latest version should always be available at: http://huskysearch.cs.washington.edu/fifth/speedstats/speedstats.zip
AT_ROCKET_LAUNCHER /^(.*) was gibbed by (.*)\'s rocket/
The AT_ROCKET_LAUNCHER is the type of the expression. AT stands for an attack, and the ROCKET_LAUNCHER is the weapon used. The stuff between the /'s is the regular expression, i.e. if the line somehow matches the expression, then the type of the line is AT_ROCKET_LAUNCHER. Don't worry too much about the formatting of regular expressions; here's what will get you by:
SUPER_SHOTGUN SOLDIER MEDIC HWGUY SPY ENGINEER
I.E. soldiers, medics, hwguys, spies, and engineers can all use the Super Shotgun. This is used for the heuristic guesser to try and figure out what class someone was when they killed somebody. In mods that don't have classes, such as CTF, there's only one class (General).