GNU TUTORIAL – PART 1

Getting started with GNUBG – A Guided Tour Part 1
by Robert-Jan Veldhuizen

Editor's Note: To get the most out of this tutorial (written in 2006), when you go the GNUBG site at the link mentioned below, download "the old 0.15-stable" - once you learn how to use that one using this tutorial, it will be easier to understand how to use the latest version (for which there is no tutorial), which you can go back and download later.

Get GNUBG! Download GNUBG

At http://www.gnubg.org you can download the most recent GNUBG installation package. This tutorial is based on the file, dated 9th May 2006: gnubg-setup-20060509.exe (size: 17MB). Updated versions are available regularly, so choose the "stable" version according to your operating system. Click on the link and save the downloaded file, for instance to your desktop so it is easy to find it later. If you have a slow (dial-up) connection, downloading will take a while.

Install GNUBG
Run this install file, for instance by double clicking on it on your desktop. You will go through a short standard installation procedure. When it's finished, you are ready to use GNUBG!

Run the program
Just use "GNU Backgammon" from a desktop shortcut or the start menu for normal operation. Other versions (CLI) are for special purposes.

Playing a game against the computer
I suggest you maximize GNUBG's window and you will see something like this:

Missing Image

Let's start exploring GNUBG by playing a game!
Click on the "New" button to start a game, match, or a session of "money" games

missing image!

By default, GNUBG will play a 7 point match, computer (bot) versus human. GNUBG will be playing at the "expert" level which is strong and very fast, but not its best. A good setting to start with though. Click OK and the match will begin with a message like this:

missing image!

GNUBG won the opening roll here. Click OK and the first game will start. In this case, GNUBG will play the 2-1 roll almost instantly and then it is your turn. This looks like a good time to examine the information on screen, the buttons and all the options and actions available to you:

missing image!

First, the board itself. As you can see, GNUBG plays the red checkers; you play the black checkers counter-clockwise. The black arrow on the left, near both players' midpoint, tells you that it is Black's turn and shows the playing direction. The numbers around the board points are useful for move notation, like 24/18 13/10 to play an opening 6-3.

If you prefer playing clockwise, that is easy: just click once on the "Direction" button. Another click and you are back to counter-clockwise.


Below the board, you can see the players' names, the matchscore and -length and the pipcounts. You can ignore the clock information.

At the bottom of the window is a status line, where GNUBG will display its most recent action or an informational message. At the bottom right, a progress indicator may appear while GNUBG is thinking.

Right above the board, GNUBG displays a "Position ID" and "MatchID". You don't have to pay attention to them while playing. They are mostly useful for exchanging interesting backgammon positions with others.

To the right of the window is the "Game record". GNUBG automatically records the match and displays the rolls and moves here. This is useful if you want to review a match later, analyze it or study some positions. The arrows can be used to navigate through the moves and games. The red arrows skips through various games in a match or session, the green arrows through the moves. The arrows with the question marks can be used to skip to the previous or next error, after you have analyzed a game. The drop-down list on the right is useful to go to a specific game directly in a long match or session. We will get back to this later; you don't need the game record while playing.

When you play, there are various actions possible: you may want to double before you roll, just roll the dice, resign the game, move the checkers, etc. You can use the board itself for most of these, or the big buttons at the top:

  • Accept: You can click this to accept (take) a double from your opponent, GNUBG.
  • Decline: To drop (pass) an offered cube
  • Beaver: A special, instant redouble that is only available in money games.
  • Resign: You will be able to resign either a single game, or a (back)gammon if you don't want to play the game out anymore.
  • Undo: When you're moving the checkers and haven't finished the move yet, clicking this will set the checkers back in the original position so you can try again.
  • Hint: GNUBG will give you its advice on what to do. Before rolling the dice, it will tell you whether to double or not; after rolling the dice it will give you a list of moves from best to worst.

On the board itself, you can click on the doubling cube on the bar in the middle to offer a double. If opponent doubles you, you can left-click on the cube to accept; right-click to reject. To just roll the dice, click on the right side of the playfield, in the middle. The dice roll will appear.

missing image!

To make a move, left-click on a checker to make it move the number on the left die, or right-click to use the right die first. Once you have moved one die, GNUBG will automatically understand you want to use the other die next. Alternatively, you can drag checkers and GNUBG will help you by outlining the points it can go to. Experiment with moving various checkers and use the "Undo" button to reset the checkers. It is quite intuitive.

I have decided to move 24/23 13/11. Clicking on the dice will make your move definitive and end your turn. GNUBG will respond immediately, either by doubling or by rolling the dice and making its move.

In my case, it rolled 3-1 and played 8/5 6/5 instantly. I decide not to double (of course!) and roll the dice for a 5-5:

missing image!

Asking GNUBG for advice
So many choices! Let's ask the bot (GNUBG) for some help, by clicking the hint button.

missing image!

I suggest you first click on the "MWC" button, then the numbers should look equal or similar. Instead of displaying your Match Winning Chances, GNUBG now displays equities as "Equivalent Money Game" (EMG), which is often more useful. You can think of EMG as displaying the expected outcome of the game: -1 is a loss, +1 is a win, 0 means both players are 50% to win. Values in between show how likely one side is to win: plus is good, minus is bad. Because gammons are worth 2 points and backgammons 3 points, it usually gets a bit more complicated than this though.

You can click the "MWC" button again to toggle between the two views.

The moves are sorted from best to worst. The best move, according to GNUBG: 23/13 6/1*(2). The "Equity" column says -0.027, close to zero, which means the game is almost tied after this move. I am a very slight underdog. Other moves give me a lower, more negative equity.

The "Diff." column shows how bad these other moves are. As a guideline, a -0.010 equity difference or less means the play is very close and hardly a real error, -0.050 is a clear error and -0.100 is often called a blunder.

So, in this case, the second best move is 8/3(2) 6/1*(2) and is a clear error, giving up 0.056 "points". 23/18 11/1* 6/1 is almost a blunder. Other moves are blunders or worse.

If you want to know more about the moves, you can take a look at the other numbers. After the "Rank" and "Type" columns, GNUBG shows respectively: how many games you are expected to win (including gammons and backgammons); how many gammons (including backgammons) and how many backgammons. The next three columns show the same information for your opponent. So if you play 23/13 6/1*(2), you win 0.492 here, which means 49.2% of games. You are a very slight underdog. 0.004 backgammons means you will win a backgammon 0.4% of the time from here: only once every 250 games! And so on for the other columns and each move...

The "Type" column shows the type of evaluation GNUBG used to produce all these numbers: "Cubeful 0-ply". Cubeful means GNUBG takes possible cube actions into consideration. 0-ply means that GNUBG looked zero plies ahead. A ply is one turn by one player. In this case, GNUBG did not look ahead at all and just evaluated the moves directly. This is very quick and pretty good most of the time, but GNUBG can do better.

Cubeful 2-ply evaluation takes a bit more time, since GNUBG will look ahead two moves, one for each player. But it is more accurate and probably the best all-around setting to use. GNUBG 2-ply is as strong as the best backgammon players in the world, maybe even stronger!

You can get 2-ply evaluations for moves by first selecting them in the hint window. Use Ctrl+LeftClick to add moves to your selection, or Shift+LeftClick to select the whole range in between. Selected moves will be colored blue. Now you can get a 2-ply evaluation for these moves by clicking on the little button with the "2".

missing image!

GNUBG hasn't changed its mind on the best move, but if you look closely you will see all the numbers are a little different now. You can expect 2-ply to be more accurate than 0-ply and sometimes rank plays differently. The little buttons with the numbers can give you evaluations from 0-ply to 4-ply. 3-ply is a bit slow, like five seconds per move; 4-ply can take more than one minute per move. I suggest using 2-ply as it is already very strong.

(For people used to other backgammon programs: GNUBG 0-ply is equivalent to Snowie and BGBlitz 1-ply or Jellyfish level 5; GNUBG 2-ply is equivalent to Snowie and BGBlitz 3-ply or Jellyfish level 7)

Another useful button in the Hint window is "Show": select one move in the list and click Show to display this move on the board. Click "Show" again to take the move back.

Once you have decided which move you like from the Hint window (the top choice perhaps?), you can select it and click "Move", so you don't have to drag checkers yourself. This will also close the Hint window.

I followed the bot's advice and played 23/13 6/1*(2). GNUBG rolls 1-1 and dances (can't move). That was a lucky sequence! Suppose you wonder whether you should double now. Clicking "Hint" before you roll gives information about the cube decision:

missing image!

Above the familiar Win, W(g), ... breakdown GNUBG gives an estimate of the cubeless equity, which for GNUBG means the equity at the current the cube value, in this case 1. In brackets, GNUBG gives its approximation of the cubeless equity if it were not a match, but a money session. As you can see there is not much difference here, in the first game of a 7pt match.

The most important numbers are the cubeful equities. If you don't double now, perhaps you can double later. GNUBG says your equity is +0.271 then. If you double now, opponent should take. Your equity is only +0.085 then. That is a loss of 0.186 over No double, so you shouldn't double, the "Proper cube action" according to GNUBG.

Should you double this anyway and have an opponent who blunders with a pass, then you gain an instant point of course. That is the +1.000 equity of Double, Pass. That would be a 0.729 gain over No double, but only because opponent mistakenly passes.

That brings us to the percentage figure in brackets, 20.3%: if the chance that your opponent passes this is higher than that, you should still double. The 1 in 5 chance at an incorrect pass would gain you so much, that it is enough to overcome the loss when you get a take 4 out of 5 times.

As with the move hint, you can use the 0 to 4 buttons to change the ply of the evaluation. 2-ply cube is clearly recommended over 0-ply. 1- and 3-ply cube usually don't give reliable results. 4-ply cube is only a little bit better than 2-ply, but can take a minute or so.

Saving your efforts

So now you know how to start a game or match, play and get some help from GNUBG when you go along. I finished the match, with the usual result:

missing image!

Saving the match is easy. GNUBG uses the SGF file format which besides the match itself, includes any evaluations or rollouts done by GNUBG and some additional information. Just click on the "Save" button, pick a folder and good name for the file ending with .SGF. You can review this match later with GNUBG by using the "Open" button. For more information on how to use GNUBG's file requester, see under Importing your matches.

This concludes the first part of GNUBG's guided tour. Next we're going to learn how to import matches played on any of the backgammon servers on Internet and how to analyze them.

Go to Part 2

Copyright © 2006 by GammonLife.com and Robert-Jan Veldhuizen

Visit the GammonLife.com Tournaments section to see great pictorials from real live backgammon tournaments.



Copyright © 2006-2011 by GammonLife.com. All rights reserved. This material may not be broadcast, published, re-written, or re-distributed in any form.