GNU Backgammon
Backgammon board image
Table of Contents

Working with matches

Opening and importing matches

The SGF file format

GNU Backgammon uses the Smart Game Format (SGF) to store games, matches, sessions and positions. SGF is used in as a standard format for several other turn based games. The most known game that uses SGF extensivly is Go. The format is described at this site.

In GNU Backgammon the SGF files can store all the rolls and moves and cube decisions as well as commentary and analysis.

Opening a SGF file

To open a SGF file, select in the menu File→Open→Game…, or File→Open→Match or session…. This will display a file dialog box where you can select the file you want to open. You can also use the keyboard shortcut Ctrl-O to open the file dialog box directly, or you can use the tool bar button labeled Open.

Tip: The internal routine in GNU Backgammon does not care if you have pressed Open→Match and you then try to open a SGF game or SGF position instead. It opens the SGF file whatever it is and whatever you selected in the menu, as long as it is a valid backgammon game, match, session or position. It is therefore safe to use the Open button in the tool bar for any SGF file you want to open.

Opening a SGF file at the command line

If you’re working with a command line version of GNU Backgammon, you can use the command:

   load match filename.sgf

or

   load game filename.sgf

or

   load position filename.sgf

Tip: The internal routine in GNU Backgammon does not care if you have typed load match and you then try to open a SGF game or SGF position instead. It opens the SGF file whatever it is, as long as it is a valid backgammon game, match, session or position. It is therefore safe to use the load match to open any SGF file.

Saving a SGF file

If you have played a match or imported a match into GNU Backgammon, and want to save it to a SGF file, you can select from the menu File→Save→Match. A file dialog box will appear and you can type in a filename or keep the suggested default filename. (The suggested default filename contains the date, the players name and the length of the match). This will save the whole match of the current match or session. If there is any analysis or commentary available this wil also be saved to the file. You can also use the tool bar button labeled Save to open the file dialog box directly. There is also a keyboard shortcut, Ctrl-S, for saving a match or session.

You can also possible to save just the current game to a SGF file. To do this you select from the menu File→Save→Game. It works in the same way as saveing a match, but this will only save all the current game and analysis if available.

You can also save the current position only. Use the menu option File→Save→Position. This will open a file dialog box where you can type your filename in the same way as saving a match. Please note that saving a position wil not save any analysis.

Saving a SGF file with the command line interface

If you’re working with a command line interface of GNU Backgammon, you can save your match the command

  save match filenam.sgf

or you can save the current game with

  save game filename.sgf

or you can save the position with

  save position filename.sgf

Import files

GNU Backgammon can import matches produced by various other programs or online servers. For example, you can import matches played on GamesGrid or FIBS. GNU Backgammon can export positions, matches, or money session to a number of formats; some suitable for printing, some suitable for including in emails or Usenet postings, and others suitable for publishing on the world wide web or for posting to backgammon forums.

The following sections describe how to import and export positions, matches, and sessions with GNU Backgammon.

Jellyfish .pos

GNU Backgammon can import positions in Jellyfish .pos format. To import a position file using the GUI select a file from File→Import→.pos position.

The .pos position format is documented at The Jellyfish Position File Format.

Jellyfish .mat

GNU Backgammon can also import matches and money sessions in the .mat format. This format is often used to move games between different programs, as most programs (e.g., Jellyfish, Snowie, BGBlitz, and others) support import and export of this format.

To import a match or money session in the .mat format, select a file from File→Import→.mat match.

Note that at least one program (BBGT) is known to write multiple matches in the same .mat file. In this case GNU Backgammon will only read the first match. If you wish to import all matches from such a .mat file, you’ll manually have to split the file into files containing the individual matches.

GamesGrid .sgg

GNU Backgammon can import matches and money sessions played on GamesGrid if saved in the SGG format. Currently, GNU Backgammon doesn’t support import of the native undocumented .cbg format. Also note that GNU Backgammon does not analyse table stakes, so imported money sessions will be analysed as a normal money session.

To import an SGG file using the GUI select a file using the menu entry File→Import→.sgg match.

FIBS oldmoves

GNU Backgammon can import matches and money sessions from FIBS in the oldmoves format. Most of the GUIs for playing on FIBS supports saving of matches either in the oldmoves format or in Jellyfish .mat format.

To import an oldmoves file using the GUI select a file using the menu entry File→Import→FIBS oldmoves.

Note that GNU Backgammon will only read the first match in the file. If you wish to import all matches from a file containing more than more game, you’ll manually have to split it.

TrueMoneyGames .tmg

GNU Backgammon can also import matches and money sessions played on TrueMoneyGames saved in the TMG format (file suffix .tmg). Please note that GNU Backgammon does not analyse table stakes, so imported money sessions will be analysed as a normal money session.

To import an TMG file using the GUI select a file using the menu entry File→Import→TrueMoneyGames .tmg match.

Hans Berliner BKG format

Matches written in the Hans Berliner BKG format can be imported into GNU Backgammon. To import an BKG file using the GUI select a file using the menu entry File→Import→BKG session.

Snowie .txt position format

GNU Backgammon can import positions written in the Snowie .txt position format. Please note that very important distinction between Snowie .txt position and Snowie Standard Text. The former is used for position and the latter is an extension of the Jellyfish .mat format, and can be imported in GNU Backgammon using the .mat importer.

GNU Backgammon can also export positions to Snowie .txt format for easy exchange of positions with Snowie users.

To import an Snowie .txt position file using the GUI select a file using the menu entry File→Import→Snowie .txt position file.

Batch import

GNU Backgammon doesn’t support batch import and analysis using the GUI, but batch import is possible with the command line version of GNU Backgammon.

Under Unix execute:

    gnubg -t < input-file > output-file

Under Windows it depends on how your version of GNU Backgammon was build. For example, if you use the build by Øystein Johansen you should execute:

    gnubg-no-gui.exe < input-file > output-file

The input-file must be carefully prepared. For example, it could look like:

   import sgg file1.sgg
   analyse match
   save match file1.sgf
   import sgg file2.sgg
   analyse match
   save match file1.sgf
   import mat file3.mat
   analyse match
   save match file3.sgf
   

If you wish to adjust your setting for the analysis you can include commands like:

   set analysis chequerplay evaluation plies 2
   set analysis cubedecision evaluation plies 3
   [...]
   

See the command reference for further details regarding the commands available in GNU Backgammon.

Other formats

There are a number of utilities written that can read and write positions, matches, and money sessions in other formats than the ones GNU Backgammon has direct support for. Bunny's Zone Converter can be used to convert matches saved on MSN Gaming Zone to Jellyfish .mat format which can be imported into GNU Backgammon.

The neural net backgammon program BGBlitz can read Gamesgrid .cbg, FIBS/W logfiles, MacFIBS logfiles and other formats which can be written back in the .mat format for importing into GNU Backgammon.

Tips and tricks

If you want to exchange the playes, i.e., GNU Backgammon has imported you as the top player rather than the bottom player, select them menu entry Game→Swap Players.

Entering live tournament matches

It’s possible to enter match transcriptions into GNU Backgammon. It’s not very difficult. Presuming you’re using the GUI, do this:

  1. Start a match of any length, pressing the New button, and select Human-Human and manual dice.
  2. To select the opening roll, click on the right dice pair in the dice selection window that appears. The left die in the dice pair is the die thats rolled by player 0, or the player at the top. The right die is the die that will be rolled by player 1 or the buttom player. So if you select for example the [embedded Image] dice combination it means that player 0 rolls a 5 and player 1 rolls a 3, and player 0 is therfore beginning this game. However, if you select the [embedded Image] dice combination it means that player 0 rolls a 3 and player 1 rolls a 5. Player 1 will therefore begin when you select [embedded Image] instead of [embedded Image].
  3. To change the names, use the Edit button at the top. If you want to enter information such as the name of the Annotator, date, locale, etc. go to the Game menu and choose Match Information.
  4. To enter written comments, you first have to play the move, and then go back to the move in the move list to be able to use the Commentary pane (feel free to close the Messages pane from the Windows menu). Don’t forget to save the match every once in a while.
  5. One comment: when entering the Cube commentary of a cube play (meaning it was turned), select the Take/Pass decision to enter the commentary. The reason is that if you export it after, and didn’t do this, the commentary appears before the cube decision and not after as it should.

Tip: while entering the match, if you wish to see GNU Backgammon’s opinion while you are entering the moves, play the move on the board and press the Hint button in the tool bar. In the latest builds, if you have done this, the results will then be placed with the move so that it means it is already analysed when you run the full match analysis. Mind you, it will preserve the information even if you ran a deeper 3-ply or 4-ply from the Hint window. After playing the move and confirming the dice, go back in the move list and click on the move, and you’ll see the analysis appear in the Analysis pane as it should.

Entering illegal moves

It’s possible to enter illegal moves with a little trick. This is a step by step guide for the exampe: If a player rolls 41 and the player makes an illegal move as the dice showed 31.

Analysing matches

If you have just played a match or just loaded a match or in some kind of other way got a match into GNU Backgammon, you can have GNU Backgammon to analyse every move and cube decision of the match. GNU Backgammon can also analyse the luck through the match.

For analysing a whole match you simply select for the menu Analyse→Analyse match. This will make GNU Backgammon analyse all moves and cube decision of the match. You will also see a progress bar at the buttom right corner of the main interface window while the computer is buzy analysing.

You can also analyse just the current game, by selecting Analyse→Analyse game. If you’re only interested in the analysis of the current move, you can select Analyse→Analyse move.

Analysis settings

You can configure how GNU Backgammon analysis the match or game for you. This can be configured in the dialog box that appears when you select from the menu Settings→Analysis.

[embedded Image]

In the top left frame in this dialog box, you can select what to analyse. GNU Backgammon is able to analyse three different properties in a match.

In addition you can have the analysis to analyse just one of the players, or both. There is also possible to set a limit of how many moves to be analysed at each position. When you’re reviewing your match, the number of analysed moves will be limited to number in this field. However, if you want to analyse further moves in a particular position, it’s not a problem to do that later. The move that was actually done in the match will be analysed even if it is manked below the number of moves limit.

GNU Backgammon will also mark each move or cube decision with Doubtful, Bad and Very bad. You can adjust the limits in equity difference for which label to assign. This is done in the frame box to the left. Note: Currently the Good and Very good classes are not used.

You can also adjust the classes for what GNU Backgammon considers lucky and unlucky rolls. The luck of a roll is defined as the differnce of equity after the best move after rolled dice and the equity after best move avergaged over all possible rolls.

The right part of the dialog box is an evaluation setting for how each move or cube decision should be avaluated in the analysis. For an explanation of this settings, see the chapter called “Evaluation settings”.

Reviewing matches

Game record

When a match is analysed in GNU Backgammon you should open the game record window. Open this by checking Window→Game record on from the main menu. The game record window can also be docked into the right side panel. If you want it docked into the right side panel you should check on Window→Dock panels. The game record window shows a list of all the moves in the game. You can also navigate between the games and moves.

[embedded Image]

The figure shows a typical game record list. The moves are shown in two columns. The left column shows the moves for player 0 ,the to player, and the right column shows the moves of player 1, the buttom player. You can navigate through the game with the arrow buttons at the top of the game record. The red buttons with the double arrows take you to the previous game or the next match. (Arrow pointing to the left takes you to the previous game, and the red arrow pointing to the right takes you to the next game.) The green buttons take you one move ahead in the game or one move back. The green arrow button pointing to the right take you to the previous move. The green arrow button pointing to the right take you to the next move or to the next dice roll. If your in the move list where the dice is not rolled, a click on this green Next button will show you the same position with the dice rolled. The last two buttons take you to the next marked move, or to the previous marked move. The green arrow button with a question mark pointing to the left will take you to the previous marked move. The green arrow button with a question mark pointing to the right will take you to the next marked move. You can also go to other games in the match or session by selecting the game in the game dropdown menu. You can also go to a move directly by clicking that move in the game record list.

There is also some keyboard shortcuts for naviagting through the match. Page Down till take you to the next move and Page up will take you to the previous move.

After a analysis some of the move in the gamelist will be marked. You will see some moves marked with “?” and some with “?!” and some with “??”. These marks means the same as the marks in normal chess notation.

?? a very bad move
? a bad move
?! a doubtful move

Note that it is the same marks for cube decisions as for checker moves. Nevertheless, checker moves marks are before the cube decisions marks. If no mark exists for checker move, the cube mark is separated by two spaces.

In newer builds of GNU Backgammon the various moves also get a color code. The cube decisions are shown by the background color. The checkers move decisions are shown by the font color.

Cube Move Decision
Yellow Red Very Bad
Pink Blue Bad
Grey Green Doubtful

The luck is also marked in the font

Font Luck
Bold Very Lucky
Italics Very Unlucky

Analysis panel

You can also study your moves and cube decisions in more detail in the analysis window, or analysis panel if you have checked Dock panels in the Window menu. You can open this window by checking on Windows→Analysis. If you have docked panels the analysis panel will appear under the game record. The analysis window is basically the same as the Hint window described in the “Playing a game or match” chapter.

[embedded Image]

In the figure you can see the analysis panel. At the top of the analysis panel you will see three pulldown menus. The leftmost pulldown menu is a comment on the cube decision. In the figure it is a position where the player didn’t double and the GNU Backgammon’s analysis of this is empty. There was nothing wrong with not doubling in this position. The user can also override GNU Backgammon’s evaluation and mark the cube decision as ‘Doubtful’, ‘Bad’ or ‘Very bad’. Note that the cube decision pulldown menu will only be visible when the player has the cube available.

The next pulldown menu shows a simple analysis of the roll. The roll in this position was 32. GNU Backgammon’s evaluation of this dice roll is also empty. It shows that this particular roll was -.162 equity worse than the average roll. This means that the roll is a bit unlucky, but does not qualify for beeing marked as an unlucky roll. The rolls are marked in these categories: ‘Very lucky’, ‘Lucky’, ‘Unlucky’ and ‘Very unlucky’.

The rightmost pulldown menu, shows the move which was done. In this situation the move that was done was 3/off 2/off. This move did not qualify for any mark. Moves that GNU Backgammon don’t like will be marked as ‘Doubtful’, ‘Bad’ or ‘Very bad’. The user can also override GNU Backgammon’s evaluation and mark the move manually with the pulldown menu.

The rest of the analysis window is a notebook of two pages. The first page is the list of possible moves. The list is sorted in the ranked order with the best considered move at the top. The moves are sorted by equity or EMG. In the list in the figure there is only two possible moves. The move that was actually done in the match, is marked with red color. The only difference of this list of moves and the list of moves in the hint window, is that this list does not show the probabilities for each outcome of the game. If you want to see the probabilities of the different outcomes, you can click on the button labeled Details. This will then show you a list with these numbers.

The other page of the notebook is the cube decision analysis. This analysis show exactly the same as in the Hint window described in the chapter called “Playing a game or match”. Note that the cube decision page will only be available if there is a cube decision. It will not be visible if the cube is not available to the player.

There is also a set of tool buttons in the analysis panel. These buttons does exactly the same as the tool buttons in the Hint window, which is described in the the chapter called “Playing a game or match”.

Statistics

You can get a summary of the analysis from the game, match, or session analysis. The game analysis is a summary for the current game whereas the match or session statistics is a summary of all the games in the match or session. The match analysis is available in the GUI from Analysis→Match Statistics or at the bottom of exported files.

Chequer play statistics

This section provides a summary of the chequer play statistics. The following information is available

Luck analysis

This section provides information about how Ms. Fortuna distributed her luck. The following information is available:

Thresholds for marking of rolls:

Deviation of equity from average Roll is marked
> 0.6 very lucky
0.3 - 0.6 lucky
-0.3 - 0.3 unmarked
-0.6 - -0.3 unlucky
< -0.6 very unlucky

Luck ratings:

Normalised luck rate per move Luck rating
> 0.10 Cheater :-)
0.06 - 0.10 Go to Las Vegas immediately
0.02 - 0.06 Good dice, man!
-0.02 - 0.02 none
-0.06 - -0.02 Better luck next time
-0.06 - -0.10 Go to bed
< -0.10 Haaa-haaa

Cube statistics

This section provides a summary of the cube decision statistics: the number of cube decisions, missed doubles, etc.

Overall rating

The last section is the overall summary.

Threshold for ratings:

Normalised total error rate per move Rating
0.000 - 0.002 Supernatural
0.002 - 0.005 World Class
0.005 - 0.008 Expert
0.008 - 0.012 Advanced
0.012 - 0.018 Intermediate
0.018 - 0.026 Casual Player
0.026 - 0.035 Beginner
> 0.035 Awful!

Please note: The Normalised total error rate per move is multiplied by 1000 in the default settings.

Exporting matches to other formats

FIXME Show the export settings dialog.

HTML export

GNU Backgammon can export the current position, game, match or session in HTML if you wish to publish it on the web. A sample match with the World Cup Final 2002 from Monte Carlo is available for viewing.

GNU Backgammon exports in validating XHTML 1.0 with the use of CSS style sheets. You may add your own style sheet to the exported HTML files if you wish to override the default layout, e.g., change colors or fonts.

The board is made up from hundreds of pictures. Currently, you can choose between three different sets of pictures:

The images generated by GNU Backgammon will have the same design as your current design, and honours your settings on clockwise or anti-clockwise movement and board numbering (on, off, dynamic).

If you export a match or session to HTML, GNU Backgammon will write the individual games to separate files. For example, if you export to file foo.html the first game is exported to foo.html, the second game to foo_002.html, the third game to foo_003.html and so forth.

The output from the HTML export can be customised. For example, it’s possible to leave out the analysis or parts of the analysis. Also, you may enter a specific URL to the pictures used to compose the board which is useful for posting positions on web-based discussion groups such as Kit Woolsey’s GammOnLine, the Danish Backgammon Federation’s Debat Forum, or you may opt to use a default set of images available from the gnubg web site at http://www.gnubg.org/images/html-images/.

Description of the CSS stylesheet

As mentioned above GNU Backgammon writes a CSS stylesheet along with the generated XHTML file. The CSS stylesheet may be written verbatim in the header section of the XHTML file, to an external file named gnubg.css, or inside the tags using the style attribute. If you wish to make any modifications to the stylesheet without modifying the actual source code of GNU Backgammon you have to choose one of the first two methods. Note that the special export for Kit Woolsey’s GammOnLine uses the third method since the XHTML is pasted into a web page without the possibility to modify the header section of the page where the style sheet is defined. Thus, it’s not possible to modify the style of the generated XHTML for GammOnLine without modifications of the source code or extensive search and replace in the geneated XHTML.

Below follows a description of the CSS classes used in the XHTML export:

Class Description
.movetable Style applied to the entire table used for the move analysis
.moveheader The header of the move analysis table
.movenumber The rank number of a move in the move analysis
.moveply The column indicating the number of plies or rollout
.movemove The formatted move, e.g., 13/7 8/7.
.moveequity The column with the equity or MWC.
.movethemove Special style for row that contains the actual move chosen by the player
.moveodd Special style for the odd rows. Can be used to give an alternating color for the rows.
.percent Style for the game winning probabilities and equities in the move analysis.
.blunder Emphasize blunders, e.g., “Alert: missed double” or “Alert: bad move”.
.joker Emphasize very good or bad rolls, e.g., “Alert: unlucky roll”.
.stattable The style applied to the entire table with game, match, and session statistics
.stattableheader The header row of the statistics table
.result Style for the text indicating the outcome of the game or match, e.g., “Joern Thyssen wins 16 points”.
.tiny Currently unsued.
.cubedecision The style applied to the entire cube decision table
.cubedecisionheader Style for the header row of the cube decision table
.cubeequity Style for any equity or MWC in the cube decision table
.cubeaction Style for the text indicating the correct cube action
.cubeply Style for the text that states the level of evaluation
.cubeprobs Style for the game winning probabilities in the cube decision table
.comment The style applied to the entire table used for annotations or comments, e.g., the kibitzing from imported SGG files
.commentheader The style applied to the header row of the annotations’ table
.number Currently unsued
.fontfamily Style applied to the entire body of the XHTML document.
.block Style applied to the images in the export to avoid gaps between individual pictures both horisontally and vertically.
.positionid Style for the Position ID and match ID.

Export the current position in HTML to filename.

  export position html filename

Export the current game in HTML to filename.

  export game html filename

Export the current match in HTML to filename.

  export match html filename

Export the current session in HTML to filename.

  export session html filename

If you are using the menu system, you can also use the teh menu item File→Export, and then select game, match, session or position, and then select HTML. This will open a file dialog box where you can enter the desired filename or you can accept the default filename.

Generating you own local HTML images

If you want to have html images locally on your computer, you can have GNU Backgammon generate these. The html images will be generated based on the current appearence settings. You can also control the size of the images in the export settings dialog. (To get the export settings dialog you can select in the menu Settings→Export…). Select the size of your html images at the buttom right in this dialog.

To start teh generation of the html images, select in the menu File→Export→HTML images…. In the file dialog box, you can select a directory where the images will be generated. The images are stored in PNG format.

To generate images for the command line, use the command:

 export htmlimages directory

where directory is the directory where you want your images to be created.

LaTeX export

GNU Backgammon can export games, match and positions to the document typesetting system LaTeX. For exporting a match or session to LaTeX, you can either use the menu and click File→Export→Match→LaTeX… and then type in a filename in the file diaog box. You can also use the command:

 export match latex filename.tex

The LaTeX export will export all board diagrams and analysis if available. The produced documents can therefore be quite large. Note that the LaTeX file produced needs the eepic package. You can get this package at your nearest CTAN mirror1).

You can not export a position to LaTeX. (At least not yet!) However, you can export a position to EPS and include this EPS file in your LaTeX document.

PostScript export

You can also genrate PostScript files of you matches with GNU Backgammon. To export a match, game or session to PostScript you can select for the menu File→Export→Match→PostScript…. In the file dialog box that appears, you can type your desired filename, or accept the default filename.

If your working with a version of GNU Backgammon that takes commands from a command line you can use this command:

 export match postscipt filename.ps

(instead of match you can also type game if you just want to export the current game.)

The PostScript document will include all diagrams and analysis if available. The document can therefore be quite large.

PDF export

GNU Backgammon can also produce PDF documents of your games, matches or sessions. This export feature works in the same way as the PostScript export. To export a match, game or session to PDF, you can select for the menu File→Export→Match→PDF. In the file dialog box that appears, you can type your desired filename, or accept the default filename.

If your working with a version of GNU Backgammon that takes commands from a command line you can use this command:

 export match pdf filename.pdf

(instead of match you can also type game if you just want to export the current game.)

The exported can be viewed in any PDF file reader, like Adobe Acrobat.

.mat format export

GNU Backgammon can export games and matches to the standard text format used in JellyFish. This format can be read by many other backgammon sofware packages, and is therefore a very handy format to distribute to other backgammon players who might not use GNU Backgammon.

At the command line you can type

 export match mat filename.mat

This will export you match to the JellyFish .mat format. You can also use session instead of match if you want to export a money game session.

You can also use the menu system of course. Select File→Export→Match→.mat… and type in the filename in teh file dialog box, or accept the default filename.

.gam files

.gam files are basically the same as a .mat file. Thie difference is that a .gam stores a game instead of a full match. To export a game to this format you can use the command

 export game gam filename.gam

or you can use the menu system by selecting File→Export→Game→.gam….

The formats, .gam and .mat, does not store the analysis.

Text export

There is also a text export format available. This is a format that writes out all the board and analysis in an ASCII format. In that way it’s readable for humans, but not the best to parse for computers.

To export you position, game, match or session to this format, you can select File→Export→Match→Text… and then type in a proper filename or accept the default filename.

At the command line you can type:

 export match text filename.txt

(Of course you can use game instead of match if you only want to export the current game.)

Jellyfish .pos export

There is also several position types which GNU Backgammon can export to. It’s possible to export to the .pos file format that’s used by JellyFish. To export a position to this format, you can select File→Export→Position→.pos… and then type the desired filename in the file dialog box.

The command line equivalent is

 export position pos filename.pos

The .pos format does not save any analysis. The format is described at the JellyFish site.

Snowie position .txt export

Snowie has it’s own position file format which is based on ASCII text. GNU Backgammon can also export to this format. To export a position to this format, you can select File→Export→Position→Snowie .txt… and then type the desired filename in the file dialog box.

The command line equivalent is

 export position snowietxt filename.txt
1) The produced LaTeX file also needs epic, textcomp and ucs, but these are more common in LaTeX distributions so you probably already have these.
working_with_matches.txt · Last modified: 2012/11/10 01:52
Valid XHTML 1.0! Valid CSS! Get Firefox!