# ChessX Help

## ChessX Reference

### About PGN Databases

PGN is a portable format between different chess programs, a file format, that can be written and read sequentially, but not modified at random places.

ChessX is a viewer for these files, thus ChessX is somewhat limited in handling chess data as these files can not really be handled like a proper database.

To work around some of these issues, ChessX handles smaller and larger files differently. You can configure the limit where ChessX switches the algorithm according to your computers performance.

Smaller databases are read completely into memory and can be read and written.

Larger files are only indexed and as of version 0.9.4, the index is also saved to disk for a faster reopening of a PGN file. As the games are not in memory, this algorithm does not allow saving the files again, so the database is opened read-only

### About Index Databases

The index files are saved in the index-subdirectory of the Default Data Path. If the index directory or one of its files is deleted, ChessX will recreate the Index file the next time you open the PGN file.

ChessX will open the index file instead of the PGN file if the filename fits (e.g. "chess.cxi" fits to any "chess.pgn") if the date of the last modification fits to the date stored in the index file. So ChessX won't care for the path where your PGN is located (you can relocate the file after indexing), but this limits the Index to only one file with the same basename.

ChessX versions 0.9.6 and lower have index format 0, later versions support index format 1 and 0. On occasion, ChessX versions > 0.9.6 will not be able to read a version 0 format and will thus recreate the index file with the latest version. These occasions depend on the timezone when the file was created and the time it was read (summer/winter) and the version of the Qt libraries ChessX was compiled with.

### About themes and file system

ChessX reads and writes files at different locations

- Intermediate files arer put into the temp folder offered by the OS (see About Dialog for the exact path)
- Themes are put into the program data directory assigned by the OS (see About Dialog again)
- PGN databases are stored in a user defined folder (see Preferences Dialog)

ChessX has builtin themes and languages, which can be extended by external themes. These themes need to be stored in defined subfolders of the program data directory. Starting from ProgramDataPath/data/

- Translation files are stored in lang/
- Theme files in themes/...
- Output templates in templates/
- Windows Engines in engines/uci/ and engines/winboard/
- Mac OS Engines in engines-mac/uci/ and engines-mac/winboard/

Board themes are put into themes/boards while simple piece sets are put into themes/. Outlined and shadowed piece sets are put into themes/outline and themes/shadow respectively.

The About dialog gives hints on the actual paths (which depend on the operating system).

### About the Complexity in the Analysis output

The value given with "complexity" tries to give a hint on the complexity of a position with the help of the engine as suggested by Matej Guid and Ivan Bratko. As complexity metric for an individual move, the sum of the absolute differences between the evaluation of the best and the second best move is calculated. It is invoked at every time that a change in evaluation occurs when the search depth is increased. Therefore, the number of lines has to be set to '2' to start the calculation.