File names chosen for PGN data should be both informative and portable. The directory names and arrangements should also be chosen for the same reasons and also for ease of navigation.
Some of suggested file and directory names may be difficult or impossible to represent on certain computing systems. Use of appropriate conversion customs is encouraged.
The use of the file suffix ".pgn" is encouraged for ASCII text files containing PGN data.
PGN games for a specific player should have a file name consisting of the player's last name followed by the ".pgn" suffix.
PGN games for a specific event should have a file name consisting of the event's name followed by the ".pgn" suffix.
PGN data files used for chronologically ordered (oldest first) archives use date information as file name root strings. A file containing all the PGN games for a given year would have an eight character name in the format "YYYY.pgn". A file containing PGN data for a given month would have a ten character name in the format "YYYYMM.pgn". Finally, a file for PGN games for a single day would have a twelve character name in the format "YYYYMMDD.pgn". Large files are split into smaller files as needed.
As game files are commonly arranged by chronological order, games with missing or incomplete Date tag pair data are to be avoided. Any question mark characters in a Date tag value will be treated as zero digits for collation within a file and also for file naming.
Large quantities of PGN data arranged by chronological order should be organized into hierarchical directories. A directory containing all PGN data for a given year would have a four character name in the format "YYYY"; directories containing PGN files for a given month would have a six character name in the format "YYYYMM".
A suggested directory arrangement for ftp sites and CD-ROM distributions:
* PGN: master directory of the PGN subtree (pub/chess/Game-Databases/PGN)
* PGN/Events: directory of PGN files, each for a specific event
* PGN/Events/News: news and status of the event collection
* PGN/Events/ReadMe: brief description of the local directory contents
* PGN/MGR: directory of the Master Games Repository subtree
* PGN/MGR/News: news and status of the entire PGN/MGR subtree
* PGN/MGR/ReadMe: brief description of the local directory contents
* PGN/MGR/YYYY: directory of games or subtrees for the year YYYY
* PGN/MGR/YYYY/ReadMe: description of local directory for year YYYY
* PGN/MGR/YYYY/News: news and status for year YYYY data
* PGN/News: news and status of the entire PGN subtree
* PGN/Players: directory of PGN files, each for a specific player
* PGN/Players/News: news and status of the player collection
* PGN/Players/ReadMe: brief description of the local directory contents
* PGN/ReadMe: brief description of the local directory contents
* PGN/Standard: the PGN standard (this document)
* PGN/Tools: software utilities that access PGN data
There is a standard sorting order for PGN games within a file. This collation is based on eight keys; these are the seven tag values of the STR and also the movetext itself.
The first (most important, primary key) is the Date tag. Earlier dated games appear prior to games played at a later date. This field is sorted by ascending numeric value first with the year, then the month, and finally the day of the month. Query characters used for unknown date digit values will be treated as zero digit characters for ordering comparison.
The second key is the Event tag. This is sorted in ascending ASCII order.
The third key is the Site tag. This is sorted in ascending ASCII order.
The fourth key is the Round tag. This is sorted in ascending numeric order based on the value of the integer used to denote the playing round. A query or hyphen used for the round is ordered before any integer value. A query character is ordered before a hyphen character.
The fifth key is the White tag. This is sorted in ascending ASCII order.
The sixth key is the Black tag. This is sorted in ascending ASCII order.
The seventh key is the Result tag. This is sorted in ascending ASCII order.
The eighth key is the movetext itself. This is sorted in ascending ASCII order with the entire text including spaces and newline characters.
This section describes some PGN software that is either currently available or expected to be available in the near future. The entries are presented in rough chronological order of their being made known to the PGN standard coordinator. Authors of PGN capable software are encouraged to contact the coordinator (e-mail address listed near the start of this document) so that the information may be included here in this section.
In addition to the PGN standard, there are two more chess standards of interest to the chess software community. These are the FEN standard (Forsyth-Edwards Notation) for position notation and the EPD standard (Extended Position Description) for comprehensive position description for automated interprogram processing. These are described in a later section of this document.
Some PGN software is freeware and can be gotten from ftp sites and other sources. Other PGN software is payware and appears as part of commercial chessplaying programs and chess database managers. Those who are interested in the propagation of the PGN standard are encouraged to support manufacturers of chess software that use the standard. If a particular vendor does not offer PGN compatibility, it is likely that a few letters to them along with a copy of this specification may help them decide to include PGN support in their next release.
The staff at the University of Oklahoma at Norman (USA) have graciously provided an ftp site (chess.uoknor.edu) for the storage of chess related data and programs. Because file names change over time, those accessing the site are encouraged to first retrieve the file "pub/chess/ls-lR.gz" for a current listing. A scan of this listing will also help locate versions of PGN programs for machine types and operating systems other than those listed below. Further information about this archive can be gotten from its administrator, Chris Petroff (chris@uoknor.edu).
For European users, the kind staff at the University of Hamburg (Germany) have provided the ftp site ftp.math.uni-hamburg.de; this carries a daily mirror of the pub/chess directory at the chess.uoknor.edu site.
The "SAN Kit" is an ANSI C source chess programming toolkit available for free from the ftp site chess.uoknor.edu in the directory pub/chess/Unix as the file "SAN.tar.gz" (a gzip tar archive). This kit contains code for PGN import and export and can be used to "regularize" PGN data into reduced export format by use of its "tfgg" command. The SAN Kit also supports FEN I/O. Code from this kit is freely redistributable for anyone as long as future distribution is unhindered for everyone. The SAN Kit is undergoing continuous development, although dates of future deliveries are quite difficult to predict and releases sometimes appear months apart. Suggestions and comments should be directed to its author, Steven J. Edwards (sje@world.std.com).
The program "pgnRead" runs under MS Windows 3.1 and provides an interactive graphical user interface for scanning PGN data files. This program includes a colorful figurine chessboard display and scrolling controls for game and game text selection. It is available from the chess.uoknor.edu ftp site in the pub/chess/DOS directory; several versions are available with names of the form "pgnrd**.exe"; the latest at this writing is "PGNRD130.EXE". Suggestions and comments should be directed to its author, Keith Fuller (keithfx@aol.com).
The program "mail2pgn" produces a PGN version of chess game data generated by the ICS (Internet Chess Server). It can be found at the chess.uoknor.edu ftp site in the pub/chess/DOS directory as the file "mail2pgn.zip" A C language version is in the directory pub/chess/Unix as the file "mail2pgn.c". Suggestions and comments should be directed to its author, John Aronson (aronson@helios.ece.arizona.edu). This code has been reportedly incorporated into the GIICS (Graphical Interface for the ICS); suggestions and comments should be directed to its author, Tony Acero (ace3@midway.uchicago.edu).
There is a report that mail2pgn has been superseded by the newer program "MV2PGN" described below.
"XBoard" is a comprehensive chess utility running under the X Window System that provides a graphical user interface in a portable manner. A new version now handles PGN data. It is available from the chess.uoknor.edu ftp site in the pub/chess/X directory as the file "xboard-3.0.pl9.tar.gz". Suggestions and comments should be directed to its author, Tim Mann (mann@src.dec.com).
The program "cupgn" converts game data stored in the ChessBase format into PGN. It is available from the chess.uoknor.edu ftp site in the pub/chess/Game-Databases/CBUFF directory as the file "cupgn.tar.gz". Another version is in the directory pub/chess/DOS as the file "cupgn120.exe". Suggestions and comments should be directed to its author, Anjo Anjewierden (anjo@swi.psy.uva.nl).
The current version (3.0) of the commercial chessplaying program "Zarkov" can read and write games using PGN. This program can also use the EPD standard for communication with other EPD capable programs. Historically, Zarkov is the very first program to use EPD. Suggestions and comments should be directed to its author, John Stanback (jhs@icbdfcs1.fc.hp.com).
A vendor for North America is:
International Chess Enterprises P.O. Box 19457 Seattle, WA 98109 USA (800) 262-4277
A vendor for Europe is:
Gambit-Soft Feckenhauser Strasse 27 D-78628 Rottweil GERMANY 49-741-21573
The upcoming version of the multifunction commercial database program "Chess Assistant" will be able to use the PGN standard as an import and export option. There is a report of a freeware program, "PGN2CA", that will convert PGN databases into Chess Assistant format. For more information, the contact is Victor Zakharov, one of the members of the Chess Assistant development team (VICTOR@ldis.cs.msu.su).
A vendor for North America is:
International Chess Enterprises P.O. Box 19457 Seattle, WA 98109 USA (800) 262-4277
The MS-DOS edition of the multifunction commercial program BOOKUP, version 8.1, is able to use the EPD standard for communication with other EPD capable programs. It may also be PGN capable as well.
The BOOKUP 8.1.1 Addenda notes dated 1993.12.17 provide comprehensive information on how to use EPD in conjunction with "analyst" programs such as Zarkov and HIARCS. Specifically, the search and evaluation abilities of an analyst program are combined with the information organization abilities of the BOOKUP database program to provide position scoring. This is done by first having BOOKUP export a database in EPD format, then having an analyst program annotate each EPD record with a numeric score, and then having BOOKUP import the changed EPD file. BOOKUP can then apply minimaxing to the imported database; this results in scores from terminal positions being propagated back to earlier positions and even back to moves from the starting array.
For some reason, BOOKUP calls this process "backsolving", but it's really just standard minimaxing. In any case, it's a good example of how different programs from different authors performing different types of tasks can be integrated by use of a common, non-proprietary standard. This allows for a new set of powerful features that are beyond the capabilities of any one of the individual component programs.
BOOKUP allows for some customizing of EPD actions. One such customization is to require the positional evaluations to follow the EPD standard; this means that the score is always given from the viewpoint of the active player. This is explained more fully in the section on the "ce" (centipawn evaluation) opcode in the EPD description in a later section of this document. To ensure that BOOKUP handles the centipawn evaluations in the "right" way, the EPD setting "Positive for White" must be set to "N". This makes BOOKUP work correctly with Zarkov and with all other programs that use the "right" centipawn evaluation convention. There is an apparent problem with HIARCS that requires this option to be set to "Y"; but this really means that, if true, HIARCS needs to be adjusted to use the "right" centipawn evaluation convention.
A vendor in North America is:
BOOKUP 2763 Kensington Place West Columbus, OH 43202 USA (800) 949-5445 (614) 263-7219
The current version (2.1) of the commercial chessplaying program "HIARCS" is able to use the EPD standard for communication with other EPD capable programs. It may also be PGN capable as well. More details will appear here as they become available.
A vendor in North America is:
HIARCS c/o BOOKUP 2763 Kensington Place West Columbus, OH 43202 USA (800) 949-5445 (614) 263-7219
The chess database "Deja Vu" from ChessWorks is a PGN compatible collection of over 300,000 games. It is available only on CD-ROM and is scheduled for release in 1994.05 with periodic revisions thereafter. The introductory price is US$329. For further information, the authors are John Crayton and Eric Schiller and they can be contacted via e-mail (chesswks@netcom.com).
The program "MV2PGN" can be used to convert game data generated by both current and older versions of the GIICS (Graphical Interface - Internet Chess Server). The program is included in the self extracting archive available from chess.uoknor.edu in the directory pub/chess/DOS as the file "ics2pgn.exe". Source code is also included. This program is reported to supersede the older "mail2pgn" and was needed due to a change in ICS recording format in late 1993. For further information about MV2PGN, the contact person is Gary Bastin (gbastin@x102a.ess.harris.com).
The Hansen utilities are used to convert among various chess data representation formats. The PGN related programs include: "cb2pgn.exe" (convert ChessBase to PGN), "nic2pgn.exe" (convert NIC to PGN), "pgn2cb.exe" (convert PGN to ChessBase), and "pgn2nic.exe" (convert PGN to NIC).
The ChessBase related utilities (cb2pgn/pgn2cb) are found at chess.uoknor.edu in the pub/chess/Game-Databases/ChessBase directory.
The NIC related utilities (nic2pgn/pgn2nic) are found at chess.uoknor.edu in the pub/chess/Game-Databases/NIC directory.
For further information about the Hansen utilities, the contact person is the author, Carsten Hansen (ch0506@hdc.hha.dk).
"Slappy the Database" is a commercial chess database and translation program scheduled for release no sooner than late 1994. It is a low cost utility with a simple character interface intended for those who want a supported product but who do not need (or cannot afford) a comprehensive, feature-laden program with a graphical user interface. Slappy's two most important features are its batch processing ability and its full implementation of each and every standard described in this document. Versions of Slappy the Database will be provided for various platforms including: Intel 386/486 Unix, Apple Macintosh, and MS-DOS.
Slappy may also be useful to those who have a full feature program who also need to run time consuming chess database tasks on a spare computer.
Suggestions and comments should be directed to its author, Steven J. Edwards (sje@world.std.com). More details will appear here as they become available.
"CBASCII" is a general utility for converting chess data between ChessBase format and ASCII representations. It has PGN capability, and it is available from the chess.uoknor.edu ftp site in the pub/chess/DOS directory as the file "cba1_2.zip". The contact person is the program's author, Andy Duplain (duplain@btcs.bt.co.uk).
"ZZZZZZ" is a chessplaying program, complete with source, that also includes some database functions. A recent version is reported to have both PGN and EPD capabilities. It is available from the chess.uoknor.edu ftp site in the pub/chess/Unix directory as the file "zzzzzz-3.2b1.tar.gz". The contact person is its author, Gijsbert Wiesenecker (wiesenecker@sara.nl).
The program "icsconv" can be used to convert Internet Chess Server games, both old and new format, to PGN. It is available from the chess.uoknor.edu site in the pub/chess/Game-Databases/PGN/Tools directory as the file "icsconv.exe". The contact person is the author, Kevin Nomura (chow@netcom.com).
CHESSOP is an openings database and viewing tool with support for reading PGN games. It runs under MS-DOS and displays positions rather than games. For each position, both good and bad moves are listed with appropriate annotation. Transpositions are handled as well. The distributed database contains over 100,000 positions covering all the common openings. Users can feed in their own PGN data as well. CHESSOP takes 3 Mbyte of hard disk, costs US$39 and can be obtained from:
CHESSX Software 12 Bluebell Close Glenmore Park AUSTRALIA 2745.
The ideas behind CHESSOP can be seen in CHESSOPN (alias CHESSOPG), a free version on the ICS server which has a reduced openings database (25,000 positions) and no PGN or transposition support but is otherwise the same as CHESSOP. (These are the files "chessopg.zip" in the directory pub/chess/DOS at the chess.uoknor.edu ftp site.)
The program "CAT2PGN" is a utility that translates data from the format used by Chess Assistant into PGN. It is available from the chess.uoknor.edu ftp site. The contact person for CAT2PGN is its author, David Myers (myers@frodo.biochem.duke.edu).
The utility "pgn2opg" can be used to convert PGN files into a text format used by the "CHESSOPG" program mentioned above. Although it does not perform any semantic analysis on PGN input, it has been demonstrated to handle known correct PGN input properly. The file can be found in the pub/chess/PGN/Tools directory at the chess.uoknor.edu ftp site. For more information, the author is David Barnes (djb@ukc.ac.uk).