PsychoStats FAQ

From PsychoStats

Jump to: navigation, search

Contents

General Questions

What is PsychoStats?

PsychoStats is a log analyzer that produces statistics for games. Currently the only game supported is the Half-Life and Half-Life 2 game engines. This includes support for a couple of mods Counter-Strike, Day of Defeat and the built in HLDM / HL2DM valve multiplayer games. Team Fortress 2 is also supported. New support for other games, such as Call of Duty is also in active development.

Other mods may work as well, but the unique statistics that may be present in those games will not be recorded or shown in the stats.

Who made PsychoStats?

Stormtrooper has been the original author of PsychoStats since about 2001. He's had lots of help throughout the years with bug fixes, patches, suggestions, donations and support from everyone in the community. He couldn't have done it without you =).

Installation and Configuration

How do I install PsychoStats?

See the PsychoStats Installation in the documentation and follow the directions. If you run into problems or require more help please visit the PsychoStats Forums for more help.

Where do I download PsychoStats?

Goto PsychoStats Downloads and download the proper version for your operating system. The archives for download (zip and tar.gz) are actually identical except the zip file is formatted for Window's.

DBD::Mysql module is not found!

This is most likely due to you using ActivePerl 5.10. For some reason the ActiveState servers do not have an updated module for DBD::MySQL for Perl 5.10 so the ppm doesn't find it by default.

For Perl v5.10 do the following command at a dos prompt:

ppm install http://cpan.uwinnipeg.ca/PPMPackages/10xx/DBD-mysql.ppd

For Perl v5.8 do the following command at a dos prompt:

ppm install http://theoryx5.uwinnipeg.ca/ppms/DBD-mysql.ppd

See the following thread for more information.

Server "Overview" images do not show up

The connection history graph, server country overview, and player skill images are dynamic images and are created on-the-fly by PsychoStats. These images require the PHP extension GD to be installed in order to work properly. See the PHP GD extension documentation for more information on how to enable this extension in your PHP installation.

Starting with PsychoStats v3.1 the overview page no longer uses dynamic images, instead a series of Flash charts are shown and only require that your browser support Flash.

Players not ranking, wildly messed up stats, etc.

There is a good chance you are trying to parse a log source that has logs from more than one year in it. You need to move the logs for each year into their own directory. Then it is just a matter of adding a logsource for each directory. Make sure you keep them in order.

Stats Display

How is skill calculated?

PsychoStats version 3.0 uses the ELO formula to calculate skill values for players. In a nutshell, ELO tries to base how many points you gain or receive for kills and deaths based on your skill compared to your victim or killer. It calculates a probability of chance when someone kills another player.

Starting with PsychoStats version 3.1 a new alternative formula is being used that is much more stable and seems to be more accurate overall. This new formula is the default so nothing needs to be done on your part to start using it once you upgrade to v3.1.

Accuracy and Hitboxes

In order for player accuracy to be collected you need a server plugin for most servers. See the tutorial Accuracy for Half-Life servers

Why do the ranks for players appear out of order?

It's possible for the player ranks to show players with ranks that are not in order, or some players won't have a rank at all even though they appear in the ranking list. Player ranks are not calculated in real-time and require a special processing phase from the stats updates. The "Daily player update" feature of PsychoStats will calculate player ranks. This update should be run at least once a day or every time stats are updated. From the ACP the admin can change when the "daily" updates are performed.

Why are my headshot totals over 100%?

There could be a couple reasons for this. PsychoStats uses the 'weaponstats' triggers that are generated from server plugins to determine how many hits and shots you had while connected to the game. If your server has BOTS and you have ignore_bots enabled in your configuration all the kills for those bots will be ignored, however all the weaponstats triggers that players accumulated killing those bots are still going to count since there's no way to tell if you shot at a bot or another player.

The same thing would happen if you BAN a player in the stats. Their actions in the game would be ignored, but kills against those players will still count in the weaponstats information.

There's no way to fix this in the PsychoStats code since you can't break the weaponstats information apart and determine which player they are for. If you want to BAN players or ignore BOTS you'll have to live with skewed 'accuracy' and 'headshot' stats.

Why are there no clans listed?

Clantags are detected and players are assigned to them automatically while stats update. However, a newly detected clan will be hidden from ranking by default. Clans that meet the minimum requirements to rank will show up after a "Daily clan update" is run. Starting with PsychoStats v3.1 clans are updated more frequently automatically while stats.pl processes log files. So nothing more needs to be configured on your part. However, the Daily clan update can still be run manually to force an update at any time.

The country for my player is wrong

PsychoStats uses the ip-to-country database from Maxmind. It's not 100% accurate but is generally close enough. If you login to your player stats you can change your own flag/country.

The ACP allows you to change the IP lookup URL that is used to perform lookups on IP addresses. By default it points to a database on PsychoStats.com. Users may eventually override this with their own databases in the future.

The Google map displays my location wrong

The Google map implemented in PsychoStats uses a Maxmind database for IP lookups and is not 100% accurate. Starting with PsychoStats v3.1 you can edit your player profile to include map latitude and longitude which will place your player icon anywhere in the world on the google map.

The ACP allows you to change the IP lookup URL that is used to perform lookups on IP addresses. By default it points to a database on PsychoStats.com. Users may eventually override this with their own databases in the future.

Where are the map images?

In order to keep the file size to a minimum PsychoStats does not include images for map thumbnails. You can download a map pack from the downloads section. Once you have the file downloaded you can unzip the file inside your stats website. The maps archive has a directory structure in it that starts with 'maps/halflife/*'. This means you can unzip it directly inside your 'stats/img/' directory on your website. Once the files are in place the map images will start to appear within your stats site.

PsychoStats v3+ requires the img/maps/* directory to be structured in a special way. All maps for a particular gametype and modtype must be in different directories. There are no prefixes used on filenames (ie: cstrike_dust.png is invalid'. Here's what the directory looks like:

  • stats/img/maps/
    • halflife/
      • hldm/
      • cstrike/
        • de_dust2.jpg
      • dod/
      • tf2/
        • ctf_well.jpg
    • cod4
    • soldat

Hierarchy

PsychoStats will search for a map image starting from the highest level available (ie: maps/halflife/cstrike). If no image is found it'll go down a directory (ie: maps/halflife). So it's possible to have uncategorized map images in the lower directory.

Image types

PsychoStats v3+ allows you to configure in the ACP which image types to search for, ie: PNG, JPG, GIF, etc... So the map images can be any of the types you have configured.

The dynamic images do not work

PsychoStats has some images that are created on-the-fly for showing graphs and piecharts for different things, like player skill, connection histories and country-codes. These images break and show up as a broken image on some websites.

This is a common problem with Windows servers because the Windows PHP binary release does not have the GD graphics library enabled by default. To enable GD support you need to edit your php.ini file and add a line that says:

extension=php_gd2.dll

Your php.ini may already have that but it will be commented out (a semi-colon ';' is in front of it), if thats the case just remove the ';'.

Users running WAMP simply have to enable the php_gd2 extension from the pulldown menu that it provides for extensions.

Linux users can enable the extension usually by just installing the proper binary extension using the package manager for their system. For example, for Debian you'd do:

aptitude install php5-gd

or

aptitude install php4-gd

depending on your version of PHP installed. Restart apache after enabling the extension.

EAccelerator

Some servers use an extension called EAccelerator. This extension speeds up dynamic websites that run PHP by compiling the PHP code into bytecode once and then caches it so load times on pages is faster.

Some users experience problems with the JPGRAPH library and EA. While I'm not sure why this happens on some systems I can offer the following work around. Find your eaccelerator.ini file and add the following:

eaccelerator.filter="!*jpgraph*"

This will prevent any of the jpgraph routines from being cached by the accelerator.

PHP 5 and illegal plots

If you get the error "A plot has an illegal scale" you can change one line in your php.ini to work around the problem:

zend.ze1_compatibility_mode = off

Database

Client does not support authentication protocol

This is a problem between the perl modules (DBD::mysql) and the version of the MySQL server running.

Look at the following MYSQL documentation page: http://dev.mysql.com/doc/mysql/en/Old_client.html

MYSQL v4.1 and higher uses a different hashing algorithm for user passwords and the mysql perl module 3.x and lower only support the old hashing algorithm.

Work-around: Reset the password for the user in question using the old_password() function in mysql. If you have access to the mysql command line utility do this:

SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpwd');

A better solution is to upgrade your DBD::mysql modules. You need version 4.0001 or higher of the DBD-mysql module. In windows you can use the PPM to do this very easily. Linux users can use CPAN or their local apt-get (aptitude, yum, rpm, etc) package manager to get the updated module.

Setting up the Database before using the Install

CREATE DATABASE psychostats;
GRANT ALL ON psychostats.* TO 'psuser'@'localhost';
SET PASSWORD FOR 'psuser'@'localhost' = PASSWORD('aPassWord');

PsychoQuery

Call to undefined function bzdecompress

I receive the following error on the live server view when querying my Half-Life game servers.

Fatal error: Call to undefined function bzdecompress()

This is due to newer 'Source' based games supporting compression in the server query protocol. Response packets can be compressed when they are transfered. In order for these packets to be read properly your installation of PHP needs to have bzip2 support enabled. See the php.net website for more information.