# ChessX Help

## ChessX Manual

### Opening a database

You can open a database either from the File menu or drag a file from Explorer / Finder into the Databases view.

You can make a database stay permanently in the database list by turning it into a "Favorite" (right-click the file). A database is reopened from there by clicking the asterisk or again by the context menu.

You can also drag files from yor Internet Browser into the ChessX Database List, they are downloaded into the configured default path (see the Preferences-Advanced-Default Data Path entry). If they are compressed (zip), the archive is stored at the Default Data Path and its content is extracted. Again, if there is something like PGN inside, the files are opened afterwards.

### Opening a periodic database from the web

For regularly loading a periodically updated database from the web, enter the target URL into the preference for Web Favorite, where $1 can be replaced by an incrementing counter. Let's say amonthincheckers.com hosts a monthly database update at "http://amonthincheckers.com/zips/amic123g.zip" where 123 is incremented every time an update is posted, enter "http://amonthincheckers.com/zips/amic$1g.zip" into the URL field and set the starting number at the right of the URL. Each time the database is successfully loaded, $1 is incremented by one so you are all set for the next update.

### Making moves

A move is done by grabbing a piece and dragging it to another square.

Depending on your settings in the board preferences, you can either

- Click on a piece and a target square (if move guesses are deactivated)
- Click on a piece and accepting the move quess (in case of deactivated next guess on right click)
- Right Click on a piece and then again until the correct target square is high-lighted, then press the left mouse button to make the move (in case right click is used for next guess).

Going back a move can be done by a right-click (in case the right click is not configured for backtracking a move) or by pressing CTRL-right click if backtracking is assigned to the right mouse key.

Usually, making a move will insert a new variation unless you are at the end of the game or a variation. If you do not want to create a new variation, press CTR while moving, which replaces the current move and all following moves by the new move.

If you want to exchange a move without deleting subsequent moves, you can press CTRL+ALT while moving, this will exchange the move played with the new move and check the remaining game for illegal positions. The game is then truncated at these illegal positions.

If you promote a pawn, ChessX will pop up a selection dialog, which piece you would like to have. This can be disabled in the Preferences. If you have enabled automatic promotion, you can still force the promotion dialog to appear bei pressing the Meta-Key while dragging the pawn to the eigth row.

Castling is performed by moving the king to its destination square. See Chess Variants on castling in Chess960.

### Let ChessX replay the game

If you want ChessX to replay the game, select "Game->Auto Player". You can change the move rate with the slider in the bottom right corner of the status bar.

### Entering moves with the keyboard

If the focus is somewhere on the board or the notation, you can enter moves simply by starting to type. A label in the status bar will indicate, what you have typed. Whenever ChessX recognizes a complete move, the move is executed and the buffer is cleared.

You can enter anything that looks like (PGN-) notation, make sure, your move us unambiguos. For example, typing "e4" in the starting position is fine, whereas a subsequent "e2" could either be Be2,Ne2,Ke2,Qe2 - or f1e2...

By pressing [Enter] you can force ChessX to accept an entry or discard it, if ChessX cannot make anything reasonable of your entry.

### Annotating moves

Move annotations can be done by activating the context menu in the games text browser or by simply pressing the corresponding key sequence, e.g. '!?','!!','??','!x','?x','=','+-','-+' and so on, where 'x' is used in case the first character is ambiguous, 'x' can be the Return/Enter-Key or literally the small letter 'x'.

You can make special annotations like drawing an arrow or coloring squares by pressing Shift+Right-Mouse-Clicking (either select a single square or make a drawing gesture for drawing an arrow).

Pressing a green, red or yellow pen enters paint mode. You cannot enter moves, instead, you can paint squares and arrows without having to press Shift+Right-Mouse.

Pressing the grey pen selects the eraser.
Pressing Shift+grey pen erases all markups at once.

### Saving games

Saving games is slightly confusing! A game needs to be saved into the database (Press CTRL+S, Menu Game/Save). From there, the whole database needs to be saved to disk by pressing CTRL+Shift+S / Menu File/Save. This is somewhat inconvenient but on the other hand prevents you from mistakenly overwriting games or files.

If you want to commit a database to harddisk immediately and automatically when saving a game, you can select Option "Commit Database after Saving Game" from the Database Pane in the Preferences Dialog.

By default, a clipboard database is open, which does not have a backing file on disk. Anything that remains in the Clipboard is lost upon closing ChessX! So you need to open at least one other database for writing and transfer anything from the Clipboard into this database by either dragging the games to that database or using "Copy Games" from the Database menu.

### Switching databases

Switching between open databases can be achieved by either the Database menu, pressing CTRL+Shift+Number 0 .. 9, right-clicking or double-clicking into the database list or clicking onto the board's tab associated with the database. The currently selected database is highlighted in the database list!

### Open or start a new game

Once you have opened or selected a database a described above, you can either start a new game by pressing CTRL+N or select a game from the list of games inside the database.

If you want to start a game from a given position, enter CTRL-SHIFT-E to bring up the board editor. Within this editor, you can set up an arbitrary position or a Chess960 starting position. The editor checks the position for legality so you might need to adapt the castling rights or the side to move to make your position legal.

### Analysing games

There are two analysis windows where two different engines can be configured to analyse the current board position.

Engines must be configured before in the Preferences Dialog. A default engine (Stockfish) comes with this installation and will be configured as first engine, if no other entries exist. Stockfish is an open source engine (see Homepage of Stockfish. The source code for Stockfish is also located on the homepage. Note that Stockfish is licensed under GPLv3

You can fine-tune engines with the protocol options dialog (works for UCI only, Winboard is seldom used and due to the clumsy specification hard to implement for GUI developers.)

You can change the move rate with the slider in the bottom right corner of the status bar. Draw the slider to the very left for infinite analysis or to the right to make the engine analyse from 1 to 10 secondes per move.

If the number of lines is set to at least 2, the Guid/Bratko complexity is also calculated - see the reference on details.

A hint for engine developers: You can log the communication from/to the engine with the "Log" checkbox in the engine settings. Logging will be sent to a file 'name.log' where name is the "given" name in the engine settings. Logging directory is the Program data path + /log. What the program data path resolves to can be found in the About box.

Some engines (e.g. lc0) have issues keeping a proper internal state across two position commands, therefore ChessX allows sending a complete game history instead of an updated position. This can be disabled via the "Send History" check box.

### Playing (out) games against an engine

You can play out a game after the final position by activating Auto Respond mode. Whenever you make a move the engine in pane 1 will start to analyse the position for the time defined by the slider at the bottom right of the status bar. If the allotted time is over, the engine will make the best move found so far.

If you start a game with Chess960 rules you will need an engine that supports this. The integrated Stockfish is ready for Chess960.

### Automatically annotating games

Activating menu "Game->Auto Analysis" will start to move through the current game, analysing each position for some time. After the alotted time is over, annotations will be inserted into the game text. Then ChessX will continue with the next move.

There are a couple of options which have an influence on the behaviuor:

- The slider in the status bar will determine, how long the engine will ponder on each position
- Preferences->Game->Automatically save and continue with next game: This allows analysing a complete database, select this option, start Engine 1, open the first game from the database and select move 1.
- Preferences->Database->Commit Database after saving Game: Recommended, commits your results to the harddisk after each game, especially if you analyse a complete database, a loss of power will otherwise lose all results so far.
- Preferences->Game->Blunder Check limit: Threshold in centipawns
- Preferences->Game->Auto Analysis backwards: Backward analysis will enter variations only if the move's evaluation is above the limit described above Forward analysis will only add a NAG (?, ??, !, !!) instead.3
- Preferences->Game->Add Annotation: The text given is added to inserted lines or NAGs so that the result of the analysis can be distinguished from already existing lines and comments.
- Preferences->Game->Mainline Only: This will prevent ChessX from diving into existing variations.

If no limit is set, all variations will be added to the game text.

### Using Books in engines

UCI engines may support books. Just set the OwnBook option to true, set the name of the "Book File" option and restart the engine. The engine will answer immediately with a book move when playing out games (see above), depending on "Best Book Move" option this may or may not be the best move from the book. In infinite analysis, the engine won't use information from opening books.

If your engine does not support books (e.g. Stockfish does not support it anymore), the GUI can act as a frontend for the engine: Open a book as described below and select it from the book-selector in the Analysis pane. If you start a engine match or a game against an engine, you can use the option "Allow use of books" and select an algorithm, how the GUI shall select moves if several moves are available for a given position.

- Best move will always take the preferred move
- Random selection will choose one move at random with equal probability
- Weighted selection will make a random selection but prefers better moves

### Using Books in ChessX

ChessX supports three book formats: Polyglot (*.bin), Arena (*.abk) and Chessbase (*.ctg/*.ctb/*.cto).

The original Polyglot code was licensed under GNU GPL Version 2.0, the ctg-support largely inspired by the Daydreamer engine code.

ChessX displays books like any other database in the Opening Tree Browser. Drag a polyglot book (which must have the suffix ".bin") an Arena Book (.abk) or a Chessbase book (*.ctg) to the Database List or open the book via menu. Once it is open, it becomes available as any other open database in the combo box "Source" beneath the opening tree.

One note on Chessbase books: Three files are required with externsion 'ctg', 'ctb' and 'cto'. They all need to have the same basename and reside within the same directory.

One note on Polyglot: Books can be difficult to interpret: they are made for engines, as they give a hint on moves, the engine should play. Moves which did not succeed at all are usually not part of polyglot books.

So do not learn openings from polyglot books - important moves might be missing!

One note on Arena: Unlike Polyglot or Chessbase, Arena books are a compressed set of games, so they are handled like read-only databases. You can drag games from Arena books like from any other database.

### Creating your own book

You can create your own Polyglot book by selecting a open PGN or Arena database (right click with the mouse) and select "Make polyglot book".

ChessX will query the following parameters and pass them for creating a book:

- The number of plies (half moves) to read for each game. E.g. if set to "20", only the first 10 full moves of each game will be scanned.
- The number of times a move must have been played to be kept in the book. In other words, moves that were played too rarely will be left out. If you scan full games "2" seems a minimum, but if you selected lines manually "1" will make sense.
- You can overwrite the actual results of games by selecting the side for which you want to build a repertoire, assuming that all the games in a database contain lines that you want to play.
- Before, you can filter out unwanted games.
- By default, a probability is calculated by ChessX PolyGlot for each move depending on how popular it is (how often it was playing in the provided PGN file) and how much it "scored". This option bypasses the default mechanism and affects equal probability to all moves. This allows more variety of play.

### Generating content

You can copy/paste positions(FEN and images) and complete games(PGN) from/into the clipboard, export games in LATEX, HTML or PGN again. See the Edit menu and the File/Export Dialog.

### Merging games

By dragging a game from the game list into the current notation, the dragged game will be merged into the current game at the first position after the current position, where both games deviate. The game will be merged with all annotations and variations. If nothing is merged, no suitable point for merging was found. This can happen, if

- no position could be found where both games where equal (after the current position!)
- the remainder of the game to be merged in was already contained in the current game

You can select multiple games and merge them at once.

### Sorting and filtering games

The list of games can be filtered either by the opening tree, the Player or Event widget or from the context menu in the list header. Several searches can be combined or inverted. Further occurrences of the current board position in the current database can be found via the Find / Find Position menu.

Clicking on the header sorts the list.

Keyboard Shortcuts inside the game list:

- Meta+A: Select all games
- Meta+C: Bring up the copy dialog for the selected games
- Meta+H: Hide the selected games
- Meta+X: Delete selected games

### Filter Databases into an opening tree

The opening tree takes the current board position and matches it with each game in the selected database. The moves found in the database are listed with the number of occurrences and the score that was achieved with each move alternative. The database is updated continuously, the progress bar gives a hint how far the database is analysed.

The result of the position search can be filtered into the list of games. This filter can again be used as input for the search in the opening tree. Especially on large databases this can speed up further searches (but will of course miss other move orders into the same position).

Usually, clicking onto one of the moves in opening tree will only update the small overview in the opening tree widget. Pressing Shift while clicking onto a move will add the move to the current game (if the position permits)

### Filter duplicate games

Filtering duplicate games searches for exact matching, all further copies of a game within the database a put into the filter, the original game is not included into the filter. Thus all the copies in the filter can be marked for deletion.

Filter for duplicate headers searches for identical tags. The games shown in the filter are games that have a brother game, that is not included in the list and in addition, the invisible brother has at least as many moves and comments as the games in the list.

The context menu in the game list has a context menu entry "Filter twins" which for all selected games searches the whole database for exact duplicates. Both twins will appear in the filter list afterwards.

### Merge complete databases

By dragging a database list item either onto a different database list item or by dragging it into the list of games, games are appended to the database where the item was dropped or into the currently active database in case the drop target is the list of games.

You can also drag databases from the file system into the list of games to append all content into the current database.

Dragging a database into the list of databases will open the database instead (i.e. it will not append to the database where it was dropped).

### Refactor games or active database

You can clean games or complete databases from variations, time annotations or comments. See either the game or the database menu for either of the three refactoring methods.

Note: Refactoring a game can be undone, while there is no Undo for refactoring a complete database.

### Training Modes

Selecting "Game/Training" starts the training mode. Moves starting from the current move are hidden on the game sheet. You can't modify a game so you can make any move in a position. If the move is the right one (the one that was played or a existing variation) then the move is executed and the game is moved one step forward. The game notation is updated and variations on that move become visible. Ideal for use with a tactics database.

If you have no idea what to move, you can get hints by hovering with the mouse over your pieces. Perhaps, the right move pops up! See the chapter on Making Moves and the associated preferences to enable move guesses.

Selecting "Game/Training both sides" forces you to play both sides while hiding the sheet.

### Playing matches

Match allows two humans to play a game of chess. The match button makes sure, that ChessX does not give away hints on the position. This effectively disables engine output, tablebase output, moving back or forward in a game, changing databases etc.

Play a game against an engine with time limit.

### Matches between engines

With "Game/Engine Match" you can arrange a match between two engines. Analysis pane 1 will play the white pieces, pane 2 with the black pieces. Starting an engine match brings up the match parameter dialog. If activated, the elapsed game time is annotated. You can play with Gong (each move will be made within a fixed time) or sudden death, where each engine gets a fixed amount of time for the whole game. ChessX will supervise the time and also adjudicate a draw in case of a three-fold repetition, insufficient material or the 50 move rule.

### Online Chess

ChessX supports online access to games played or stored on the free internet chess server.

If you have a FICS account, you can enter the credentials in the Preferences, otherwise, ChessX will login as guest.

ChessX connects to FICS upon opening the virtual database FICS. A successful connection is indicated in the message pane of the FICS console.

Selecting the tab "Games" will read in the list of games which are currently played on FICS. Double clicking a games will start monitoring this game. Selecting Players will read in all players currently connected to FICS. Double-clicking a player will read in the players history (last 10 games). Double clicking a game from the History pane will read in the game into the current game of the FICS database. You can finally save any observed or examined game and transfer it to a persistent database. Games in the FICS database are not persistent!

For playing games online, using TimeSeal is recommended. See the message pane upon connecting to FICS. It will show, if Telnet or Timeseal is used. Telnet will give you a disadvantage for faster games so this is not recommended.

You can accept incoming match requests from other players pressing "Accept" or you can seek for an opponent in the seek pane.

While waiting for your opponents move, you can already grab a piece and hover over a target square or you can enter a premove by dropping it somewhere, the premove piece and its target square a indicated. An active premove can be cancelled by clicking somewhere on the board or by selecting a new premove.

Chess variants are not supported in Online mode

### Chess Variants

ChessX supports Chess 960 games (also call Fisherandom).

You can start a Chess960 game by setting up the board manually. The setup dialog allows entering the position identifier or chossing a random identifier.

While entering a Chess 960 game, castling is performed by dragging the king onto the castling rook. This will work even if the king is already on its destination square.