NOP v4.x Documentation


Contents:

Introduction
Credits

Getting Started
Command Line Arguments
Rankings
Daily / Weekly / Monthly Stats
Links for D / W / M Pages
Accessing databases via CGI and ASP
Uploading HTML files via FTP
Banned List
Alias List

NOP's Score Calculation
Version History




Introduction

This html help file should cover all topics related to the use of NOP with all supported games. If you're having problems installing or using NOP, please
e-mail me. The latest version of NOP will always be available at www.n-o-p.com. There's also a page with FAQs and you can join a mailing list to be informed about new versions and changes.

NOP supports the following games:

Quake 3 Arena (by id software)
HalfLife and HL Team Fortress Classic (by valve software and sierra)
HalfLife CounterStrike (by the Counter Strike Crew)
HalfLife Jailbreak (by Team Reaction) and
Unreal Tournament (by Epic Games & Digital Extremes).

All servers of these games create logfiles at the time people play. These logfiles contain information about frags, items, deaths, parts and joins and a lot of useless stuff as well. NOP simply parses these logfiles, saves the data for future use and generates ranking tables and statistic HTML pages based upon HTML templates. NOP's main features are:

- compatible with all systems using java, jre or jview (java application) 
- runs parallel to servers, without slowing them down (lowest system priority)
- re-runs at a certain amount of time
- fast data access and HTML creating
- comes with ASP and CGI (perl) scripts to let the people search databases
- uploads HTML files to ftp-servers / executes a command of your choice
- unlimited number of players and games
- parses multiple logfiles of different type of games at once
- generates multiple HTML pages for different type of games at once
- output 100% customizable through templates & style sheets
- uses a config file (no cryptic command line parameters)
- alias list, banned list, player expiration

NOP generates 2 kind of HTML files. Ranking tables and daily/weekly/monthly statistic pages. Each HTML file is created using a template file. NOP comes with a normal ranking table template (t_rank.html), an unreal tournament ranking table template (t_utrank.html), a CTF ranking table template (t_rankctf.html) and a few top10 ranking templates. The D/W/M stats use seperate template files (t_day.html, t_week.html, t_month.html). There's another version of the D/W/M stats template files, which looks a bit better (t_day2.html etc.). Of course, you can build your own template files the way you like them, so NOP's tables will fit perfectly to your webserver.

Please note that if you're viewing template files with Microsoft's Internet Explorer, it might pop up with a message box saying that some Scripting Syntax Error occured. This is okay! Just ignore the message and go on.

Be warned!
Statistics produce traffic. Not just the page loadings by players, but people will play for hours to get a good ranking, trust me. :-)

If you have a webpage with NOP rankings / statistics, I'll be happy to add a link at NOP's WebSite.



Credits

NOP is my first full blown application in Java and although Java is very similiar to C++, there are a lot of differences. The source-code contains around 7000 lines of code, including comments. Without the help of books, online-forums and source-examples I could not have done it.

Thanks go especially to Rod Stephens for a deeper look into sorting algorithms.

Thanks and greetings go out to: Brian Anhalt, BongStalk (Kannibas), Todd Clineschmidt, Sascha Juch (Metzelarena), Ric Moseley (5AssedMonkey), Karl Stroh, Dan Santoni, Michael Shavit (Swissquake), Fraser Stewart, Greg Woods, John Cain, Reto Sigl, Klaus Blaschek, Sam Tingey, Edwin Neill, Charles McRobert, Tim O'Donohoe, Tim Schuh, Mike Teeples, Thomas Zajic, Robert, Ryan, Derrick Miller



Getting started

Note: NOP does not have and does not need an installation program. It is a command-line application.

All you need is a Java Runtime Environment, such as the JRE, JView or Java itself. NOP was developed using Java 1.1.7 - so you don't need the latest stuff. Almost any Java or JRE version should do it.

Linux users see
this page for a list of mirrors to download the JRE from. Look for the RT package. Please note that some glibc versions need version 1.1.7 of the JRE/RT.

Windows users don't need to download anything, unless they use some old crappy version of Win95. All later windows versions contain Microsoft's JView, which is a bit slow but working. See this page for a list of mirrors to download the JRE from, which is from SUN and faster than JView.

Mac users see this page for a list of mirrors to download the JRE from. Look for the MRE package. I couldn't test NOP on Mac systems, see for yourself and let me know what happens.

Install the appropriate package on your system and be sure to set all environment variables, if it isn't done by the installation process itself. Install NOP to a seperate directory by unzip'ing/untar'ing the archive with subdirectories. Create a directory somewhere for your output html files.

Next step is: get your game server going and creating logfiles if you haven't done so. Locate where the server saves the logfile(s).

Quake 3 Arena: The logfiles contain almost all information needed by NOP. You can change where the logfile is saved. The windows default is a file called "games.log". It will be created in your baseq3 directory. Using Linux, this file will be created in the following path: "/root/.q3a/baseq3/games.log".
- "logfile 3" 				- enables logging of games
- "g_log (filename)" 			- sets the target file - DO NOT LET 2 SERVERS LOG TO ONE FILE
- "g_logsync 0" 			- forces Q3A to write in chunks of data, instead of writing permanently
Important: If you want to use NOP's new daily / weekly / monthly statistics, you need to pass the date and time of starting the server to Q3A, since this is not being logged by the game. Here's how you do it.

Windows systems need to use this batchfile (q3server.bat) to start the server:
	@ECHO OFF
	IF NOT '%2'=='' GOTO SecondTime
	ECHO @PROMPT %0 $d $t > T$E$M$P1.BAT
	COMMAND /e:4096 /C T$E$M$P1.BAT > T$E$M$P2.BAT
	T$E$M$P2.BAT
	:==== SecondTime ====
	DEL T$E$M$P?.BAT
	
	QUAKE3.EXE +set dedicated 2 +sets gamestartup "%2 %3" +exec server.cfg
You may change the last line that starts the game, but do NOT remove the gamestartup variable. On some systems the space for environment variables is full, so the above batch file breaks (to see why it breaks, remove the first line of the batch). Here's how to raise the space using NT4 (taken from Microsoft's Knowledge base):

	To specify additional space for environment variables: 
      	  1.In Control Panel, click the System icon. 
      	  2.In the Environment list, select ComSpec. 
      	  3.To increase the amount of environment space, use the following syntax: 

        	ComSpec = (drive:\windir)\system32\cmd.exe /e:4096 

        where (drive:\windir) is the drive and directory where the Windows NT systems files are located. 

	The maximum size for the environment is 32768 bytes. 

Linux systems (bash) need to use this to start Q3A:
	quake3.exe +set dedicated 2 +sets gamestartup \"`date +"%D %T"`\" +exec server.cfg
You can check if the gamestartup thingy is working by taking a look at the logfiles. The first line of an unparsed logfile should be something like "InitGame" - check if the "gamestartup" string is in that line! If you have the server running, you can type "gamestartup" in the console. This should show you the exact start date AND time of the server.

HalfLife: All logfiles are saved to a directory "logs" in your HalfLife or MOD directory. Unfortunately, there's no way to differ between normal, CStrike, TFC or Jailbreak logfiles. You've got to tell NOP by using keywords. See NOP's config file for details.

Unreal Tournament: All logfiles are saved to a directory "logs" in your game directory.

Open a text editor and edit NOP's config file, which contains comments on how to set things up. See the file for details.

Note:
If you're going to use the D/W/M stats: after running NOP the first time to do the rankings and D/W/M pages, run NOP right after that again with "-dwm" to rebuild the D/W/M stats. This will make sure all links are working correctly.



Command Line Arguments

NOP itself accepts only 4 options, all other settings are done via its configuration file.
	-quite 			- disables all output of NOP to the shell or DOS-window
				  be careful, not even error-messages will be displayed.
			  	  Java Exceptions however, will show up.
			  
	-debug			- enabled debug-mode, which causes NOP to produce a lot
			  	  of output. This is in case of crashes or strange bahaviours.
	
	-del (playername)	- deletes a single player from the database. The search is a
					  case sensitive exact match. To update the rankings after
					  deleting a player, run NOP without any arguments.
					  If you want to keep a player in the database, but don't want
					  him to show up in rankings, use the banned list .
	
	-dwm			- forces NOP to rebuild all D/W/M stats from the directory set by
					the configuration file
					
	-dwm (path and name of .dat files)	- this forces NOP to re-build the D/W/M stats
								  pages (e.g. -dwm dwm/q3*.dat)




Rankings

NOP creates ranking tables based upon HTML template files. The archive comes with a few examples, such as "t_rank.html". You may change it as you like.

But first, let NOP know which template file to use for which game (add this to the config file):
	[utrank]
	active = "1"
	game_type = "UT"
	min_time = "30"
	min_games = "5"
	min_frags = "50"
This tells NOP that it should output a file utrankx.html (x being the number of the page, starting with 0) and that there's a template file called t_utrank.html. Furthermore, it says that the ranking is for Unreal Tournament players that have played a minimum time of 30 minutes, 5 games and have a minimum of 50 frags. The minimum values are very important if you're sorting your rankings by SCORE. Because a lack of data causes unrealistic score calculation, it gets better over a decent amount of time. If you're running your server for weeks and weeks, raise these values even more, it really gives better rankings.

You can use several keywords in a template file, that will be replaced when NOP parses the file. Here's a list of keywords you can use:
	%GAMES%			- number of normal games (deathmatch/ffa)
	%ALL_PLAYERS%		- number of players in database of the specific game
	%ALL_GAMES%		- number of all games ever played
	%TEAM_GAMES%		- number of team games (does include ctf as of Q3 v1.09 and above)
	%CTF_GAMES%		- number of ctf games
	%DUELS%			- number of tournaments (Q3)
	%DOM_GAMES%		- number of domination games (UT)
	%INS_GAMES%		- number of InstaGib games (UT)
	%TIMELIMITS_HIT%	- number of timelimits hit
	%FRAGLIMITS_HIT%	- number of fraglimits hit
To place a table in a ranking HTML template, create a table with standard HTML tags, but do not close the table tag yet. Use the keyword %PLAYERS% below your table header, then close the table. Here's an example:

<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 WIDTH=80%>
<TR align="center">
	<TH id="tablehead" width=10%>Pos</TH>
	<TH id="tablehead" width=30% align="left">Name</TH>
	<TH id="tablehead" width=10%>Score</TH>
	<TH id="tablehead" width=10%>Frags</TH>
	<TH id="tablehead" width=10%>Deaths</TH>
	<TH id="tablehead" width=10%>Time</TH>
</TR>

%PLAYERS CGI="1" MAX="100" LPP="20" SORT="SCORE" TABLE="POS, NAME, SCORE, FRAGS, DEATHS, TIME"%
</TABLE>
The %PLAYERS% keyword will be replaced by a list of players including column and row tags, so don't forget to put a table tag around it. The %PLAYERS% keyword needs a few parameters, MAX, LPP and TABLE are required, all others are optional. Here's a list of all:

	ASP="1"		- inserts a link to the file "nopsearch.asp" for every player
	CGI="1"		- inserts a link to the file "nopsearch.pl" for every player
	MAX="xxx"	- sets the maximum number of players
	LPP="xxx"	- sets "lines per page" - so setting MAX="200" and LPP="50" will produce 4 pages with 50 players each. 
	SORT="xxx"	- sets the type of sorting, append a "-" to sort descending, possible values are: SCORE, RANK, SKILL, 
			  	EFFICIENCY, FRAGS, DEATHS, SUICIDES, TIME, GAMES, GAME/WON, FPH, FPG
	TABLE="xxx"	- this sets the columns you want, regardless of what you've set in your table header, possible values are:
				POS, NAME, SCORE, FRAGS, DEATHS, SUICIDES, RANK, SKILL, EFFICIENCY, FPH, FPG,
				GAMES, GAME/WON, DUELS, DUEL/WON, TEAMPLAYS, TEAMFRAG, TIME, PING, WEAPONS, 
				LOC, LASTSEEN, CTFGETS, CTFRETURNS, CTFCAPTURES
Note: The default alignment for columns is centered. If you want to change that, you can overwrite this setting by adding an align=xxx to the column name in the %PLAYERS% line (DO NOT add quotation marks):
%PLAYERS CGI="1" MAX="100" LPP="20" SORT="SCORE" TABLE="POS, NAME align=left, SCORE align=right, FRAGS, DEATHS, TIME"%

The last part is the placement of possible links, that link to next or previous pages (remember, setting LPP to 50 and MAX to 200 generates 4 pages with 50 lines each). Here's an example that fits to the table above:


	<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2>
	<TR>
		<TD width=50% align="left">
			<A %PREV_HTML_FILE%><<< prev | </A>
		</TD>
		<TD width=50% align="right">
			<A %NEXT_HTML_FILE%> | next >>></A>
		</TD>
	</TR>
	</TABLE>
NOP will replace %PREV_HTML_FILE% and %NEXT_HTML_FILE% with a href="xxxx.html" AND the appropriate style, so the link will not only have no link if there's no file, it will also be invisible. The style used to display the link is id=tablefeet. The style used to let the link disappear is id=back. See the style sheet files if you want to change the colors.

This stuff might look a bit weird and hard to use, but it is really easy to do. Just grab a standard template and adjust it to your needs. Sure, you got to know some HTML, but it's completely customizable. :-)

Everytime you run NOP, the ranking HTML files will be updated and uploaded (if enabled). Even if no logfiles were read. Since most games don't last that long, I'd recommend setting NOP to re-run every hour or every 2 hours. This keeps the number and size of logfiles small (fast parsing) and provides up-to-date rankings to the people.

Additonally, NOP reads the file t_help.html and outputs a help file for every ranking page. It checks for the columns you've set in the ranking HTML template files and selects the appropriate help texts. These help files are linked by the ranking tables by default. See the templates for details.

Possible columns for ranking tables are:

	POS		- player's position in list, depends on type of sorting
	NAME		- player's name, without color codes
	SCORE		- score value, see chapter NOP's Score Calculation for details
	FRAGS		- all frags ever made
	DEATHS		- all deaths
	SUICIDES	- all suicides
	RANK		- Rank = Frags - (Deaths + Suicides)
	SKILL		- everyone starts at 1000, see chapter NOP's Score Calculation for details
	EFFICIENCY	- frags/deaths efficiency = (Frags * 100) / (Frags + Deaths)
	FPH		- frags per hour
	FPG		- frags per game
	GAMES		- all games ever played
	GAME/WON	- all games played / all games won
	DUELS		- number of played duels (tourneys, 1on1)
	DUEL/WON	- played duels / won duels
	TEAMPLAYS	- number of played team games, including ctf
	TEAMFRAG	- number of teamfrags (team mate frags)
	TIME		- total playing time
	PING		- average ping
	WEAPONS		- a list of squares representing the weapons, the more left a square is, 
			  	the more people where killed by that weapon, move the mouse over the 
			  	squares to get a description
	LOC		- last player's location, most likely the last server name, see config file
	LASTSEEN	- date of last game (month/day/year)
	CTFCAPTURES	- number of enemy flag captures (scoring)
	CTFRETURNS	- number of own flag returns
	CTFGETS		- number of enemy flag pickups
	CTFPLAYS	- number of CTF games played
	CTFPOINTS	- Points = (CTFCaptures*10 + CTFReturns*8 + CTFGets*5) / CTFPlays
The tables are sortable by one of these columns:
	SCORE, RANK, SKILL, EFFICIENCY, FRAGS, DEATHS, SUICIDES, TIME, GAMES, 
	GAMEWON, FPH, FPG, CTFCAPTURES, CTFRETURNS; CTFGETS, CTFPLAYS, CTFPOINTS
Add a - to the type of sorting to sort the list descending (e.g. SORT="TIME-").



Daily / Weekly / Monthly stats

First, enable one or all of these statistics using the config file. Set day_stats, week_stats and month_stats to "1", if you want them all. Be sure to use the special server-start parameters for Q3A, see
"Getting Started" for details. Next, create a template HTML file for each of these statistic pages or use a standard file and add the appropriate part to the config file. For example, these lines add a weekly stats page for Unreal Tournament:

	[utweek]
	active = "1"
	weekly = "1"
	game_type = "UT"
This means that a template HTML file called t_utweek.html must exist in your NOP directory. NOP's archive comes with 3 standard templates for D/W/M statistics, just copy, rename and edit them for your server.

Here's a list of keywords you can use in D/W/M (daily, weekly, monthly) stats pages:

	%DATE%			- complete date in month/day/year style
	%DAY_NUM%		- day of month (1-31)
	%DAY_NAME%		- day name of week (monday, tuesday...)
	%MONTH_NUM%		- month number (1-12)
	%MONTH_NAME%		- month name (january, february...)
	%WEEK_NUM%		- week number of year (1-52)
	
	%DWM_GAMES%		- daily/weekly/monthly overall number of games
	%DWM_FRAGS%		- d/w/m number of frags
	%DWM_ITEMS%		- d/w/m number of items picked up (Q3 & UT only)
	%DWM_SUICIDES%		- d/w/m number of suicides
	%DWM_PLAYERS%		- d/w/m number of players
	%DWM_TIME%		- d/w/m playing time
	
	%PHx%			- connects (players) per hour x in a daily statistic, x is a value from 1 to 24
	%PDWx%			- connects (players) per day x in a weekly statistic, x is a value from 1 to 7
	%PDMx%			- connects (players) per day x in a monthly statistic, x is a value from 1 to 31
	
	%GHx%			- games per hour x in a daily statistic, x is a value from 1 to 24
	%GDWx%			- games per day x in a weekly statistic, x is a value from 1 to 7
	%GDMx%			- games per day x in a monthly statistic, x is a value from 1 to 31
	
	%FHx%			- frags per hour x in a daily statistic, x is a value from 1 to 24
	%FDWx%			- frags per day x in a weekly statistic, x is a value from 1 to 7
	%FDMx%			- frags per day x in a monthly statistic, x is a value from 1 to 31
Additionally, you can add as much player & maps lists as you like. It works the same way as the player lists work for ranking tables, except that only one page will be created (the LPP parameter has no impact on D/W/M stats pages). Here's an example for a MAP list, sorted by FPG (Frags per Game):


	<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 WIDTH=60%>
		<TR align="center">
			<TH id="tablehead" width=30% align="left">Name</TH>
			<TH id="tablehead" width=10%>Frags</TH>
			<TH id="tablehead" width=10%>Games</TH>
			<TH id="tablehead" width=10%>FPG</TH>
		</TR>
		
		%MAPS MAX="1000" SORT="FPG" TABLE="NAME, FRAGS, GAMES, FPG"%
	
	</TABLE>
Notes:
	- If you enable CGI or ASP for D/W/M player lists, the main database will be searched for the playername and
	  his full statistic will be displayed, not just the values from that day / week / month. Also, if you're
	  using the SCORE column in D/W/M stats, it is the overall score of that player, not just from that day / week / month.
	
	- You can not use a MAP list in ranking tables, just in D/W/M stats pages.
	
	- If you use the style sheet IDs provided by NOP's standard CSS files, you can change the color theme of
	  your ranking and stats pages very easily: just use another CSS file (see the header of the HTML templates).
	  
	- The daily / weekly / monthly data files will be saved in a directory called dwm whereever NOP is located.
	  Keep the files for later use and backup or delete them if you like to.
	  
	- If you've lost your D/W/M stats pages and want to rebuild them, without parsing all the logfiles again, run NOP
	  like this: nop -dwm dwm/*.dat or nop -dwm dwm/q3_day*.dat if you just want to rebuild Q3A daily
	  stats pages.
Additonally, NOP reads the file t_help.html and outputs a help file for every D/W/M page. It checks for the columns you've set in the D/W/M HTML template files and selects the appropriate help texts.

Possible columns for d/w/m player tables are the same as Ranking tables

Possible columns for d/w/m map tables are:
	NAME		- map's name
	FRAGS		- all frags ever made on that map
	FPH		- frags per hour
	FPG		- frags per game
	SUICIDES	- all suicides ever made on that map
	GAMES		- number of games played on that map
	CONNECTS	- number of connects for that map, only counts players that finish the games (!)
	TIME		- total playing time
	WEAPONS		- weapon usage (kills) of that map

The tables are sortable by one of these columns:
	FRAGS, FPH, FPG, SUICIDES, GAMES, CONNECTS, TIME
Add a - to the type of sorting to sort the list descending (e.g. SORT="SUICIDES-").



Links for D / W / M Pages

NOP is able to create a page containing links to daily / weekly / monthly stats pages whenever one or more of these pages have been changed. Such a page could display a list of links to the last 10 daily stats pages and/or links to the last 3 months - regardless of today's date. See the standard template t_dwmstart.html for details.

This template is for LINKS ONLY, don't attempt to put Ranking keywords or DWM-Keywords in it. They will be zero. I might change that in a future version.

(However, the D/W/M stats pages itself may contain links to other pages using %LINK% keywords as described here.)

First, let NOP know there's a template file called t_dwmstart.html and what kind of game it belongs to (add this to the configuration file):

	[dwmstart]
	active = "1"
	dwm = "1"
	game_type = "Q3"

Now, create a new HTML file with that name or grab the old one and add NOP's DATE-keywords. Here's how the link-stuff works:

	<A %LINK DAY="0"% > %NAME DAY="0"% </A>
When NOP parses this line, it will be replaced with a link to todays D/W/M HTML file. If a D/W/M file with that date exists, the link will be enabled and the style-id link will be used. If there's no file, the style deadlink will be used and the link will be empty. %LINK... means the actual link, %NAME... represents the text of the link. You might as well kick the %NAME part and just say TODAY.

If you want a link to the stats page of the current week, use WEEK instead of DAY. If you want a link to yesterdays stats page, just change "0" to "-1". Got it? Okay then, let's try something else:

This creates a link to the stats page of wednesday this week ...
	<A %LINK WEEK="0" DAY="3"%> %NAME WEEK="0" DAY="3"% </A>
... and the following a link to the stats page of tuesday 2 weeks ago. Simple, isn't it?
	<A %LINK WEEK="-2" DAY="2"%> %NAME WEEK="-2" DAY="2"% </A>

But there's more. Let's say you want the stats page of week number 30 this year ...
	<A %LINK WEEK="30"%> Week 30 </A>
... or a link to the stats of the 1st of August ...
	<A %LINK MONTH="8" DAY="1"%> August, 1st 1999 </A>
... or a link to the following month of the current file ...
	<A %LINK MONTH="+1"%> %NAME MONTH="+1"% </A>
Play around with it a little, you'll get used to it. The rules are simple: use a "+" or "-" to go back and forth, use fixed numbers to get a specific day/week/month and use 0 to get the current day/week/month.

Note:
If you're going to use the D/W/M stats: after running NOP the first time to do the rankings and D/W/M pages, run NOP right after that again with "-dwm" to rebuild the D/W/M stats. This will make sure all links are working correctly.



Acessing databases via CGI and ASP

Neat features of NOP rankings are that playernames in rankings can work as links to detailed statistics about that player and that people can search the database for a specific playername. You know, it's kinda hard to find someone special having 3000 people in the list.

Both nopsearch.cgi and nopsearch.asp handle both functions - clicking at a name and searching the database. To enable CGI, add a CGI="1" to the %PLAYERS% line in your template files. To enable ASP, add a ASP="1".

Most linux systems will use the perl CGI script, windows systems might use the ASP script. The ASP is easier to install, just place it in your html directory, where the ranking html files and a file called nopdata.txt are located.

The perl script needs some tweaking, since it is most likely placed into a cgi-bin directory somewhere on your system. Put it there, edit NOP's config file to adjust the path to it (html_cgi_path). Make a test-run. The script will attempt to find the datafile nopdata.txt by itself, but sometimes it just can not do it. In such cases, open the perl script in a text editor and find this line somewhere on top of the file:
	# $Filename="../nopdata.txt";
Remove the # and adjust the path to nopdata.txt (which should always be in your html directory where the ranking html files are located!). This should do it. If you're experiencing difficulties in setting this up, please dump the tree of your webserver to a textfile and send the config file and the treefile over.

If someone has ideas on improving the perl script in that matter, please let me know. I'm not a perl guru, you know.



Uploading HTML files via FTP

Whenever NOP generates / updates the HTML files, it can upload them automatically to any FTP server. You'll have to provide IP, Port, Login, Password and a remote system path via the config file. The password will be decrypted the first time NOP reads its config file. If you want to change the password, just enter it again and it will be decrypted the next time NOP runs. The remote system path is the path to put the HTML files in. NOP needs delete and store permissions in that directory. You should move the style sheet files and weapon gif files to this directory, because they are not being uploaded by NOP.



Banned List

Simple but useful. Create a file called banned.txt in your NOP directory and add as much player names as you like (each in a seperate line). NOP will keep those players in the database & update their stats, but they won't show up in rankings / statistics.

These playernames are case insensitive substring searches. So be careful - player will ban people like player, PlAyEr, newplayer, unnamedplayer etc.



Alias List

Very useful as well. Create a file called alias.txt in your NOP path. Add one name per line:
"jesus" = "jesus christ", "JeSuS", "JesusLover", "Prayer", "Antichrist"
All five names will be saved as jesus. All frags, deaths, suicides etc. count together!

This is also useful if a player has renamed, but wants to keep his data. You'd add a line to the alias file, run NOP once (doesn't matter if a logfile is parsed or not) and remove the line from the alias file after that. That's it.



NOP's Score Calculation

The calculation of a "Score" for each player is the most important part and I'm pretty sure that NOP's system is very solid here. I'll try to explain why NOP uses a "Score" instead of simply using "Rank", "Efficiency" or "Skill" like other ranking systems. Please note that I've used the common calculations for the above values, used by most stats-tools, taken from "Fragstats" by Chris Scarvell.

First, let me show you the (cumulative) values of a player that can be used to rank him:

	Frags - obviously the player's kills
	Deaths - how often a player has been killed by others
	Suicides - how often a player killed himself
Most ranking systems sort the players by a so called "Rank" value which is a cumulative of:
	Frags - (Deaths + Suicides)
This means, the more often someone plays the better his score - at least as long as he doesn't die too often. It is also very hard for other players to reach the "Rank" of another - if player A has a "Rank" of 1000, another player has to do at least 1000 frags to get a better "Rank" - he might be much better than player A, but he isn't listed that high, just because he did not play as much as player A. The "Rank" of a player says something but not enough about the real skill of a player.

Another way to sort players is by "Efficiency". This value is also quite simple to calculate and it's a non cumulatve value:
	(Frags * 100) / (Frags + Deaths)
This is indeed a very nice value showing how efficient someone plays. But a ranking table by efficiency misses how he killed, who he killed (good/weak) and how long it took to have a specific amount of frags.

The last often used way to rank players is by a "Skill" value which is also calculated cumulative:
	
	killer->skill += (killed->skill/200)
	killed->skill -= (killed->skill/200)
	if (killed->skill < 1000) killed->skill = 1000
This means, the skill of the killer is raised by a 200th of the skill of the killed one. The killed one looses a 200th part of his own skill. Everyone starts at a skill 1000 and cannot drop below that. Since it is a cumulative calculation it is as useless as the "Rank" value. The more often someone plays, the higher his chances to get a high "Skill". Good players starting at 1000 have a long way to reach a player with a "Skill" of 8000 (8000 is a real value, seen in quite a few ranking tables).

Why do have players to play a long time to be in a ranking table?

Instead of using single cumulative values, NOP uses 3 values which represent the "Score" value. The first part is the "Efficiency", since we've seen that it is a quite good value and it ranges from 0 to 100.

The second one is a bit trickier. Everytime a player finishes a game, NOP grabs his number of frags of that game and divides it by the number of players minus one of that game (for Teamplay, NOP counts the number of opponents only). I call it FPE - Frags per Enemy. NOP then calculates these values "per hour" (by dividing by play time, multiplying with 60). This value gives information about how a player owned his frags - by playing against a wild bunch of others (mostly easy frags) or against fewer players and in which amount of time. So, getting 10 frags against 10 enemies gives less points than getting 10 frags against 3 players.

FPE is updated everytime a game ends: FPE += FPE, it is then divided by the number of games: FPE /= Games. Now, this gives an average "Frags Per Enemy" of the player "Per Hour". Values range roughly from 0 to 200, therefor NOP divides it by 2, to get a value that fits to the efficiency (0-100). If someone really beats the 150 FPE in a game (lucky guy) - NOP sets it back to 150.

What do we need as the third part of the Score? Right, we need to know who was killed - did our player play against good or weak enemies? The above mentioned value "Skill" adds a 200th of the skill of the killed player to the killer's skill-value. But it's cumulative, so we simply divide the Skill minus 1000 by the number of frags of the player. That gives us information about how strong (average) the enemies were. Since it's a quite small value and it should be at the same level as the efficiency (0-100), we multiply the average skill with 10.

With Efficiency, FPE and average Skill of the enemies the Score includes information about how good someone played, how he owned his frags and how strong the enemies were. The only weak part of this calculation is that even people with just 1 game and 2 frags can get a quite high score - if they would stop playing, they would be in the table forever. NOP fixes that by only rating people that played a minimum of 5 games, an overall minimum time of 30 minutes and a minimum Frag count of 50 (you can change these values, see nop3.cfg for details). You can't give a player a ranking after playing only one game anyway, so this isn't a big drawback.

One last word about pings: I don't think the ping should be part of a calculated "Score". Simlpy because good players can play well even with a bad ping, but bad players won't play much better just because they get a better ping. If someone really wants to be as good as someone else, he just HAS to get a decent connection. EOD.



Version History

	NOP 2.0 -> 2.01, 25 august 1999

	- fixed help.html, which is now saved to the right path
	- fixed nop2.dat, nop now overwrites old player databases
	- fixed old message output (ftp)
	
	
	NOP 2.01 -> 2.1, 28 august 1999
	
	- fixed weird bug that caused a loss of games / players
	- fixed displaying of wrong month
	- fixed max_layers = "0" (list all)
	- fixed zero names, players without a name or with a named
	  filled with spaces are now being properly removed
	- fixed cgi path for player names
	- generated html files are smaller now
	- enhanced cgi so that it now finds the path by itself

	- added NOPTrans v1.0, a tool to automate transferring of
	  games.log files from q3a servers to a ranking table
	  master


	NOP 2.1 -> 3.0, 29 september 1999

	- added multiple output file support, one pass generates up to 20
	  different ranking tables, each can have a different design
	- output 100% customizable through style sheets
	- added 5 example styles (red, blue, yellow, negative and litho)
	- improved cgi-output / player statistics
	- added up and down sorting and TIME, GAMES, GAMEWON, FPH & FPG as
	  sortable items
	- added location (LOC) and last seen (LAST) as possible table columns
	- you can now remove players that haven't played for a certain amount
	  of time
	- fixed teamfrags screwing up the player statistics
	- fixed overall games counter 
	- tweaked score-calculation a bit
	- fixed a bunch of other minor stuff I can't remember
	- added full unreal tournament demo support


	NOP 3.0 -> 3.2, 10 october 1999

	- fixed a bug that caused NOP to crash while parsing UTDemo logfiles
	  (the server is pinging a player 0, even if no one is playing)
	- fixed updating of UTDemo logfile list
	- added HalfLife, HL CounterStrike, HL Team Fortress Classic and 
	  HL Jailbreak support
	- added ASP support to search player database and display player 
	  statistics

	  
	NOP 3.2 -> 4.0, 12 december 1999
	
	- added daily / weekly / monthly stats generation
	- added Q3A bots support, new color codes, fixed game_type
	- added work around for Q3A timecode bug
	- added Q3A full and UT full weapons support
	- added CTFCaptures, CTFGets & CTFReturns stuff
	- completely changed template handling, output is now 100% customizable
	- completely rewrote FTP stuff
	- fixed sorting for FPH/FPG
	- fixed bug "winning more games than playing"
	- fixed timezone bug	
	- updated ASP / CGI scripts

	
	NOP 4.0 -> 4.1, 21 december 1999
	
	- fixed nopdata.txt not uploading (FTP)
	- fixed deleting of files (FTP)
	- fixed time for players
	- fixed linux week mismatch
	- fixed ctf values for alias people
	- fixed InitGame logfile modification
	- fixed duplicate maps in map-stats
	- fixed startup-batchfile for windows
	- added weapon pic for Gauntlet
	- updated docs

nop stats by nop v4.1, 12/21/99
written by denis moeller, 1999 - www.n-o-p.com