Accuracy Plugins for Half-Life Source Servers

From PsychoWiki

Jump to: navigation, search

This guide will show you how to get Psychostats v3 properly working with your Counter Strike: Source server. This was written and tested on a Linux server but should work for Windows based setups as well.


[edit] Setting up server.cfg

Edit your server.cfg file (located in BASE/cstrike/cfg) to include the following:

server.cfg

// Log Settings
sv_log_onefile 0
sv_logfile 1
sv_logbans 1
sv_logecho 1 // Optional echoes log info to the terminal
mp_logdetail 1
log on

Since Source alone doesn't log all the required data for Psychostats (notably weapon shots). You need to install one of the following:

[edit] Mani's Admin Plugin

Mani's Admin Plugin is a great addition to any Counter Strike: Source server. I wont echo all its cool features here, check out the web page. Note: The only version of Mani's Admin Plugin (currently) capable of supporting external logging (required for Psychostats) is version 1.2. (currently beta) Performance Note: If you are concerned with server performance with Mani's Admin Plugin see the footnote

Install instructions for Mani's Admin Plugin:

Once you have Mani's Admin Plugin installed, you need to enable external logging in mani_server.cfg (located in BASE/cstrike/cfg)

mani_server.cfg Line: 1074

// *****************************************************************************
// Module : External logging (V1.2 required)
//
// Desc : This configures extra logging that is required by extern stats
//        programs like hlstatsx and psychostats for body hit group counts
//        and accuracy related to weapon types.
// *****************************************************************************

// Enables disables the logging 0 = off, 1 = on
mani_external_stats_log 1

// Option to allow extra logs within war mode, 0 = off, 1 = on
mani_external_stats_log_allow_war_logs 0

// Option for CSS to log bot kills or not
// 0 = do not log bot kills
// 1 = log bot kills
mani_external_stats_css_include_bots 0

Mani's log style defaults to Valve's logs and Valve's format (writes to the same logs generated by Source in the same format). It should read:

mani_server.cfg Line: 802

// *****************************************************************************
// Module : Plugin Logging
//
// Desc : The following cvars control how the plugin logging is configured
// *****************************************************************************

// Admin logging parameters
// Directory where logs will be stored under the mani_path directory
// The logging mode you wish to use
// 0 = default placing of log files in the same .log files that Valve creates
// 1 = logs created per map change using the same style filenames that Valve
// uses in the mani_log_directory directory
// 2 = One large file is written in the mani_log_directory
// 3 = A log is written as a steam id for each admin that runs a command, the
// format is STEAM_x_x_xxxxxxxx.log
mani_log_mode 0

// Path where the logs are stored
mani_log_directory "mani_logs"

No modifications need to be made to halflife.pm (as per This post) if you are using Mani (or another mod) to create extended logs. halflife.pm (located PsychostatsBASE/lib/PS/Game/) Should read:

halflife.pm Line: 973

[attacked]
  regex = /^"([^"]+)" attacked "([^"]+)" with "([^"]+)"(.*)/
  options = ignore


[edit] Run stats.pl

Play a game or two, run stats.pl, (make sure you've configured the location of your log files correctly on the Admin page on your Psychostats website) and your hitbox, heatshot and accuracy data should appear.


For those interested, CS-Evolution is a mod that incorporates practically every mod known for Counter Strike: Source.


  • Mani Performance Note: I was initially reluctant to install Mani's Plugin since it comes bundled with a lot of functionality that I don't need/want. The install is relatively easy, but I did incur a slight (unnoticeable in game) hit to memory consumption during game play. On my Linux server (minimalistic install, no X), I went from 68Mb memory usage (average) to about 107Mb (average) with Mani's Plugin running (63% increase). This was unnoticeable in the game and actually well worth it. There are a lot of great features in Mani that I find useful (and fun). Therefore, I encourage any one reluctant to install Mani because of performance considerations to install it. (These numbers may or may not be representative of Mani's load on your system or Mani's performance in general. Included for informational purposes only.)
  • Log Note: With the additional triggers being written to the logs, they grow in size much more quickly than with Source's logging alone. 90 minutes of play (3 human players, 8-16 bots) created approximately 1.2Mb worth of logs. Be sure to keep an eye on them and remove old logs when needed.